Documentation ¶
Index ¶
- Variables
- type Data
- func (d Data) CreateList(list structures.List) (structures.List, error)
- func (d Data) Delete(key *datastore.Key) error
- func (d Data) DeleteStore(ID int64) error
- func (d Data) GetAllLists() ([]structures.List, error)
- func (d Data) GetConsumables(query structures.Query) ([]structures.Consumables, error)
- func (d Data) GetConsumablesTmp(query structures.Query) ([]structures.Consumables, error)
- func (d Data) GetList(id int64) (structures.List, error)
- func (d Data) GetListContent(id int64) ([]structures.ListContent, error)
- func (d Data) GetStore(store structures.Store) (structures.Store, error)
- func (d Data) GetStoreKey(store structures.Store) (*datastore.Key, error)
- func (d Data) GetUser(UserMail string) (structures.User, error)
- func (d Data) GetUserKey(UserMail string) (*datastore.Key, error)
- func (d Data) Log(log structures.Log) error
- func (d Data) ScoreStore(store structures.Store) error
- func (d Data) StoreConsumable(consumable structures.Consumable) (int64, error)
- func (d Data) StoreContent(content structures.ListContent) (int64, error)
- func (d Data) StoreStore(store structures.Store) error
- func (d Data) StoreUser(user structures.User) error
- func (d Data) UpdateStore(store structures.Store) error
- func (d Data) UpdateUser(user structures.User) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { // User the user making the request. Got from the cookie in the header User structures.User // contains filtered or unexported fields }
Data container for all data relative variables initiated inside InitData(...)
func (Data) CreateList ¶
func (d Data) CreateList(list structures.List) (structures.List, error)
CreateList is used to create a list in the datastore
func (Data) DeleteStore ¶
DeleteStore remove a store from storage
func (Data) GetAllLists ¶
func (d Data) GetAllLists() ([]structures.List, error)
GetAllLists return all lists of a user
func (Data) GetConsumables ¶
func (d Data) GetConsumables(query structures.Query) ([]structures.Consumables, error)
GetConsumables is used to find some consumables in the datastore
func (Data) GetConsumablesTmp ¶
func (d Data) GetConsumablesTmp(query structures.Query) ([]structures.Consumables, error)
GetConsumablesTmp is used to find some consumables in the datastore but for testing purposes only
func (Data) GetList ¶
func (d Data) GetList(id int64) (structures.List, error)
GetList return a list if the id provided is right and the user know the list
func (Data) GetListContent ¶
func (d Data) GetListContent(id int64) ([]structures.ListContent, error)
GetListContent return list content
func (Data) GetStore ¶
func (d Data) GetStore(store structures.Store) (structures.Store, error)
GetStore is used to find if a store is already in the datastore using it's name and location
func (Data) GetStoreKey ¶
GetStoreKey return the key attached to a particuliar store
func (Data) GetUser ¶
func (d Data) GetUser(UserMail string) (structures.User, error)
GetUser is used to find if a email is already used in the datastore
func (Data) GetUserKey ¶
GetUserKey return the key associated with the user email
func (Data) Log ¶
func (d Data) Log(log structures.Log) error
Log is used to store a log in the datastore
func (Data) ScoreStore ¶
func (d Data) ScoreStore(store structures.Store) error
ScoreStore update the score of a store
func (Data) StoreConsumable ¶
func (d Data) StoreConsumable(consumable structures.Consumable) (int64, error)
StoreConsumable is used to store a consumable in the datastore
func (Data) StoreContent ¶
func (d Data) StoreContent(content structures.ListContent) (int64, error)
StoreContent is used to store a content in the datastore
func (Data) StoreStore ¶
func (d Data) StoreStore(store structures.Store) error
StoreStore is used to store a consumable in the datastore
func (Data) StoreUser ¶
func (d Data) StoreUser(user structures.User) error
StoreUser is used to store a user in the datastore
func (Data) UpdateStore ¶
func (d Data) UpdateStore(store structures.Store) error
UpdateStore update store fields
func (Data) UpdateUser ¶
func (d Data) UpdateUser(user structures.User) error
UpdateUser update user fields