mapper

package
v0.0.0-...-cad01ba Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSlice

func GetSlice(data map[string]interface{}, keys ...string) ([]map[string]interface{}, bool)

func GetValue

func GetValue(data map[string]interface{}, keys ...string) (interface{}, bool)

func GetValueN

func GetValueN(data map[string]interface{}, keys ...string) interface{}

func PutValue

func PutValue(data map[string]interface{}, val interface{}, keys ...string)

func RemoveValue

func RemoveValue(data map[string]interface{}, keys ...string) (interface{}, bool)

Types

type Copy

type Copy struct {
	From, To string
}

func (Copy) Back

func (c Copy) Back(data map[string]interface{})

func (Copy) Forward

func (c Copy) Forward(data map[string]interface{})

type Drop

type Drop struct {
	Field string
}

func (Drop) FromInternal

func (d Drop) FromInternal(data map[string]interface{})

func (Drop) ModifySchema

func (d Drop) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (Drop) ToInternal

func (d Drop) ToInternal(data map[string]interface{})

type Embed

type Embed struct {
	Field string
	// contains filtered or unexported fields
}

func (*Embed) FromInternal

func (e *Embed) FromInternal(data map[string]interface{})

func (*Embed) ModifySchema

func (e *Embed) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (*Embed) ToInternal

func (e *Embed) ToInternal(data map[string]interface{})

type Enum

type Enum struct {
	Field  string
	Values map[string][]string
}

func (Enum) FromInternal

func (e Enum) FromInternal(data map[string]interface{})

func (Enum) ModifySchema

func (e Enum) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (Enum) ToInternal

func (e Enum) ToInternal(data map[string]interface{})

type Move

type Move struct {
	From, To string
}

func (Move) FromInternal

func (m Move) FromInternal(data map[string]interface{})

func (Move) ModifySchema

func (m Move) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (Move) ToInternal

func (m Move) ToInternal(data map[string]interface{})

type Object

type Object struct {
	types.TypeMapper
}

func NewObject

func NewObject(mappers []types.Mapper) *Object

type SliceToMap

type SliceToMap struct {
	Field string
	Key   string
}

func (SliceToMap) FromInternal

func (s SliceToMap) FromInternal(data map[string]interface{})

func (SliceToMap) ModifySchema

func (s SliceToMap) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (SliceToMap) ToInternal

func (s SliceToMap) ToInternal(data map[string]interface{})

type Swap

type Swap struct {
	Left, Right string
}

func (Swap) Back

func (s Swap) Back(data map[string]interface{})

func (Swap) Forward

func (s Swap) Forward(data map[string]interface{})

type UnionEmbed

type UnionEmbed struct {
	Fields []UnionMapping
	// contains filtered or unexported fields
}

func (*UnionEmbed) FromInternal

func (u *UnionEmbed) FromInternal(data map[string]interface{})

func (*UnionEmbed) ModifySchema

func (u *UnionEmbed) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (*UnionEmbed) ToInternal

func (u *UnionEmbed) ToInternal(data map[string]interface{})

type UnionMapping

type UnionMapping struct {
	FieldName   string
	CheckFields []string
}

Jump to

Keyboard shortcuts

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