user

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 6 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 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