resource

package
v0.0.0-...-1cc1a95 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the resource type in the database.
	Label = "resource"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldResourceName holds the string denoting the resource_name field in the database.
	FieldResourceName = "resource_name"
	// FieldResourceValue holds the string denoting the resource_value field in the database.
	FieldResourceValue = "resource_value"
	// EdgeRole holds the string denoting the role edge name in mutations.
	EdgeRole = "role"
	// EdgeUser holds the string denoting the user edge name in mutations.
	EdgeUser = "user"
	// EdgeAuthorization holds the string denoting the authorization edge name in mutations.
	EdgeAuthorization = "authorization"
	// Table holds the table name of the resource in the database.
	Table = "resources"
	// RoleTable is the table that holds the role relation/edge. The primary key declared below.
	RoleTable = "role_resource"
	// RoleInverseTable is the table name for the Role entity.
	// It exists in this package in order to avoid circular dependency with the "role" package.
	RoleInverseTable = "roles"
	// UserTable is the table that holds the user relation/edge. The primary key declared below.
	UserTable = "user_resource"
	// UserInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	UserInverseTable = "users"
	// AuthorizationTable is the table that holds the authorization relation/edge. The primary key declared below.
	AuthorizationTable = "authorization_resource"
	// AuthorizationInverseTable is the table name for the Authorization entity.
	// It exists in this package in order to avoid circular dependency with the "authorization" package.
	AuthorizationInverseTable = "authorizations"
)

Variables

View Source
var (
	// RolePrimaryKey and RoleColumn2 are the table columns denoting the
	// primary key for the role relation (M2M).
	RolePrimaryKey = []string{"role_id", "resource_id"}
	// UserPrimaryKey and UserColumn2 are the table columns denoting the
	// primary key for the user relation (M2M).
	UserPrimaryKey = []string{"user_id", "resource_id"}
	// AuthorizationPrimaryKey and AuthorizationColumn2 are the table columns denoting the
	// primary key for the authorization relation (M2M).
	AuthorizationPrimaryKey = []string{"authorization_id", "resource_id"}
)
View Source
var (
	// ResourceNameValidator is a validator for the "resource_name" field. It is called by the builders before save.
	ResourceNameValidator func(string) error
	// ResourceValueValidator is a validator for the "resource_value" field. It is called by the builders before save.
	ResourceValueValidator func(string) error
)

Columns holds all SQL columns for resource fields.

Functions

func And

func And(predicates ...predicate.Resource) predicate.Resource

And groups predicates with the AND operator between them.

func HasAuthorization

func HasAuthorization() predicate.Resource

HasAuthorization applies the HasEdge predicate on the "authorization" edge.

func HasAuthorizationWith

func HasAuthorizationWith(preds ...predicate.Authorization) predicate.Resource

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

func HasRole

func HasRole() predicate.Resource

HasRole applies the HasEdge predicate on the "role" edge.

func HasRoleWith

func HasRoleWith(preds ...predicate.Role) predicate.Resource

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

func HasUser

func HasUser() predicate.Resource

HasUser applies the HasEdge predicate on the "user" edge.

func HasUserWith

func HasUserWith(preds ...predicate.User) predicate.Resource

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

func ID

func ID(id int) predicate.Resource

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Resource

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Resource

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Resource

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Resource

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Resource

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Resource

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

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

Or groups predicates with the OR operator between them.

func ResourceName

func ResourceName(v string) predicate.Resource

ResourceName applies equality check predicate on the "resource_name" field. It's identical to ResourceNameEQ.

func ResourceNameContains

func ResourceNameContains(v string) predicate.Resource

ResourceNameContains applies the Contains predicate on the "resource_name" field.

func ResourceNameContainsFold

func ResourceNameContainsFold(v string) predicate.Resource

ResourceNameContainsFold applies the ContainsFold predicate on the "resource_name" field.

func ResourceNameEQ

func ResourceNameEQ(v string) predicate.Resource

ResourceNameEQ applies the EQ predicate on the "resource_name" field.

