Documentation ¶
Index ¶
- Variables
- func AddVersionWrapperType(typeVal interface{}) dynamicstruct.DynamicStruct
- func GetVersionWrapperStruct(typeVal interface{}) dynamicstruct.DynamicStruct
- type AVersionCapture
- type D
- type HasVersion
- type Loader
- type LoaderRegistry
- type SLoaders
- type STargetTransformers
- type STransformers
- type SrcLoaders
- type SrcToTargetTransformers
- type SrcToTargetVersions
- type TargetTransformers
- type Transformer
- type Version
- func (v Version) Greater(anotherVersion Version) bool
- func (v Version) Less(anotherVersion Version) bool
- func (v Version) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (v Version) NextMINOR() Version
- func (v Version) NextPATCH() Version
- func (v Version) String() string
- func (v *Version) UnmarshalBSONValue(t bsontype.Type, src []byte) error
- type VersionCapture
- type Versions
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidVersionValue = xerrors.New("Invalid version value")
View Source
var LoaderNotFoundError = xerrors.New("cannot found loader handlers for src version")
View Source
var NoVersionTagError = xerrors.New("data not version field or with invalid 0.0 version")
View Source
var TransformerNotFoundError = xerrors.New("cannot found next transformer to the target version")
View Source
var TransformerSrcTypeIncorrectError = xerrors.New("src type for transformer is incorrect and failed to cast")
View Source
var VersionWrapperStructs = map[reflect.Type]dynamicstruct.DynamicStruct{}
Functions ¶
func AddVersionWrapperType ¶ added in v0.0.2
func AddVersionWrapperType(typeVal interface{}) dynamicstruct.DynamicStruct
func GetVersionWrapperStruct ¶ added in v0.0.2
func GetVersionWrapperStruct(typeVal interface{}) dynamicstruct.DynamicStruct
Types ¶
type AVersionCapture ¶ added in v0.0.2
type AVersionCapture VersionCapture
type HasVersion ¶
type Loader ¶
type Loader func([]byte, HasVersion) error
func DefaultLoader ¶ added in v0.0.3
func DefaultLoader(typeVal interface{}) Loader
type LoaderRegistry ¶
type LoaderRegistry struct {
// contains filtered or unexported fields
}
func NewLoaderRegistry ¶
func NewLoaderRegistry(loadersL SLoaders, transformersT STransformers) *LoaderRegistry
func (*LoaderRegistry) Load ¶
func (l *LoaderRegistry) Load(src []byte, target Version) (HasVersion, error)
func (*LoaderRegistry) Transform ¶
func (l *LoaderRegistry) Transform(data HasVersion, target Version) error
type SLoaders ¶
type SLoaders map[string]interface{}
type SLoaders map[string]Loader
func (SLoaders) SrcLoaders ¶
func (l SLoaders) SrcLoaders() SrcLoaders
type STargetTransformers ¶
type STargetTransformers map[string]Transformer
type STransformers ¶
type STransformers map[string]STargetTransformers
func (STransformers) SrcToTargetTransformers ¶
func (t STransformers) SrcToTargetTransformers() SrcToTargetTransformers
type SrcLoaders ¶
type SrcToTargetTransformers ¶
type SrcToTargetTransformers map[Version]TargetTransformers
type SrcToTargetVersions ¶
type TargetTransformers ¶
type TargetTransformers map[Version]Transformer
type Transformer ¶
type Transformer func(HasVersion) error
type VersionCapture ¶
func (VersionCapture) GetData ¶
func (v VersionCapture) GetData() interface{}
func (VersionCapture) GetVersion ¶
func (v VersionCapture) GetVersion() Version
func (VersionCapture) MarshalBSON ¶ added in v0.0.2
func (v VersionCapture) MarshalBSON() ([]byte, error)
func (*VersionCapture) SetData ¶
func (v *VersionCapture) SetData(d interface{})
func (*VersionCapture) SetVersion ¶
func (v *VersionCapture) SetVersion(vv Version)
func (*VersionCapture) UnmarshalBSON ¶ added in v0.0.2
func (v *VersionCapture) UnmarshalBSON(src []byte) error
Click to show internal directories.
Click to hide internal directories.