Documentation ¶
Index ¶
- Constants
- func Get(ctx context.Context) (stats.Provider, error)
- func GetEnity(ctx context.Context, enityName string) (interface{}, error)
- func Registrate(ctx context.Context) (context.Context, error)
- func RegistrateEnity(ctx context.Context, enityName string, options interface{}) (context.Context, error)
- type Config
- type Enity
- func (e *Enity) RegisterAliveCheck(dependencyName string, checkFunc stats.CheckFunc) error
- func (e *Enity) RegisterMetric(metricName string, options interface{}) error
- func (e *Enity) RegisterReadyCheck(dependencyName string, checkFunc stats.CheckFunc) error
- func (e *Enity) Shutdown() error
- func (e *Enity) Start() error
- type Provider
- func (p *Provider) CreateEnity(enityName string, options interface{}) error
- func (p *Provider) GetEnity(connectionName string) (interface{}, error)
- func (p *Provider) RegisterAliveCheck(dependencyName string, checkFunc stats.CheckFunc) error
- func (p *Provider) RegisterMetric(metricName string, options interface{}) error
- func (p *Provider) RegisterReadyCheck(dependencyName string, checkFunc stats.CheckFunc) error
Constants ¶
const (
DefaultProviderName = "stats"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // HTTPProviderName is a name http server provider for server, where will be // handled statistics and metrics requests HTTPProviderName string `envconfig:"optional"` // HTTPEnityName is a name of http server HTTPEnityName string `envconfig:"optional"` }
Config describes struct with options for Statistics provider
type Enity ¶
type Enity struct {
// contains filtered or unexported fields
}
Enity is a connection controlling structure. It controls connection, asynchronous queue and everything that related to specified connection.
func GetEnityTypeCast ¶
func (*Enity) RegisterAliveCheck ¶
RegisterAliveCheck should register a function for /health/alive endpoint.
func (*Enity) RegisterMetric ¶
RegisterMetric should register a metric of defined type. Passed metricName should be used only as internal identifier. Provider should provide instructions for using metricOptions as well as cast to appropriate type.
func (*Enity) RegisterReadyCheck ¶
RegisterReadyCheck should register a function for /health/ready endpoint.
type Provider ¶
func (*Provider) CreateEnity ¶
CreateEnity should create enity using passed parameters.
func (*Provider) RegisterAliveCheck ¶
RegisterAliveCheck should register a function for /health/alive endpoint. nolint : dupl
func (*Provider) RegisterMetric ¶
RegisterMetric should register a metric of defined type. Passed metricName should be used only as internal identifier. Provider should provide instructions for using metricOptions as well as cast to appropriate type.