func ResourceNameEqualFold

func ResourceNameEqualFold(v string) predicate.Resource

ResourceNameEqualFold applies the EqualFold predicate on the "resource_name" field.

func ResourceNameGT

func ResourceNameGT(v string) predicate.Resource

ResourceNameGT applies the GT predicate on the "resource_name" field.

func ResourceNameGTE

func ResourceNameGTE(v string) predicate.Resource

ResourceNameGTE applies the GTE predicate on the "resource_name" field.

func ResourceNameHasPrefix

func ResourceNameHasPrefix(v string) predicate.Resource

ResourceNameHasPrefix applies the HasPrefix predicate on the "resource_name" field.

func ResourceNameHasSuffix

func ResourceNameHasSuffix(v string) predicate.Resource

ResourceNameHasSuffix applies the HasSuffix predicate on the "resource_name" field.

func ResourceNameIn

func ResourceNameIn(vs ...string) predicate.Resource

ResourceNameIn applies the In predicate on the "resource_name" field.

func ResourceNameLT

func ResourceNameLT(v string) predicate.Resource

ResourceNameLT applies the LT predicate on the "resource_name" field.

func ResourceNameLTE

func ResourceNameLTE(v string) predicate.Resource

ResourceNameLTE applies the LTE predicate on the "resource_name" field.

func ResourceNameNEQ

func ResourceNameNEQ(v string) predicate.Resource

ResourceNameNEQ applies the NEQ predicate on the "resource_name" field.

func ResourceNameNotIn

func ResourceNameNotIn(vs ...string) predicate.Resource

ResourceNameNotIn applies the NotIn predicate on the "resource_name" field.

func ResourceValue

func ResourceValue(v string) predicate.Resource

ResourceValue applies equality check predicate on the "resource_value" field. It's identical to ResourceValueEQ.

func ResourceValueContains

func ResourceValueContains(v string) predicate.Resource

ResourceValueContains applies the Contains predicate on the "resource_value" field.

func ResourceValueContainsFold

func ResourceValueContainsFold(v string) predicate.Resource

ResourceValueContainsFold applies the ContainsFold predicate on the "resource_value" field.

func ResourceValueEQ

func ResourceValueEQ(v string) predicate.Resource

ResourceValueEQ applies the EQ predicate on the "resource_value" field.

func ResourceValueEqualFold

func ResourceValueEqualFold(v string) predicate.Resource

ResourceValueEqualFold applies the EqualFold predicate on the "resource_value" field.

func ResourceValueGT

func ResourceValueGT(v string) predicate.Resource

ResourceValueGT applies the GT predicate on the "resource_value" field.

func ResourceValueGTE

func ResourceValueGTE(v string) predicate.Resource

ResourceValueGTE applies the GTE predicate on the "resource_value" field.

func ResourceValueHasPrefix

func ResourceValueHasPrefix(v string) predicate.Resource

ResourceValueHasPrefix applies the HasPrefix predicate on the "resource_value" field.

func ResourceValueHasSuffix

func ResourceValueHasSuffix(v string) predicate.Resource

ResourceValueHasSuffix applies the HasSuffix predicate on the "resource_value" field.

func ResourceValueIn

func ResourceValueIn(vs ...string) predicate.Resource

ResourceValueIn applies the In predicate on the "resource_value" field.

func ResourceValueLT

func ResourceValueLT(v string) predicate.Resource

ResourceValueLT applies the LT predicate on the "resource_value" field.

func ResourceValueLTE

func ResourceValueLTE(v string) predicate.Resource

ResourceValueLTE applies the LTE predicate on the "resource_value" field.

func ResourceValueNEQ

func ResourceValueNEQ(v string) predicate.Resource

ResourceValueNEQ applies the NEQ predicate on the "resource_value" field.

func ResourceValueNotIn

func ResourceValueNotIn(vs ...string) predicate.Resource

ResourceValueNotIn applies the NotIn predicate on the "resource_value" field.

func ValidColumn

func ValidColumn(column string) bool

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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