user

package
v1.6.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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the user type in the database.
	Label = "user"
	// 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"
	// FieldBio holds the string denoting the bio field in the database.
	FieldBio = "bio"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUsername holds the string denoting the username field in the database.
	FieldUsername = "username"
	// FieldScore holds the string denoting the score field in the database.
	FieldScore = "score"
	// FieldExternalID holds the string denoting the external_id field in the database.
	FieldExternalID = "external_id"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldSettings holds the string denoting the settings field in the database.
	FieldSettings = "settings"
	// FieldLabels holds the string denoting the labels field in the database.
	FieldLabels = "labels"
	// FieldTagNames holds the string denoting the tag_names field in the database.
	FieldTagNames = "tag_names"
	// FieldMetadata holds the string denoting the metadata field in the database.
	FieldMetadata = "metadata"
	// EdgePosts holds the string denoting the posts edge name in mutations.
	EdgePosts = "posts"
	// EdgePinnedPost holds the string denoting the pinned_post edge name in mutations.
	EdgePinnedPost = "pinned_post"
	// EdgeTags holds the string denoting the tags edge name in mutations.
	EdgeTags = "tags"
	// Table holds the table name of the user in the database.
	Table = "users"
	// PostsTable is the table that holds the posts relation/edge.
	PostsTable = "posts"
	// PostsInverseTable is the table name for the Post entity.
	// It exists in this package in order to avoid circular dependency with the "post" package.
	PostsInverseTable = "posts"
	// PostsColumn is the table column denoting the posts relation/edge.
	PostsColumn = "user_posts"
	// PinnedPostTable is the table that holds the pinned_post relation/edge.
	PinnedPostTable = "users"
	// PinnedPostInverseTable is the table name for the Post entity.
	// It exists in this package in order to avoid circular dependency with the "post" package.
	PinnedPostInverseTable = "posts"
	// PinnedPostColumn is the table column denoting the pinned_post relation/edge.
	PinnedPostColumn = "user_pinned_post"
	// TagsTable is the table that holds the tags relation/edge. The primary key declared below.
	TagsTable = "user_tags"
	// TagsInverseTable is the table name for the Tag entity.
	// It exists in this package in order to avoid circular dependency with the "tag" package.
	TagsInverseTable = "tags"
)
View Source
const DefaultStatus = StatusActive

StatusActive is the default value of the Status enum.

Variables

Columns holds all SQL columns for user fields.

View Source
var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
)
View Source
var ForeignKeys = []string{
	"user_pinned_post",
}

ForeignKeys holds the SQL foreign-keys that are owned by the "users" table and are not defined as standalone fields in the schema.

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

Functions

func And

func And(predicates ...predicate.User) predicate.User

And groups predicates with the AND operator between them.

func Bio

func Bio(v string) predicate.User

Bio applies equality check predicate on the "bio" field. It's identical to BioEQ.

func BioContains

func BioContains(v string) predicate.User

BioContains applies the Contains predicate on the "bio" field.

func BioContainsFold

func BioContainsFold(v string) predicate.User

BioContainsFold applies the ContainsFold predicate on the "bio" field.

func BioEQ

func BioEQ(v string) predicate.User

BioEQ applies the EQ predicate on the "bio" field.

func BioEqualFold

func BioEqualFold(v string) predicate.User

BioEqualFold applies the EqualFold predicate on the "bio" field.

func BioGT

func BioGT(v string) predicate.User

BioGT applies the GT predicate on the "bio" field.

func BioGTE

func BioGTE(v string) predicate.User

BioGTE applies the GTE predicate on the "bio" field.

func BioHasPrefix

func BioHasPrefix(v string) predicate.User

BioHasPrefix applies the HasPrefix predicate on the "bio" field.

func BioHasSuffix

func BioHasSuffix(v string) predicate.User

BioHasSuffix applies the HasSuffix predicate on the "bio" field.

func BioIn

func BioIn(vs ...string) predicate.User

BioIn applies the In predicate on the "bio" field.

func BioIsNil

func BioIsNil() predicate.User

BioIsNil applies the IsNil predicate on the "bio" field.

func BioLT

func BioLT(v string) predicate.User

BioLT applies the LT predicate on the "bio" field.

func BioLTE

func BioLTE(v string) predicate.User

BioLTE applies the LTE predicate on the "bio" field.

func BioNEQ

func BioNEQ(v string) predicate.User

BioNEQ applies the NEQ predicate on the "bio" field.

