Version: v0.0.0-...-11a205f Latest Latest

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

Go to latest
Published: Feb 10, 2017 License: MIT Imports: 12 Imported by: 0




This section is empty.


This section is empty.


func Compress

func Compress(msg *bytes.Buffer) (*bytes.Buffer, error)

Compress the given string

func ConvertBatchCSV

func ConvertBatchCSV(events []*Event) (*bytes.Buffer, error)

Converts to CSV string for list of events

func ConvertBatchJSON

func ConvertBatchJSON(events []*Event) (*bytes.Buffer, error)

Converts multiple events into JSON string

func ConvertCSV

func ConvertCSV(event *Event) (*bytes.Buffer, error)

Dumps the Event into a CSV string

func ConvertIsoformat

func ConvertIsoformat(at uint64) string

Converts EPOCH timestamp to isoformat string

func ConvertJSON

func ConvertJSON(event *Event) (*bytes.Buffer, error)

Dumps the Event into a JSON string

func ConvertToJson

func ConvertToJson(paramters []*payload.Parameter) string

func GetRandomPath

func GetRandomPath(basePath string, extension string, compress bool) string

Get a random name for the blob

func RandStringBytes

func RandStringBytes(n int) string

Generates an `n` length random string.

func ResolvePath

func ResolvePath(basePath string) string

Resolves custom names in the path


type BatchConverter

type BatchConverter func(events []*Event) (*bytes.Buffer, error)

func GetBatchConverterFunction

func GetBatchConverterFunction(fileFormat string) (BatchConverter, error)

Returns a batch event converter function based on file extension.

type Converter

type Converter func(event *Event) (*bytes.Buffer, error)

Define converter functions based on the file extension type.

func GetConverterFunction

func GetConverterFunction(fileFormat string) (Converter, error)

Returns a single event converter function based on file extension.

type Dialect

type Dialect interface {
	IsValid() bool
	NewClient() (StorageClient, error)

Dialect interface for create StorageQueue from Configuration

type Event

type Event struct {
	DeviceID        string `json:"device_id"`
	ClientID        string `json:"client_id"`
	Session         string `json:"session"`
	Nr              uint32 `json:"nr"`
	Env             string `json:"env"`
	SystemVersion   string `json:"system_version"`
	ProductVersion  string `json:"product_version"`
	At              string `json:"at"`
	Timezone        string `json:"timezone"`
	Event           string `json:"event"`
	DeviceMake      string `json:"device_make,omitempty"`
	DeviceModel     string `json:"device_model,omitempty"`
	System          string `json:"system,omitempty"`
	SystemLanguage  string `json:"system_language,omitempty"`
	Browser         string `json:"browser,omitempty"`
	BrowserVersion  string `json:"browser_version,omitempty"`
	ProductGitHash  string `json:"product_git_hash,omitempty"`
	ProductLanguage string `json:"product_language,omitempty"`
	UserID          string `json:"user_id,omitempty"`
	TenantID        string `json:"tenant_id,omitempty"`
	IP              string `json:"ip,omitempty"`
	Country         string `json:"country,omitempty"`
	Parameters      string `json:"parameters,omitempty"`

Single event

func NewEvent

func NewEvent(meta *payload.Collection, payload *payload.Payload) *Event

Creates a new event based on the collection and a single payload

func (*Event) SetIPAddress

func (event *Event) SetIPAddress(IP string)

Set IP Address

func (*Event) String

func (event *Event) String() []string

Returns a

func (*Event) TruncateIPv4LastOctet

func (event *Event) TruncateIPv4LastOctet()

Truncates the IP address

type StorageClient

type StorageClient interface {
	IsBufferedStorage() bool
	GetConverter() Converter
	GetBatchConverter() BatchConverter
	Save(*bytes.Buffer) error

Interface for processing events


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL