entity

package
v0.0.0-...-82e7740 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 9 Imported by: 10

README

data-entity GoDoc

entity library for Go

Installation

go get gopkg.in/goyy/goyy.v0/data/entity

Documentation

Index

Constants

View Source
const (
	// DeletionEnable Deletion = 0
	DeletionEnable = 0 // logical delete : no
	// DeletionDisable Deletion = 1
	DeletionDisable = 1 // logical delete : yes
)

Variables

View Source
var SysColumns = [...]string{
	"id",
	"memo",
	"creates",
	"creater",
	"created",
	"modifier",
	"modified",
	"version",
	"deletion",
	"artifical",
	"history",
}

SysColumns default column for Sys structure.

View Source
var SysFields = [...]string{
	"id",
	"memo",
	"creates",
	"creater",
	"created",
	"modifier",
	"modified",
	"version",
	"deletion",
	"artifical",
	"history",
}

SysFields default field for Sys structure.

View Source
var TreeColumns = [...]string{
	"id",
	"code",
	"name",
	"fullname",
	"genre",
	"leaf",
	"grade",
	"ordinal",
	"parent_id",
	"parent_ids",
	"parent_codes",
	"parent_names",
	"memo",
	"creates",
	"creater",
	"created",
	"modifier",
	"modified",
	"version",
	"deletion",
	"artifical",
	"history",
}

TreeColumns default column for Tree structure.

View Source
var TreeFields = [...]string{
	"id",
	"code",
	"name",
	"fullname",
	"genre",
	"leaf",
	"grade",
	"ordinal",
	"parentId",
	"parentIds",
	"parentCodes",
	"parentNames",
	"memo",
	"creates",
	"creater",
	"created",
	"modifier",
	"modified",
	"version",
	"deletion",
	"artifical",
	"history",
}

TreeFields default field for Tree structure.

Functions

func FormatJSON

func FormatJSON(e Interface) string

FormatJSON entity.Interface to Json.

func ParseJSON

func ParseJSON(out Interface, json string) error

ParseJSON Json to entity.Interface.

func SetPriority

func SetPriority(value int)

SetPriority set the priority of the logger.

Types

type Bool

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

Bool bool type.

func (*Bool) Column

func (me *Bool) Column() schema.Column

func (*Bool) Field

func (me *Bool) Field() Field

func (*Bool) HasInsert

func (me *Bool) HasInsert() bool

func (*Bool) HasUpdate

func (me *Bool) HasUpdate() bool

func (*Bool) Name

func (me *Bool) Name() string

Name gets the name of the type.

func (*Bool) SetColumn

func (me *Bool) SetColumn(v schema.Column)

func (*Bool) SetDefault

func (me *Bool) SetDefault(v string) error

SetDefault sets the default value.

func (*Bool) SetField

func (me *Bool) SetField(v Field)

func (*Bool) SetString

func (me *Bool) SetString(v string) error

SetString sets the value of the string type.

func (*Bool) SetValue

func (me *Bool) SetValue(v bool)

SetValue sets the value.

func (*Bool) String

func (me *Bool) String() string

String gets the value of the string type.

func (*Bool) Value

func (me *Bool) Value() bool

Value gets the value.

func (*Bool) ValuePtr

func (me *Bool) ValuePtr() *bool

ValuePtr gets the value of the pointer type.

type Excel

type Excel interface {
	Value() string      // Name of the way to get the value of a field
	SetValue(v string)  // SetValue
	Title() string      // The title of the entity field displayed in the excel
	SetTitle(v string)  // SetTitle
	Format() string     // The format of the entity field displayed in the excel
	SetFormat(v string) // SetFormat
	Genre() int         // Field type(0:export or import,1:export only,2:import only)
	SetGenre(v int)     // SetGenre
	Align() int         // Alignment of columns(0:automatic,1:left,2:middle,3:right)
	SetAlign(v int)     // SetAlign
	Sort() int          // Display order of columns in the excel(0:asc,1:desc)
	SetSort(v int)      // SetSort
	Width() int         // Display width of columns in the excel
	SetWidth(v int)     // SetWidth
}

