builder

package
v0.0.0-...-e5d1c0a Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FieldNoExist error = errors.New("field no exist")
)

Functions

This section is empty.

Types

type Builder

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

构造器动态struct

func NewBuilder

func NewBuilder() *Builder

func (*Builder) AddBool

func (b *Builder) AddBool(name string) *Builder

func (*Builder) AddField

func (b *Builder) AddField(field string, typ reflect.Type) *Builder

添加字段

func (*Builder) AddFloat64

func (b *Builder) AddFloat64(name string) *Builder

func (*Builder) AddInt

func (b *Builder) AddInt(name string) *Builder

func (*Builder) AddInt64

func (b *Builder) AddInt64(name string) *Builder

func (*Builder) AddString

func (b *Builder) AddString(name string) *Builder

func (*Builder) Build

func (b *Builder) Build() *Struct

根据预先添加的字段构建出结构体

func (*Builder) DelField

func (b *Builder) DelField(field string) *Builder

删除字段

type Instance

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

结构体的值

func (*Instance) Addr

func (i *Instance) Addr() interface{}

func (Instance) Field

func (in Instance) Field(name string) (reflect.Value, error)

func (*Instance) Interface

func (i *Instance) Interface() interface{}

func (*Instance) SetBool

func (in *Instance) SetBool(name string, value bool)

func (*Instance) SetFloat64

func (in *Instance) SetFloat64(name string, value float64)

func (*Instance) SetInt

func (in *Instance) SetInt(name string, value int)

func (*Instance) SetInt64

func (in *Instance) SetInt64(name string, value int64)

func (*Instance) SetInterface

func (in *Instance) SetInterface(colname string, colType string, val interface{})

func (*Instance) SetString

func (in *Instance) SetString(name, value string)

type Struct

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

实际生成的结构体,基类 结构体的类型

func (Struct) New

func (s Struct) New() *Instance

Jump to

Keyboard shortcuts

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