mapper

package
Version: v0.0.0-...-59c4a29 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetadataMapper

func NewMetadataMapper() types.Mapper

func ValidateField

func ValidateField(field string, schema *types.Schema) error

Types

type Access

type Access struct {
	Fields map[string]string
}

func (Access) FromInternal

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

func (Access) ModifySchema

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

func (Access) ToInternal

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

type AnnotationField

type AnnotationField struct {
	Field            string
	Object           bool
	List             bool
	IgnoreDefinition bool
}

func (AnnotationField) FromInternal

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

func (AnnotationField) ModifySchema

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

func (AnnotationField) ToInternal

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

type Base64

type Base64 struct {
	Field            string
	IgnoreDefinition bool
	Separator        string
}

func (Base64) FromInternal

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

func (Base64) ModifySchema

func (m Base64) ModifySchema(s *types.Schema, schemas *types.Schemas) error

func (Base64) ToInternal

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

type BatchMove

type BatchMove struct {
	From              []string
	To                string
	DestDefined       bool
	NoDeleteFromField bool
	// contains filtered or unexported fields
}

func (*BatchMove) FromInternal

func (b *BatchMove) FromInternal(data map[string]interface{})

func (*BatchMove) ModifySchema

func (b *BatchMove) ModifySchema(s *types.Schema, schemas *types.Schemas) error

func (*BatchMove) ToInternal

func (b *BatchMove) ToInternal(data map[string]interface{})

type ChangeType

type ChangeType struct {
	Field string
	Type  string
}

func (ChangeType) FromInternal

func (c ChangeType) FromInternal(data map[string]interface{})

func (ChangeType) ModifySchema

func (c ChangeType) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (ChangeType) ToInternal

func (c ChangeType) ToInternal(data map[string]interface{})

type Condition

type Condition struct {
	Field  string
	Value  interface{}
	Mapper types.Mapper
}

func (Condition) FromInternal

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

func (Condition) ModifySchema

func (m Condition) ModifySchema(s *types.Schema, schemas *types.Schemas) error

func (Condition) ToInternal

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

type Copy

type Copy struct {
	From, To string
}

func (Copy) FromInternal

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

func (Copy) ModifySchema

func (c Copy) ModifySchema(s *types.Schema, schemas *types.Schemas) error

func (Copy) ToInternal

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

type DisplayName

type DisplayName struct {
}

func (DisplayName) FromInternal

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

func (DisplayName) ModifySchema

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

func (DisplayName) ToInternal

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

type Drop

type Drop struct {
	Field            string
	IgnoreDefinition bool
}

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
	Optional bool
	ReadOnly bool
	Ignore   []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
	Options []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 JSONEncode

type JSONEncode struct {
	Field            string
	IgnoreDefinition bool
	Separator        string
}

func (JSONEncode) FromInternal

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

func (JSONEncode) ModifySchema

func (m JSONEncode) ModifySchema(s *types.Schema, schemas *types.Schemas) error

func (JSONEncode) ToInternal

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

type LabelField

type LabelField struct {
	Field string
}

func (LabelField) FromInternal

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

func (LabelField) ModifySchema

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

func (LabelField) ToInternal

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

type Move

type Move struct {
	From, To          string
	DestDefined       bool
	NoDeleteFromField bool
}

func (Move) FromInternal

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

func (Move) ModifySchema

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

func (Move) ToInternal

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

type Object

type Object struct {
	types.Mappers
}

func NewObject

func NewObject(mappers ...types.Mapper) Object

type ReadOnly

type ReadOnly struct {
	Field     string
	Optional  bool
	SubFields bool
}

func (ReadOnly) FromInternal

func (r ReadOnly) FromInternal(data map[string]interface{})

func (ReadOnly) ModifySchema

func (r ReadOnly) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (ReadOnly) ToInternal

func (r ReadOnly) ToInternal(data map[string]interface{})

type RenameReference

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

func (*RenameReference) FromInternal

func (r *RenameReference) FromInternal(data map[string]interface{})

func (*RenameReference) ModifySchema

func (r *RenameReference) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (*RenameReference) ToInternal

func (r *RenameReference) ToInternal(data map[string]interface{})

type Required

type Required struct {
	Fields []string
}

func (Required) FromInternal

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

func (Required) ModifySchema

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

func (Required) ToInternal

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

type Scope

type Scope struct {
	If      types.TypeScope
	IfNot   types.TypeScope
	Mappers []types.Mapper
	// contains filtered or unexported fields
}

func (*Scope) FromInternal

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

func (*Scope) ModifySchema

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

func (*Scope) ToInternal

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

type SetValue

type SetValue struct {
	Field, To        string
	Value            interface{}
	IfEq             interface{}
	IgnoreDefinition bool
}

func (SetValue) FromInternal

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

func (SetValue) ModifySchema

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

func (SetValue) ToInternal

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

type SliceMerge

type SliceMerge struct {
	From             []string
	To               string
	IgnoreDefinition bool
}

func (SliceMerge) FromInternal

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

func (SliceMerge) ModifySchema

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

func (SliceMerge) ToInternal

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

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 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
}

type UntypedMove

type UntypedMove struct {
	From, To  string
	Separator string
}

func (UntypedMove) FromInternal

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

func (UntypedMove) ModifySchema

func (m UntypedMove) ModifySchema(s *types.Schema, schemas *types.Schemas) error

func (UntypedMove) ToInternal

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL