Documentation ¶
Index ¶
- Constants
- Variables
- func DNT() bool
- type Client
- type Config
- type Doer
- type EventState
- type EventType
- type GetOption
- type MockClient
- func (m *MockClient) Attr(key, val string)
- func (m *MockClient) Failure(ctx context.Context, eventType EventType, err error) error
- func (m *MockClient) Start(ctx context.Context, eventType EventType) error
- func (m *MockClient) Success(ctx context.Context, eventType EventType) error
- func (m *MockClient) User() string
- func (m *MockClient) Wrap(ctx context.Context, et EventType, f func() error) error
- type NoopClient
- func (n NoopClient) Attr(_, _ string)
- func (n NoopClient) Failure(context.Context, EventType, error) error
- func (n NoopClient) Start(context.Context, EventType) error
- func (n NoopClient) Success(context.Context, EventType) error
- func (n NoopClient) User() string
- func (n NoopClient) Wrap(ctx context.Context, et EventType, f func() error) error
- type Option
- type SegmentClient
- func (s *SegmentClient) Attr(key, val string)
- func (s *SegmentClient) Failure(ctx context.Context, et EventType, err error) error
- func (s *SegmentClient) Start(ctx context.Context, et EventType) error
- func (s *SegmentClient) Success(ctx context.Context, et EventType) error
- func (s *SegmentClient) User() string
- func (s *SegmentClient) Wrap(ctx context.Context, et EventType, f func() error) (res error)
- type ULID
- type UUID
Constants ¶
const ( Start EventState = "started" Failed = "failed" Success = "succeeded" )
const ( Credentials EventType = "credentials" Deployments = "deployments" Install = "install" Migrate = "migrate" Status = "status" Uninstall = "uninstall" )
const ( // Welcome is displayed the first time the telemetry config is created. Welcome = `` /* 141-byte string literal not displayed */ )
Variables ¶
var ConfigFile = filepath.Join(".airbyte", "analytics.yml")
Functions ¶
Types ¶
type Client ¶
type Client interface { // Start should be called as quickly as possible. Start(context.Context, EventType) error // Success should be called only if the activity succeeded. Success(context.Context, EventType) error // Failure should be called only if the activity failed. Failure(context.Context, EventType, error) error // Attr should be called to add additional attributes to this activity. Attr(key, val string) // User returns the user identifier being used by this client User() string // Wrap wraps the func() error with the EventType, // calling the Start, Failure or Success methods correctly based on // the behavior of the func() error Wrap(context.Context, EventType, func() error) error }
Client interface for telemetry data.
type Config ¶
type Config struct { UserID ULID `yaml:"anonymous_user_id,omitempty"` AnalyticsID UUID `yaml:"analytics_id,omitempty"` Other map[string]interface{} `yaml:",inline"` }
Config represents the analytics.yaml file.
type EventState ¶
type EventState string
type GetOption ¶ added in v0.2.0
type GetOption func(*getConfig)
GetOption is for optional configuration of the Get call.
func WithDNT ¶ added in v0.8.0
func WithDNT() GetOption
WithDNT tells the Get call to enable the do-not-track configuration. If the DNT method returns true, there method is implicitly called. This method exists to explicitly ensuring the client is running in dnt mode
func WithUserHome ¶ added in v0.2.0
WithUserHome tells the Get call which directory should be considered the user's home. Primary for testing purposes.
type MockClient ¶ added in v0.19.0
type MockClient struct {
// contains filtered or unexported fields
}
func (*MockClient) Attr ¶ added in v0.19.0
func (m *MockClient) Attr(key, val string)
func (*MockClient) Start ¶ added in v0.19.0
func (m *MockClient) Start(ctx context.Context, eventType EventType) error
func (*MockClient) Success ¶ added in v0.19.0
func (m *MockClient) Success(ctx context.Context, eventType EventType) error
func (*MockClient) User ¶ added in v0.19.0
func (m *MockClient) User() string
type NoopClient ¶
type NoopClient struct { }
NoopClient client, all methods are no-ops.
func (NoopClient) Attr ¶
func (n NoopClient) Attr(_, _ string)
func (NoopClient) User ¶ added in v0.5.0
func (n NoopClient) User() string
type Option ¶ added in v0.3.0
type Option func(*SegmentClient)
Option is a configuration option for segment
func WithHTTPClient ¶ added in v0.3.0
WithHTTPClient overrides the default http.Client, primarily for testing purposes.
func WithSessionID ¶ added in v0.3.0
WithSessionID overrides the default uuid session, primarily for testing purposes.
type SegmentClient ¶
type SegmentClient struct {
// contains filtered or unexported fields
}
SegmentClient client, all methods communicate with segment.
func NewSegmentClient ¶
func NewSegmentClient(cfg Config, opts ...Option) *SegmentClient
func (*SegmentClient) Attr ¶
func (s *SegmentClient) Attr(key, val string)
func (*SegmentClient) Start ¶
func (s *SegmentClient) Start(ctx context.Context, et EventType) error
func (*SegmentClient) Success ¶
func (s *SegmentClient) Success(ctx context.Context, et EventType) error
func (*SegmentClient) User ¶ added in v0.5.0
func (s *SegmentClient) User() string
type ULID ¶
type ULID ulid.ULID
ULID is a wrapper around ulid.ULID so that we can implement the yaml interfaces. Deprecated: use UUID instead
func (ULID) MarshalYAML ¶
MarshalYAML allows for converting a ULID into a yaml field.
func (*ULID) UnmarshalYAML ¶
UnmarshalYAML allows for converting a yaml field into a ULID.
type UUID ¶ added in v0.5.0
UUID is a wrapper around uuid.UUID so that we can implement the yaml interfaces.
func (UUID) IsZero ¶ added in v0.5.0
IsZero implements the yaml interface, used to treat a uuid.Nil as empty for yaml purposes