bind

package
v0.0.0-...-0cd90d5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindString

func BindString(treeList []*TreeStruct, buffer *Buffer) int

* * 序列化tree:[{"test":[{"params":[{"name":"name1"},{"key":"value"},{"count":{"value":"www"}}]},{"params":[{"name":"name2"},{"key":"value"}]}]}]

func DefaultBind

func DefaultBind(tree []*TreeStruct, obj Binder) interface{}

* * 绑定实体和参数

func DefaultBindStruct

func DefaultBindStruct(treeList []*TreeStruct, obj interface{}) []interface{}

func DefaultUnBind

func DefaultUnBind(obj Binder) []*TreeStruct

Types

type Array

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

func ArrayInterface

func ArrayInterface() *Array

func (*Array) Bind

func (a *Array) Bind(treeList []*TreeStruct)

* * 获取数据树的map和slice

func (*Array) GetValue

func (a *Array) GetValue() interface{}

func (*Array) SetMap

func (a *Array) SetMap(m map[string]interface{})

func (*Array) UnBind

func (a *Array) UnBind() ([]*TreeStruct, error)

type Binder

type Binder interface {
	/**
	* bind the tree list to object data
	 */
	Bind(treeList []*TreeStruct)
	UnBind() []*TreeStruct
	GetValue() interface{}
}

type String

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

func StrigInstance

func StrigInstance() *String

func (*String) Bind

func (s *String) Bind(treeList []*TreeStruct)

func (*String) GetValue

func (s *String) GetValue() interface{}

func (*String) UnBind

func (s *String) UnBind() []*TreeStruct

* * unbind string,parser the string to tree data

type Struct

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

func (*Struct) Bind

func (s *Struct) Bind(treeList []*TreeStruct, obj interface{})

func (*Struct) GetValue

func (s *Struct) GetValue() interface{}

Jump to

Keyboard shortcuts

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