permission

package
v0.0.0-...-2d29f82 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the permission type in the database.
	Label = "permission"
	// 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"
	// FieldParentID holds the string denoting the parent_id field in the database.
	FieldParentID = "parent_id"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldKey holds the string denoting the key field in the database.
	FieldKey = "key"
	// FieldType holds the string denoting the type field in the database.
	FieldType = "type"
	// FieldPath holds the string denoting the path field in the database.
	FieldPath = "path"
	// FieldDesc holds the string denoting the desc field in the database.
	FieldDesc = "desc"
	// FieldSort holds the string denoting the sort field in the database.
	FieldSort = "sort"
	// FieldAttrs holds the string denoting the attrs field in the database.
	FieldAttrs = "attrs"
	// EdgeRoles holds the string denoting the roles edge name in mutations.
	EdgeRoles = "roles"
	// EdgeParent holds the string denoting the parent edge name in mutations.
	EdgeParent = "parent"
	// EdgeChildren holds the string denoting the children edge name in mutations.
	EdgeChildren = "children"
	// Table holds the table name of the permission in the database.
	Table = "permissions"
	// RolesTable is the table that holds the roles relation/edge. The primary key declared below.
	RolesTable = "role_permissions"
	// 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"
	// ParentTable is the table that holds the parent relation/edge.
	ParentTable = "permissions"
	// ParentColumn is the table column denoting the parent relation/edge.
	ParentColumn = "parent_id"
	// ChildrenTable is the table that holds the children relation/edge.
	ChildrenTable = "permissions"
	// ChildrenColumn is the table column denoting the children relation/edge.
	ChildrenColumn = "parent_id"
)

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
	// DefaultSort holds the default value on creation for the "sort" field.
	DefaultSort int
)

Columns holds all SQL columns for permission fields.

View Source
var (
	// RolesPrimaryKey and RolesColumn2 are the table columns denoting the
	// primary key for the roles relation (M2M).
	RolesPrimaryKey = []string{"role_id", "permission_id"}
)

Functions

func And

func And(predicates ...predicate.Permission) predicate.Permission

And groups predicates with the AND operator between them.

func AttrsIsNil

func AttrsIsNil() predicate.Permission

AttrsIsNil applies the IsNil predicate on the "attrs" field.

func AttrsNotNil

func AttrsNotNil() predicate.Permission

AttrsNotNil applies the NotNil predicate on the "attrs" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Permission

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Permission

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Permission

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Permission

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

func CreatedAtIn

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

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

func CreatedAtIsNil

func CreatedAtIsNil() predicate.Permission

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Permission

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Permission

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Permission

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

func CreatedAtNotIn

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

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

func CreatedAtNotNil

func CreatedAtNotNil() predicate.Permission

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

func Desc

func Desc(v string) predicate.Permission

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

func DescContains

func DescContains(v string) predicate.Permission

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

func DescContainsFold

func DescContainsFold(v string) predicate.Permission

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

func DescEQ

func DescEQ(v string) predicate.Permission

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

func DescEqualFold

func DescEqualFold(v string) predicate.Permission

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

func DescGT

func DescGT(v string) predicate.Permission

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

func DescGTE

func DescGTE(v string) predicate.Permission

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

func DescHasPrefix

func DescHasPrefix(v string) predicate.Permission

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

func DescHasSuffix

func DescHasSuffix(v string) predicate.Permission

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

func DescIn

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

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

func DescIsNil

func DescIsNil() predicate.Permission

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

func DescLT

func DescLT(v string) predicate.Permission

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

func DescLTE

func DescLTE(v string) predicate.Permission

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

func DescNEQ

func DescNEQ(v string) predicate.Permission

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

func DescNotIn

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

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

func DescNotNil

func DescNotNil() predicate.Permission

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

func HasChildren

func HasChildren() predicate.Permission

HasChildren applies the HasEdge predicate on the "children" edge.

func HasChildrenWith

func HasChildrenWith(preds ...predicate.Permission) predicate.Permission

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

func HasParent

func HasParent() predicate.Permission

HasParent applies the HasEdge predicate on the "parent" edge.

func HasParentWith

func HasParentWith(preds ...predicate.Permission) predicate.Permission

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

func HasRoles

func HasRoles() predicate.Permission

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

func HasRolesWith

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

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

func ID

func ID(id int) predicate.Permission

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Permission

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Permission

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Permission

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.Permission

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Permission

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Permission

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Permission

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.Permission

