envelope

package
v0.11.12 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VENDOR         string = "vendor"
	NAMESPACE      string = "namespace"
	VERSION        string = "version"
	FORMAT         string = "format"
	PATH           string = "path"
	INPUT_PROTOCOL string = "inputProtocol"
)
View Source
const HTTP_HEADERS_CONTEXT string = "io.silverton/buz/internal/contexts/httpHeaders/v1.0.json"

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct{}

Reserving this for future use.

type App

type App struct {
	Name    *string `json:"name,omitempty"`
	Version *string `json:"version,omitempty"`
	Build   *string `json:"build,omitempty"`
}

type Browser

type Browser struct {
	Lang           *string `json:"language,omitempty"`
	Cookies        *bool   `json:"cookies,omitempty"`
	ColorDepth     *int64  `json:"colorDepth,omitempty"`
	Charset        *string `json:"charset,omitempty"`
	ViewportSize   *string `json:"viewportSize,omitempty"`
	ViewportWidth  *int    `json:"viewportWidth,omitempty"`
	ViewportHeight *int    `json:"viewportHeight,omitempty"`
	DocumentSize   *string `json:"documentSize,omitempty"`
	DocumentWidth  *int    `json:"documentWidth,omitempty"`
	DocumentHeight *int    `json:"documentHeight,omitempty"`
}

type Collector

type Collector struct {
	Tstamp  time.Time `json:"tstamp,omitempty"`
	Name    *string   `json:"name,omitempty"`
	Version *string   `json:"version,omitempty"`
}

func (Collector) Scan

func (c Collector) Scan(input interface{}) error

func (Collector) Value

func (c Collector) Value() (driver.Value, error)

type Device

type Device struct {
	Ip                string  `json:"ip"`
	Useragent         string  `json:"useragent"`
	Id                string  `json:"id"`                  // Server-side cookie, header, or query params
	Idfa              *string `json:"idfa,omitempty"`      // [iOS]
	Idfv              *string `json:"idfv,omitempty"`      // [iOS]
	AdId              *string `json:"adId,omitempty"`      // [Android] Google play services advertising id
	AndroidId         *string `json:"androidId,omitempty"` // [Android] Android id
	AdTrackingEnabled *bool   `json:"adTrackingEnabled,omitempty"`
	Manufacturer      *string `json:"manufacturer,omitempty"`
	Model             *string `json:"model,omitempty"`
	Name              *string `json:"name,omitempty"`
	Type              *string `json:"type,omitempty"`
	Token             *string `json:"token,omitempty"`
	Os                `json:"os,omitempty"`
	Browser           `json:"browser,omitempty"`
	Screen            `json:"screen,omitempty"`
	Network           `json:"network,omitempty"`
	App               `json:"app,omitempty"`
	Location          `json:"location,omitempty"`
	Traits            *map[string]interface{} `json:"traits,omitempty"`
}

func (Device) Scan

func (d Device) Scan(input interface{}) error

func (Device) Value

func (d Device) Value() (driver.Value, error)

type Envelope

type Envelope struct {
	db.BasePKeylessModel
	EventMeta  `json:"eventMeta" gorm:"type:json"`
	Pipeline   `json:"pipeline" gorm:"type:json"`
	Device     `json:"device" gorm:"type:json"`
	User       `json:"user" gorm:"type:json"`
	Session    `json:"session" gorm:"type:json"`
	Web        `json:"web" gorm:"type:json"`
	Annotation `json:"annotation" gorm:"type:json"`
	Validation `json:"validation" gorm:"type:json"`
	Contexts   event.Contexts `json:"contexts" gorm:"type:json"`
	Payload    event.Payload  `json:"payload" gorm:"type:json"`
}

func BuildCloudeventEnvelopesFromRequest

func BuildCloudeventEnvelopesFromRequest(c *gin.Context, conf *config.Config, m *meta.CollectorMeta) []Envelope

func BuildGenericEnvelopesFromRequest

