event

package
v0.16.0-beta01 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUriIsRelative = errors.New("uri is relative")
)

Functions

This section is empty.

Types

type Custom added in v0.14.0

type Custom struct {
	Timestamp time.Time
	PageUri   Uri
	Session   Session
	Name      string
	Keys      []string
	Values    []string
}

Custom define a user defined event with custom properties.

func (*Custom) MarshalZerologObject added in v0.14.0

func (c *Custom) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog.LogObjectMarshaler.

type PageView

type PageView struct {
	Session   Session
	Timestamp time.Time
	PageUri   Uri
}

PageView define a page view event.

func (*PageView) MarshalZerologObject added in v0.14.0

func (pv *PageView) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog.LogObjectMarshaler.

type ReferrerUri added in v0.14.0

type ReferrerUri struct {
	Uri
}

ReferrerUri wraps an URI to represent referrer URIs. An empty referrer uri is considered as "direct".

func (*ReferrerUri) HostOrDirect added in v0.14.0

func (ru *ReferrerUri) HostOrDirect() []byte

HostOrDirect returns uri host or "direct" if uri is empty.

func (*ReferrerUri) Parse added in v0.14.0

func (ru *ReferrerUri) Parse(uri []byte) error

Parse initializes URI from the given absolute uri. If given uri is nil or if this method is never called, ReferrerUri is considered as direct.

type Session added in v0.15.0

type Session struct {
	PageUri     *Uri
	ReferrerUri *ReferrerUri
	Client      uaparser.Client
	CountryCode ipgeolocator.CountryCode
	VisitorId   string
	SessionUuid uuid.UUID
	Utm         UtmParams
	Pageviews   uint16
}

Session holds data about visitor's/user's session/visit.

func (*Session) MarshalZerologObject added in v0.15.0

func (s *Session) MarshalZerologObject(e *zerolog.Event)

func (*Session) SessionTime added in v0.15.0

func (s *Session) SessionTime() time.Time

SessionTime returns session creation date time.

func (*Session) Version added in v0.15.0

func (s *Session) Version() uint16

Version returns session version number. Higher version number means more recent session.

type Uri added in v0.14.0

type Uri struct {
	fasthttp.URI
}

Uri wraps a fasthttp.URI to implements Uri.

func (*Uri) IsEmpty added in v0.14.0

func (u *Uri) IsEmpty() bool

IsEmpty returns whether Uri contains actual data or is empty.

func (*Uri) Parse added in v0.14.0

func (u *Uri) Parse(uri []byte) error

Parse initializes URI from the given absolute uri.

func (*Uri) Path added in v0.14.0

func (u *Uri) Path() []byte

Path returns URI path, i.e. /foo/bar of [http://aaa.com/foo/bar?baz=123#qwe](http://aaa.com/foo/bar?baz=123#qwe) .

The returned path is always urldecoded and normalized, i.e. '//f%20obar/baz/../zzz' becomes '/f obar/zzz'.

The returned bytes are valid until the next URI method call.

type UtmParams added in v0.15.0

type UtmParams struct {
	Source   string
	Medium   string
	Campaign string
	Term     string
	Content  string
}

UtmParams holds Urchin Tracking Module (UTM) URL parameters. See https://en.wikipedia.org/wiki/UTM_parameters.

func (*UtmParams) MarshalZerologObject added in v0.15.0

func (up *UtmParams) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog.LogObjectMarshaler.

Jump to

Keyboard shortcuts

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