func BioNotIn

func BioNotIn(vs ...string) predicate.User

BioNotIn applies the NotIn predicate on the "bio" field.

func BioNotNil

func BioNotNil() predicate.User

BioNotNil applies the NotNil predicate on the "bio" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.User

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.User

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.User

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.User

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.User

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.User

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.User

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.User

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.User

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func ExternalID

func ExternalID(v uuid.UUID) predicate.User

ExternalID applies equality check predicate on the "external_id" field. It's identical to ExternalIDEQ.

func ExternalIDEQ

func ExternalIDEQ(v uuid.UUID) predicate.User

ExternalIDEQ applies the EQ predicate on the "external_id" field.

func ExternalIDGT

func ExternalIDGT(v uuid.UUID) predicate.User

ExternalIDGT applies the GT predicate on the "external_id" field.

func ExternalIDGTE

func ExternalIDGTE(v uuid.UUID) predicate.User

ExternalIDGTE applies the GTE predicate on the "external_id" field.

func ExternalIDIn

func ExternalIDIn(vs ...uuid.UUID) predicate.User

ExternalIDIn applies the In predicate on the "external_id" field.

func ExternalIDLT

func ExternalIDLT(v uuid.UUID) predicate.User

ExternalIDLT applies the LT predicate on the "external_id" field.

func ExternalIDLTE

func ExternalIDLTE(v uuid.UUID) predicate.User

ExternalIDLTE applies the LTE predicate on the "external_id" field.

func ExternalIDNEQ

func ExternalIDNEQ(v uuid.UUID) predicate.User

ExternalIDNEQ applies the NEQ predicate on the "external_id" field.

func ExternalIDNotIn

func ExternalIDNotIn(vs ...uuid.UUID) predicate.User

ExternalIDNotIn applies the NotIn predicate on the "external_id" field.

func HasPinnedPost

func HasPinnedPost() predicate.User

HasPinnedPost applies the HasEdge predicate on the "pinned_post" edge.

func HasPinnedPostWith

func HasPinnedPostWith(preds ...predicate.Post) predicate.User

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

func HasPosts

func HasPosts() predicate.User

HasPosts applies the HasEdge predicate on the "posts" edge.

func HasPostsWith

func HasPostsWith(preds ...predicate.Post) predicate.User

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

func HasTags

func HasTags() predicate.User

HasTags applies the HasEdge predicate on the "tags" edge.

func HasTagsWith

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

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

func ID

func ID(id int) predicate.User

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.User

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.User

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.User

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.User

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.User

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.User

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.User

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

func NameContains

func NameContains(v string) predicate.User

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

func NameContainsFold

func NameContainsFold(v string) predicate.User

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

func NameEQ

func NameEQ(v string) predicate.User

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

func NameEqualFold

func NameEqualFold(v string) predicate.User

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

func NameGT

func NameGT(v string) predicate.User

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

func NameGTE

func NameGTE(v string) predicate.User

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.User

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.User

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.User

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

func NameLTE

func NameLTE(v string) predicate.User

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

func NameNEQ

func NameNEQ(v string) predicate.User

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

func NameNotIn

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

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

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.User) predicate.User

Or groups predicates with the OR operator between them.

func Score

func Score(v int) predicate.User

Score applies equality check predicate on the "score" field. It's identical to ScoreEQ.

func ScoreEQ

func ScoreEQ(v int) predicate.User

ScoreEQ applies the EQ predicate on the "score" field.

func ScoreGT

func ScoreGT(v int) predicate.User

ScoreGT applies the GT predicate on the "score" field.

func ScoreGTE

func ScoreGTE(v int) predicate.User

ScoreGTE applies the GTE predicate on the "score" field.

func ScoreIn

func ScoreIn(vs ...int) predicate.User

ScoreIn applies the In predicate on the "score" field.

func ScoreIsNil

func ScoreIsNil() predicate.User

ScoreIsNil applies the IsNil predicate on the "score" field.

func ScoreLT

func ScoreLT(v int) predicate.User

ScoreLT applies the LT predicate on the "score" field.

func ScoreLTE

func ScoreLTE(v int) predicate.User

ScoreLTE applies the LTE predicate on the "score" field.

func ScoreNEQ

func ScoreNEQ(v int) predicate.User

ScoreNEQ applies the NEQ predicate on the "score" field.

func ScoreNotIn

func ScoreNotIn(vs ...int) predicate.User

