user

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 3 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"
	// FieldEmail holds the string denoting the email field in the database.
	FieldEmail = "email"
	// FieldPassword holds the string denoting the password field in the database.
	FieldPassword = "password"
	// EdgeRefCreatedBy holds the string denoting the ref_created_by edge name in mutations.
	EdgeRefCreatedBy = "ref_created_by"
	// EdgeCreatedBy holds the string denoting the created_by edge name in mutations.
	EdgeCreatedBy = "created_by"
	// EdgeRefUpdatedBy holds the string denoting the ref_updated_by edge name in mutations.
	EdgeRefUpdatedBy = "ref_updated_by"
	// EdgeUpdatedBy holds the string denoting the updated_by edge name in mutations.
	EdgeUpdatedBy = "updated_by"
	// EdgeAdminCreatedBy holds the string denoting the admin_created_by edge name in mutations.
	EdgeAdminCreatedBy = "admin_created_by"
	// EdgeAdminUpdatedBy holds the string denoting the admin_updated_by edge name in mutations.
	EdgeAdminUpdatedBy = "admin_updated_by"
	// EdgeRoles holds the string denoting the roles edge name in mutations.
	EdgeRoles = "roles"
	// EdgeDefaultRole holds the string denoting the default_role edge name in mutations.
	EdgeDefaultRole = "default_role"
	// Table holds the table name of the user in the database.
	Table = "users"
	// RefCreatedByTable is the table that holds the ref_created_by relation/edge.
	RefCreatedByTable = "users"
	// RefCreatedByColumn is the table column denoting the ref_created_by relation/edge.
	RefCreatedByColumn = "user_created_by"
	// CreatedByTable is the table that holds the created_by relation/edge.
	CreatedByTable = "users"
	// CreatedByColumn is the table column denoting the created_by relation/edge.
	CreatedByColumn = "user_created_by"
	// RefUpdatedByTable is the table that holds the ref_updated_by relation/edge.
	RefUpdatedByTable = "users"
	// RefUpdatedByColumn is the table column denoting the ref_updated_by relation/edge.
	RefUpdatedByColumn = "user_updated_by"
	// UpdatedByTable is the table that holds the updated_by relation/edge.
	UpdatedByTable = "users"
	// UpdatedByColumn is the table column denoting the updated_by relation/edge.
	UpdatedByColumn = "user_updated_by"
	// AdminCreatedByTable is the table that holds the admin_created_by relation/edge.
	AdminCreatedByTable = "users"
	// AdminCreatedByInverseTable is the table name for the AdminUser entity.
	// It exists in this package in order to avoid circular dependency with the "adminuser" package.
	AdminCreatedByInverseTable = "admin_users"
	// AdminCreatedByColumn is the table column denoting the admin_created_by relation/edge.
	AdminCreatedByColumn = "user_admin_created_by"
	// AdminUpdatedByTable is the table that holds the admin_updated_by relation/edge.
	AdminUpdatedByTable = "users"
	// AdminUpdatedByInverseTable is the table name for the AdminUser entity.
	// It exists in this package in order to avoid circular dependency with the "adminuser" package.
	AdminUpdatedByInverseTable = "admin_users"
	// AdminUpdatedByColumn is the table column denoting the admin_updated_by relation/edge.
	AdminUpdatedByColumn = "user_admin_updated_by"
	// RolesTable is the table that holds the roles relation/edge. The primary key declared below.
	RolesTable = "user_roles"
	// RolesInverseTable is the table name for the Role entity.
	// It exists in this package in order to avoid circular dependency with the "role" package.
	RolesInverseTable = "roles"
	// DefaultRoleTable is the table that holds the default_role relation/edge.
	DefaultRoleTable = "users"
	// DefaultRoleInverseTable is the table name for the Role entity.
	// It exists in this package in order to avoid circular dependency with the "role" package.
	DefaultRoleInverseTable = "roles"
	// DefaultRoleColumn is the table column denoting the default_role relation/edge.
	DefaultRoleColumn = "user_default_role"
)

Variables