Excel import and export information for the field of the entity struct.

func NewExcel

func NewExcel() Excel

NewExcel returns the Excel.

func NewExcelBy

func NewExcelBy(value, title, format string, genre, align, sort, width int) Excel

NewExcelBy returns the Excel from value, title, format, genre, align, sort, width.

type Field

type Field interface {
	Insertable() bool
	SetInsertable(v bool)
	Updateable() bool
	SetUpdateable(v bool)
	Modified() bool
	SetModified(v bool)
	Excel() Excel
	SetExcel(v Excel)
	Json() Json
	SetJson(v Json)
	Xml() Xml
	SetXml(v Xml)
}

Field entity.Field.

func DefaultField

func DefaultField() Field

DefaultField default field.

type Float32

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

Float32 float32 type.

func (*Float32) Column

func (me *Float32) Column() schema.Column

func (*Float32) Field

func (me *Float32) Field() Field

func (*Float32) HasInsert

func (me *Float32) HasInsert() bool

func (*Float32) HasUpdate

func (me *Float32) HasUpdate() bool

func (*Float32) Name

func (me *Float32) Name() string

Name gets the name of the type.

func (*Float32) SetColumn

func (me *Float32) SetColumn(v schema.Column)

func (*Float32) SetDefault

func (me *Float32) SetDefault(v string) error

SetDefault sets the default value.

func (*Float32) SetField

func (me *Float32) SetField(v Field)

func (*Float32) SetString

func (me *Float32) SetString(v string) error

SetString sets the value of the string type.

func (*Float32) SetValue

func (me *Float32) SetValue(v float32)

SetValue sets the value.

func (*Float32) String

func (me *Float32) String() string

String gets the value of the string type.

func (*Float32) Value

func (me *Float32) Value() float32

Value gets the value.

func (*Float32) ValuePtr

func (me *Float32) ValuePtr() *float32

ValuePtr gets the value of the pointer type.

type Float64

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

Float64 float64 type.

func (*Float64) Column

func (me *Float64) Column() schema.Column

func (*Float64) Field

func (me *Float64) Field() Field

func (*Float64) HasInsert

func (me *Float64) HasInsert() bool

func (*Float64) HasUpdate

func (me *Float64) HasUpdate() bool

func (*Float64) Name

func (me *Float64) Name() string

Name gets the name of the type.

func (*Float64) SetColumn

func (me *Float64) SetColumn(v schema.Column)

func (*Float64) SetDefault

func (me *Float64) SetDefault(v string) error

SetDefault sets the default value.

func (*Float64) SetField

func (me *Float64) SetField(v Field)

func (*Float64) SetString

func (me *Float64) SetString(v string) error

SetString sets the value of the string type.

func (*Float64) SetValue

func (me *Float64) SetValue(v float64)

SetValue sets the value.

func (*Float64) String

func (me *Float64) String() string

String gets the value of the string type.

func (*Float64) Value

func (me *Float64) Value() float64

Value gets the value.

func (*Float64) ValuePtr

func (me *Float64) ValuePtr() *float64

ValuePtr gets the value of the pointer type.

type Int

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

Int int type.

func (*Int) Column

func (me *Int) Column() schema.Column

func (*Int) Field

func (me *Int) Field() Field

func (*Int) HasInsert

func (me *Int) HasInsert() bool

func (*Int) HasUpdate

func (me *Int) HasUpdate() bool

func (*Int) Name

func (me *Int) Name() string

Name gets the name of the type.

func (*Int) SetColumn

func (me *Int) SetColumn(v schema.Column)

func (*Int) SetDefault

func (me *Int) SetDefault(v string) error

SetDefault sets the default value.

func (*Int) SetField

func (me *Int) SetField(v Field)

func (*Int) SetString

func (me *Int) SetString(v string) error

SetString sets the value of the string type.

func (*Int) SetValue