func BuildGenericEnvelopesFromRequest(c *gin.Context, conf *config.Config, m *meta.CollectorMeta) []Envelope

func BuildPixelEnvelopesFromRequest

func BuildPixelEnvelopesFromRequest(c *gin.Context, conf *config.Config, m *meta.CollectorMeta) []Envelope

NOTE - one envelope per request

func BuildSnowplowEnvelopesFromRequest

func BuildSnowplowEnvelopesFromRequest(c *gin.Context, conf *config.Config, m *meta.CollectorMeta) []Envelope

func BuildWebhookEnvelopesFromRequest

func BuildWebhookEnvelopesFromRequest(c *gin.Context, conf *config.Config, m *meta.CollectorMeta) []Envelope

func (*Envelope) AsByte

func (e *Envelope) AsByte() ([]byte, error)

func (*Envelope) AsMap

func (e *Envelope) AsMap() (map[string]interface{}, error)

type EventMeta

type EventMeta struct {
	Protocol  string    `json:"protocol,omitempty"`
	Uuid      uuid.UUID `json:"uuid,omitempty"`
	Vendor    string    `json:"vendor,omitempty"`
	Namespace string    `json:"namespace,omitempty"`
	Version   string    `json:"version,omitempty"`
	Format    string    `json:"format,omitempty"`
	Schema    string    `json:"schema,omitempty"`
}

func (EventMeta) Scan

func (e EventMeta) Scan(input interface{}) error

func (EventMeta) Value

func (e EventMeta) Value() (driver.Value, error)

type Group

