Documentation
¶
Index ¶
- Constants
- func Capture(eventType string, providers registry.Providers, data Message, ...)
- func Close()
- func Enabled() bool
- func GetCookieId() uuid.UUID
- func HashAttribute(value string) string
- func Init(opts ...Option) error
- func IsCI() bool
- func IsFaaS() bool
- func SetGlobalProperty(k string, v interface{})
- func SetUserId(userId string)
- type Client
- type Environment
- type Message
- type Option
- func WithApiKey(apikey string) Option
- func WithDebug() Option
- func WithDisabled() Option
- func WithInspect() Option
- func WithInstanceId(instanceId string) Option
- func WithProperties(properties map[string]interface{}) Option
- func WithTerminal(terminal bool) Option
- func WithVersionInfo(version, commit, buildDate string) Option
- type VersionInfo
Constants ¶
const (
CQTeamID = "12345678-0000-0000-0000-c1a0dbeef000"
)
Variables ¶
This section is empty.
Functions ¶
func GetCookieId ¶ added in v0.23.3
GetCookieId will read or generate a persistent `telemetry-random-id` file and return its value. First it will try reading ~/.cq/telemetry-random-id and use that value if found. If not, it will move on to ./cq/telemetry-random-id, first attempting a read and if not found, will create that file filling it with a newly generated ID. If a directory with the same name is encountered, process is aborted and an empty string is returned. If a new file is generated, c.newRandomId is set.
func HashAttribute ¶
HashAttribute creates a one-way hash from an attribute
func Init ¶
Init initializes the Analytics Client with options. The returned error is non-nil if options is invalid, for instance if a malformed DSN is provided.
func IsCI ¶
func IsCI() bool
IsCI determines if we're running under a CI env by checking CI-specific env vars
func IsFaaS ¶
func IsFaaS() bool
IsFaaS determines if we're running under a Lambda env by checking Lambda-specific env vars
func SetGlobalProperty ¶
func SetGlobalProperty(k string, v interface{})
Types ¶
type Environment ¶
type Environment struct {
// OS Client executing
OS string `json:"os"`
// Terminal is true if Client is executed inside a terminal environment
Terminal bool `json:"terminal"`
// CI is true if the Client is executed inside a CI i.e github actions etc'
CI bool `json:"ci"`
// FaaS is true if Client is executed inside a function i.e lambda etc'
FaaS bool `json:"faas"`
// Hashed hostname identifier
Hostname string `json:"hostname"`
MacAddr string `json:"mac_addr"`
}
type Option ¶
type Option func(c *Client)
func WithApiKey ¶
func WithDisabled ¶
func WithDisabled() Option
func WithInspect ¶
func WithInspect() Option