Documentation ¶
Index ¶
- func ArrayTransformer(value *interface{}) *arrayTransformer
- func Empty() moleculer.Payload
- func EmptyList() moleculer.Payload
- func Error(msgs ...interface{}) moleculer.Payload
- func GetValueType(value *interface{}) string
- func MapTransformer(value *interface{}) *mapTransformer
- func New(source interface{}) moleculer.Payload
- type RawPayload
- func (p *RawPayload) Add(field string, value interface{}) moleculer.Payload
- func (p *RawPayload) AddItem(value interface{}) moleculer.Payload
- func (p *RawPayload) AddMany(toAdd map[string]interface{}) moleculer.Payload
- func (p *RawPayload) Array() []moleculer.Payload
- func (p *RawPayload) Bool() bool
- func (p *RawPayload) BoolArray() []bool
- func (p *RawPayload) Bson() bson.M
- func (p *RawPayload) BsonArray() bson.A
- func (p *RawPayload) ByteArray() []byte
- func (p *RawPayload) Error() error
- func (p *RawPayload) Exists() bool
- func (p *RawPayload) First() moleculer.Payload
- func (p *RawPayload) Float() float64
- func (p *RawPayload) Float32() float32
- func (p *RawPayload) Float32Array() []float32
- func (p *RawPayload) FloatArray() []float64
- func (p *RawPayload) ForEach(iterator func(key interface{}, value moleculer.Payload) bool)
- func (p *RawPayload) Get(path string) moleculer.Payload
- func (p *RawPayload) Int() int
- func (p *RawPayload) Int64() int64
- func (p *RawPayload) Int64Array() []int64
- func (p *RawPayload) IntArray() []int
- func (p *RawPayload) IsArray() bool
- func (p *RawPayload) IsError() bool
- func (p *RawPayload) IsMap() bool
- func (p *RawPayload) Len() int
- func (p *RawPayload) Map() map[string]moleculer.Payload
- func (p *RawPayload) MapArray() []map[string]interface{}
- func (p *RawPayload) Only(path string) moleculer.Payload
- func (p *RawPayload) RawMap() map[string]interface{}
- func (p *RawPayload) Remove(fields ...string) moleculer.Payload
- func (p *RawPayload) Sort(field string) moleculer.Payload
- func (p *RawPayload) String() string
- func (p *RawPayload) StringArray() []string
- func (p *RawPayload) Time() time.Time
- func (p *RawPayload) TimeArray() []time.Time
- func (p *RawPayload) Uint() uint64
- func (p *RawPayload) UintArray() []uint64
- func (p *RawPayload) Value() interface{}
- func (p *RawPayload) ValueArray() []interface{}
- type Sortable
- type Stringer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayTransformer ¶
func ArrayTransformer(value *interface{}) *arrayTransformer
ArrayTransformer : return the array/slice transformer for the specific map type
func GetValueType ¶
func GetValueType(value *interface{}) string
GetValueType : return a string that represents the map type. examples: map[string]int , map[string]string, map[string]float32 and etc there are a few possible implementations, Reflection is not very popular in GO.. so this uses mt.Sprintf .. but we need to test a second version of this with Reflect to check what is faster
func MapTransformer ¶
func MapTransformer(value *interface{}) *mapTransformer
MapTransformer : return the map transformer for the specific map type
Types ¶
type RawPayload ¶
type RawPayload struct {
// contains filtered or unexported fields
}
RawPayload is a payload implementation for raw types.
func (*RawPayload) Add ¶
func (p *RawPayload) Add(field string, value interface{}) moleculer.Payload
Add add the field:value pair to the existing values and return a new payload.
func (*RawPayload) AddItem ¶
func (p *RawPayload) AddItem(value interface{}) moleculer.Payload
func (*RawPayload) AddMany ¶
func (p *RawPayload) AddMany(toAdd map[string]interface{}) moleculer.Payload
AddMany merge the maps with eh existing values and return a new payload.
func (*RawPayload) Array ¶
func (p *RawPayload) Array() []moleculer.Payload
func (*RawPayload) Bool ¶
func (p *RawPayload) Bool() bool
func (*RawPayload) BoolArray ¶
func (p *RawPayload) BoolArray() []bool
func (*RawPayload) Bson ¶
func (p *RawPayload) Bson() bson.M
TODO refactor out as a transformer.. just not depend on bson.
func (*RawPayload) BsonArray ¶
func (p *RawPayload) BsonArray() bson.A
func (*RawPayload) ByteArray ¶
func (p *RawPayload) ByteArray() []byte
func (*RawPayload) Error ¶
func (p *RawPayload) Error() error
func (*RawPayload) Exists ¶
func (p *RawPayload) Exists() bool
func (*RawPayload) First ¶
func (p *RawPayload) First() moleculer.Payload
func (*RawPayload) Float ¶
func (p *RawPayload) Float() float64
func (*RawPayload) Float32 ¶
func (p *RawPayload) Float32() float32
func (*RawPayload) Float32Array ¶
func (p *RawPayload) Float32Array() []float32
func (*RawPayload) FloatArray ¶
func (p *RawPayload) FloatArray() []float64
func (*RawPayload) ForEach ¶
func (p *RawPayload) ForEach(iterator func(key interface{}, value moleculer.Payload) bool)
func (*RawPayload) Int ¶
func (p *RawPayload) Int() int
func (*RawPayload) Int64 ¶
func (p *RawPayload) Int64() int64
func (*RawPayload) Int64Array ¶
func (p *RawPayload) Int64Array() []int64
func (*RawPayload) IntArray ¶
func (p *RawPayload) IntArray() []int
func (*RawPayload) IsArray ¶
func (p *RawPayload) IsArray() bool
func (*RawPayload) IsError ¶
func (p *RawPayload) IsError() bool
func (*RawPayload) IsMap ¶
func (p *RawPayload) IsMap() bool
func (*RawPayload) Len ¶
func (p *RawPayload) Len() int
func (*RawPayload) MapArray ¶
func (p *RawPayload) MapArray() []map[string]interface{}
func (*RawPayload) Only ¶
func (p *RawPayload) Only(path string) moleculer.Payload
Only return a payload containing only the field specified
func (*RawPayload) RawMap ¶
func (p *RawPayload) RawMap() map[string]interface{}
func (*RawPayload) String ¶
func (p *RawPayload) String() string
func (*RawPayload) StringArray ¶
func (p *RawPayload) StringArray() []string
func (*RawPayload) Time ¶
func (p *RawPayload) Time() time.Time
func (*RawPayload) TimeArray ¶
func (p *RawPayload) TimeArray() []time.Time
func (*RawPayload) Uint ¶
func (p *RawPayload) Uint() uint64
func (*RawPayload) UintArray ¶
func (p *RawPayload) UintArray() []uint64
func (*RawPayload) Value ¶
func (p *RawPayload) Value() interface{}
func (*RawPayload) ValueArray ¶
func (p *RawPayload) ValueArray() []interface{}