repos

package
v0.0.0-...-5d070c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckIn

type CheckIn struct {
	//Created   time.Time     `bson:"created" json:"created"`
	//CheckUser bson.ObjectId `bson:"user" json:"user"`
	CheckUser bson.ObjectId `bson:"user" json:"user"`
}

type Geolocation

type Geolocation struct {
	Type        string     `bson:"type" json:"type"`
	Coordinates [2]float64 `bson:"coordinates" json:"coordinates"`
}

type Marker

type Marker struct {
	Id          bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Geolocation Geolocation   `json:"geolocation,omitempty"`
	Name        string        `json:"name,omitempty"`
	Address     string        `json:"address,omitempty"`
	Website     string        `json:"website,omitempty"`
	Kind        int           `json:"kind,omitempty"`
	Else        string        `json:"else,omitempty"`
	Author      string        `json:"author,omitempty"`
	CheckIns    []CheckIn     `json:"checkins,omitempty"`
}

type MarkerCollection

type MarkerCollection struct {
	Data []Marker `json:"data"`
}

type MarkerRepo

type MarkerRepo struct {
	Coll *mgo.Collection
}

func (*MarkerRepo) All

func (r *MarkerRepo) All(lat string, lng string, km string) (MarkerCollection, error)

func (*MarkerRepo) Create

func (r *MarkerRepo) Create(marker *Marker) error

func (*MarkerRepo) Delete

func (r *MarkerRepo) Delete(id string) error

func (*MarkerRepo) Find

func (r *MarkerRepo) Find(id string) (MarkerResource, error)

func (*MarkerRepo) Update

func (r *MarkerRepo) Update(marker *Marker) error

type MarkerResource

type MarkerResource struct {
	Data Marker `json:"data"`
}

type Skill

type Skill struct {
	Id       bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Name     string        `json:"name,omitempty"`
	Category bson.ObjectId `json:"category,omitempty" bson:"category,omitempty"`
}

type SkillCategory

type SkillCategory struct {
	Id    bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Name  string        `bson:"name,omitempty" json:"name,omitempty"`
	Skill []Skill       `bson:"skills,omitempty" json:"skills,omitempty"`
}

type SkillCategoryCollection

type SkillCategoryCollection struct {
	Data []SkillCategory `json:"data"`
}

type SkillCategoryRepo

type SkillCategoryRepo struct {
	Coll *mgo.Collection
}

func (*SkillCategoryRepo) All

func (*SkillCategoryRepo) GetById

type SkillCategoryResource

type SkillCategoryResource struct {
	Data SkillTempCategory `json:"data"`
}

type SkillCollection

type SkillCollection struct {
	Data []SkillTemp `json:"data"`
}

type SkillRepo

type SkillRepo struct {
	Coll *mgo.Collection
}

func (*SkillRepo) All

func (r *SkillRepo) All(lang string) (SkillCollection, error)

func (*SkillRepo) GetByCategoryId

func (r *SkillRepo) GetByCategoryId(id bson.ObjectId, lang string) ([]Skill, error)

func (*SkillRepo) GetByIds

func (r *SkillRepo) GetByIds(ids []bson.ObjectId, lang string) (SkillCollection, error)

type SkillTemp

type SkillTemp struct {
	Id       bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Name     [1]string     `bson:"name,omitempty" json:"name,omitempty"`
	Category bson.ObjectId `json:"category,omitempty" bson:"category,omitempty"`
}

type SkillTempCategory

type SkillTempCategory struct {
	Id   bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Name [1]string     `bson:"name,omitempty" json:"name,omitempty"`
}

type SkillTempCategoryCollection

type SkillTempCategoryCollection struct {
	Data []SkillTempCategory `json:"data"`
}

type User

type User struct {
	Id           bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Username     string        `bson:"username,omitempty" json:"username,omitempty"`
	FirstName    string        `bson:"firstname,omitempty" json:"firstname,omitempty"`
	LastName     string        `bson:"lastname,omitempty" json:"lastname,omitempty"`
	Email        string        `bson:"email,omitempty" json:"email,omitempty"`
	Verified     bool          `bson:"verified,omitempty" json:"verified,omitempty"`
	Facebook     bool          `bson:"facebook,omitempty" json:"facebook,omitempty"`
	ShowEmail    bool          `bson:"showEmail,omitempty" json:"showEmail,omitempty"`
	Password     string        `json:"password,omitempty"` //only used for parsing incoming json
	FacebookId   string        `bson:"facebookid,omitempty" json:"facebookid,omitempty"`
	Hash         string        `bson:"hash,omitempty"`
	Salt         string        `bson:"salt,omitempty"`
	Created      time.Time     `bson:"created,omitempty" json:"created,omitempty"`
	Updated      time.Time     `bson:"updated,omitempty" json:"updated,omitempty"`
	UrlToken     string        `bson:"urltoken,omitempty" json:"urltoken,omitempty"`
	About        string        `bson:"about,omitempty" json:"about,omitempty"`
	FollowInfo   []UserF       `bson:"followinfo,omitempty" json:"followinfo,omitempty"`
	FollowedInfo []UserF       `bson:"followedinfo,omitempty" json:"followedinfo,omitempty"`
	Image        string        `bson:"image,omitempty" json:"image,omitempty"`
	// TODO: make bson object objects id better...
	Skills    []bson.ObjectId `bson:"skills,omitempty" json:"skills,omitempty"`
	Following []bson.ObjectId `bson:"following,omitempty" json:"following,omitempty"`
}

type UserCollection

type UserCollection struct {
	Data []User `json:"data"`
}

type UserF

type UserF struct {
	Id         bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	Username   string        `bson:"username,omitempty" json:"username,omitempty"`
	FirstName  string        `bson:"firstname,omitempty" json:"firstname,omitempty"`
	LastName   string        `bson:"lastname,omitempty" json:"lastname,omitempty"`
	FacebookId string        `bson:"facebookid,omitempty" json:"facebookid,omitempty"`
	Image      string        `bson:"image,omitempty" json:"image,omitempty"`
}

type UserRepo

type UserRepo struct {
	Coll *mgo.Collection
}

func (*UserRepo) All

func (r *UserRepo) All() (UserCollection, error)

func (*UserRepo) Authenticate

func (r *UserRepo) Authenticate(user User) (UserResource, error)

func (*UserRepo) Create

func (r *UserRepo) Create(user *User) error

func (*UserRepo) Delete

func (r *UserRepo) Delete(id string) error

func (*UserRepo) Find

func (r *UserRepo) Find(id string) (UserResource, error)

func (*UserRepo) GetByIds

func (r *UserRepo) GetByIds(ids []bson.ObjectId) (UserCollection, error)

func (*UserRepo) GetFByIds

func (r *UserRepo) GetFByIds(ids []bson.ObjectId) ([]UserF, error)

func (*UserRepo) GetFollowers

func (r *UserRepo) GetFollowers(id bson.ObjectId) ([]UserF, error)

func (*UserRepo) Unfollow

func (r *UserRepo) Unfollow(userId bson.ObjectId, unfollowId bson.ObjectId) error

func (*UserRepo) Update

func (r *UserRepo) Update(user *User) error

func (*UserRepo) UserAlreadyExists

func (r *UserRepo) UserAlreadyExists(username string) (bool, error)

type UserResource

type UserResource struct {
	Data User `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL