types

package
v0.0.0-...-76f4a85 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Detail string `json:"detail"`
	// This is a pointer in order to marshal '0' value
	// but not if uninitialized.
	Index *uint64 `json:"index,omitempty"`
}

Error describes either an API error, or a rejected event. If rejected event, then Index field will be included.

func NewError

func NewError(index uint64, detail string) *Error

NewError returns an initialized Error.

func (*Error) Error

func (err *Error) Error() string

func (*Error) MarshalJSON

func (j *Error) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*Error) MarshalJSONBuf

func (j *Error) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*Error) UnmarshalJSON

func (j *Error) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*Error) UnmarshalJSONFFLexer

func (j *Error) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type Event

type Event struct {
	TypeField    Type    `json:"type"`
	PayloadField Payload `json:"payload" valid:"-"`
}

func (*Event) MarshalJSON

func (j *Event) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*Event) MarshalJSONBuf

func (j *Event) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*Event) UnmarshalJSON

func (j *Event) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*Event) UnmarshalJSONFFLexer

func (j *Event) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type EventMsg

type EventMsg struct {
	SenderID string
	Event    Event
}

func (*EventMsg) MarshalJSON

func (j *EventMsg) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*EventMsg) MarshalJSONBuf

func (j *EventMsg) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*EventMsg) UnmarshalJSON

func (j *EventMsg) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*EventMsg) UnmarshalJSONFFLexer

func (j *EventMsg) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type Payload

type Payload map[string]interface{}

Payload is the event's actual data inserted into data stores.

type TrackRequest

type TrackRequest struct {
	SenderID string  `json:"sender_id" valid:"notempty,required"`
	Events   []Event `json:"events"`
}

func (*TrackRequest) MarshalJSON

func (j *TrackRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*TrackRequest) MarshalJSONBuf

func (j *TrackRequest) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*TrackRequest) UnmarshalJSON

func (j *TrackRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*TrackRequest) UnmarshalJSONFFLexer

func (j *TrackRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type Type

type Type struct {
	EventVersionField string `json:"event_version" valid:"notempty,required"`
	EventNameField    string `json:"event_name" valid:"notempty,required"`
}

Type is an Event's metadata.

func (*Type) MarshalJSON

func (j *Type) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*Type) MarshalJSONBuf

func (j *Type) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*Type) UnmarshalJSON

func (j *Type) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*Type) UnmarshalJSONFFLexer

func (j *Type) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

Jump to

Keyboard shortcuts

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