ScoreNotIn applies the NotIn predicate on the "score" field.

func ScoreNotNil

func ScoreNotNil() predicate.User

ScoreNotNil applies the NotNil predicate on the "score" field.

func SettingsIsNil

func SettingsIsNil() predicate.User

SettingsIsNil applies the IsNil predicate on the "settings" field.

func SettingsNotNil

func SettingsNotNil() predicate.User

SettingsNotNil applies the NotNil predicate on the "settings" field.

func StatusEQ

func StatusEQ(v Status) predicate.User

StatusEQ applies the EQ predicate on the "status" field.

func StatusIn

func StatusIn(vs ...Status) predicate.User

StatusIn applies the In predicate on the "status" field.

func StatusNEQ

func StatusNEQ(v Status) predicate.User

StatusNEQ applies the NEQ predicate on the "status" field.

func StatusNotIn

func StatusNotIn(vs ...Status) predicate.User

StatusNotIn applies the NotIn predicate on the "status" field.

func StatusValidator

func StatusValidator(s Status) error

StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.User

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.User

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.User

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.User

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.User

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtIsNil

func UpdatedAtIsNil() predicate.User

UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.User

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.User

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.User

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.User

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.

func UpdatedAtNotNil

func UpdatedAtNotNil() predicate.User

UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field.

func Username

func Username(v string) predicate.User

Username applies equality check predicate on the "username" field. It's identical to UsernameEQ.

func UsernameContains

func UsernameContains(v string) predicate.User

UsernameContains applies the Contains predicate on the "username" field.

func UsernameContainsFold

func UsernameContainsFold(v string) predicate.User

UsernameContainsFold applies the ContainsFold predicate on the "username" field.

func UsernameEQ

func UsernameEQ(v string) predicate.User

UsernameEQ applies the EQ predicate on the "username" field.

func UsernameEqualFold

func UsernameEqualFold(v string) predicate.User

UsernameEqualFold applies the EqualFold predicate on the "username" field.

func UsernameGT

func UsernameGT(v string) predicate.User

UsernameGT applies the GT predicate on the "username" field.

func UsernameGTE

func UsernameGTE(v string) predicate.User

UsernameGTE applies the GTE predicate on the "username" field.

func UsernameHasPrefix

func UsernameHasPrefix(v string) predicate.User

UsernameHasPrefix applies the HasPrefix predicate on the "username" field.

func UsernameHasSuffix

func UsernameHasSuffix(v string) predicate.User

UsernameHasSuffix applies the HasSuffix predicate on the "username" field.

func UsernameIn

func UsernameIn(vs ...string) predicate.User

UsernameIn applies the In predicate on the "username" field.

func UsernameLT

func UsernameLT(v string) predicate.User

UsernameLT applies the LT predicate on the "username" field.

func UsernameLTE

func UsernameLTE(v string) predicate.User

UsernameLTE applies the LTE predicate on the "username" field.

func UsernameNEQ

func UsernameNEQ(v string) predicate.User

UsernameNEQ applies the NEQ predicate on the "username" field.

func UsernameNotIn

func UsernameNotIn(vs ...string) predicate.User

UsernameNotIn applies the NotIn predicate on the "username" field.

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 User nodes in the graph.

func NewMutation added in v1.6.0

func NewMutation(op ent.Op) *Mutation

NewMutation creates a new Mutation for the User 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) AddPostIDs added in v1.6.0

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

AddPostIDs adds the "posts" edge to the Post entity by ids.

func (*Mutation) AddScore added in v1.6.0

func (m *Mutation) AddScore(i int)

AddScore adds i to the "score" field.

func (*Mutation) AddTagIDs added in v1.6.0

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

AddTagIDs adds the "tags" edge to the Tag 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) AddedScore added in v1.6.0

func (m *Mutation) AddedScore() (r int, exists bool)

AddedScore returns the value that was added to the "score" field in this mutation.

func (*Mutation) AppendTagNames added in v1.6.0

func (m *Mutation) AppendTagNames(s []string)

AppendTagNames adds s to the "tag_names" field.

func (*Mutation) AppendedTagNames added in v1.6.0

func (m *Mutation) AppendedTagNames() ([]string, bool)

AppendedTagNames returns the list of values that were appended to the "tag_names" field in this mutation.

func (*Mutation) Bio added in v1.6.0

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

Bio returns the value of the "bio" field in the mutation.

func (*Mutation) BioCleared added in v1.6.0

func (m *Mutation) BioCleared() bool

