tags

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQLTag        = "sql"
	SQLSummaryTag = "sqlSummary"
)
View Source
const CodecTag = "codec"

CodecTag codec tag

View Source
const DocumentationTag = "doc"
View Source
const HandlerTag = "handler"

HandlerTag Handler tag

View Source
const LinkOnTag = "on"
View Source
const ParameterTag = "parameter"
View Source
const PredicateTag = "predicate"

PredicateTag Predicate tag

View Source
const ValueTag = "value"

ValueTag represents default value tag

View Source
const (
	ViewTag = "view"
)

Variables

This section is empty.

Functions

func ExcludeStateTags

func ExcludeStateTags(tag string) string

ExcludeStateTags exclude state tags

Types

type Codec

type Codec struct {
	Name      string   `tag:"name,omitempty"`
	Body      string   `tag:"body,omitempty"`
	URI       string   `tag:"uri,omitempty"`
	Arguments []string `tag:"arguments,omitempty"`
}

func (*Codec) Tag

func (p *Codec) Tag() *tags.Tag

type Handler

type Handler struct {
	Name      string   `tag:"name,omitempty"`
	Arguments []string `tag:"arguments,omitempty"`
}

func (*Handler) Tag

func (p *Handler) Tag() *tags.Tag

type LinkOn

type LinkOn []string // [relfieldX:][ns.]relcolumnX[(includeFlag)]=[reffieldX:][ns.]refcolumnX [,[relfieldY:][ns.]relcolumnY]

LinkOn represents relation join tag

func (LinkOn) Append

func (l LinkOn) Append(opts ...LinkOption) LinkOn

func (LinkOn) ForEach

func (l LinkOn) ForEach(dest func(relField, relColumn, refField, refColumn string, includeColumn *bool) error) error

func (LinkOn) Tag

func (l LinkOn) Tag() *tags.Tag

type LinkOption

type LinkOption func(o *linkOption)
func WithRefLink(field, column string) LinkOption
func WithRelLink(field, column string, include *bool) LinkOption

type Parameter

type Parameter struct {
	Name      string `tag:"name,omitempty"`
	Kind      string `tag:"kind,omitempty"`  //parameter location kind
	In        string `tag:"in,omitempty"`    //parameter location name
	When      string `tag:"when,omitempty"`  //condition to evaluate
	Scope     string `tag:"scope,omitempty"` //parameter scope
	ErrorCode int    `tag:"errorCode,omitempty"`
	DataType  string `tag:"dataType,omitempty"` //parameter input type
	With      string `tag:"with,omitempty"`     //optional auxiliary type name holding parameters
	Required  bool   `tag:"required,omitempty"`
}

func (*Parameter) Tag

func (p *Parameter) Tag() *tags.Tag

type Predicate

type Predicate struct {
	Name        string
	Group       int
	Inclusion   bool
	Exclusion   bool
	IncludeName string
	ExcludeName string
	Filter      string
	Arguments   []string
	Ensure      bool
}

func (*Predicate) Init

func (p *Predicate) Init(name string)

func (*Predicate) Tag

func (p *Predicate) Tag() *tags.Tag

type Tag

type Tag struct {
	View          *View
	SQL           ViewSQL
	SummarySQL    ViewSQLSummary
	Parameter     *Parameter
	LinkOn        LinkOn
	Predicates    []*Predicate
	Codec         *Codec
	Handler       *Handler
	TypeName      string
	Documentation string
	Value         *string
	Format        *format.Tag
	// contains filtered or unexported fields
}

func Parse

func Parse(tag reflect.StructTag, fs *embed.FS, tagNames ...string) (*Tag, error)

func ParseStateTags

func ParseStateTags(tag reflect.StructTag, fs *embed.FS) (*Tag, error)

ParseStateTags parse state related tags

func ParseViewTags

func ParseViewTags(tag reflect.StructTag, fs *embed.FS) (*Tag, error)

ParseViewTags parse view related tags

func (*Tag) EnsurePredicate

func (t *Tag) EnsurePredicate() *Predicate

func (*Tag) GetValue

func (t *Tag) GetValue(destType reflect.Type) (interface{}, error)

func (*Tag) UpdateTag

func (t *Tag) UpdateTag(tag reflect.StructTag) reflect.StructTag

type Tagger

type Tagger interface {
	Tag() *tags.Tag
}

type View

type View struct {
	Name                   string
	Table                  string
	Parameters             []string //parameter references
	Connector              string
	Limit                  *int
	Match                  string
	Batch                  int
	PartitionerType        string
	PartitionedConcurrency int
}

View represent basic view tag

func (*View) Tag

func (v *View) Tag() *tags.Tag

type ViewSQL

type ViewSQL struct {
	SQL string `tag:"sql,omitempty"`
	URI string `tag:"uri,omitempty"`
}

func NewViewSQL

func NewViewSQL(sql, uri string) ViewSQL

func (ViewSQL) Tag

func (v ViewSQL) Tag() *tags.Tag

type ViewSQLSummary

type ViewSQLSummary ViewSQL

func NewViewSQLSummary

func NewViewSQLSummary(sql, uri string) ViewSQLSummary

func (ViewSQLSummary) Tag

func (v ViewSQLSummary) Tag() *tags.Tag

Jump to

Keyboard shortcuts

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