mapper

package
v0.0.0-...-86ac83c Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 128

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 APIGroup

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

func (*APIGroup) FromInternal

func (a *APIGroup) FromInternal(data map[string]interface{})

func (*APIGroup) ModifySchema

func (a *APIGroup) ModifySchema(schema *types.Schema, schemas *types.Schemas) error

func (*APIGroup) ToInternal

func (a *APIGroup) ToInternal(data map[string]interface{}) error

type Access

type Access struct {
	Fields   map[string]string
	Optional bool
}

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{}) error

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{}) error

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{}) error

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{}) error

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{}) error

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{}) error

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{}) error

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{}) error

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{}) error

type Embed

type Embed struct {
	Field    string
	Optional bool
	ReadOnly bool
	Ignore   []string

	EmptyValueOk bool
	// 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{}) error

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{}) error

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{}) error

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{}) error

type Move

type Move struct {
	From, To, CodeName 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{}) error

type Object

type Object struct {
	types.Mappers
}

func NewObject

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

type PendingStatus

type PendingStatus struct {
}

func (PendingStatus) FromInternal

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

func (PendingStatus) ModifySchema

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

func (PendingStatus) ToInternal

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

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{}) error

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{}) error

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{}) error

type Root

type Root struct {
	Mapper types.Mapper
	// contains filtered or unexported fields
}

func (*Root) FromInternal

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

func (*Root) ModifySchema

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

func (*Root) ToInternal

func (m *Root) ToInternal(data map[string]interface{}) error

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{}) error
type SelfLink struct {
	// contains filtered or unexported fields
}

func (*SelfLink) FromInternal

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

func (*SelfLink) ModifySchema

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

func (*SelfLink) ToInternal

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

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{}) error

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{}) error

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{}) error

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{}) error

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{}) error

Jump to

Keyboard shortcuts

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