BioCleared returns if the "bio" field was cleared in this mutation.

func (*Mutation) ClearBio added in v1.6.0

func (m *Mutation) ClearBio()

ClearBio clears the value of the "bio" field.

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) ClearPinnedPost added in v1.6.0

func (m *Mutation) ClearPinnedPost()

ClearPinnedPost clears the "pinned_post" edge to the Post entity.

func (*Mutation) ClearPosts added in v1.6.0

func (m *Mutation) ClearPosts()

ClearPosts clears the "posts" edge to the Post entity.

func (*Mutation) ClearScore added in v1.6.0

func (m *Mutation) ClearScore()

ClearScore clears the value of the "score" field.

func (*Mutation) ClearSettings added in v1.6.0

func (m *Mutation) ClearSettings()

ClearSettings clears the value of the "settings" field.

func (*Mutation) ClearTags added in v1.6.0

func (m *Mutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*Mutation) ClearUpdatedAt added in v1.6.0

func (m *Mutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

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) CreatedAt added in v1.6.0

func (m *Mutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the 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) ExternalID added in v1.6.0

func (m *Mutation) ExternalID() (r uuid.UUID, exists bool)

ExternalID returns the value of the "external_id" field in the 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) Labels added in v1.6.0

func (m *Mutation) Labels() (r map[string]interface{}, exists bool)

Labels returns the value of the "labels" field in the mutation.

func (*Mutation) Metadata added in v1.6.0

func (m *Mutation) Metadata() (r domain.UserMetadata, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

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) PinnedPostCleared added in v1.6.0

func (m *Mutation) PinnedPostCleared() bool

PinnedPostCleared reports if the "pinned_post" edge to the Post entity was cleared.

func (*Mutation) PinnedPostID added in v1.6.0

func (m *Mutation) PinnedPostID() (id int, exists bool)

PinnedPostID returns the "pinned_post" edge ID in the mutation.

func (*Mutation) PinnedPostIDs added in v1.6.0

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

PinnedPostIDs returns the "pinned_post" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PinnedPostID instead. It exists only for internal usage by the builders.

func (*Mutation) PostsCleared added in v1.6.0

func (m *Mutation) PostsCleared() bool

PostsCleared reports if the "posts" edge to the Post entity was cleared.

func (*Mutation) PostsIDs added in v1.6.0

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

PostsIDs returns the "posts" edge IDs in the mutation.

func (*Mutation) Predicates added in v1.6.0

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

Predicates returns the list of predicates set on the mutation.

func (*Mutation) RemovePostIDs added in v1.6.0

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

RemovePostIDs removes the "posts" edge to the Post entity by IDs.

func (*Mutation) RemoveTagIDs added in v1.6.0

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

RemoveTagIDs removes the "tags" edge to the Tag 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) RemovedPostsIDs added in v1.6.0

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

RemovedPosts returns the removed IDs of the "posts" edge to the Post entity.

func (*Mutation) RemovedTagsIDs added in v1.6.0

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

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*Mutation) ResetBio added in v1.6.0

func (m *Mutation) ResetBio()

ResetBio resets all changes to the "bio" field.

func (*Mutation) ResetCreatedAt added in v1.6.0

func (m *Mutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

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) ResetExternalID added in v1.6.0

func (m *Mutation) ResetExternalID()

ResetExternalID resets all changes to the "external_id" field.

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) ResetLabels added in v1.6.0

func (m *Mutation) ResetLabels()

ResetLabels resets all changes to the "labels" field.

func (*Mutation) ResetMetadata added in v1.6.0

func (m *Mutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*Mutation) ResetName added in v1.6.0

func (m *Mutation) ResetName()

ResetName resets all changes to the "name" field.

func (*Mutation) ResetPinnedPost added in v1.6.0

func (m *Mutation) ResetPinnedPost()

ResetPinnedPost resets all changes to the "pinned_post" edge.

func (*Mutation) ResetPosts added in v1.6.0

func (m *Mutation) ResetPosts()

ResetPosts resets all changes to the "posts" edge.

func (*Mutation) ResetScore added in v1.6.0

func (m *Mutation) ResetScore()

ResetScore resets all changes to the "score" field.

func (*Mutation) ResetSettings added in v1.6.0

func (m *Mutation) ResetSettings()

ResetSettings resets all changes to the "settings" field.

func (*Mutation) ResetStatus added in v1.6.0

func (m *Mutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*Mutation) ResetTagNames added in v1.6.0

