This section is empty.


View Source
var (
	// ErrUnsupportedType represents an unsupported type error
	ErrUnsupportedType = errors.New("Unsupported type")


func AutoIncrTagHandler

func AutoIncrTagHandler(ctx *Context) error

AutoIncrTagHandler describes autoincr tag handler

func CacheTagHandler

func CacheTagHandler(ctx *Context) error

CacheTagHandler describes cache tag handler

func CommentTagHandler

func CommentTagHandler(ctx *Context) error

CommentTagHandler add comment to column

func CreatedTagHandler

func CreatedTagHandler(ctx *Context) error

CreatedTagHandler describes created tag handler

func DefaultTagHandler

func DefaultTagHandler(ctx *Context) error

DefaultTagHandler describes default tag handler

func DeletedTagHandler

func DeletedTagHandler(ctx *Context) error

DeletedTagHandler describes deleted tag handler

func ExtendsTagHandler

func ExtendsTagHandler(ctx *Context) error

ExtendsTagHandler describes extends tag handler

func IgnoreTagHandler

func IgnoreTagHandler(ctx *Context) error

IgnoreTagHandler describes ignored tag handler

func IndexTagHandler

func IndexTagHandler(ctx *Context) error

IndexTagHandler describes index tag handler

func LocalTagHandler

func LocalTagHandler(ctx *Context) error

LocalTagHandler describes local tag handler

func NULLTagHandler

func NULLTagHandler(ctx *Context) error

NULLTagHandler describes null tag handler

func NoCacheTagHandler

func NoCacheTagHandler(ctx *Context) error

NoCacheTagHandler describes nocache tag handler

func NotNullTagHandler

func NotNullTagHandler(ctx *Context) error

NotNullTagHandler describes notnull tag handler

func OnlyFromDBTagHandler

func OnlyFromDBTagHandler(ctx *Context) error

OnlyFromDBTagHandler describes mapping direction tag handler

func OnlyToDBTagHandler

func OnlyToDBTagHandler(ctx *Context) error

OnlyToDBTagHandler describes mapping direction tag handler

func PKTagHandler

func PKTagHandler(ctx *Context) error

PKTagHandler describes primary key tag handler

func SQLTypeTagHandler

func SQLTypeTagHandler(ctx *Context) error

SQLTypeTagHandler describes SQL Type tag handler

func UTCTagHandler

func UTCTagHandler(ctx *Context) error

UTCTagHandler describes utc tag handler

func UniqueTagHandler

func UniqueTagHandler(ctx *Context) error

UniqueTagHandler describes unique tag handler

func UpdatedTagHandler

func UpdatedTagHandler(ctx *Context) error

UpdatedTagHandler describes updated tag handler

func VersionTagHandler

func VersionTagHandler(ctx *Context) error

VersionTagHandler describes version tag handler


type Context

type Context struct {
	// contains filtered or unexported fields

Context represents a context for xorm tag parse.

type Handler

type Handler func(ctx *Context) error

Handler describes tag handler for XORM

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

func (parser *Parser) ClearCacheTable(t reflect.Type)

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

func (parser *Parser) GetColumnMapper() names.Mapper

GetColumnMapper returns column mapper

func (*Parser) GetTableMapper

func (parser *Parser) GetTableMapper() names.Mapper

GetTableMapper returns table mapper

func (*Parser) Parse

func (parser *Parser) Parse(v reflect.Value) (*schemas.Table, error)

Parse parses a struct as a table information

func (*Parser) ParseWithCache

func (parser *Parser) ParseWithCache(v reflect.Value) (*schemas.Table, error)

ParseWithCache parse a struct with cache

func (*Parser) SetColumnMapper

func (parser *Parser) SetColumnMapper(mapper names.Mapper)

SetColumnMapper sets column mapper

func (*Parser) SetIdentifier

func (parser *Parser) SetIdentifier(identifier string)

SetIdentifier sets tag identifier

func (*Parser) SetTableMapper

func (parser *Parser) SetTableMapper(mapper names.Mapper)

SetTableMapper sets table mapper

Source Files