model

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Correlation

type Correlation struct {
	ID          int       `json:"correlationID"`
	Coef        float64   `json:"coef"`
	P           float64   `json:"p"`
	R2          float64   `json:"r2"`
	Type        string    `json:"type"`
	Granularity string    `json:"granularity"`
	UpdateTime  time.Time `json:"updateTime"`
	Left        *Dataset  `json:"left,omitempty"`
	Right       *Dataset  `json:"right,omitempty"`
}

Correlation is a common model to use in various methods

type CreateIndicatorRequest

type CreateIndicatorRequest struct {
	Title        string                       `json:"title" validate:"required"`
	ScaleType    string                       `json:"scaleType" validate:"required"`
	Description  string                       `json:"description"`
	ValueMapping map[string]string            `json:"valueMapping"`
	ValueParams  *domain.IndicatorValueParams `json:"valueParams"`
}

type CreateOrUpdateObservationRequest

type CreateOrUpdateObservationRequest struct {
	IndicatorID int
	Value       float64
	Date        *time.Time
}

type CreateUserRequest

type CreateUserRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

type Dataset

type Dataset struct {
	ID           int                       `json:"id,omitempty"`
	Source       string                    `json:"source,omitempty"`
	Shared       bool                      `json:"shared,omitempty"`
	Granularity  string                    `json:"granularity"`
	Style        domain.DatasetStyle       `json:"style,omitempty"`
	Aggregation  domain.DatasetAggregation `json:"aggregation,omitempty"`
	Observations []Observation             `json:"observations,omitempty"`
}

Dataset is a common model to use in various methods

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
}

ErrorResponse is default error response schema

type FindUserCorrelationsRequest

type FindUserCorrelationsRequest struct {
	UserID     int  `json:"userID"`
	WithShared bool `json:"withShared"`
}

FindUserCorrelationsRequest is just for testing

type GetCorrelationMatrixRequest

type GetCorrelationMatrixRequest struct {
	Granularity string `json:"granularity"`
	WithShared  bool   `json:"withShared"`
}

type GetCorrelationMatrixResponse

type GetCorrelationMatrixResponse struct {
	Granularity string                                   `json:"granularity"`
	Header      []GetCorrelationMatrixResponseHeaderItem `json:"header"`
	Body        [][]GetCorrelationMatrixResponseBodyItem `json:"body"`
}

type GetCorrelationMatrixResponseBodyItem

type GetCorrelationMatrixResponseBodyItem struct {
	CorrelationID int       `json:"correlationID"`
	Coef          float64   `json:"coef"`
	P             float64   `json:"p"`
	R2            float64   `json:"r2"`
	Type          string    `json:"type"`
	UpdateTime    time.Time `json:"updateTime"`
}

type GetCorrelationMatrixResponseHeaderItem

type GetCorrelationMatrixResponseHeaderItem struct {
	IndicatorID    int    `json:"indicatorID"`
	DatasetID      int    `json:"datasetID"`
	IndicatorTitle string `json:"indicatorTitle"`
	DatasetShared  bool   `json:"datasetShared"`
}

type GetCorrelationRequest

type GetCorrelationRequest struct {
	ID int `json:"id"`
}

type GetCorrelationResponse

type GetCorrelationResponse struct {
	Correlation
}

type GetIndicatorsRequest

type GetIndicatorsRequest struct {
	WithDataset       bool                       `json:"withDataset"`
	ObservationsLimit int                        `json:"observationsLimit"`
	Granularity       string                     `json:"granularity"`
	Filter            GetIndicatorsRequestFilter `json:"filter"`
}

type GetIndicatorsRequestFilter

type GetIndicatorsRequestFilter struct {
	ID        []int    `json:"id"`
	Code      []string `json:"code"`
	Title     []string `json:"title"`
	Active    *bool    `json:"active"`
	BuiltIn   *bool    `json:"builtIn"`
	ScaleType *string  `json:"scaleType"`
}

type GetIndicatorsResponse

type GetIndicatorsResponse []GetIndicatorsResponseItem

type GetIndicatorsResponseItem

type GetIndicatorsResponseItem struct {
	Indicator
}

type GetTokenRequest

type GetTokenRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type GetTokenResponse

type GetTokenResponse struct {
	Token string `json:"token"`
}

type GetUserRequest

type GetUserRequest struct{}

type GetUserResponse

type GetUserResponse struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
}

type Indicator

type Indicator struct {
	ID           int                          `json:"id"`
	Code         string                       `json:"code"`
	Title        string                       `json:"title"`
	Description  string                       `json:"description"`
	Active       bool                         `json:"active"`
	BuiltIn      bool                         `json:"builtIn"`
	External     bool                         `json:"external"`
	ScaleID      int                          `json:"scaleID"`
	AuthorID     int                          `json:"authorID,omitempty"`
	CreateTime   time.Time                    `json:"createTime"`
	UpdateTime   time.Time                    `json:"updateTime"`
	ValueMapping map[string]string            `json:"valueMapping,omitempty"`
	ValueParams  *domain.IndicatorValueParams `json:"valueParams,omitempty"`
	Dataset      *Dataset                     `json:"dataset,omitempty"`
}

Indicator is a common model to use in various methods

type OKResponse

type OKResponse struct {
	Status  string `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
}

OKResponse is default ok response schema

type Observation

type Observation struct {
	ID    int        `json:"id"`
	Value float64    `json:"value"`
	Date  *time.Time `json:"date"`
}

Observation is a common model to use in various methods

type ServiceStatsResponse added in v0.0.5

type ServiceStatsResponse struct {
	Users        int `json:"users,omitempty"`
	Scales       int `json:"scales,omitempty"`
	Indicators   int `json:"indicators,omitempty"`
	Datasets     int `json:"datasets,omitempty"`
	Observations int `json:"observations,omitempty"`
	Correlations int `json:"correlations,omitempty"`
}

type UpdateAggregationsRequest

type UpdateAggregationsRequest struct {
	DatasetID int `json:"datasetID"`
}

UpdateAggregationsRequest is just for testing

type UpdateIndicatorRequest added in v0.0.8

type UpdateIndicatorRequest struct {
	ID           int                          `json:"id"`
	Title        string                       `json:"title"`
	Description  string                       `json:"description"`
	Active       bool                         `json:"active"`
	ValueMapping map[string]string            `json:"valueMapping"`
	ValueParams  *domain.IndicatorValueParams `json:"valueParams"`
}

Jump to

Keyboard shortcuts

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