func (m *Mutation) ResetTagNames()

ResetTagNames resets all changes to the "tag_names" field.

func (*Mutation) ResetTags added in v1.6.0

func (m *Mutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*Mutation) ResetUpdatedAt added in v1.6.0

func (m *Mutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*Mutation) ResetUsername added in v1.6.0

func (m *Mutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*Mutation) Score added in v1.6.0

func (m *Mutation) Score() (r int, exists bool)

Score returns the value of the "score" field in the mutation.

func (*Mutation) ScoreCleared added in v1.6.0

func (m *Mutation) ScoreCleared() bool

ScoreCleared returns if the "score" field was cleared in this mutation.

func (*Mutation) SetBio added in v1.6.0

func (m *Mutation) SetBio(s string)

SetBio sets the "bio" field.

func (*Mutation) SetCreatedAt added in v1.6.0

func (m *Mutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*Mutation) SetExternalID added in v1.6.0

func (m *Mutation) SetExternalID(u uuid.UUID)

SetExternalID sets the "external_id" field.

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) SetLabels added in v1.6.0

func (m *Mutation) SetLabels(value map[string]interface{})

SetLabels sets the "labels" field.

func (*Mutation) SetMetadata added in v1.6.0

func (m *Mutation) SetMetadata(dm domain.UserMetadata)

SetMetadata sets the "metadata" field.

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) SetPinnedPostID added in v1.6.0

func (m *Mutation) SetPinnedPostID(id int)

SetPinnedPostID sets the "pinned_post" edge to the Post entity by id.

func (*Mutation) SetScore added in v1.6.0

func (m *Mutation) SetScore(i int)

SetScore sets the "score" field.

func (*Mutation) SetSettings added in v1.6.0

func (m *Mutation) SetSettings(value map[string]interface{})

SetSettings sets the "settings" field.

func (*Mutation) SetStatus added in v1.6.0

func (m *Mutation) SetStatus(u Status)

SetStatus sets the "status" field.

func (*Mutation) SetTagNames added in v1.6.0

func (m *Mutation) SetTagNames(s []string)

SetTagNames sets the "tag_names" field.

func (*Mutation) SetUpdatedAt added in v1.6.0

func (m *Mutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*Mutation) SetUsername added in v1.6.0

func (m *Mutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*Mutation) Settings added in v1.6.0

func (m *Mutation) Settings() (r map[string]interface{}, exists bool)

Settings returns the value of the "settings" field in the mutation.

func (*Mutation) SettingsCleared added in v1.6.0

func (m *Mutation) SettingsCleared() bool

SettingsCleared returns if the "settings" field was cleared in this mutation.

func (*Mutation) Status added in v1.6.0

func (m *Mutation) Status() (r Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*Mutation) TagNames added in v1.6.0

func (m *Mutation) TagNames() (r []string, exists bool)

TagNames returns the value of the "tag_names" field in the mutation.

func (*Mutation) TagsCleared added in v1.6.0

func (m *Mutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*Mutation) TagsIDs added in v1.6.0

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

TagsIDs returns the "tags" edge IDs in the mutation.

func (*Mutation) Type added in v1.6.0

func (m *Mutation) Type() string

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

func (*Mutation) UpdatedAt added in v1.6.0

func (m *Mutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*Mutation) UpdatedAtCleared added in v1.6.0

func (m *Mutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*Mutation) Username added in v1.6.0

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

Username returns the value of the "username" field in the mutation.

func (*Mutation) Where added in v1.6.0

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

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 User queries.

func ByBio

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

ByBio orders the results by the bio field.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at field.

func ByExternalID

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

ByExternalID orders the results by the external_id field.

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 ByPinnedPostField

func ByPinnedPostField(field string, opts ...sql.OrderTermOption) OrderOption

ByPinnedPostField orders the results by pinned_post field.

func ByPosts

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

ByPosts orders the results by posts terms.

func ByPostsCount

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

ByPostsCount orders the results by posts count.

func ByScore

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

ByScore orders the results by the score field.

func ByStatus

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

ByStatus orders the results by the status field.

func ByTags

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

ByTags orders the results by tags terms.

func ByTagsCount

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

ByTagsCount orders the results by tags count.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

func ByUsername

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

ByUsername orders the results by the username field.

type Status

type Status string

Status defines the type for the "status" enum field.

const (
	StatusActive   Status = "active"
	StatusInactive Status = "inactive"
)

Status values.

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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