Versions in this module Expand all Collapse all v0 v0.2.0 Mar 13, 2023 v0.1.0 Nov 3, 2022 Changes in this version + const DefaultBatchSize + const DefaultEndpoint + const DefaultInterval + const SIZE_DEFAULT + var ErrClosed = errors.New("the client was already closed") + var ErrMessageTooBig = errors.New("the message exceeds the maximum allowed size") + var ErrTooManyRequests = errors.New("too many requests are already in-flight") + type APIMessage interface + type Alias struct + Alias string + DistinctId string + Timestamp time.Time + Type string + func (msg Alias) APIfy() APIMessage + func (msg Alias) Validate() error + type AliasInApi struct + Event string + Library string + LibraryVersion string + Properties AliasInApiProperties + Timestamp time.Time + Type string + type AliasInApiProperties struct + Alias string + DistinctId string + Lib string + LibVersion string + type Backo struct + func DefaultBacko() *Backo + func NewBacko(base time.Duration, factor uint8, jitter float64, cap time.Duration) *Backo + func (b *Backo) NewTicker() *Ticker + func (backo *Backo) Duration(attempt int) time.Duration + func (backo *Backo) Sleep(attempt int) + type Callback interface + Failure func(APIMessage, error) + Success func(APIMessage) + type Capture struct + DistinctId string + Event string + Groups Groups + Properties Properties + Timestamp time.Time + Type string + func (msg Capture) APIfy() APIMessage + func (msg Capture) Validate() error + type CaptureInApi struct + DistinctId string + Event string + Library string + LibraryVersion string + Properties Properties + Timestamp time.Time + Type string + type Client interface + EndpointURL func() string + Enqueue func(Message) error + func New() Client + func NewTestWithConfig(t *testing.T, config Config, tc TestConfig) Client + func NewWithConfig(config Config) (cli Client, err error) + type Config struct + BatchSize int + Callback Callback + Endpoint string + Interval time.Duration + Logger Logger + RetryAfter func(int) time.Duration + Transport http.RoundTripper + Verbose bool + type ConfigError struct + Field string + Reason string + Value interface{} + func (e ConfigError) Error() string + type FieldError struct + Name string + Type string + Value interface{} + func (e FieldError) Error() string + type GroupIdentify struct + DistinctId string + Key string + Properties Properties + Timestamp time.Time + Type string + func (msg GroupIdentify) APIfy() APIMessage + func (msg GroupIdentify) Validate() error + type GroupIdentifyInApi struct + DistinctId string + Event string + Library string + LibraryVersion string + Properties Properties + Timestamp time.Time + type Groups map[string]interface + func (p Groups) Set(name string, value interface{}) Groups + func NewGroups() Groups + type Identify struct + DistinctId string + Groups Groups + Properties Properties + Timestamp time.Time + Type string + func (msg Identify) APIfy() APIMessage + func (msg Identify) Validate() error + type IdentifyInApi struct + DistinctId string + Event string + Library string + LibraryVersion string + Properties Properties + Set Properties + Timestamp time.Time + Type string + type Logger interface + Errorf func(format string, args ...interface{}) + Logf func(format string, args ...interface{}) + func StdLogger(logger *log.Logger) Logger + type Message interface + APIfy func() APIMessage + Validate func() error + type NoopClient struct + func (c *NoopClient) Close() error + func (c *NoopClient) EndpointURL() string + func (c *NoopClient) Enqueue(Message) error + type Properties map[string]interface + func (p Properties) Set(name string, value interface{}) Properties + func NewProperties() Properties + type TestConfig struct + Now func() time.Time + UID func() string + type Ticker struct + C <-chan time.Time + func (t *Ticker) Stop()