Documentation ¶
Index ¶
- Variables
- func AutoIncrTagHandler(ctx *Context) error
- func CacheTagHandler(ctx *Context) error
- func CommentTagHandler(ctx *Context) error
- func CreatedTagHandler(ctx *Context) error
- func DefaultTagHandler(ctx *Context) error
- func DeletedTagHandler(ctx *Context) error
- func ExtendsTagHandler(ctx *Context) error
- func IgnoreHandler(ctx *Context) error
- func IndexTagHandler(ctx *Context) error
- func LocalTagHandler(ctx *Context) error
- func NULLTagHandler(ctx *Context) error
- func NoCacheTagHandler(ctx *Context) error
- func NotNullTagHandler(ctx *Context) error
- func NotTagHandler(ctx *Context) error
- func OnlyFromDBTagHandler(ctx *Context) error
- func OnlyToDBTagHandler(ctx *Context) error
- func PKTagHandler(ctx *Context) error
- func SQLTypeTagHandler(ctx *Context) error
- func UTCTagHandler(ctx *Context) error
- func UniqueTagHandler(ctx *Context) error
- func UnsignedTagHandler(ctx *Context) error
- func UpdatedTagHandler(ctx *Context) error
- func VersionTagHandler(ctx *Context) error
- type Context
- type Handler
- type Parser
- func (parser *Parser) ClearCacheTable(t reflect.Type)
- func (parser *Parser) ClearCaches()
- func (parser *Parser) GetColumnMapper() names.Mapper
- func (parser *Parser) GetTableMapper() names.Mapper
- func (parser *Parser) Parse(v reflect.Value) (*schemas.Table, error)
- func (parser *Parser) ParseWithCache(v reflect.Value) (*schemas.Table, error)
- func (parser *Parser) SetColumnMapper(mapper names.Mapper)
- func (parser *Parser) SetIdentifier(identifier string)
- func (parser *Parser) SetTableMapper(mapper names.Mapper)
- type TableIndices
Constants ¶
This section is empty.
Variables ¶
var ErrIgnoreField = errors.New("field will be ignored")
ErrIgnoreField represents an error to ignore field
var ErrUnsupportedType = errors.New("unsupported type")
ErrUnsupportedType represents an unsupported type error
Functions ¶
func AutoIncrTagHandler ¶
AutoIncrTagHandler describes autoincr tag handler
func CacheTagHandler ¶
CacheTagHandler describes cache tag handler
func CommentTagHandler ¶
CommentTagHandler add comment to column
func CreatedTagHandler ¶
CreatedTagHandler describes created tag handler
func DefaultTagHandler ¶
DefaultTagHandler describes default tag handler
func DeletedTagHandler ¶
DeletedTagHandler describes deleted tag handler
func ExtendsTagHandler ¶
ExtendsTagHandler describes extends tag handler
func IgnoreHandler ¶ added in v1.2.5
IgnoreHandler represetns the field should be ignored
func IndexTagHandler ¶
IndexTagHandler describes index tag handler
func LocalTagHandler ¶
LocalTagHandler describes local tag handler
func NULLTagHandler ¶
NULLTagHandler describes null tag handler
func NoCacheTagHandler ¶
NoCacheTagHandler describes nocache tag handler
func NotNullTagHandler ¶
NotNullTagHandler describes notnull tag handler
func NotTagHandler ¶ added in v1.2.5
NotTagHandler describes ignored tag handler
func OnlyFromDBTagHandler ¶
OnlyFromDBTagHandler describes mapping direction tag handler
func OnlyToDBTagHandler ¶
OnlyToDBTagHandler describes mapping direction tag handler
func PKTagHandler ¶
PKTagHandler describes primary key tag handler
func SQLTypeTagHandler ¶
SQLTypeTagHandler describes SQL Type tag handler
func UniqueTagHandler ¶
UniqueTagHandler describes unique tag handler
func UnsignedTagHandler ¶ added in v1.2.5
UnsignedTagHandler represents the column is unsigned
func UpdatedTagHandler ¶
UpdatedTagHandler describes updated tag handler
func VersionTagHandler ¶
VersionTagHandler describes version tag handler
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context represents a context for xorm tag parse.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser represents a parser for xorm tag
func NewParser ¶
func NewParser(identifier string, dialect dialects.Dialect, tableMapper, columnMapper names.Mapper, cacherMgr *caches.Manager) *Parser
NewParser creates a tag parser
func (*Parser) ClearCacheTable ¶
ClearCacheTable removes the database mapper of a type from the cache
func (*Parser) ClearCaches ¶
func (parser *Parser) ClearCaches()
ClearCaches removes all the cached table information parsed by structs
func (*Parser) GetColumnMapper ¶
GetColumnMapper returns column mapper
func (*Parser) GetTableMapper ¶
GetTableMapper returns table mapper
func (*Parser) ParseWithCache ¶
ParseWithCache parse a struct with cache
func (*Parser) SetColumnMapper ¶
SetColumnMapper sets column mapper
func (*Parser) SetIdentifier ¶
SetIdentifier sets tag identifier
func (*Parser) SetTableMapper ¶
SetTableMapper sets table mapper
type TableIndices ¶ added in v1.2.7
TableIndices is an interface that describes structs that provide additional index information above that which is automatically parsed