data

package module
v0.0.0-...-31c5f1c Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(event *Event) (data []byte, err error)

func EncodeJSON

func EncodeJSON(event *Event) (data []byte, err error)

Types

type Event

type Event struct {
	Payload interface{}
}

func Decode

func Decode(payload []byte) (*Event, error)

func DecodeJSON

func DecodeJSON(payload []byte) (*Event, error)

func (*Event) Array

func (j *Event) Array() ([]interface{}, error)

Array type asserts to an `array`

func (*Event) Bool

func (j *Event) Bool() (bool, error)

Bool type asserts to `bool`

func (*Event) Bytes

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

Bytes type asserts to `[]byte`

func (*Event) Float64

func (j *Event) Float64() (float64, error)

Float64 type asserts to `float64`

func (*Event) Get

func (j *Event) Get(key string) *Event

Get returns a pointer to a new `Json` object for `key` in its `map` representation

useful for chaining operations (to traverse a nested JSON):

js.Get("top_level").Get("dict").Get("value").Int()

func (*Event) Int

func (j *Event) Int() (int, error)

Int type asserts to `float64` then converts to `int`

func (*Event) Int64

func (j *Event) Int64() (int64, error)

Int type asserts to `float64` then converts to `int64`

func (*Event) Map

func (j *Event) Map() (map[string]interface{}, error)

Map type asserts to `map`

func (*Event) String

func (j *Event) String() (string, error)

String type asserts to `string`

type EventsChannel

type EventsChannel chan *Event

Jump to

Keyboard shortcuts

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