data

package
v0.0.0-...-3de62b2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Logger used to log output
	Logger = log.New(os.Stdout, "data: ",
		log.Ldate|log.Ltime|log.Lshortfile)

	// GeoHashRadius is the query bounding box max value
	GeoHashRadius = uint64(500)
)

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 InitData

func InitData(projID string) Data

InitData return an initialised Data struct

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) Delete

func (d Data) Delete(key *datastore.Key) error

Delete remove from the datastore the entity of the given key

func (Data) DeleteStore

func (d Data) DeleteStore(ID int64) error

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

func (d Data) GetStoreKey(store structures.Store) (*datastore.Key, error)

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

func (d Data) GetUserKey(UserMail string) (*datastore.Key, error)

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

Jump to

Keyboard shortcuts

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