Documentation ¶
Index ¶
- Constants
- func ActivateUser(c context.Context, activationKey string, id string) error
- func AddLoginToken(c context.Context, user *models.User, ip string) (*models.LoginToken, error)
- func CreateDevice(c context.Context, record *models.Device) error
- func CreateFleet(c context.Context, fleet *models.Fleet) error
- func CreateLocation(c context.Context, location *models.Location) error
- func CreateSigfoxLocationWithMessage(c context.Context, location *models.Location, message *models.SigfoxMessage) error
- func CreateSigfoxMessage(c context.Context, message *models.SigfoxMessage) error
- func CreateUser(c context.Context, record *models.User) error
- func Current(c context.Context) *models.User
- func DeleteDevice(c context.Context, id string) error
- func DeleteFleet(c context.Context, id string) error
- func FindUser(c context.Context, params params.M) (*models.User, error)
- func FindUserById(c context.Context, id string) (*models.User, error)
- func GetAllDeviceLocations(c context.Context, id string) ([]*models.Location, error)
- func GetAllDeviceMessages(c context.Context, id string) ([]*models.SigfoxMessage, error)
- func GetAllFleets(c context.Context) ([]models.Fleet, error)
- func GetDevice(c context.Context, id string) (*models.Device, error)
- func GetDeviceLastMessage(c context.Context, id string) (*models.SigfoxMessage, error)
- func GetDevices(c context.Context) ([]*models.Device, error)
- func GetFleetById(c context.Context, id string) (*models.Fleet, error)
- func GetLastDeviceLocations(c context.Context, id string) ([]*models.Location, error)
- func GetLastDeviceMessages(c context.Context, id string) ([]*models.SigfoxMessage, error)
- func GetLastDevicesLocations(c context.Context) ([]*models.LastLocation, error)
- func GetLastDevicesSigfoxMessages(c context.Context) ([]*models.SigfoxMessage, error)
- func GetLastFleetMessages(c context.Context, id string) ([]*models.SigfoxMessage, error)
- func RemoveLoginToken(c context.Context) error
- func ToContext(c Setter, store Store)
- func UpdateDevice(c context.Context, id string, m params.M) error
- func UpdateUser(c context.Context, params params.M) error
- type Setter
- type Store
Constants ¶
View Source
const ( CurrentKey = "currentUser" LoginTokenKey = "currentLoginToken" StoreKey = "store" )
Keys for various values
Variables ¶
This section is empty.
Functions ¶
func AddLoginToken ¶
func CreateDevice ¶
Create a device in store
func CreateLocation ¶
Create a single Location in store
func CreateSigfoxLocationWithMessage ¶
func CreateSigfoxLocationWithMessage(c context.Context, location *models.Location, message *models.SigfoxMessage) error
Storing both Sigfox Message and Location
func CreateSigfoxMessage ¶
func CreateSigfoxMessage(c context.Context, message *models.SigfoxMessage) error
Storing a Sigfox Message
func DeleteDevice ¶
Delete a specific device in store
func GetAllDeviceLocations ¶
Getting all locations from a specific device in store
func GetAllDeviceMessages ¶
Getting all messages from a specific device in store
func GetDeviceLastMessage ¶
Getting last message from a specific device in store
func GetDevices ¶
Get all devices of a User in store
func GetLastDeviceLocations ¶
Getting last locations from a specific device in store
func GetLastDeviceMessages ¶
Getting last messages from a specific device in store
func GetLastDevicesLocations ¶
func GetLastDevicesLocations(c context.Context) ([]*models.LastLocation, error)
Getting Last Locations from all devices of a user in store
func GetLastDevicesSigfoxMessages ¶
func GetLastDevicesSigfoxMessages(c context.Context) ([]*models.SigfoxMessage, error)
Get Last Sigfox Messages from Devices
func GetLastFleetMessages ¶
func RemoveLoginToken ¶
func UpdateDevice ¶
Update a specific device in store
Types ¶
type Store ¶
type Store interface { CreateUser(*models.User) error FindUserById(string) (*models.User, error) ActivateUser(string, string) error FindUser(params.M) (*models.User, error) UpdateUser(*models.User, params.M) error CreateMessage(*models.SigfoxMessage) error CreateLocation(*models.Location) error CreateLocationWithMessage(*models.Location, *models.SigfoxMessage) error GetLastDevicesSigfoxMessages(*models.User) ([]*models.SigfoxMessage, error) CreateDevice(*models.Device, *models.User) error GetDevices(*models.User) ([]*models.Device, error) UpdateDevice(string, params.M) error DeleteDevice(string) error GetDevice(*models.User, string) (*models.Device, error) GetDeviceLastMessage(string) (*models.SigfoxMessage, error) GetLastDeviceMessages(string) ([]*models.SigfoxMessage, error) GetLastDeviceLocations(string) ([]*models.Location, error) GetAllDeviceMessages(string) ([]*models.SigfoxMessage, error) GetAllDeviceLocations(string) ([]*models.Location, error) GetLastDevicesLocations(*models.User) ([]*models.LastLocation, error) GetAllFleets() ([]models.Fleet, error) CreateFleet(*models.Fleet) error GetFleetById(string) (*models.Fleet, error) GetLastFleetMessages(id string) ([]*models.SigfoxMessage, error) DeleteFleet(id string) error AddLoginToken(*models.User, string) (*models.LoginToken, error) RemoveLoginToken(*models.User, string) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.