Documentation
¶
Index ¶
- type Config
- type DailyMonthlyLimits
- type Limits
- type MinMaxConsumption
- type MinMaxTemperature
- type MinMaxTimestamp
- type UsageProcessor
- type UsageStorage
- func (storage UsageStorage) AddDailyLimit(userId, dayId, temperature, consumption int, timestamp string) error
- func (storage UsageStorage) AddMonthlyLimit(userId, monthId, temperature, consumption int, timestamp string) error
- func (storage UsageStorage) AddNewUser(userId int, username string, password string) error
- func (storage UsageStorage) GetDailyLimits(userId int) (Limits, error)
- func (storage UsageStorage) GetDailyUserData(userId int, count int, start string) ([][]interface{}, error)
- func (storage UsageStorage) GetMonthlyLimits(userId int) (Limits, error)
- func (storage UsageStorage) GetMonthlyUserData(userId int, count int, start string) ([][]interface{}, error)
- func (storage UsageStorage) GetUser(username string, password string) (User, error)
- type User
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DailyMonthlyLimits ¶
type Limits ¶
type Limits struct {
MinMaxTimestamp `json:"timestamp"`
MinMaxConsumption `json:"consumption"`
MinMaxTemperature `json:"temperature"`
}
type MinMaxConsumption ¶
type MinMaxTemperature ¶
type MinMaxTimestamp ¶
type UsageProcessor ¶
type UsageProcessor struct {
Storage UsageStorage
}
func NewProcessor ¶
func NewProcessor(config Config) (UsageProcessor, error)
func (UsageProcessor) GetDataForUser ¶
func (processor UsageProcessor) GetDataForUser( userId int, count int, resolution string, start string) ([][]interface{}, error)
GetDataForUser fetches the temperature, consumption data for the user based on the starting date provided.
func (UsageProcessor) GetLimitsForUser ¶
func (processor UsageProcessor) GetLimitsForUser(userId int) (DailyMonthlyLimits, error)
GetLimitsForUser fetches the daily and monthly limits for the temperature, consumption and timestamp for the provided user.
type UsageStorage ¶
func NewStorage ¶
func NewStorage(location string) (UsageStorage, error)
func (UsageStorage) AddDailyLimit ¶
func (storage UsageStorage) AddDailyLimit( userId, dayId, temperature, consumption int, timestamp string) error
func (UsageStorage) AddMonthlyLimit ¶
func (storage UsageStorage) AddMonthlyLimit( userId, monthId, temperature, consumption int, timestamp string) error
func (UsageStorage) AddNewUser ¶
func (storage UsageStorage) AddNewUser(userId int, username string, password string) error
func (UsageStorage) GetDailyLimits ¶
func (storage UsageStorage) GetDailyLimits(userId int) (Limits, error)
func (UsageStorage) GetDailyUserData ¶
func (storage UsageStorage) GetDailyUserData( userId int, count int, start string) ([][]interface{}, error)
func (UsageStorage) GetMonthlyLimits ¶
func (storage UsageStorage) GetMonthlyLimits(userId int) (Limits, error)
func (UsageStorage) GetMonthlyUserData ¶
func (storage UsageStorage) GetMonthlyUserData( userId int, count int, start string) ([][]interface{}, error)
Click to show internal directories.
Click to hide internal directories.