tag

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectByKVCondition

func SelectByKVCondition(db sqlx.DBExecutor, kvc kvcondition.KVCondition, modelWithTag ModelWithTag, idCol *builder.Column) *pgbuilder.StmtSelect

Types

type ModelWithTag

type ModelWithTag interface {
	builder.Model

	FieldKey() *builder.Column
	FieldValue() *builder.Column

	FieldCreatedAt() *builder.Column
	FieldUpdatedAt() *builder.Column

	UniqueIndexes() builder.Indexes
	UniqueIndexITag() string
}

type Tag

type Tag struct {
	Key   string `db:"f_key" json:"key"`
	Value string `db:"f_value" json:"value"`
}

type Tagger

type Tagger struct {
	// contains filtered or unexported fields
}

func TaggerFor

func TaggerFor(modelWithTag ModelWithTag) *Tagger

func (*Tagger) GetTags

func (t *Tagger) GetTags(db sqlx.DBExecutor, targetID uint64) (Tags, error)

func (*Tagger) SelectFor

func (*Tagger) Tag

func (t *Tagger) Tag(db sqlx.DBExecutor, targetID uint64, tags Tags) error

func (*Tagger) UnTag

func (t *Tagger) UnTag(db sqlx.DBExecutor, targetID uint64, keyAndValues ...string) error

type Tags

type Tags map[string][]string

func (Tags) Add

func (u Tags) Add(k, v string)

func (Tags) Get

func (u Tags) Get(k string) string

func (Tags) New

func (Tags) New() interface{}

func (Tags) Next

func (u Tags) Next(v interface{}) error

func (Tags) Set

func (u Tags) Set(k string, values ...string)

Jump to

Keyboard shortcuts

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