func (me *Int) SetValue(v int)

SetValue sets the value.

func (*Int) String

func (me *Int) String() string

String gets the value of the string type.

func (*Int) Value

func (me *Int) Value() int

Value gets the value.

func (*Int) ValuePtr

func (me *Int) ValuePtr() *int

ValuePtr gets the value of the pointer type.

type Int16

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

Int16 int16 type.

func (*Int16) Column

func (me *Int16) Column() schema.Column

func (*Int16) Field

func (me *Int16) Field() Field

func (*Int16) HasInsert

func (me *Int16) HasInsert() bool

func (*Int16) HasUpdate

func (me *Int16) HasUpdate() bool

func (*Int16) Name

func (me *Int16) Name() string

Name gets the name of the type.

func (*Int16) SetColumn

func (me *Int16) SetColumn(v schema.Column)

func (*Int16) SetDefault

func (me *Int16) SetDefault(v string) error

SetDefault sets the default value.

func (*Int16) SetField

func (me *Int16) SetField(v Field)

func (*Int16) SetString

func (me *Int16) SetString(v string) error

SetString sets the value of the string type.

func (*Int16) SetValue

func (me *Int16) SetValue(v int16)

SetValue sets the value.

func (*Int16) String

func (me *Int16) String() string

String gets the value of the string type.

func (*Int16) Value

func (me *Int16) Value() int16

Value gets the value.

func (*Int16) ValuePtr

func (me *Int16) ValuePtr() *int16

ValuePtr gets the value of the pointer type.

type Int32

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

Int32 int32 type.

func (*Int32) Column

func (me *Int32) Column() schema.Column

func (*Int32) Field

func (me *Int32) Field() Field

func (*Int32) HasInsert

func (me *Int32) HasInsert() bool

func (*Int32) HasUpdate

func (me *Int32) HasUpdate() bool

func (*Int32) Name

func (me *Int32) Name() string

Name gets the name of the type.

func (*Int32) SetColumn

func (me *Int32) SetColumn(v schema.Column)

func (*Int32) SetDefault

func (me *Int32) SetDefault(v string) error

SetDefault sets the default value.

func (*Int32) SetField

func (me *Int32) SetField(v Field)

func (*Int32) SetString

func (me *Int32) SetString(v string) error

SetString sets the value of the string type.

func (*Int32) SetValue

func (me *Int32) SetValue(v int32)

SetValue sets the value.

func (*Int32) String

func (me *Int32) String() string

String gets the value of the string type.

func (*Int32) Value

func (me *Int32) Value() int32

Value gets the value.

func (*Int32) ValuePtr

func (me *Int32) ValuePtr() *int32

ValuePtr gets the value of the pointer type.

type Int64

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

Int64 int64 type.

func (*Int64) Column

func (me *Int64) Column() schema.Column

func (*Int64) Field

func (me *Int64) Field() Field

func (*Int64) HasInsert

func (me *Int64) HasInsert() bool

func (*Int64) HasUpdate

func (me *Int64) HasUpdate() bool

func (*Int64) Name

func (me *Int64) Name() string

Name gets the name of the type.

func (*Int64) SetColumn

func (me *Int64) SetColumn(v schema.Column)

func (*Int64) SetDefault

func (me *Int64) SetDefault(v string) error

SetDefault sets the default value.

func (*Int64) SetField

func (me *Int64) SetField(v Field)

func (*Int64) SetString

func (me *Int64) SetString(v string) error

SetString sets the value of the string type.

func (*Int64) SetValue

func (me *Int64) SetValue(v int64)

SetValue sets the value.

func (*Int64) String

func (me *Int64) String() string

String gets the value of the string type.

func (*Int64) Value

func (me *Int64) Value() int64

Value gets the value.

func (*Int64) ValuePtr

func (me *Int64) ValuePtr() *int64

ValuePtr gets the value of the pointer type.

type Int8

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

Int8 int8 type.

func (*Int8) Column

func (me *Int8) Column() schema.Column