View Source
var (
	// EmailValidator is a validator for the "email" field. It is called by the builders before save.
	EmailValidator func(string) error
	// PasswordValidator is a validator for the "password" field. It is called by the builders before save.
	PasswordValidator func(string) error
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() string
)

Columns holds all SQL columns for user fields.

View Source
var ForeignKeys = []string{
	"user_created_by",
	"user_updated_by",
	"user_admin_created_by",
	"user_admin_updated_by",
	"user_default_role",
}

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 (
	// RolesPrimaryKey and RolesColumn2 are the table columns denoting the
	// primary key for the roles relation (M2M).
	RolesPrimaryKey = []string{"user_id", "role_id"}
)

Functions

func And

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

And groups predicates with the AND operator between them.

func Email

func Email(v string) predicate.User

Email applies equality check predicate on the "email" field. It's identical to EmailEQ.

func EmailContains

func EmailContains(v string) predicate.User

EmailContains applies the Contains predicate on the "email" field.

func EmailContainsFold

func EmailContainsFold(v string) predicate.User

EmailContainsFold applies the ContainsFold predicate on the "email" field.

func EmailEQ

func EmailEQ(v string) predicate.User

EmailEQ applies the EQ predicate on the "email" field.

func EmailEqualFold

func EmailEqualFold(v string) predicate.User

EmailEqualFold applies the EqualFold predicate on the "email" field.

func EmailGT

func EmailGT(v string) predicate.User

EmailGT applies the GT predicate on the "email" field.

func EmailGTE

func EmailGTE(v string) predicate.User

EmailGTE applies the GTE predicate on the "email" field.

func EmailHasPrefix

func EmailHasPrefix(v string) predicate.User

EmailHasPrefix applies the HasPrefix predicate on the "email" field.

func EmailHasSuffix

func EmailHasSuffix(v string) predicate.User

EmailHasSuffix applies the HasSuffix predicate on the "email" field.

func EmailIn

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

EmailIn applies the In predicate on the "email" field.

func EmailLT

func EmailLT(v string) predicate.User

EmailLT applies the LT predicate on the "email" field.

func EmailLTE

func EmailLTE(v string) predicate.User

EmailLTE applies the LTE predicate on the "email" field.

func EmailNEQ

func EmailNEQ(v string) predicate.User

EmailNEQ applies the NEQ predicate on the "email" field.

func EmailNotIn

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

EmailNotIn applies the NotIn predicate on the "email" field.

func HasAdminCreatedBy

func HasAdminCreatedBy() predicate.User

HasAdminCreatedBy applies the HasEdge predicate on the "admin_created_by" edge.

func HasAdminCreatedByWith

func HasAdminCreatedByWith(preds ...predicate.AdminUser) predicate.User

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

func HasAdminUpdatedBy

func HasAdminUpdatedBy() predicate.User

HasAdminUpdatedBy applies the HasEdge predicate on the "admin_updated_by" edge.

func HasAdminUpdatedByWith

func HasAdminUpdatedByWith(preds ...predicate.AdminUser) predicate.User

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

func HasCreatedBy

func HasCreatedBy() predicate.User

HasCreatedBy applies the HasEdge predicate on the "created_by" edge.

func HasCreatedByWith

func HasCreatedByWith(preds ...predicate.User) predicate.User

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

func HasDefaultRole

func HasDefaultRole() predicate.User

HasDefaultRole applies the HasEdge predicate on the "default_role" edge.

func HasDefaultRoleWith

func HasDefaultRoleWith(preds ...predicate.Role) predicate.User

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

func HasRefCreatedBy

func HasRefCreatedBy() predicate.User

HasRefCreatedBy applies the HasEdge predicate on the "ref_created_by" edge.

func HasRefCreatedByWith

func HasRefCreatedByWith(preds ...predicate.User) predicate.User

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

func HasRefUpdatedBy

func HasRefUpdatedBy() predicate.User

HasRefUpdatedBy applies the HasEdge predicate on the "ref_updated_by" edge.

func HasRefUpdatedByWith

func HasRefUpdatedByWith(preds ...predicate.User) predicate.User

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

