role

package
v0.0.0-...-a2c21a8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 5 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"
	// FieldCreateTime holds the string denoting the create_time field in the database.
	FieldCreateTime = "create_time"
	// FieldUpdateTime holds the string denoting the update_time field in the database.
	FieldUpdateTime = "update_time"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldDesc holds the string denoting the desc field in the database.
	FieldDesc = "desc"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// EdgePermissions holds the string denoting the permissions edge name in mutations.
	EdgePermissions = "permissions"
	// EdgeEmployees holds the string denoting the employees edge name in mutations.
	EdgeEmployees = "employees"
	// Table holds the table name of the role in the database.
	Table = "roles"
	// PermissionsTable is the table the holds the permissions relation/edge. The primary key declared below.
	PermissionsTable = "role_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"
	// EmployeesTable is the table the holds the employees relation/edge. The primary key declared below.
	EmployeesTable = "employee_roles"
	// EmployeesInverseTable is the table name for the Employee entity.
	// It exists in this package in order to avoid circular dependency with the "employee" package.
	EmployeesInverseTable = "employees"
)
View Source
const DefaultStatus = StatusOn

StatusOn is the default value of the Status enum.

Variables

View Source
var (
	// PermissionsPrimaryKey and PermissionsColumn2 are the table columns denoting the
	// primary key for the permissions relation (M2M).
	PermissionsPrimaryKey = []string{"role_id", "permission_id"}
	// EmployeesPrimaryKey and EmployeesColumn2 are the table columns denoting the
	// primary key for the employees relation (M2M).
	EmployeesPrimaryKey = []string{"employee_id", "role_id"}
)
View Source
var (
	// DefaultCreateTime holds the default value on creation for the "create_time" field.
	DefaultCreateTime func() time.Time
	// DefaultUpdateTime holds the default value on creation for the "update_time" field.
	DefaultUpdateTime func() time.Time
	// UpdateDefaultUpdateTime holds the default value on update for the "update_time" field.
	UpdateDefaultUpdateTime func() time.Time
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
)

Columns holds all SQL columns for role fields.

Functions

func And

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

And groups predicates with the AND operator between them.

func CreateTime

func CreateTime(v time.Time) predicate.Role

CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.

func CreateTimeEQ

func CreateTimeEQ(v time.Time) predicate.Role

CreateTimeEQ applies the EQ predicate on the "create_time" field.

func CreateTimeGT

func CreateTimeGT(v time.Time) predicate.Role

CreateTimeGT applies the GT predicate on the "create_time" field.

func CreateTimeGTE

func CreateTimeGTE(v time.Time) predicate.Role

CreateTimeGTE applies the GTE predicate on the "create_time" field.

func CreateTimeIn

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

CreateTimeIn applies the In predicate on the "create_time" field.

func CreateTimeLT

func CreateTimeLT(v time.Time) predicate.Role

CreateTimeLT applies the LT predicate on the "create_time" field.

func CreateTimeLTE

func CreateTimeLTE(v time.Time) predicate.Role

CreateTimeLTE applies the LTE predicate on the "create_time" field.

func CreateTimeNEQ

func CreateTimeNEQ(v time.Time) predicate.Role

CreateTimeNEQ applies the NEQ predicate on the "create_time" field.

func CreateTimeNotIn

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

CreateTimeNotIn applies the NotIn predicate on the "create_time" field.

func Desc

func Desc(v string) predicate.Role

Desc applies equality check predicate on the "desc" field. It's identical to DescEQ.

func DescContains

func DescContains(v string) predicate.Role

DescContains applies the Contains predicate on the "desc" field.

func DescContainsFold

func DescContainsFold(v string) predicate.Role

DescContainsFold applies the ContainsFold predicate on the "desc" field.

func DescEQ

func DescEQ(v string) predicate.Role

DescEQ applies the EQ predicate on the "desc" field.

func DescEqualFold

func DescEqualFold(v string) predicate.Role

DescEqualFold applies the EqualFold predicate on the "desc" field.

func DescGT

func DescGT(v string) predicate.Role

DescGT applies the GT predicate on the "desc" field.

func DescGTE

func DescGTE(v string) predicate.Role

DescGTE applies the GTE predicate on the "desc" field.

func DescHasPrefix

func DescHasPrefix(v string) predicate.Role

DescHasPrefix applies the HasPrefix predicate on the "desc" field.

func DescHasSuffix

func DescHasSuffix(v string) predicate.Role

DescHasSuffix applies the HasSuffix predicate on the "desc" field.

func DescIn

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

DescIn applies the In predicate on the "desc" field.

func DescIsNil

func DescIsNil() predicate.Role

DescIsNil applies the IsNil predicate on the "desc" field.

func DescLT

func DescLT(v string) predicate.Role

DescLT applies the LT predicate on the "desc" field.

func DescLTE

func DescLTE(v string) predicate.Role

DescLTE applies the LTE predicate on the "desc" field.

func DescNEQ

func DescNEQ(v string) predicate.Role

DescNEQ applies the NEQ predicate on the "desc" field.

func DescNotIn

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

DescNotIn applies the NotIn predicate on the "desc" field.

func DescNotNil

func DescNotNil() predicate.Role

DescNotNil applies the NotNil predicate on the "desc" field.

func HasEmployees

func HasEmployees() predicate.Role

HasEmployees applies the HasEdge predicate on the "employees" edge.

func HasEmployeesWith

func HasEmployeesWith(preds ...predicate.Employee) predicate.Role

HasEmployeesWith applies the HasEdge predicate on the "employees" 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 ID

func ID(id int64) predicate.Role

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int64) predicate.Role

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int64) predicate.Role

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int64) predicate.Role

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int64) predicate.Role

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int64) predicate.Role

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int64) predicate.Role

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int64) 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 StatusEQ

func StatusEQ(v Status) predicate.Role

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

func StatusIn

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

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

func StatusIsNil

func StatusIsNil() predicate.Role

StatusIsNil applies the IsNil predicate on the "status" field.

func StatusNEQ

func StatusNEQ(v Status) predicate.Role

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

func StatusNotIn

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

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

func StatusNotNil

func StatusNotNil() predicate.Role

StatusNotNil applies the NotNil 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 UpdateTime

func UpdateTime(v time.Time) predicate.Role

UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ.

func UpdateTimeEQ

func UpdateTimeEQ(v time.Time) predicate.Role

UpdateTimeEQ applies the EQ predicate on the "update_time" field.

func UpdateTimeGT

func UpdateTimeGT(v time.Time) predicate.Role

UpdateTimeGT applies the GT predicate on the "update_time" field.

func UpdateTimeGTE

func UpdateTimeGTE(v time.Time) predicate.Role

UpdateTimeGTE applies the GTE predicate on the "update_time" field.

func UpdateTimeIn

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

UpdateTimeIn applies the In predicate on the "update_time" field.

func UpdateTimeLT

func UpdateTimeLT(v time.Time) predicate.Role

UpdateTimeLT applies the LT predicate on the "update_time" field.

func UpdateTimeLTE

func UpdateTimeLTE(v time.Time) predicate.Role

UpdateTimeLTE applies the LTE predicate on the "update_time" field.

func UpdateTimeNEQ

func UpdateTimeNEQ(v time.Time) predicate.Role

UpdateTimeNEQ applies the NEQ predicate on the "update_time" field.

func UpdateTimeNotIn

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

UpdateTimeNotIn applies the NotIn predicate on the "update_time" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type Status

type Status string

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

const (
	StatusOff Status = "Off"
	StatusOn  Status = "On"
)

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