func (*Int8) Field

func (me *Int8) Field() Field

func (*Int8) HasInsert

func (me *Int8) HasInsert() bool

func (*Int8) HasUpdate

func (me *Int8) HasUpdate() bool

func (*Int8) Name

func (me *Int8) Name() string

Name gets the name of the type.

func (*Int8) SetColumn

func (me *Int8) SetColumn(v schema.Column)

func (*Int8) SetDefault

func (me *Int8) SetDefault(v string) error

SetDefault sets the default value.

func (*Int8) SetField

func (me *Int8) SetField(v Field)

func (*Int8) SetString

func (me *Int8) SetString(v string) error

SetString sets the value of the string type.

func (*Int8) SetValue

func (me *Int8) SetValue(v int8)

SetValue sets the value.

func (*Int8) String

func (me *Int8) String() string

String gets the value of the string type.

func (*Int8) Value

func (me *Int8) Value() int8

Value gets the value.

func (*Int8) ValuePtr

func (me *Int8) ValuePtr() *int8

ValuePtr gets the value of the pointer type.

type Interface

type Interface interface {
	New() Interface
	Get(column string) interface{}
	GetPtr(column string) interface{}
	GetString(field string) string
	SetString(field, value string) error
	Type(column string) (Type, bool)
	Table() schema.Table
	Column(field string) (schema.Column, bool)
	Columns() []schema.Column
	Names() []string
	Validate() error
	JSON() string
	ExcelColumns() []string
}

Interface entity.Interface.

type Interfaces

type Interfaces interface {
	Make(v int)
	New() Interface
	Append(v Interface)
	Len() int
	Cap() int
	Index(i int) Interface
	Slice() interface{}
	JSON() string
}

Interfaces entity.Interfaces.

type Json

type Json interface {
	Tag() string     // Get Tag
	SetTag(v string) // Set Tag
	Name() string    // Field appears in JSON as key name
	Omitempty() bool // The field is omitted from the object if its value is empty
	Ignored() bool   // Field is ignored by this package
}

Json information for the field of the entity struct.

func NewJson

func NewJson() Json

NewJson returns the Json.

func NewJsonBy

func NewJsonBy(tag string) Json

NewJsonBy returns the Json from tag.

type Pk

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

Pk database primary key.

func (*Pk) Column

func (me *Pk) Column(field string) (schema.Column, bool)

Column get schema.Column by the name of the entity attribute.

func (*Pk) Get

func (me *Pk) Get(column string) interface{}

Get according to the database column to obtain values.

func (*Pk) GetPtr

func (me *Pk) GetPtr(column string) interface{}

GetPtr gets the value of a pointer type according to the database column name.

func (*Pk) GetString

func (me *Pk) GetString(field string) string

GetString gets the value according to the entity property name.

func (*Pk) Id

func (me *Pk) Id() string

Id get Pk.id.

func (*Pk) SetId

func (me *Pk) SetId(v string)

SetId set Pk.id.

func (*Pk) SetString

func (me *Pk) SetString(field, value string) error

SetString sets the value according to the entity property name.

func (*Pk) Type

func (me *Pk) Type(column string) (Type, bool)

Type get entity.Type through the column of the database.

type String

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

String string type.

func (*String) Column

func (me *String) Column() schema.Column

func (*String) Field

func (me *String) Field() Field

func (*String) HasInsert

func (me *String) HasInsert() bool

func (*String) HasUpdate

func (me *String) HasUpdate() bool

func (*String) Name

func (me *String) Name() string

Name gets the name of the type.

func (*String) SetColumn

func (me *String) SetColumn(v schema.Column)

func (*String) SetDefault

func (me *String) SetDefault(v string) error

SetDefault sets the default value.

func (*String) SetField

func (me *String) SetField(v Field)

func (*String) SetString

func (me *String) SetString(v string) error

SetString sets the value of the string type.

func (*String) SetValue

func (me *String) SetValue(v string)

SetValue sets the value.

func (*String) String