IDNotIn applies the NotIn predicate on the ID field.

func Key

Key applies equality check predicate on the "key" field. It's identical to KeyEQ.

func KeyContains

func KeyContains(v string) predicate.Permission

KeyContains applies the Contains predicate on the "key" field.

func KeyContainsFold

func KeyContainsFold(v string) predicate.Permission

KeyContainsFold applies the ContainsFold predicate on the "key" field.

func KeyEQ

func KeyEQ(v string) predicate.Permission

KeyEQ applies the EQ predicate on the "key" field.

func KeyEqualFold

func KeyEqualFold(v string) predicate.Permission

KeyEqualFold applies the EqualFold predicate on the "key" field.

func KeyGT

func KeyGT(v string) predicate.Permission

KeyGT applies the GT predicate on the "key" field.

func KeyGTE

func KeyGTE(v string) predicate.Permission

KeyGTE applies the GTE predicate on the "key" field.

func KeyHasPrefix

func KeyHasPrefix(v string) predicate.Permission

KeyHasPrefix applies the HasPrefix predicate on the "key" field.

func KeyHasSuffix

func KeyHasSuffix(v string) predicate.Permission

KeyHasSuffix applies the HasSuffix predicate on the "key" field.

func KeyIn

func KeyIn(vs ...string) predicate.Permission

KeyIn applies the In predicate on the "key" field.

func KeyIsNil

func KeyIsNil() predicate.Permission

KeyIsNil applies the IsNil predicate on the "key" field.

func KeyLT

func KeyLT(v string) predicate.Permission

KeyLT applies the LT predicate on the "key" field.

func KeyLTE

func KeyLTE(v string) predicate.Permission

KeyLTE applies the LTE predicate on the "key" field.

func KeyNEQ

func KeyNEQ(v string) predicate.Permission

KeyNEQ applies the NEQ predicate on the "key" field.

func KeyNotIn

func KeyNotIn(vs ...string) predicate.Permission

KeyNotIn applies the NotIn predicate on the "key" field.

func KeyNotNil

func KeyNotNil() predicate.Permission

KeyNotNil applies the NotNil predicate on the "key" field.

func Name

func Name(v string) predicate.Permission

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

func NameContains

func NameContains(v string) predicate.Permission

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

func NameContainsFold

func NameContainsFold(v string) predicate.Permission

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

func NameEQ

func NameEQ(v string) predicate.Permission

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

func NameEqualFold

func NameEqualFold(v string) predicate.Permission

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

func NameGT

func NameGT(v string) predicate.Permission

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

func NameGTE

func NameGTE(v string) predicate.Permission

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Permission

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Permission

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Permission

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

func NameLTE

func NameLTE(v string) predicate.Permission

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

func NameNEQ

func NameNEQ(v string) predicate.Permission

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

func NameNotIn

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

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

Or groups predicates with the OR operator between them.

func ParentID

func ParentID(v int) predicate.Permission

ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ.

func ParentIDEQ

func ParentIDEQ(v int) predicate.Permission

ParentIDEQ applies the EQ predicate on the "parent_id" field.

func ParentIDIn

func ParentIDIn(vs ...int) predicate.Permission

ParentIDIn applies the In predicate on the "parent_id" field.

func ParentIDIsNil

func ParentIDIsNil() predicate.Permission

ParentIDIsNil applies the IsNil predicate on the "parent_id" field.

func ParentIDNEQ

func ParentIDNEQ(v int) predicate.Permission

ParentIDNEQ applies the NEQ predicate on the "parent_id" field.

func ParentIDNotIn

func ParentIDNotIn(vs ...int) predicate.Permission

ParentIDNotIn applies the NotIn predicate on the "parent_id" field.

func ParentIDNotNil

func ParentIDNotNil() predicate.Permission

ParentIDNotNil applies the NotNil predicate on the "parent_id" field.

func Path

func Path(v string) predicate.Permission

Path applies equality check predicate on the "path" field. It's identical to PathEQ.

func PathContains

func PathContains(v string) predicate.Permission

PathContains applies the Contains predicate on the "path" field.

func PathContainsFold

func PathContainsFold(v string) predicate.Permission

PathContainsFold applies the ContainsFold predicate on the "path" field.

func PathEQ

func PathEQ(v string) predicate.Permission

PathEQ applies the EQ predicate on the "path" field.

func PathEqualFold

func PathEqualFold(v string) predicate.Permission

PathEqualFold applies the EqualFold predicate on the "path" field.

func PathGT

