serializer

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONPayload

type JSONPayload struct {
	// contains filtered or unexported fields
}

func (JSONPayload) Add

func (jpayload JSONPayload) Add(field string, value interface{}) moleculer.Payload

func (JSONPayload) AddItem

func (jpayload JSONPayload) AddItem(value interface{}) moleculer.Payload

func (JSONPayload) AddMany

func (jpayload JSONPayload) AddMany(toAdd map[string]interface{}) moleculer.Payload

func (JSONPayload) Array

func (payload JSONPayload) Array() []moleculer.Payload

func (JSONPayload) Bool

func (payload JSONPayload) Bool() bool

func (JSONPayload) BoolArray

func (payload JSONPayload) BoolArray() []bool

func (JSONPayload) Bson

func (jp JSONPayload) Bson() bson.M

func (JSONPayload) BsonArray

func (jp JSONPayload) BsonArray() bson.A

func (JSONPayload) ByteArray

func (payload JSONPayload) ByteArray() []byte

func (JSONPayload) Error

func (payload JSONPayload) Error() error

func (JSONPayload) Exists

func (payload JSONPayload) Exists() bool

func (JSONPayload) First

func (jp JSONPayload) First() moleculer.Payload

func (JSONPayload) Float

func (payload JSONPayload) Float() float64

func (JSONPayload) Float32

func (payload JSONPayload) Float32() float32

func (JSONPayload) Float32Array

func (payload JSONPayload) Float32Array() []float32

func (JSONPayload) FloatArray

func (payload JSONPayload) FloatArray() []float64

func (JSONPayload) ForEach

func (payload JSONPayload) ForEach(iterator func(key interface{}, value moleculer.Payload) bool)

func (JSONPayload) Get

func (payload JSONPayload) Get(path string) moleculer.Payload

func (JSONPayload) Int

func (payload JSONPayload) Int() int

func (JSONPayload) Int64

func (payload JSONPayload) Int64() int64

func (JSONPayload) Int64Array

func (payload JSONPayload) Int64Array() []int64

func (JSONPayload) IntArray

func (payload JSONPayload) IntArray() []int

func (JSONPayload) IsArray

func (payload JSONPayload) IsArray() bool

func (JSONPayload) IsError

func (payload JSONPayload) IsError() bool

func (JSONPayload) IsMap

func (payload JSONPayload) IsMap() bool

func (JSONPayload) Len

func (jp JSONPayload) Len() int

func (JSONPayload) Map

func (payload JSONPayload) Map() map[string]moleculer.Payload

func (JSONPayload) MapArray

func (payload JSONPayload) MapArray() []map[string]interface{}

func (JSONPayload) Only

func (p JSONPayload) Only(path string) moleculer.Payload

Only return a payload containing only the field specified

func (JSONPayload) RawMap

func (payload JSONPayload) RawMap() map[string]interface{}

func (JSONPayload) Remove

func (jpayload JSONPayload) Remove(fields ...string) moleculer.Payload

func (JSONPayload) Sort

func (p JSONPayload) Sort(field string) moleculer.Payload

func (JSONPayload) String

func (jp JSONPayload) String() string

func (JSONPayload) StringArray

func (payload JSONPayload) StringArray() []string

func (JSONPayload) StringIdented

func (jp JSONPayload) StringIdented(ident string) string

func (JSONPayload) Time

func (payload JSONPayload) Time() time.Time

func (JSONPayload) TimeArray

func (payload JSONPayload) TimeArray() []time.Time

func (JSONPayload) Uint

func (payload JSONPayload) Uint() uint64

func (JSONPayload) UintArray

func (payload JSONPayload) UintArray() []uint64

func (JSONPayload) Value

func (payload JSONPayload) Value() interface{}

func (JSONPayload) ValueArray

func (payload JSONPayload) ValueArray() []interface{}

type JSONSerializer

type JSONSerializer struct {
	// contains filtered or unexported fields
}

func CreateJSONSerializer

func CreateJSONSerializer(logger *log.Entry) JSONSerializer

func (JSONSerializer) BytesToPayload

func (serializer JSONSerializer) BytesToPayload(bytes *[]byte) moleculer.Payload

func (JSONSerializer) MapToPayload

func (serializer JSONSerializer) MapToPayload(mapValue *map[string]interface{}) (moleculer.Payload, error)

func (JSONSerializer) PayloadToBytes

func (serializer JSONSerializer) PayloadToBytes(payload moleculer.Payload) []byte

func (JSONSerializer) PayloadToContextMap

func (serializer JSONSerializer) PayloadToContextMap(message moleculer.Payload) map[string]interface{}

type Serializer

type Serializer interface {
	BytesToPayload(*[]byte) moleculer.Payload
	PayloadToBytes(moleculer.Payload) []byte
	PayloadToContextMap(moleculer.Payload) map[string]interface{}
	MapToPayload(*map[string]interface{}) (moleculer.Payload, error)
}

func New

Jump to

Keyboard shortcuts

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