xproperty

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 2 Imported by: 0

README

xproperty

References
  • xtesting*
Functions
  • type PropertyMappers struct {}
  • type PropertyMapper struct {}
  • type PropertyDict map[string]*PropertyMapperValue
  • type VariableDict map[string]int
  • type PropertyMapperValue struct {}
  • New() *PropertyMappers
  • NewMapper(from interface{}, to interface{}, dict map[string]*PropertyMapperValue) *PropertyMapper
  • NewValue(revert bool, destProps ...string) *PropertyMapperValue
  • (p *PropertyMappers) AddMapper(mapper *PropertyMapper)
  • (p *PropertyMappers) AddMappers(mappers ...*PropertyMapper)
  • (p *PropertyMapper) GetDict() PropertyDict
  • (p *PropertyMappers) GetMapper(from interface{}, to interface{}) (*PropertyMapper, error)
  • (p *PropertyMappers) GetDefaultMapper(from interface{}, to interface{}) *PropertyMapper
  • AddMapper(mapper *PropertyMapper)
  • AddMappers(mappers ...*PropertyMapper)
  • GetMapper(from interface{}, to interface{}) (*PropertyMapper, error)
  • GetDefaultMapper(from interface{}, to interface{}) *PropertyMapper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMapper

func AddMapper(mapper *PropertyMapper)

AddMapper adds a PropertyMapper to PropertyMappers.

func AddMappers

func AddMappers(mappers ...*PropertyMapper)

AddMappers adds some PropertyMapper to PropertyMappers.

Types

type PropertyDict added in v1.3.7

type PropertyDict map[string]*PropertyMapperValue

PropertyDict represents a dictionary of property mapping.

type PropertyMapper

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

PropertyMapper represents a property mapper.

func GetDefaultMapper added in v1.3.7

func GetDefaultMapper(from interface{}, to interface{}) *PropertyMapper

GetDefaultMapper returns the PropertyMapper from PropertyMappers, returns a empty PropertyMapper if not found.

func GetMapper

func GetMapper(from interface{}, to interface{}) (*PropertyMapper, error)

GetMapper returns the PropertyMapper from PropertyMappers.

func NewMapper

func NewMapper(from interface{}, to interface{}, dict PropertyDict) *PropertyMapper

NewMapper creates a PropertyMapper.

func (*PropertyMapper) GetDict added in v1.4.0

func (p *PropertyMapper) GetDict() PropertyDict

GetDict returns the PropertyDict from PropertyMapper.

type PropertyMapperValue

type PropertyMapperValue struct {
	// Is need to revert sort.
	Revert bool

	// `from` -> `to` properties mapping.
	Destinations []string
}

A property mapper.

func NewValue

func NewValue(revert bool, destinations ...string) *PropertyMapperValue

NewValue creates a PropertyMapperValue.

type PropertyMappers

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

PropertyMappers represents a property mappers container.

func New

func New() *PropertyMappers

New creates a PropertyMappers.

func (*PropertyMappers) AddMapper

func (p *PropertyMappers) AddMapper(m *PropertyMapper)

AddMapper adds a PropertyMapper to PropertyMappers.

func (*PropertyMappers) AddMappers

func (p *PropertyMappers) AddMappers(mappers ...*PropertyMapper)

AddMappers adds some PropertyMapper to PropertyMappers.

func (*PropertyMappers) GetDefaultMapper added in v1.3.7

func (p *PropertyMappers) GetDefaultMapper(from interface{}, to interface{}) *PropertyMapper

GetDefaultMapper returns the PropertyMapper from PropertyMappers, returns a empty PropertyMapper if not found.

func (*PropertyMappers) GetMapper

func (p *PropertyMappers) GetMapper(from interface{}, to interface{}) (*PropertyMapper, error)

GetMapper returns the PropertyMapper from PropertyMappers.

type VariableDict added in v1.4.0

type VariableDict map[string]int

VariableDict represents a dictionary of property id pair. (Almost used in cypher)

Jump to

Keyboard shortcuts

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