func (me *String) String() string

String gets the value of the string type.

func (*String) Value

func (me *String) Value() string

Value gets the value.

func (*String) ValuePtr

func (me *String) ValuePtr() *[]byte

ValuePtr gets the value of the pointer type.

type Sys

type Sys struct {
	Pk
	// contains filtered or unexported fields
}

Sys sys structure used for inheritance.

func (*Sys) Artifical

func (me *Sys) Artifical() int

Artifical gets the value of the artifical attribute in the entity.Sys.

func (*Sys) Column

func (me *Sys) Column(field string) (schema.Column, bool)

Column get schema.Column by the name of the entity attribute.

func (*Sys) Created

func (me *Sys) Created() int64

Created gets the value of the created attribute in the entity.Sys.

func (*Sys) Creater

func (me *Sys) Creater() string

Creater gets the value of the creater attribute in the entity.Sys.

func (*Sys) Creates

func (me *Sys) Creates() string

Creates gets the value of the creates attribute in the entity.Sys.

func (*Sys) Deletion

func (me *Sys) Deletion() int

Deletion gets the value of the deletion attribute in the entity.Sys.

func (*Sys) Get

func (me *Sys) Get(column string) interface{}

Get gets the value of the column in the database.

func (*Sys) GetPtr

func (me *Sys) GetPtr(column string) interface{}

GetPtr gets the value of the pointer type through the database column.

func (*Sys) GetString

func (me *Sys) GetString(field string) string

GetString gets the value of the attribute in the struct.

func (*Sys) History

func (me *Sys) History() int

History gets the value of the history attribute in the entity.Sys.

func (*Sys) Memo

func (me *Sys) Memo() string

Memo gets the value of the memo attribute in the entity.Sys.

func (*Sys) Modified

func (me *Sys) Modified() int64

Modified gets the value of the modified attribute in the entity.Sys.

func (*Sys) Modifier

func (me *Sys) Modifier() string

Modifier gets the value of the nodifier attribute in the entity.Sys.

func (*Sys) SetArtifical

func (me *Sys) SetArtifical(v int)

SetArtifical sets the value of the artifical attribute in the entity.Sys.

func (*Sys) SetCreated

func (me *Sys) SetCreated(v int64)

SetCreated sets the value of the created attribute in the entity.Sys.

func (*Sys) SetCreater

func (me *Sys) SetCreater(v string)

SetCreater sets the value of the creater attribute in the entity.Sys.

func (*Sys) SetCreates

func (me *Sys) SetCreates(v string)

SetCreates sets the value of the creates attribute in the entity.Sys.

func (*Sys) SetDeletion

func (me *Sys) SetDeletion(v int)

SetDeletion sets the value of the deletion attribute in the entity.Sys.

func (*Sys) SetHistory

func (me *Sys) SetHistory(v int)

SetHistory sets the value of the history attribute in the entity.Sys.

func (*Sys) SetMemo

func (me *Sys) SetMemo(v string)

SetMemo sets the value of the memo attribute in the entity.Sys.

func (*Sys) SetModified

func (me *Sys) SetModified(v int64)

SetModified sets the value of the modified attribute in the entity.Sys.

func (*Sys) SetModifier

func (me *Sys) SetModifier(v string)

SetModifier sets the value of the nodifier attribute in the entity.Sys.

func (*Sys) SetString

func (me *Sys) SetString(field, value string) error

SetString sets the value of the attribute in the struct.

func (*Sys) SetVersion

func (me *Sys) SetVersion(v int)

SetVersion sets the value of the version attribute in the entity.Sys.

func (*Sys) Type

func (me *Sys) Type(column string) (Type, bool)

Type get entity.Type through the column of the database.

func (*Sys) Version

func (me *Sys) Version() int

Version gets the value of the version attribute in the entity.Sys.

type Time

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

Time time type.

func (*Time) Column

func (me *Time) Column() schema.Column

func (*Time) Field

func (me *Time) Field() Field

func (*Time) HasInsert

