user

package
v0.0.0-...-83e02d6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 4 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"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldEmail holds the string denoting the email field in the database.
	FieldEmail = "email"
	// FieldHashedPassword holds the string denoting the hashed_password field in the database.
	FieldHashedPassword = "hashed_password"
	// FieldAPIKey holds the string denoting the api_key field in the database.
	FieldAPIKey = "api_key"
	// FieldRole holds the string denoting the role field in the database.
	FieldRole = "role"
	// Table holds the table name of the user in the database.
	Table = "users"
)
View Source
const DefaultRole = RoleUser

RoleUser is the default value of the Role enum.

Variables

View Source
var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
)

Columns holds all SQL columns for user fields.

Functions

func APIKey

func APIKey(v string) predicate.User

APIKey applies equality check predicate on the "api_key" field. It's identical to APIKeyEQ.

func APIKeyContains

func APIKeyContains(v string) predicate.User

APIKeyContains applies the Contains predicate on the "api_key" field.

func APIKeyContainsFold

func APIKeyContainsFold(v string) predicate.User

APIKeyContainsFold applies the ContainsFold predicate on the "api_key" field.

func APIKeyEQ

func APIKeyEQ(v string) predicate.User

APIKeyEQ applies the EQ predicate on the "api_key" field.

func APIKeyEqualFold

func APIKeyEqualFold(v string) predicate.User

APIKeyEqualFold applies the EqualFold predicate on the "api_key" field.

func APIKeyGT

func APIKeyGT(v string) predicate.User

APIKeyGT applies the GT predicate on the "api_key" field.

func APIKeyGTE

func APIKeyGTE(v string) predicate.User

APIKeyGTE applies the GTE predicate on the "api_key" field.

func APIKeyHasPrefix

func APIKeyHasPrefix(v string) predicate.User

APIKeyHasPrefix applies the HasPrefix predicate on the "api_key" field.

func APIKeyHasSuffix

func APIKeyHasSuffix(v string) predicate.User

APIKeyHasSuffix applies the HasSuffix predicate on the "api_key" field.

func APIKeyIn

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

APIKeyIn applies the In predicate on the "api_key" field.

func APIKeyLT

func APIKeyLT(v string) predicate.User

APIKeyLT applies the LT predicate on the "api_key" field.

func APIKeyLTE

func APIKeyLTE(v string) predicate.User

APIKeyLTE applies the LTE predicate on the "api_key" field.

func APIKeyNEQ

func APIKeyNEQ(v string) predicate.User

APIKeyNEQ applies the NEQ predicate on the "api_key" field.

func APIKeyNotIn

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

APIKeyNotIn applies the NotIn predicate on the "api_key" field.

func And

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

And groups predicates with the AND operator between them.

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 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 HashedPassword

func HashedPassword(v string) predicate.User

HashedPassword applies equality check predicate on the "hashed_password" field. It's identical to HashedPasswordEQ.

func HashedPasswordContains

func HashedPasswordContains(v string) predicate.User

HashedPasswordContains applies the Contains predicate on the "hashed_password" field.

func HashedPasswordContainsFold

func HashedPasswordContainsFold(v string) predicate.User

HashedPasswordContainsFold applies the ContainsFold predicate on the "hashed_password" field.

func HashedPasswordEQ

func HashedPasswordEQ(v string) predicate.User

HashedPasswordEQ applies the EQ predicate on the "hashed_password" field.

func HashedPasswordEqualFold

func HashedPasswordEqualFold(v string) predicate.User

HashedPasswordEqualFold applies the EqualFold predicate on the "hashed_password" field.

func HashedPasswordGT

func HashedPasswordGT(v string) predicate.User

HashedPasswordGT applies the GT predicate on the "hashed_password" field.

func HashedPasswordGTE

func HashedPasswordGTE(v string) predicate.User

HashedPasswordGTE applies the GTE predicate on the "hashed_password" field.

func HashedPasswordHasPrefix

func HashedPasswordHasPrefix(v string) predicate.User

HashedPasswordHasPrefix applies the HasPrefix predicate on the "hashed_password" field.

func HashedPasswordHasSuffix

func HashedPasswordHasSuffix(v string) predicate.User

HashedPasswordHasSuffix applies the HasSuffix predicate on the "hashed_password" field.

func HashedPasswordIn

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

HashedPasswordIn applies the In predicate on the "hashed_password" field.

func HashedPasswordLT

func HashedPasswordLT(v string) predicate.User

HashedPasswordLT applies the LT predicate on the "hashed_password" field.

func HashedPasswordLTE

func HashedPasswordLTE(v string) predicate.User

HashedPasswordLTE applies the LTE predicate on the "hashed_password" field.

func HashedPasswordNEQ

func HashedPasswordNEQ(v string) predicate.User

HashedPasswordNEQ applies the NEQ predicate on the "hashed_password" field.

func HashedPasswordNotIn

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

HashedPasswordNotIn applies the NotIn predicate on the "hashed_password" field.

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 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 RoleEQ

func RoleEQ(v Role) predicate.User

RoleEQ applies the EQ predicate on the "role" field.

func RoleIn

func RoleIn(vs ...Role) predicate.User

RoleIn applies the In predicate on the "role" field.

func RoleNEQ

func RoleNEQ(v Role) predicate.User

RoleNEQ applies the NEQ predicate on the "role" field.

func RoleNotIn

func RoleNotIn(vs ...Role) predicate.User

RoleNotIn applies the NotIn predicate on the "role" field.

func RoleValidator

func RoleValidator(r Role) error

RoleValidator is a validator for the "role" 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 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 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 ByAPIKey

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

ByAPIKey orders the results by the api_key field.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at field.

func ByEmail

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

ByEmail orders the results by the email field.

func ByHashedPassword

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

ByHashedPassword orders the results by the hashed_password field.

func ByID

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

ByID orders the results by the id field.

func ByRole

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

ByRole orders the results by the role field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

type Role

type Role string

Role defines the type for the "role" enum field.

const (
	RoleAdmin Role = "admin"
	RoleUser  Role = "user"
)

Role values.

func (Role) String

func (r Role) String() string

Jump to

Keyboard shortcuts

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