tags

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 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 DescriptionTag = "desc"
View Source
const ExampleTag = "example"
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 QuerySelectorTag = "querySelector"
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

func ParseQuerySelector added in v0.38.0

func ParseQuerySelector(value string) string

ParseQuerySelector returns the target view alias encoded in querySelector tag. Supported forms:

querySelector:"vendor"
querySelector:"view=vendor"

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"`
	ErrorMessage string `tag:"errorMessage,omitempty"`
	DataType     string `tag:"dataType,omitempty"`    //parameter input type
	Cardinality  string `tag:"cardinality,omitempty"` //parameter input type
	With         string `tag:"with,omitempty"`        //optional auxiliary type name holding parameters
	Required     *bool  `tag:"required,omitempty"`
	Cacheable    *bool  `tag:"cacheable,omitempty"`
	Async        bool   `tag:"async,omitempty"`
	URI          string `tag:"uri,omitempty"` //parameter URI
}

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
	Description string
	Example     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
	SummaryURI             string
	TypeName               string
	Dest                   string
	CustomTag              string
	Parameters             []string //parameter references
	Connector              string
	Cache                  string
	Limit                  *int
	Match                  string
	Batch                  int
	PublishParent          bool
	PartitionerType        string
	PartitionedConcurrency int
	RelationalConcurrency  int
	Groupable              *bool
	SelectorNamespace      string
	SelectorCriteria       *bool
	SelectorProjection     *bool
	SelectorOrderBy        *bool
	SelectorOffset         *bool
	SelectorPage           *bool
	SelectorFilterable     []string
	SelectorOrderByColumns map[string]string
}

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