func (me *Time) HasInsert() bool

func (*Time) HasUpdate

func (me *Time) HasUpdate() bool

func (*Time) Name

func (me *Time) Name() string

Name gets the name of the type.

func (*Time) SetColumn

func (me *Time) SetColumn(v schema.Column)

func (*Time) SetDefault

func (me *Time) SetDefault(layout, value string) error

SetDefault sets the default value.

func (*Time) SetField

func (me *Time) SetField(v Field)

func (*Time) SetString

func (me *Time) SetString(layout, value string) error

SetString sets the value of the string type.

func (*Time) SetValue

func (me *Time) SetValue(v time.Time)

SetValue sets the value.

func (*Time) String

func (me *Time) String() string

String gets the value of the string type.

func (*Time) Value

func (me *Time) Value() time.Time

Value gets the value.

func (*Time) ValuePtr

func (me *Time) ValuePtr() *time.Time

ValuePtr gets the value of the pointer type.

type Tree

type Tree struct {
	Sys
	// contains filtered or unexported fields
}

Tree tree structure used for inheritance.

func (*Tree) Code

func (me *Tree) Code() string

Code gets the value of the code attribute in the entity.Tree.

func (*Tree) Column

func (me *Tree) Column(field string) (schema.Column, bool)

Column get schema.Column by the name of the entity attribute.

func (*Tree) Fullname

func (me *Tree) Fullname() string

Fullname gets the value of the fullname attribute in the entity.Tree.

func (*Tree) Genre

func (me *Tree) Genre() string

Genre gets the value of the genre attribute in the entity.Tree.

func (*Tree) Get

func (me *Tree) Get(column string) interface{}

Get gets the value of the column in the database.

func (*Tree) GetPtr

func (me *Tree) GetPtr(column string) interface{}

GetPtr gets the value of the pointer type through the database column.

func (*Tree) GetString

func (me *Tree) GetString(field string) string

GetString gets the value of the attribute in the struct.

func (*Tree) Grade

func (me *Tree) Grade() int

Grade gets the value of the grade attribute in the entity.Tree.

func (*Tree) Leaf

func (me *Tree) Leaf() int

Leaf gets the value of the leaf attribute in the entity.Tree.

func (*Tree) Name

func (me *Tree) Name() string

Name gets the value of the name attribute in the entity.Tree.

func (*Tree) Ordinal

func (me *Tree) Ordinal() string

Ordinal gets the value of the ordinal attribute in the entity.Tree.

func (*Tree) ParentCodes

func (me *Tree) ParentCodes() string

ParentCodes gets the value of the parentCodes attribute in the entity.Tree.

func (*Tree) ParentId

func (me *Tree) ParentId() string

ParentId gets the value of the parentId attribute in the entity.Tree.

func (*Tree) ParentIds

func (me *Tree) ParentIds() string

ParentIds gets the value of the parentIds attribute in the entity.Tree.

func (*Tree) ParentNames

func (me *Tree) ParentNames() string

ParentNames gets the value of the parentNames attribute in the entity.Tree.

func (*Tree) SetCode

func (me *Tree) SetCode(v string)

SetCode sets the value of the code attribute in the entity.Tree.

func (*Tree) SetFullname

func (me *Tree) SetFullname(v string)

SetFullname sets the value of the fullname attribute in the entity.Tree.

func (*Tree) SetGenre

func (me *Tree) SetGenre(v string)

SetGenre sets the value of the genre attribute in the entity.Tree.

func (*Tree) SetGrade

func (me *Tree) SetGrade(v int)

SetGrade sets the value of the grade attribute in the entity.Tree.

func (*Tree) SetLeaf

func (me *Tree) SetLeaf(v int)

SetLeaf sets the value of the leaf attribute in the entity.Tree.

func (*Tree) SetName

func (me *Tree) SetName(v string)

SetName sets the value of the name attribute in the entity.Tree.

func (*Tree) SetOrdinal

func (me *Tree) SetOrdinal(v string)

