tag

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the tag type in the database.
	Label = "tag"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// EdgeUsers holds the string denoting the users edge name in mutations.
	EdgeUsers = "users"
	// Table holds the table name of the tag in the database.
	Table = "tags"
	// UsersTable is the table that holds the users relation/edge. The primary key declared below.
	UsersTable = "user_tags"
	// UsersInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	UsersInverseTable = "users"
)

Variables

View Source
var Columns = []string{
	FieldID,
	FieldName,
}

Columns holds all SQL columns for tag fields.

View Source
var (
	// UsersPrimaryKey and UsersColumn2 are the table columns denoting the
	// primary key for the users relation (M2M).
	UsersPrimaryKey = []string{"user_id", "tag_id"}
)

Functions

func And

func And(predicates ...predicate.Tag) predicate.Tag

And groups predicates with the AND operator between them.

func HasUsers

func HasUsers() predicate.Tag

HasUsers applies the HasEdge predicate on the "users" edge.

func HasUsersWith

func HasUsersWith(preds ...predicate.User) predicate.Tag

HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates).

func ID

func ID(id int) predicate.Tag

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Tag

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Tag

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Tag

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.Tag

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Tag

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Tag

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Tag

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.Tag

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.Tag

Name applies equality check predicate on the "name" field. It's identical to NameEQ.

func NameContains

func NameContains(v string) predicate.Tag

NameContains applies the Contains predicate on the "name" field.

func NameContainsFold

func NameContainsFold(v string) predicate.Tag

NameContainsFold applies the ContainsFold predicate on the "name" field.

func NameEQ

func NameEQ(v string) predicate.Tag

NameEQ applies the EQ predicate on the "name" field.

func NameEqualFold

func NameEqualFold(v string) predicate.Tag

NameEqualFold applies the EqualFold predicate on the "name" field.

func NameGT

func NameGT(v string) predicate.Tag

NameGT applies the GT predicate on the "name" field.

func NameGTE

func NameGTE(v string) predicate.Tag

NameGTE applies the GTE predicate on the "name" field.

func NameHasPrefix

func NameHasPrefix(v string) predicate.Tag

NameHasPrefix applies the HasPrefix predicate on the "name" field.

func NameHasSuffix

func NameHasSuffix(v string) predicate.Tag

NameHasSuffix applies the HasSuffix predicate on the "name" field.

func NameIn

func NameIn(vs ...string) predicate.Tag

NameIn applies the In predicate on the "name" field.

func NameLT

func NameLT(v string) predicate.Tag

NameLT applies the LT predicate on the "name" field.

func NameLTE

func NameLTE(v string) predicate.Tag

NameLTE applies the LTE predicate on the "name" field.

func NameNEQ

func NameNEQ(v string) predicate.Tag

NameNEQ applies the NEQ predicate on the "name" field.

func NameNotIn

func NameNotIn(vs ...string) predicate.Tag

NameNotIn applies the NotIn predicate on the "name" field.

func Not

func Not(p predicate.Tag) predicate.Tag

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Tag) predicate.Tag

Or groups predicates with the OR operator between them.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type Mutation added in v1.6.0

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

Mutation represents an operation that mutates the Tag nodes in the graph.

func NewMutation added in v1.6.0

func NewMutation(op ent.Op) *Mutation

NewMutation creates a new Mutation for the Tag entity.

func (*Mutation) AddField added in v1.6.0

func (m *Mutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*Mutation) AddUserIDs added in v1.6.0

func (m *Mutation) AddUserIDs(ids ...int)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*Mutation) AddedEdges added in v1.6.0

func (m *Mutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*Mutation) AddedField added in v1.6.0

func (m *Mutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*Mutation) AddedFields added in v1.6.0

func (m *Mutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*Mutation) AddedIDs added in v1.6.0

func (m *Mutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*Mutation) ClearEdge added in v1.6.0

func (m *Mutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*Mutation) ClearField added in v1.6.0

func (m *Mutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*Mutation) ClearUsers added in v1.6.0

func (m *Mutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*Mutation) ClearedEdges added in v1.6.0

func (m *Mutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*Mutation) ClearedFields added in v1.6.0

func (m *Mutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (*Mutation) EdgeCleared added in v1.6.0

func (m *Mutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*Mutation) Field added in v1.6.0

func (m *Mutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*Mutation) FieldCleared added in v1.6.0

func (m *Mutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*Mutation) Fields added in v1.6.0

func (m *Mutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*Mutation) Name added in v1.6.0

func (m *Mutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*Mutation) OldField added in v1.6.0

func (m *Mutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*Mutation) Op added in v1.6.0

func (m *Mutation) Op() ent.Op

Op returns the operation name.

func (*Mutation) Predicates added in v1.6.0

func (m *Mutation) Predicates() []predicate.Tag

Predicates returns the list of predicates set on the mutation.

func (*Mutation) RemoveUserIDs added in v1.6.0

func (m *Mutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*Mutation) RemovedEdges added in v1.6.0

func (m *Mutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*Mutation) RemovedIDs added in v1.6.0

func (m *Mutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*Mutation) RemovedUsersIDs added in v1.6.0

func (m *Mutation) RemovedUsersIDs() (ids []int)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*Mutation) ResetEdge added in v1.6.0

func (m *Mutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*Mutation) ResetField added in v1.6.0

func (m *Mutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*Mutation) ResetName added in v1.6.0

func (m *Mutation) ResetName()

ResetName resets all changes to the "name" field.

func (*Mutation) ResetUsers added in v1.6.0

func (m *Mutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*Mutation) SetField added in v1.6.0

func (m *Mutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*Mutation) SetName added in v1.6.0

func (m *Mutation) SetName(s string)

SetName sets the "name" field.

func (*Mutation) SetOp added in v1.6.0

func (m *Mutation) SetOp(op ent.Op)

SetOp allows setting the mutation operation.

func (*Mutation) Type added in v1.6.0

func (m *Mutation) Type() string

Type returns the node type of this mutation (Tag).

func (*Mutation) UsersCleared added in v1.6.0

func (m *Mutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*Mutation) UsersIDs added in v1.6.0

func (m *Mutation) UsersIDs() (ids []int)

UsersIDs returns the "users" edge IDs in the mutation.

func (*Mutation) Where added in v1.6.0

func (m *Mutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the Mutation builder.

func (*Mutation) WhereP added in v1.6.0

func (m *Mutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the Mutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Tag queries.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByName

func ByName(opts ...sql.OrderTermOption) OrderOption

ByName orders the results by the name field.

func ByUsers

func ByUsers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByUsers orders the results by users terms.

func ByUsersCount

func ByUsersCount(opts ...sql.OrderTermOption) OrderOption

ByUsersCount orders the results by users count.

Jump to

Keyboard shortcuts

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