Documentation ¶
Index ¶
- type Dog
- type DogMongoStore
- func (dataStore *DogMongoStore) CreateDog(dog *Dog) (err error)
- func (dataStore *DogMongoStore) DeleteDog(id string) (err error)
- func (dataStore *DogMongoStore) Disconnect()
- func (dataStore *DogMongoStore) ReadAllDogs() (dogs []*Dog, err error)
- func (dataStore *DogMongoStore) ReadDog(id string) (dog *Dog, err error)
- func (dataStore *DogMongoStore) UpdateDog(dog *Dog) (err error)
- type DogsDataStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dog ¶
type Dog struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` Name string `json:"name"` Age int32 `json:"age"` Type string `json:"type"` }
Dog data struct
type DogMongoStore ¶
type DogMongoStore struct { DogsDataStore DBName string CollectionName string Session *mgo.Session }
DogMongoStore implements DogsDataStore
func NewDogMongoStore ¶
func NewDogMongoStore(mongoDBURL, DBName, CollectionName string) (*DogMongoStore, error)
func (*DogMongoStore) CreateDog ¶
func (dataStore *DogMongoStore) CreateDog(dog *Dog) (err error)
func (*DogMongoStore) DeleteDog ¶
func (dataStore *DogMongoStore) DeleteDog(id string) (err error)
func (*DogMongoStore) Disconnect ¶
func (dataStore *DogMongoStore) Disconnect()
func (*DogMongoStore) ReadAllDogs ¶
func (dataStore *DogMongoStore) ReadAllDogs() (dogs []*Dog, err error)
func (*DogMongoStore) ReadDog ¶
func (dataStore *DogMongoStore) ReadDog(id string) (dog *Dog, err error)
func (*DogMongoStore) UpdateDog ¶
func (dataStore *DogMongoStore) UpdateDog(dog *Dog) (err error)
Click to show internal directories.
Click to hide internal directories.