Documentation ¶
Index ¶
Constants ¶
const APIPrefix = "/api/gathering"
APIPrefix is the prefix used in the console-dot environment
const V1Prefix = "/v1"
V1Prefix is the version prefix used in the console-dot environment
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse structure represents HTTP response with error message.
type GatheringRulesResponse ¶
type GatheringRulesResponse struct { Version string `json:"version"` Rules interface{} `json:"rules"` }
GatheringRulesResponse structure represents HTTP response with rules-related content.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler structure represents HTTP request handler.
func NewHandler ¶
NewHandler function constructs new HTTP request handler.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is definition of objects that implement the RepositoryInterface
func NewRepository ¶
func NewRepository(s StorageInterface) *Repository
NewRepository constructs new instance of Repository
func (*Repository) Rules ¶
func (r *Repository) Rules() (*Rules, error)
Rules method reads all and unmarshals all rules stored under given path
type RepositoryInterface ¶
RepositoryInterface defines methods to be implemented by any rules providers
type Rule ¶
type Rule struct { Conditions []interface{} `json:"conditions,omitempty"` GatheringFunctions interface{} `json:"gathering_functions,omitempty"` }
Rule data type definition based on original JSON schema
type Rules ¶
type Rules struct { Items []Rule `json:"rules,omitempty"` Version string `json:"version,omitempty"` }
Rules data type definition based on original JSON schema
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service data type represents the whole service for repository interface.
func New ¶
func New(repo RepositoryInterface) *Service
New function constructs new service for given repository interface.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage type represents container for resources.
func NewStorage ¶
func NewStorage(cfg StorageConfig) *Storage
NewStorage constructs new storage object.
type StorageConfig ¶
type StorageConfig struct {
RulesPath string `mapstructure:"rules_path" toml:"rules_path"`
}
StorageConfig structure contains configuration for resource storage.
type StorageInterface ¶
StorageInterface describe interface to be implemented by resource storage implementations.