coderx

package
v0.0.0-...-4675295 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToMap

func AnyToMap(document interface{}) (map[string]interface{}, error)

Types

type ByteToMap

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

func NewByteToMap

func NewByteToMap() (obj *ByteToMap)

func NewByteToMapWithSchema

func NewByteToMapWithSchema(schema *schemax.ClassDecl) (obj *ByteToMap)

func NewByteToMapWithType

func NewByteToMapWithType(_type string) (obj *ByteToMap, err error)

func (*ByteToMap) Read

func (coder *ByteToMap) Read(reader io.Reader, target map[string]interface{}) (err error)

func (*ByteToMap) Reset

func (coder *ByteToMap) Reset()

func (*ByteToMap) SetByteOrder

func (coder *ByteToMap) SetByteOrder(order binary.ByteOrder) *ByteToMap

type MapToByte

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

func NewMapToByte

func NewMapToByte() (obj *MapToByte)

func NewMapToByteWithSchema

func NewMapToByteWithSchema(schema *schemax.ClassDecl) (obj *MapToByte)

func NewMapToByteWithType

func NewMapToByteWithType(_type string) (obj *MapToByte, err error)

func (*MapToByte) Reset

func (coder *MapToByte) Reset()

func (*MapToByte) SetByteOrder

func (coder *MapToByte) SetByteOrder(order binary.ByteOrder) *MapToByte

func (*MapToByte) WithChange

func (coder *MapToByte) WithChange() *MapToByte

func (*MapToByte) WithIgnoreAny

func (coder *MapToByte) WithIgnoreAny() *MapToByte

WithIgnoreAny 设置 IgnoreAny 后, 遇到 Any 类型的字段将被忽略,否则会返回错误

func (*MapToByte) Write

func (coder *MapToByte) Write(source map[string]interface{}, writer io.Writer) (err error)

type MapToRef

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

func NewMapToRef

func NewMapToRef() (obj *MapToRef)

func (*MapToRef) Create

func (coder *MapToRef) Create() (obj reflectx.IRefObject, err error)

Create 通过map创建一个对象 map必须设置 key=_type value=string, value指向schemax注册的声明

func (*MapToRef) Reset

func (coder *MapToRef) Reset()

func (*MapToRef) SetSource

func (coder *MapToRef) SetSource(source map[string]interface{}) *MapToRef

func (*MapToRef) Write

func (coder *MapToRef) Write(obj reflectx.IRefObject) (err error)

type RefToMap

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

func NewRefToMap

func NewRefToMap() (obj *RefToMap)

func (*RefToMap) Create

func (coder *RefToMap) Create() (r map[string]interface{}, err error)

func (*RefToMap) ExportByMapKey

func (coder *RefToMap) ExportByMapKey() *RefToMap

func (*RefToMap) ReplaceMapTypeToSchemaEnum

func (coder *RefToMap) ReplaceMapTypeToSchemaEnum() *RefToMap

func (*RefToMap) ReplaceStringToAlias

func (coder *RefToMap) ReplaceStringToAlias(from, to string) *RefToMap

func (*RefToMap) Reset

func (coder *RefToMap) Reset()

func (*RefToMap) SetSource

func (coder *RefToMap) SetSource(source reflectx.IRefObject) *RefToMap

func (*RefToMap) Write

func (coder *RefToMap) Write(target map[string]interface{}) (err error)

type TestClass1

type TestClass1 struct {
}

func (*TestClass1) RefType

func (t *TestClass1) RefType() string

Jump to

Keyboard shortcuts

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