Documentation ¶
Index ¶
- Constants
- func AddMetadataToHeaders(metadata dtos.Metadata, extraHeaders map[string]string, clientKey *string) map[string]string
- func NewHTTPSegmentFetcher(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface, ...) service.SegmentFetcher
- func NewHTTPSplitFetcher(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface, ...) service.SplitFetcher
- type AuthAPIClient
- type Client
- type HTTPClient
- type HTTPEventsRecorder
- type HTTPImpressionRecorder
- func (i *HTTPImpressionRecorder) Record(impressions []dtos.ImpressionsDTO, metadata dtos.Metadata, ...) error
- func (i *HTTPImpressionRecorder) RecordImpressionsCount(pf dtos.ImpressionsCountDTO, metadata dtos.Metadata) error
- func (h *HTTPImpressionRecorder) RecordRaw(url string, data []byte, metadata dtos.Metadata, ...) error
- type HTTPSegmentFetcher
- type HTTPSplitFetcher
- type HTTPTelemetryRecorder
- func (m *HTTPTelemetryRecorder) RecordConfig(config dtos.Config, metadata dtos.Metadata) error
- func (h *HTTPTelemetryRecorder) RecordRaw(url string, data []byte, metadata dtos.Metadata, ...) error
- func (m *HTTPTelemetryRecorder) RecordStats(stats dtos.Stats, metadata dtos.Metadata) error
- func (m *HTTPTelemetryRecorder) RecordUniqueKeys(uniques dtos.Uniques, metadata dtos.Metadata) error
- type SplitAPI
Constants ¶
const ( CacheControlHeader = "Cache-Control" CacheControlNoCache = "no-cache" )
Cache control header constants
Variables ¶
This section is empty.
Functions ¶
func AddMetadataToHeaders ¶
func AddMetadataToHeaders(metadata dtos.Metadata, extraHeaders map[string]string, clientKey *string) map[string]string
AddMetadataToHeaders adds metadata in headers
func NewHTTPSegmentFetcher ¶
func NewHTTPSegmentFetcher(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface, metadata dtos.Metadata) service.SegmentFetcher
NewHTTPSegmentFetcher instantiates and returns a new HTTPSegmentFetcher.
func NewHTTPSplitFetcher ¶
func NewHTTPSplitFetcher(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface, metadata dtos.Metadata) service.SplitFetcher
NewHTTPSplitFetcher instantiates and return an HTTPSplitFetcher
Types ¶
type AuthAPIClient ¶
type AuthAPIClient struct {
// contains filtered or unexported fields
}
AuthAPIClient struct is responsible for authenticating client for push services
func NewAuthAPIClient ¶
func NewAuthAPIClient(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface, metadata dtos.Metadata) *AuthAPIClient
NewAuthAPIClient instantiates and return an AuthAPIClient
func (*AuthAPIClient) Authenticate ¶
func (a *AuthAPIClient) Authenticate() (*dtos.Token, error)
Authenticate performs authentication for push services
type Client ¶
type Client interface { Get(service string, headers map[string]string) ([]byte, error) Post(service string, body []byte, headers map[string]string) error }
Client interface for HTTPClient
func NewHTTPClient ¶
func NewHTTPClient( apikey string, cfg conf.AdvancedConfig, endpoint string, logger logging.LoggerInterface, metadata dtos.Metadata, ) Client
NewHTTPClient instance of HttpClient
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient structure to wrap up the net/http.Client
type HTTPEventsRecorder ¶
type HTTPEventsRecorder struct {
// contains filtered or unexported fields
}
HTTPEventsRecorder is a struct responsible for submitting events bulks to the backend
func NewHTTPEventsRecorder ¶
func NewHTTPEventsRecorder(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface) *HTTPEventsRecorder
NewHTTPEventsRecorder instantiates an HTTPEventsRecorder
type HTTPImpressionRecorder ¶
type HTTPImpressionRecorder struct {
// contains filtered or unexported fields
}
HTTPImpressionRecorder is a struct responsible for submitting impression bulks to the backend
func NewHTTPImpressionRecorder ¶
func NewHTTPImpressionRecorder(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface) *HTTPImpressionRecorder
NewHTTPImpressionRecorder instantiates an HTTPImpressionRecorder
func (*HTTPImpressionRecorder) Record ¶
func (i *HTTPImpressionRecorder) Record(impressions []dtos.ImpressionsDTO, metadata dtos.Metadata, extraHeaders map[string]string) error
Record sends an array (or slice) of impressionsRecord to the backend
func (*HTTPImpressionRecorder) RecordImpressionsCount ¶
func (i *HTTPImpressionRecorder) RecordImpressionsCount(pf dtos.ImpressionsCountDTO, metadata dtos.Metadata) error
RecordImpressionsCount sens impressionsCount
type HTTPSegmentFetcher ¶
type HTTPSegmentFetcher struct {
// contains filtered or unexported fields
}
HTTPSegmentFetcher struct is responsible for fetching segment by name from the API via HTTP method
func (*HTTPSegmentFetcher) Fetch ¶
func (f *HTTPSegmentFetcher) Fetch(segmentName string, since int64, fetchOptions *service.FetchOptions) (*dtos.SegmentChangesDTO, error)
Fetch issues a GET request to the split backend and returns the contents of a particular segment
type HTTPSplitFetcher ¶
type HTTPSplitFetcher struct {
// contains filtered or unexported fields
}
HTTPSplitFetcher struct is responsible for fetching splits from the backend via HTTP protocol
func (*HTTPSplitFetcher) Fetch ¶
func (f *HTTPSplitFetcher) Fetch(since int64, fetchOptions *service.FetchOptions) (*dtos.SplitChangesDTO, error)
Fetch makes an http call to the split backend and returns the list of updated splits
type HTTPTelemetryRecorder ¶
type HTTPTelemetryRecorder struct {
// contains filtered or unexported fields
}
HTTPTelemetryRecorder is a struct responsible for submitting telemetry to the backend
func NewHTTPTelemetryRecorder ¶
func NewHTTPTelemetryRecorder(apikey string, cfg conf.AdvancedConfig, logger logging.LoggerInterface) *HTTPTelemetryRecorder
NewHTTPTelemetryRecorder instantiates an HTTPTelemetryRecorder
func (*HTTPTelemetryRecorder) RecordConfig ¶
RecordConfig method submits config
func (*HTTPTelemetryRecorder) RecordRaw ¶
func (h *HTTPTelemetryRecorder) RecordRaw(url string, data []byte, metadata dtos.Metadata, extraHeaders map[string]string) error
RecordRaw records raw data
func (*HTTPTelemetryRecorder) RecordStats ¶
RecordStats method submits stats
func (*HTTPTelemetryRecorder) RecordUniqueKeys ¶
func (m *HTTPTelemetryRecorder) RecordUniqueKeys(uniques dtos.Uniques, metadata dtos.Metadata) error
RecordUniqueKeys method submits unique keys
type SplitAPI ¶
type SplitAPI struct { AuthClient service.AuthClient SplitFetcher service.SplitFetcher SegmentFetcher service.SegmentFetcher ImpressionRecorder service.ImpressionsRecorder EventRecorder service.EventsRecorder TelemetryRecorder service.TelemetryRecorder }
SplitAPI struct for fetchers and recorders
func NewSplitAPI ¶
func NewSplitAPI( apikey string, conf conf.AdvancedConfig, logger logging.LoggerInterface, metadata dtos.Metadata, ) *SplitAPI
NewSplitAPI creates new splitAPI