type Group struct {
	Id   *string `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

type JsonbEnvelope

type JsonbEnvelope struct {
	db.BasePKeylessModel
	EventMeta  `json:"eventMeta" gorm:"type:jsonb"`
	Pipeline   `json:"pipeline" gorm:"type:jsonb"`
	Device     `json:"device" gorm:"type:jsonb"`
	User       `json:"user" gorm:"type:jsonb"`
	Session    `json:"session" gorm:"type:jsonb"`
	Web        `json:"web" gorm:"type:jsonb"`
	Annotation `json:"annotation" gorm:"type:jsonb"`
	Validation `json:"validation" gorm:"type:jsonb"`
	Contexts   event.Contexts `json:"contexts" gorm:"type:jsonb"`
	Payload    event.Payload  `json:"payload" gorm:"type:jsonb"`
}

type Location

type Location struct {
	Latitude  *float64 `json:"latitude,omitempty"`
	Longitude *float64 `json:"longitude,omitempty"`
	Country   *string  `json:"country,omitempty"`
	Region    *string  `json:"region,omitempty"`
	City      *string  `json:"city,omitempty"`
	Dma       *string  `json:"dma,omitempty"`
}

type Network

type Network struct {
	Bluetooth *bool   `json:"bluetooth,omitempty"`
	Cellular  *bool   `json:"cellular,omitempty"`
	Wifi      *bool   `json:"wifi,omitempty"`
	Carrier   *string `json:"carrier,omitempty"`
}

type Os

type Os struct {
	Name     *string `json:"name,omitempty"`
	Version  *string `json:"version,omitempty"`
	Timezone *string `json:"timezone,omitempty"`
}

type PageAttrs

type PageAttrs struct {
	Url      string                  `json:"url,omitempty"`
	Title    *string                 `json:"title,omitempty"`
	Scheme   string                  `json:"scheme,omitempty"`
	Host     string                  `json:"host,omitempty"`
	Port     string                  `json:"port,omitempty"`
	Path     string                  `json:"path,omitempty"`
	Query    *map[string]interface{} `json:"query,omitempty"`
	Fragment *string                 `json:"fragment,omitempty"`
	Medium   *string                 `json:"medium,omitempty"`
	Source   *string                 `json:"source,omitempty"`
	Term     *string                 `json:"term,omitempty"`
	Content  *string                 `json:"content,omitempty"`
	Campaign *string                 `json:"campaign,omitempty"`
}

type PayloadValidationError

type PayloadValidationError struct {
	Field       string `json:"field,omitempty"`
	Description string `json:"description,omitempty"`
	ErrorType   string `json:"errorType,omitempty"`
}

type Pipeline

type Pipeline struct {
	Source    `json:"source,omitempty"`
	Collector `json:"collector,omitempty"`
	Relay     `json:"relay,omitempty"`
}

func (Pipeline) Scan

func (p Pipeline) Scan(input interface{}) error

func (Pipeline) Value

func (p Pipeline) Value() (driver.Value, error)

type Relay

type Relay struct {
	Relayed bool       `json:"relayed,omitempty"`
	Id      *uuid.UUID `json:"id,omitempty"`
	Tstamp  *time.Time `json:"tstamp,omitempty"`
}

func (Relay) Scan

func (r Relay) Scan(input interface{}) error

func (Relay) Value

func (r Relay) Value() (driver.Value, error)

type Screen

type Screen struct {
	Resolution *string `json:"screenResolution,omitempty"`
	Width      *int    `json:"screenWidth,omitempty"`
	Height     *int    `json:"screenHeight,omitempty"`
}

type Session

type Session struct {
	Id     *string                 `json:"id,omitempty"`
	Idx    *int64                  `json:"idx,omitempty"`
	Traits *map[string]interface{} `json:"traits,omitempty"`
}

func (Session) Scan

func (e Session) Scan(input interface{}) error

func (Session) Value

func (e Session) Value() (driver.Value, error)

type Source

type Source struct {
	GeneratedTstamp time.Time `json:"generatedTstamp,omitempty"`
	SentTstamp      time.Time `json:"sentTstamp,omitempty"`
	Name            *string   `json:"name,omitempty"`
	Version         *string   `json:"version,omitempty"`
}

func (Source) Scan

func (s Source) Scan(input interface{}) error

func (Source) Value

func (s Source) Value() (driver.Value, error)

type StringEnvelope

type StringEnvelope struct {
	db.BasePKeylessModel
	EventMeta  `json:"eventMeta" gorm:"type:string"`
	Pipeline   `json:"pipeline" gorm:"type:string"`
	Device     `json:"device" gorm:"type:string"`
	User       `json:"user" gorm:"type:string"`
	Session    `json:"session" gorm:"type:string"`
	Web        `json:"web" gorm:"type:string"`
	Annotation `json:"annotation" gorm:"type:string"`
	Validation `json:"validation" gorm:"type:string"`
	Contexts   event.Contexts `json:"contexts" gorm:"type:string"`
	Payload    event.Payload  `json:"payload" gorm:"type:string"`
}

type Team

type Team struct {
	Id   *string `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

type User

type User struct {
	Id          *string                 `json:"id,omitempty"`
	AnonymousId *string                 `json:"anonymousId,omitempty"`
	Fingerprint *string                 `json:"fingerprint,omitempty"`
	Traits      *map[string]interface{} `json:"traits,omitempty"`
}

func (User) Scan

func (e User) Scan(input interface{}) error

func (User) Value

func (e User) Value() (driver.Value, error)

type Validation

type Validation struct {
	IsValid *bool            `json:"isValid,omitempty"`
	Error   *ValidationError `json:"error,omitempty"`
}

func (Validation) Scan

func (e Validation) Scan(input interface{}) error

func (Validation) Value

func (e Validation) Value() (driver.Value, error)

type ValidationError

type ValidationError struct {
	ErrorType       *string                  `json:"errorType,omitempty"`
	ErrorResolution *string                  `json:"errorResolution,omitempty"`
	Errors          []PayloadValidationError `json:"payloadValidationErrors,omitempty"`
}

func (*ValidationError) Scan

func (e *ValidationError) Scan(input interface{}) error

func (*ValidationError) Value

func (e *ValidationError) Value() (driver.Value, error)

type Web

type Web struct {
	Page     PageAttrs `json:"page"`
	Referrer PageAttrs `json:"referrer"`
}

func (Web) Scan

func (p Web) Scan(input interface{}) error

func (Web) Value

func (p Web) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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