func HasRoles

func HasRoles() predicate.User

HasRoles applies the HasEdge predicate on the "roles" edge.

func HasRolesWith

func HasRolesWith(preds ...predicate.Role) predicate.User

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

func HasUpdatedBy

func HasUpdatedBy() predicate.User

HasUpdatedBy applies the HasEdge predicate on the "updated_by" edge.

func HasUpdatedByWith

func HasUpdatedByWith(preds ...predicate.User) predicate.User

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

func ID

func ID(id string) predicate.User

ID filters vertices based on their ID field.

func IDContainsFold

func IDContainsFold(id string) predicate.User

IDContainsFold applies the ContainsFold predicate on the ID field.

func IDEQ

func IDEQ(id string) predicate.User

IDEQ applies the EQ predicate on the ID field.

func IDEqualFold

func IDEqualFold(id string) predicate.User

IDEqualFold applies the EqualFold predicate on the ID field.

func IDGT

func IDGT(id string) predicate.User

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id string) predicate.User

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id string) predicate.User

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id string) predicate.User

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id string) predicate.User

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID 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 Password

func Password(v string) predicate.User

Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.

func PasswordContains

func PasswordContains(v string) predicate.User

PasswordContains applies the Contains predicate on the "password" field.

func PasswordContainsFold

func PasswordContainsFold(v string) predicate.User

PasswordContainsFold applies the ContainsFold predicate on the "password" field.

func PasswordEQ

func PasswordEQ(v string) predicate.User

PasswordEQ applies the EQ predicate on the "password" field.

func PasswordEqualFold

func PasswordEqualFold(v string) predicate.User

PasswordEqualFold applies the EqualFold predicate on the "password" field.

func PasswordGT

func PasswordGT(v string) predicate.User

PasswordGT applies the GT predicate on the "password" field.

func PasswordGTE

func PasswordGTE(v string) predicate.User

PasswordGTE applies the GTE predicate on the "password" field.

func PasswordHasPrefix

func PasswordHasPrefix(v string) predicate.User

PasswordHasPrefix applies the HasPrefix predicate on the "password" field.

func PasswordHasSuffix

func PasswordHasSuffix(v string) predicate.User

PasswordHasSuffix applies the HasSuffix predicate on the "password" field.

func PasswordIn

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

PasswordIn applies the In predicate on the "password" field.

func PasswordLT

func PasswordLT(v string) predicate.User

PasswordLT applies the LT predicate on the "password" field.

func PasswordLTE

func PasswordLTE(v string) predicate.User

PasswordLTE applies the LTE predicate on the "password" field.

func PasswordNEQ

func PasswordNEQ(v string) predicate.User

PasswordNEQ applies the NEQ predicate on the "password" field.

func PasswordNotIn

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

PasswordNotIn applies the NotIn predicate on the "password" 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 ByAdminCreatedByField

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

ByAdminCreatedByField orders the results by admin_created_by field.

func ByAdminUpdatedByField

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

ByAdminUpdatedByField orders the results by admin_updated_by field.

func ByCreatedByField

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

ByCreatedByField orders the results by created_by field.

func ByDefaultRoleField

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

ByDefaultRoleField orders the results by default_role field.

func ByEmail

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

ByEmail orders the results by the email field.

func ByID

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

ByID orders the results by the id field.

func ByPassword

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

ByPassword orders the results by the password field.

func ByRefCreatedBy

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

ByRefCreatedBy orders the results by ref_created_by terms.

func ByRefCreatedByCount

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

ByRefCreatedByCount orders the results by ref_created_by count.

func ByRefUpdatedBy

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

ByRefUpdatedBy orders the results by ref_updated_by terms.

func ByRefUpdatedByCount

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

ByRefUpdatedByCount orders the results by ref_updated_by count.

func ByRoles

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

ByRoles orders the results by roles terms.

func ByRolesCount

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

ByRolesCount orders the results by roles count.

func ByUpdatedByField

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

ByUpdatedByField orders the results by updated_by field.

Jump to

Keyboard shortcuts

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