Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrChFull = errors.New("request channel full")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { sync.RWMutex Token string APIURL *url.URL TotalClientError4xxResponses int64 TotalRetriedUpdates int64 TotalInvalidDimensions int64 // contains filtered or unexported fields }
Client is a client for making dimensional correlations
func (*Client) Delete ¶
func (cc *Client) Delete(cor *Correlation, callback SuccessfulDeleteCB)
Delete removes a correlation
func (*Client) Get ¶
func (cc *Client) Get(dimName string, dimValue string, callback SuccessfulGetCB)
Get
type ClientConfig ¶
ClientConfig for correlation client.
type Config ¶
type Config struct { MaxRequests uint `mapstructure:"max_requests"` MaxBuffered uint `mapstructure:"max_buffered"` MaxRetries uint `mapstructure:"max_retries"` LogUpdates bool `mapstructure:"log_updates"` RetryDelay time.Duration `mapstructure:"retry_delay"` CleanupInterval time.Duration `mapstructure:"cleanup_interval"` }
Config defines configuration for correlation settings.
type CorrelateCB ¶
type CorrelateCB func(cor *Correlation, err error)
CorrelateCB is a call back invoked with Correlate requests it is not invoked if the reqeust is deduplicated, cancelled, or the client context is cancelled
type Correlation ¶
type Correlation struct { // Type is the type of correlation Type Type // DimName is the dimension name DimName string // DimValue is the dimension value DimValue string // Value is the value to makeRequest with the DimName and DimValue Value string }
Correlation is a struct referencing
type CorrelationClient ¶
type CorrelationClient interface { Correlate(*Correlation, CorrelateCB) Delete(*Correlation, SuccessfulDeleteCB) Get(dimName string, dimValue string, cb SuccessfulGetCB) Start() Shutdown() }
CorrelationClient is an interface for correlations.Client
func NewCorrelationClient ¶
func NewCorrelationClient(ctx context.Context, log log.Logger, client *http.Client, conf ClientConfig) (CorrelationClient, error)
NewCorrelationClient returns a new Client
type ErrMaxEntries ¶
type ErrMaxEntries struct {
MaxEntries int64 `json:"max,omitempty"`
}
ErrMaxEntries is an error returned when the correlation endpoint returns a 418 http status code indicating that the set of services or environments is too large to add another value
func (*ErrMaxEntries) Error ¶
func (m *ErrMaxEntries) Error() string
type SuccessfulDeleteCB ¶
type SuccessfulDeleteCB func(cor *Correlation)
SuccessfulDeleteCB is a call back that is only invoked on successful Deletion operations