SetOrdinal sets the value of the ordinal attribute in the entity.Tree.

func (*Tree) SetParentCodes

func (me *Tree) SetParentCodes(v string)

SetParentCodes sets the value of the parentCodes attribute in the entity.Tree.

func (*Tree) SetParentId

func (me *Tree) SetParentId(v string)

SetParentId sets the value of the parentId attribute in the entity.Tree.

func (*Tree) SetParentIds

func (me *Tree) SetParentIds(v string)

SetParentIds sets the value of the parentIds attribute in the entity.Tree.

func (*Tree) SetParentNames

func (me *Tree) SetParentNames(v string)

SetParentNames sets the value of the parentNames attribute in the entity.Tree.

func (*Tree) SetString

func (me *Tree) SetString(field, value string) error

SetString sets the value of the attribute in the struct.

func (*Tree) Type

func (me *Tree) Type(column string) (Type, bool)

Type get entity.Type through the column of the database.

type Type

type Type interface {
	Name() string
	Column() schema.Column
	SetColumn(v schema.Column)
	Field() Field
	SetField(v Field)
	String() string
	SetString(v string) error
	SetDefault(v string) error
	HasUpdate() bool
	HasInsert() bool
}

Type entity.Type.

type Uint

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

Uint uint type.

func (*Uint) Column

func (me *Uint) Column() schema.Column

func (*Uint) Field

func (me *Uint) Field() Field

func (*Uint) HasInsert

func (me *Uint) HasInsert() bool

func (*Uint) HasUpdate

func (me *Uint) HasUpdate() bool

func (*Uint) Name

func (me *Uint) Name() string

Name gets the name of the type.

func (*Uint) SetColumn

func (me *Uint) SetColumn(v schema.Column)

func (*Uint) SetDefault

func (me *Uint) SetDefault(v string) error

SetDefault sets the default value.

func (*Uint) SetField

func (me *Uint) SetField(v Field)

func (*Uint) SetString

func (me *Uint) SetString(v string) error

SetString sets the value of the string type.

func (*Uint) SetValue

func (me *Uint) SetValue(v uint)

SetValue sets the value.

func (*Uint) String

func (me *Uint) String() string

String gets the value of the string type.

func (*Uint) Value

func (me *Uint) Value() uint

Value gets the value.

func (*Uint) ValuePtr

func (me *Uint) ValuePtr() *uint

ValuePtr gets the value of the pointer type.

type Uint16

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

Uint16 uint16 type.

func (*Uint16) Column

func (me *Uint16) Column() schema.Column

func (*Uint16) Field

func (me *Uint16) Field() Field

func (*Uint16) HasInsert

func (me *Uint16) HasInsert() bool

func (*Uint16) HasUpdate

func (me *Uint16) HasUpdate() bool

func (*Uint16) Name

func (me *Uint16) Name() string

Name gets the name of the type.

func (*Uint16) SetColumn

func (me *Uint16) SetColumn(v schema.Column)

func (*Uint16) SetDefault

func (me *Uint16) SetDefault(v string) error

SetDefault sets the default value.

func (*Uint16) SetField

func (me *Uint16) SetField(v Field)

func (*Uint16) SetString

func (me *Uint16) SetString(v string) error

SetString sets the value of the string type.

func (*Uint16) SetValue

func (me *Uint16) SetValue(v uint16)

SetValue sets the value.

func (*Uint16) String

func (me *Uint16) String() string

String gets the value of the string type.

func (*Uint16) Value

func (me *Uint16) Value() uint16

Value gets the value.

func (*Uint16) ValuePtr

func (me *Uint16) ValuePtr() *uint16

ValuePtr gets the value of the pointer type.

type Uint32

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

Uint32 uint32 type.

func (*Uint32) Column

func (me *Uint32) Column() schema.Column

func (*Uint32) Field

func (me *Uint32) Field() Field

func (*Uint32) HasInsert

func (me *Uint32) HasInsert() bool

func (*Uint32) HasUpdate

