vto

package
v1.2.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VoToDo

func VoToDo(dst interface{}, src interface{}) error

VoToDo 试图对象与domino对象转换,只能转相同字段且类型相同的 dst: 目标 src: 源位置 支持简单的 default模式 在基础类型增加default可以指定默认值

func VoToDoPlus added in v1.2.3

func VoToDoPlus(dst interface{}, src interface{}, model ModelParameters) error

VoToDoPlus View对象与domino对象转换,根据不同模式进行转换 dst: 目标 src: 源位置 ModelParameters: 模式匹配

Types

type BindModel added in v1.2.3

type BindModel int
const (
	FieldBind BindModel = 1 << iota
	TagBind
	DefaultValueBind // 默认值绑定,在最后的情况下,如果还未绑定到相关值则设置为默认值
	OverlayBind      // 设置多个条件的情况下可以覆盖,根据代码语义,应该是会以tag优先,不设置以field为优先
)

type ModelParameters added in v1.2.3

type ModelParameters struct {
	Model     BindModel `json:"model"`      // 绑定参数 默认值为 field bind
	Tag       string    `json:"tag"`        // tag bind 指定tag,default 为 json
	TagSqlite string    `json:"tag_sqlite"` // 切分tag标识
	FilterTag []string  `json:"filter_tag"` // 过滤tag
}

Jump to

Keyboard shortcuts

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