api

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) ([]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

func (*HTTPClient) Get

func (c *HTTPClient) Get(service string) ([]byte, error)

Get method is a get call to an url

func (*HTTPClient) Post

func (c *HTTPClient) Post(service string, body []byte, headers map[string]string) error

Post performs a HTTP POST request

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

func (*HTTPEventsRecorder) Record

func (i *HTTPEventsRecorder) Record(events []dtos.EventDTO, metadata dtos.Metadata) error

Record sends an array (or slice) of dtos.EventDTO to the backend

func (*HTTPEventsRecorder) RecordRaw

func (h *HTTPEventsRecorder) RecordRaw(url string, data []byte, metadata dtos.Metadata, extraHeaders map[string]string) error

RecordRaw records raw data

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

func (*HTTPImpressionRecorder) RecordRaw

func (h *HTTPImpressionRecorder) RecordRaw(url string, data []byte, metadata dtos.Metadata, extraHeaders map[string]string) error

RecordRaw records raw data

type HTTPMetricsRecorder

type HTTPMetricsRecorder struct {
	// contains filtered or unexported fields
}

HTTPMetricsRecorder is a struct responsible for submitting metrics (latency, gauge, counters) to the backend

func NewHTTPMetricsRecorder

func NewHTTPMetricsRecorder(
	apikey string,
	cfg conf.AdvancedConfig,
	logger logging.LoggerInterface,
) *HTTPMetricsRecorder

NewHTTPMetricsRecorder instantiates an HTTPMetricsRecorder

func (*HTTPMetricsRecorder) RecordCounters

func (m *HTTPMetricsRecorder) RecordCounters(counters []dtos.CounterDTO, metadata dtos.Metadata) error

RecordCounters method submits counter metrics to the backend

func (*HTTPMetricsRecorder) RecordGauge

func (m *HTTPMetricsRecorder) RecordGauge(gauge dtos.GaugeDTO, metadata dtos.Metadata) error

RecordGauge method submits gauge metrics to the backend

func (*HTTPMetricsRecorder) RecordLatencies

func (m *HTTPMetricsRecorder) RecordLatencies(latencies []dtos.LatenciesDTO, metadata dtos.Metadata) error

RecordLatencies method submits latency metrics to the backend

func (*HTTPMetricsRecorder) RecordRaw

func (h *HTTPMetricsRecorder) RecordRaw(url string, data []byte, metadata dtos.Metadata, extraHeaders map[string]string) error

RecordRaw records raw data

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 NewHTTPSegmentFetcher

func NewHTTPSegmentFetcher(
	apikey string,
	cfg conf.AdvancedConfig,
	logger logging.LoggerInterface,
	metadata dtos.Metadata,
) *HTTPSegmentFetcher

NewHTTPSegmentFetcher instantiates and returns a new HTTPSegmentFetcher.

func (*HTTPSegmentFetcher) Fetch

func (f *HTTPSegmentFetcher) Fetch(segmentName string, since int64) (*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 NewHTTPSplitFetcher

func NewHTTPSplitFetcher(
	apikey string,
	cfg conf.AdvancedConfig,
	logger logging.LoggerInterface,
	metadata dtos.Metadata,
) *HTTPSplitFetcher

NewHTTPSplitFetcher instantiates and return an HTTPSplitFetcher

func (*HTTPSplitFetcher) Fetch

func (f *HTTPSplitFetcher) Fetch(since int64) (*dtos.SplitChangesDTO, error)

Fetch makes an http call to the split backend and returns the list of updated splits

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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