func PathGT(v string) predicate.Permission

PathGT applies the GT predicate on the "path" field.

func PathGTE

func PathGTE(v string) predicate.Permission

PathGTE applies the GTE predicate on the "path" field.

func PathHasPrefix

func PathHasPrefix(v string) predicate.Permission

PathHasPrefix applies the HasPrefix predicate on the "path" field.

func PathHasSuffix

func PathHasSuffix(v string) predicate.Permission

PathHasSuffix applies the HasSuffix predicate on the "path" field.

func PathIn

func PathIn(vs ...string) predicate.Permission

PathIn applies the In predicate on the "path" field.

func PathIsNil

func PathIsNil() predicate.Permission

PathIsNil applies the IsNil predicate on the "path" field.

func PathLT

func PathLT(v string) predicate.Permission

PathLT applies the LT predicate on the "path" field.

func PathLTE

func PathLTE(v string) predicate.Permission

PathLTE applies the LTE predicate on the "path" field.

func PathNEQ

func PathNEQ(v string) predicate.Permission

PathNEQ applies the NEQ predicate on the "path" field.

func PathNotIn

func PathNotIn(vs ...string) predicate.Permission

PathNotIn applies the NotIn predicate on the "path" field.

func PathNotNil

func PathNotNil() predicate.Permission

PathNotNil applies the NotNil predicate on the "path" field.

func Sort

func Sort(v int) predicate.Permission

Sort applies equality check predicate on the "sort" field. It's identical to SortEQ.

func SortEQ

func SortEQ(v int) predicate.Permission

SortEQ applies the EQ predicate on the "sort" field.

func SortGT

func SortGT(v int) predicate.Permission

SortGT applies the GT predicate on the "sort" field.

func SortGTE

func SortGTE(v int) predicate.Permission

SortGTE applies the GTE predicate on the "sort" field.

func SortIn

func SortIn(vs ...int) predicate.Permission

SortIn applies the In predicate on the "sort" field.

func SortLT

func SortLT(v int) predicate.Permission

SortLT applies the LT predicate on the "sort" field.

func SortLTE

func SortLTE(v int) predicate.Permission

SortLTE applies the LTE predicate on the "sort" field.

func SortNEQ

func SortNEQ(v int) predicate.Permission

SortNEQ applies the NEQ predicate on the "sort" field.

func SortNotIn

func SortNotIn(vs ...int) predicate.Permission

SortNotIn applies the NotIn predicate on the "sort" field.

func TypeEQ

func TypeEQ(v Type) predicate.Permission

TypeEQ applies the EQ predicate on the "type" field.

func TypeIn

func TypeIn(vs ...Type) predicate.Permission

TypeIn applies the In predicate on the "type" field.

func TypeNEQ

func TypeNEQ(v Type) predicate.Permission

TypeNEQ applies the NEQ predicate on the "type" field.

func TypeNotIn

func TypeNotIn(vs ...Type) predicate.Permission

TypeNotIn applies the NotIn predicate on the "type" field.

func TypeValidator

func TypeValidator(_type Type) error

TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Permission

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Permission

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Permission

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Permission

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

func UpdatedAtIn

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

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

func UpdatedAtIsNil

func UpdatedAtIsNil() predicate.Permission

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Permission

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Permission

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Permission

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

func UpdatedAtNotIn

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

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

func UpdatedAtNotNil

func UpdatedAtNotNil() predicate.Permission

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 Permission queries.

func ByChildren

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

ByChildren orders the results by children terms.

func ByChildrenCount

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

ByChildrenCount orders the results by children count.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at field.

func ByDesc

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

ByDesc orders the results by the desc field.

func ByID

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

ByID orders the results by the id field.

func ByKey

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

ByKey orders the results by the key field.

func ByName

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

ByName orders the results by the name field.

func ByParentField

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

ByParentField orders the results by parent field.

func ByParentID

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

ByParentID orders the results by the parent_id field.

func ByPath

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

ByPath orders the results by the path field.

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 BySort

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

BySort orders the results by the sort field.

func ByType

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

ByType orders the results by the type field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

type Type

type Type string

Type defines the type for the "type" enum field.

const (
	TypeMenu    Type = "menu"
	TypePage    Type = "page"
	TypeElement Type = "element"
)

Type values.

func (Type) MarshalGQL

func (e Type) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (Type) String

func (_type Type) String() string

func (*Type) UnmarshalGQL

func (e *Type) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

Jump to

Keyboard shortcuts

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