tags

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIgnoreField = errors.New("field will be ignored")

ErrIgnoreField represents an error to ignore field

View Source
var ErrUnsupportedType = errors.New("unsupported type")

ErrUnsupportedType represents an unsupported type error

Functions

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 IgnoreHandler

func IgnoreHandler(ctx *Context) error

IgnoreHandler represetns the field should be ignored

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 NotTagHandler

func NotTagHandler(ctx *Context) error

NotTagHandler describes ignored 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 UnsignedTagHandler

func UnsignedTagHandler(ctx *Context) error

UnsignedTagHandler represents the column is unsigned

func UpdatedTagHandler

func UpdatedTagHandler(ctx *Context) error

UpdatedTagHandler describes updated tag handler

func VersionTagHandler

func VersionTagHandler(ctx *Context) error

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 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

type TableIndices

type TableIndices interface {
	TableIndices() []*schemas.Index
}

TableIndices is an interface that describes structs that provide additional index information above that which is automatically parsed

Jump to

Keyboard shortcuts

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