func (me *Uint32) HasUpdate() bool

func (*Uint32) Name

func (me *Uint32) Name() string

Name gets the name of the type.

func (*Uint32) SetColumn

func (me *Uint32) SetColumn(v schema.Column)

func (*Uint32) SetDefault

func (me *Uint32) SetDefault(v string) error

SetDefault sets the default value.

func (*Uint32) SetField

func (me *Uint32) SetField(v Field)

func (*Uint32) SetString

func (me *Uint32) SetString(v string) error

SetString sets the value of the string type.

func (*Uint32) SetValue

func (me *Uint32) SetValue(v uint32)

SetValue sets the value.

func (*Uint32) String

func (me *Uint32) String() string

String gets the value of the string type.

func (*Uint32) Value

func (me *Uint32) Value() uint32

Value gets the value.

func (*Uint32) ValuePtr

func (me *Uint32) ValuePtr() *uint32

ValuePtr gets the value of the pointer type.

type Uint64

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

Uint64 uint64 type.

func (*Uint64) Column

func (me *Uint64) Column() schema.Column

func (*Uint64) Field

func (me *Uint64) Field() Field

func (*Uint64) HasInsert

func (me *Uint64) HasInsert() bool

func (*Uint64) HasUpdate

func (me *Uint64) HasUpdate() bool

func (*Uint64) Name

func (me *Uint64) Name() string

Name gets the name of the type.

func (*Uint64) SetColumn

func (me *Uint64) SetColumn(v schema.Column)

func (*Uint64) SetDefault

func (me *Uint64) SetDefault(v string) error

SetDefault sets the default value.

func (*Uint64) SetField

func (me *Uint64) SetField(v Field)

func (*Uint64) SetString

func (me *Uint64) SetString(v string) error

SetString sets the value of the string type.

func (*Uint64) SetValue

func (me *Uint64) SetValue(v uint64)

SetValue sets the value.

func (*Uint64) String

func (me *Uint64) String() string

String gets the value of the string type.

func (*Uint64) Value

func (me *Uint64) Value() uint64

Value gets the value.

func (*Uint64) ValuePtr

func (me *Uint64) ValuePtr() *uint64

ValuePtr gets the value of the pointer type.

type Uint8

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

Uint8 uint8 type.

func (*Uint8) Column

func (me *Uint8) Column() schema.Column

func (*Uint8) Field

func (me *Uint8) Field() Field

func (*Uint8) HasInsert

func (me *Uint8) HasInsert() bool

func (*Uint8) HasUpdate

func (me *Uint8) HasUpdate() bool

func (*Uint8) Name

func (me *Uint8) Name() string

Name gets the name of the type.

func (*Uint8) SetColumn

func (me *Uint8) SetColumn(v schema.Column)

func (*Uint8) SetDefault

func (me *Uint8) SetDefault(v string) error

SetDefault sets the default value.

func (*Uint8) SetField

func (me *Uint8) SetField(v Field)

func (*Uint8) SetString

func (me *Uint8) SetString(v string) error

SetString sets the value of the string type.

func (*Uint8) SetValue

func (me *Uint8) SetValue(v uint8)

SetValue sets the value.

func (*Uint8) String

func (me *Uint8) String() string

String gets the value of the string type.

func (*Uint8) Value

func (me *Uint8) Value() uint8

Value gets the value.

func (*Uint8) ValuePtr

func (me *Uint8) ValuePtr() *uint8

ValuePtr gets the value of the pointer type.

type Xml

type Xml interface {
	Tag() string     // Get Tag
	SetTag(v string) // Set Tag
	Name() string    // Field appears in XML as key name
	Omitempty() bool // The field is omitted from the object if its value is empty
	Ignored() bool   // Field is ignored by this package
}

Xml information for the field of the entity struct.

func NewXml

func NewXml() Xml

NewXml returns the Xml.

func NewXmlBy

func NewXmlBy(name string) Xml

NewXmlBy returns the Xml from name.

Jump to

Keyboard shortcuts

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