Documentation
¶
Index ¶
- type App
- func (a *App) CreateIndicator(args domain.CreateIndicatorArgs) error
- func (a *App) CreateOrUpdateObservation(args domain.CreateOrUpdateObservationArgs) error
- func (a *App) CreateUser(u *domain.User) error
- func (a *App) GetCorrelation(args domain.GetCorrelationArgs) (*domain.Correlation, error)
- func (a *App) GetCorrelationMatrix(args domain.GetCorrelationMatrixArgs) (*domain.CorrelationMatrix, error)
- func (a *App) GetIndicators(args domain.GetIndicatorsArgs) ([]*domain.Indicator, error)
- func (a *App) GetScaleByType(scaleType string) (*domain.Scale, error)
- func (a *App) GetUser(u *domain.User) (*domain.User, error)
- func (a *App) GetUserToken(u *domain.User) (string, error)
- func (a *App) ServiceStats() (*domain.ServiceStats, error)
- func (a *App) UpdateAggregations(args domain.UpdateAggregationsArgs) error
- func (a *App) UpdateCorrelations(args domain.UpdateCorrelationsArgs) error
- func (a *App) ValidateUserPassword(u *domain.User) (bool, error)
- type Cache
- type Channels
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
App combines services and holds business logic
func (*App) CreateIndicator ¶
func (a *App) CreateIndicator(args domain.CreateIndicatorArgs) error
func (*App) CreateOrUpdateObservation ¶
func (a *App) CreateOrUpdateObservation(args domain.CreateOrUpdateObservationArgs) error
CreateOrUpdateObservation checks if there is a dataset for user/indicator. If none, creates one and adds observation to it, otherwise adds to existing dataset.
func (*App) GetCorrelation ¶
func (a *App) GetCorrelation(args domain.GetCorrelationArgs) (*domain.Correlation, error)
func (*App) GetCorrelationMatrix ¶
func (a *App) GetCorrelationMatrix(args domain.GetCorrelationMatrixArgs) (*domain.CorrelationMatrix, error)
func (*App) GetIndicators ¶
func (*App) ServiceStats ¶ added in v0.0.5
func (a *App) ServiceStats() (*domain.ServiceStats, error)
func (*App) UpdateAggregations ¶
func (a *App) UpdateAggregations(args domain.UpdateAggregationsArgs) error
func (*App) UpdateCorrelations ¶
func (a *App) UpdateCorrelations(args domain.UpdateCorrelationsArgs) error
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache stores data loaded on app start
type Channels ¶
type Channels struct { UpdateUserCorrelationsChan chan domain.UpdateCorrelationsArgs UpdateDatasetAggregationsChan chan domain.UpdateAggregationsArgs }
Channels holds app channels for async jobs
type Repository ¶
type Repository interface { // users UserCount() (int, error) CreateUser(*domain.User) (*domain.User, error) GetUserByUsername(string) (*domain.User, error) GetUserByID(int) (*domain.User, error) GetUserCount() (int, error) // indicators IndicatorCount() (int, error) CreateIndicator(*domain.Indicator) (*domain.Indicator, error) GetIndicatorByID(int) (*domain.Indicator, error) GetIndicators(domain.GetIndicatorsArgs) ([]*domain.Indicator, error) // scales ScaleCount() (int, error) GetScales() ([]*domain.Scale, error) GetScaleByType(string) (*domain.Scale, error) CreateScale(domain.Scale) (*domain.Scale, error) // datasets DatasetCount() (int, error) CreateDataset(*domain.Dataset) (*domain.Dataset, error) GetDatasetByID(id int, observationsLimit int, granularity string) (*domain.Dataset, error) GetUserIndicatorDataset(*domain.User, *domain.Indicator) (*domain.Dataset, error) GetOrCreateUserIndicatorDataset(*domain.User, *domain.Indicator) (*domain.Dataset, error) GetUserDatasets(userID int, withShared bool, observationsLimit int, granularity string) ([]*domain.Dataset, error) // to be deprecated GetDatasets(domain.GetDatasetsArgs) ([]*domain.Dataset, error) // observations ObservationCount() (int, error) CreateObservation(*domain.Observation) (*domain.Observation, error) CreateOrUpdateObservation(*domain.Observation) (*domain.Observation, error) // correlations CorrelationCount() (int, error) CreateOrUpdateCorrelation(*domain.Correlation) (*domain.Correlation, error) GetUserCorrelations(userID int, granularity string) ([]*domain.Correlation, error) GetCorrelation(domain.GetCorrelationArgs) (*domain.Correlation, error) }
Repository stores data
Click to show internal directories.
Click to hide internal directories.