client

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 11 Imported by: 0

README

Jitsu Analytics client for Go

Go client for Jitsu Analytics https://jitsu.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(opts ...Option) (*Client, error)

func (*Client) Action

func (t *Client) Action(a *contexts.Action, opts ...event.Option)

func (*Client) Alias

func (t *Client) Alias(alias *contexts.Alias, usr *contexts.User, opts ...event.Option)

func (*Client) Close

func (t *Client) Close()

func (*Client) Flush

func (t *Client) Flush()

func (*Client) Group

func (t *Client) Group(g *contexts.Group, u *contexts.User, opts ...event.Option)

func (*Client) Identify

func (t *Client) Identify(u *contexts.User, opts ...event.Option)

func (*Client) Page

func (t *Client) Page(page *contexts.Page, opts ...event.Option)

func (*Client) Queue

func (t *Client) Queue(evt *event.Event)

func (*Client) Screen

func (t *Client) Screen(screen *contexts.Screen, opts ...event.Option)

func (*Client) Session

func (t *Client) Session(sess *contexts.Session, opts ...event.Option)

func (*Client) SetGroup

func (t *Client) SetGroup(grp *contexts.Group) *Client

func (*Client) SetOption

func (t *Client) SetOption(opt event.Option) *Client

func (*Client) SetUser

func (t *Client) SetUser(usr *contexts.User) *Client

func (*Client) Timing

func (t *Client) Timing(te *contexts.Timing, opts ...event.Option)

func (*Client) TimingStart

func (t *Client) TimingStart(cat, label, variable string) *timer

func (*Client) Track

func (t *Client) Track(evt string, opts ...event.Option)

type Option

type Option func(*Options)

func CollectorURL

func CollectorURL(u string) Option

func Debug

func Debug() Option

func ServerKey

func ServerKey(key string) Option

func SetAppInfo

func SetAppInfo(app *contexts.App) Option

func Strict

func Strict(b bool) Option

func TrackingID

func TrackingID(id string) Option

func WithClientHeader

func WithClientHeader(k, v string) Option

type Options

type Options struct {
	CollectorURL  string
	ServerKey     string
	S2S           bool
	ClientHeaders map[string]string
	Debug         bool
	Strict        bool

	AppInfo    *contexts.App
	Platform   string
	TrackingID string

	QueueBuffer   int
	FlushInterval time.Duration
	FlushCount    int
}

func (Options) EventOptions

func (o Options) EventOptions() []event.Option

type Store

type Store interface {
	Set(*event.Event) error
	Update(*StoreEvent) error
	Remove(*StoreEvent) error
	Get(string) (*StoreEvent, error)
	GetAll() ([]*StoreEvent, error)
	Count() int
}

func NewMemStore

func NewMemStore() (Store, error)

type StoreEvent

type StoreEvent struct {
	ID          string
	Event       []byte
	Attempted   bool
	Attempts    int
	LastAttempt time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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