role

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the role type in the database.
	Label = "role"
	// 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"
	// 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"
	// 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"
	// EdgeAdminUserRoles holds the string denoting the admin_user_roles edge name in mutations.
	EdgeAdminUserRoles = "admin_user_roles"
	// EdgeUserRoles holds the string denoting the user_roles edge name in mutations.
	EdgeUserRoles = "user_roles"
	// EdgePermissions holds the string denoting the permissions edge name in mutations.
	EdgePermissions = "permissions"
	// Table holds the table name of the role in the database.
	Table = "roles"
	// AdminCreatedByTable is the table that holds the admin_created_by relation/edge.
	AdminCreatedByTable = "roles"
	// 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 = "role_admin_created_by"
	// AdminUpdatedByTable is the table that holds the admin_updated_by relation/edge.
	AdminUpdatedByTable = "roles"
	// 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 = "role_admin_updated_by"
	// AdminUserRolesTable is the table that holds the admin_user_roles relation/edge. The primary key declared below.
	AdminUserRolesTable = "admin_user_roles"
	// AdminUserRolesInverseTable is the table name for the AdminUser entity.
	// It exists in this package in order to avoid circular dependency with the "adminuser" package.
	AdminUserRolesInverseTable = "admin_users"
	// UserRolesTable is the table that holds the user_roles relation/edge. The primary key declared below.
	UserRolesTable = "user_roles"
	// UserRolesInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	UserRolesInverseTable = "users"
	// PermissionsTable is the table that holds the permissions relation/edge.
	PermissionsTable = "permissions"
	// PermissionsInverseTable is the table name for the Permission entity.
	// It exists in this package in order to avoid circular dependency with the "permission" package.
	PermissionsInverseTable = "permissions"
	// PermissionsColumn is the table column denoting the permissions relation/edge.
	PermissionsColumn = "permission_role"
)

Variables

View Source
var (
	// AdminUserRolesPrimaryKey and AdminUserRolesColumn2 are the table columns denoting the
	// primary key for the admin_user_roles relation (M2M).
	AdminUserRolesPrimaryKey = []string{"admin_user_id", "role_id"}
	// UserRolesPrimaryKey and UserRolesColumn2 are the table columns denoting the
	// primary key for the user_roles relation (M2M).
	UserRolesPrimaryKey = []string{"user_id", "role_id"}
)
View Source
var (
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// 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
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() string
)

Columns holds all SQL columns for role fields.

View Source
var ForeignKeys = []string{
	"role_admin_created_by",
	"role_admin_updated_by",
}

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

Functions

func And

func And(predicates ...predicate.Role) predicate.Role

And groups predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.Role

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Role

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Role

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Role

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

func CreatedAtIn

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

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

func CreatedAtIsNil

func CreatedAtIsNil() predicate.Role

CreatedAtIsNil applies the IsNil predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Role

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Role

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Role

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

func CreatedAtNotIn

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

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

func CreatedAtNotNil

func CreatedAtNotNil() predicate.Role

CreatedAtNotNil applies the NotNil predicate on the "created_at" field.

func HasAdminCreatedBy

func HasAdminCreatedBy() predicate.Role

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

func HasAdminCreatedByWith

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

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

func HasAdminUpdatedBy

func HasAdminUpdatedBy() predicate.Role

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

func HasAdminUpdatedByWith

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

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

func HasAdminUserRoles

func HasAdminUserRoles() predicate.Role

HasAdminUserRoles applies the HasEdge predicate on the "admin_user_roles" edge.

func HasAdminUserRolesWith

func HasAdminUserRolesWith(preds ...predicate.AdminUser) predicate.Role

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

func HasPermissions

func HasPermissions() predicate.Role

HasPermissions applies the HasEdge predicate on the "permissions" edge.

func HasPermissionsWith

func HasPermissionsWith(preds ...predicate.Permission) predicate.Role

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

func HasUserRoles

func HasUserRoles() predicate.Role

HasUserRoles applies the HasEdge predicate on the "user_roles" edge.

func HasUserRolesWith

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

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

func ID

func ID(id string) predicate.Role

ID filters vertices based on their ID field.

func IDContainsFold

func IDContainsFold(id string) predicate.Role

IDContainsFold applies the ContainsFold predicate on the ID field.

func IDEQ

func IDEQ(id string) predicate.Role

IDEQ applies the EQ predicate on the ID field.

func IDEqualFold

func IDEqualFold(id string) predicate.Role

IDEqualFold applies the EqualFold predicate on the ID field.

func IDGT

func IDGT(id string) predicate.Role

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id string) predicate.Role

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id string) predicate.Role

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id string) predicate.Role

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id string) predicate.Role

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.Role

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

func NameContains

func NameContains(v string) predicate.Role

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

func NameContainsFold

func NameContainsFold(v string) predicate.Role

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

func NameEQ

func NameEQ(v string) predicate.Role

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

func NameEqualFold

func NameEqualFold(v string) predicate.Role

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

func NameGT

func NameGT(v string) predicate.Role

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

func NameGTE

func NameGTE(v string) predicate.Role

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Role

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Role

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Role

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

func NameLTE

func NameLTE(v string) predicate.Role

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

func NameNEQ

func NameNEQ(v string) predicate.Role

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

func NameNotIn

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

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.Role) predicate.Role

Or groups predicates with the OR operator between them.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Role

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Role

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Role

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Role

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

func UpdatedAtIn

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

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

func UpdatedAtIsNil

func UpdatedAtIsNil() predicate.Role

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Role

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Role

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Role

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

func UpdatedAtNotIn

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

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

func UpdatedAtNotNil

func UpdatedAtNotNil() predicate.Role

UpdatedAtNotNil applies the NotNil 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 Role 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 ByAdminUserRoles

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

ByAdminUserRoles orders the results by admin_user_roles terms.

func ByAdminUserRolesCount

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

ByAdminUserRolesCount orders the results by admin_user_roles count.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at 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 ByPermissions

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

ByPermissions orders the results by permissions terms.

func ByPermissionsCount

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

ByPermissionsCount orders the results by permissions count.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

func ByUserRoles

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

ByUserRoles orders the results by user_roles terms.

func ByUserRolesCount

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

ByUserRolesCount orders the results by user_roles count.

Jump to

Keyboard shortcuts

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