telemetry

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Welcome is displayed the first time the telemetry config is created.
	Welcome = `` /* 145-byte string literal not displayed */

)

Variables

View Source
var ConfigFile = filepath.Join(".airbyte", "analytics.yml")

Functions

func WriteConfigToFile

func WriteConfigToFile(path string, cfg Config) error

WriteConfigToFile will write the cfg to the provided path.

Types

type Client

type Client interface {
	// Start should be called as soon quickly as possible.
	Start(EventType) error
	// Success should be called only if the activity succeeded.
	Success(EventType) error
	// Failure should be called only if the activity failed.
	Failure(EventType, error) error
	// Attr should be called to add additional attributes to this activity.
	Attr(key, val string)
}

Client interface for telemetry data.

type Config

type Config struct {
	UserID ULID `yaml:"anonymous_user_id"`
}

Config represents the analytics.yaml file.

func LoadConfigFromFile

func LoadConfigFromFile(path string) (Config, error)

type EventState

type EventState string
const (
	Start   EventState = "started"
	Failed  EventState = "failed"
	Success EventState = "succeeded"
)

type EventType

type EventType string
const (
	Install   EventType = "install"
	Sync      EventType = "sync"
	Uninstall EventType = "uninstall"
	Validate  EventType = "validate"
	Check     EventType = "check"
)

type NoopClient

type NoopClient struct {
}

NoopClient client, all methods are no-ops.

func (NoopClient) Attr

func (n NoopClient) Attr(key, val string)

func (NoopClient) Failure

func (n NoopClient) Failure(eventType EventType, err error) error

func (NoopClient) Start

func (n NoopClient) Start(EventType) error

func (NoopClient) Success

func (n NoopClient) Success(EventType) error

type SegmentClient

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

SegmentClient client, all methods communicate with segment.

func NewSegmentClient

func NewSegmentClient(cfg Config) *SegmentClient

func (*SegmentClient) Attr

func (s *SegmentClient) Attr(key, val string)

func (*SegmentClient) Failure

func (s *SegmentClient) Failure(et EventType, err error) error

func (*SegmentClient) Start

func (s *SegmentClient) Start(et EventType) error

func (*SegmentClient) Success

func (s *SegmentClient) Success(et EventType) error

type ULID

type ULID ulid.ULID

ULID is a wrapper around ulid.ULID so that we can implement the yaml interfaces.

func NewULID

func NewULID() ULID

NewULID returns a new randomized ULID.

func (ULID) MarshalYAML

func (u ULID) MarshalYAML() (any, error)

MarshalYAML allows for converting a ULID into a yaml field.

func (ULID) String

func (u ULID) String() string

String returns a string representation of this ULID.

func (*ULID) UnmarshalYAML

func (u *ULID) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML allows for converting a yaml field into a ULID.

Jump to

Keyboard shortcuts

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