subject

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the subject type in the database.
	Label = "subject"
	// 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"
	// FieldKind holds the string denoting the kind field in the database.
	FieldKind = "kind"
	// FieldDomain holds the string denoting the domain field in the database.
	FieldDomain = "domain"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldDescription holds the string denoting the description field in the database.
	FieldDescription = "description"
	// FieldBuiltin holds the string denoting the builtin field in the database.
	FieldBuiltin = "builtin"
	// EdgeTokens holds the string denoting the tokens edge name in mutations.
	EdgeTokens = "tokens"
	// EdgeRoles holds the string denoting the roles edge name in mutations.
	EdgeRoles = "roles"
	// Table holds the table name of the subject in the database.
	Table = "subjects"
	// TokensTable is the table that holds the tokens relation/edge.
	TokensTable = "tokens"
	// TokensInverseTable is the table name for the Token entity.
	// It exists in this package in order to avoid circular dependency with the "token" package.
	TokensInverseTable = "tokens"
	// TokensColumn is the table column denoting the tokens relation/edge.
	TokensColumn = "subject_id"
	// RolesTable is the table that holds the roles relation/edge.
	RolesTable = "subject_role_relationships"
	// RolesInverseTable is the table name for the SubjectRoleRelationship entity.
	// It exists in this package in order to avoid circular dependency with the "subjectrolerelationship" package.
	RolesInverseTable = "subject_role_relationships"
	// RolesColumn is the table column denoting the roles relation/edge.
	RolesColumn = "subject_id"
)

Variables

View Source
var (
	Hooks [1]ent.Hook
	// 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
	// DefaultKind holds the default value on creation for the "kind" field.
	DefaultKind string
	// DefaultDomain holds the default value on creation for the "domain" field.
	DefaultDomain string
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// DefaultBuiltin holds the default value on creation for the "builtin" field.
	DefaultBuiltin bool
)

Note that the variables below are initialized by the runtime package on the initialization of the application. Therefore, it should be imported in the main as follows:

import _ "github.com/seal-io/walrus/pkg/dao/model/runtime"

Columns holds all SQL columns for subject fields.

Functions

func And

func And(predicates ...predicate.Subject) predicate.Subject

And groups predicates with the AND operator between them.

func Builtin

func Builtin(v bool) predicate.Subject

Builtin applies equality check predicate on the "builtin" field. It's identical to BuiltinEQ.

func BuiltinEQ

func BuiltinEQ(v bool) predicate.Subject

BuiltinEQ applies the EQ predicate on the "builtin" field.

func BuiltinNEQ

func BuiltinNEQ(v bool) predicate.Subject

BuiltinNEQ applies the NEQ predicate on the "builtin" field.

func CreateTime

func CreateTime(v time.Time) predicate.Subject

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

func CreateTimeEQ

func CreateTimeEQ(v time.Time) predicate.Subject

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

func CreateTimeGT

func CreateTimeGT(v time.Time) predicate.Subject

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

func CreateTimeGTE

func CreateTimeGTE(v time.Time) predicate.Subject

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

func CreateTimeIn

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

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

func CreateTimeLT

func CreateTimeLT(v time.Time) predicate.Subject

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

func CreateTimeLTE

func CreateTimeLTE(v time.Time) predicate.Subject

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

func CreateTimeNEQ

func CreateTimeNEQ(v time.Time) predicate.Subject

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

func CreateTimeNotIn

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

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

func Description

func Description(v string) predicate.Subject

Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ.

func DescriptionContains

func DescriptionContains(v string) predicate.Subject

DescriptionContains applies the Contains predicate on the "description" field.

func DescriptionContainsFold

func DescriptionContainsFold(v string) predicate.Subject

DescriptionContainsFold applies the ContainsFold predicate on the "description" field.

func DescriptionEQ

func DescriptionEQ(v string) predicate.Subject

DescriptionEQ applies the EQ predicate on the "description" field.

func DescriptionEqualFold

func DescriptionEqualFold(v string) predicate.Subject

DescriptionEqualFold applies the EqualFold predicate on the "description" field.

func DescriptionGT

func DescriptionGT(v string) predicate.Subject

DescriptionGT applies the GT predicate on the "description" field.

func DescriptionGTE

func DescriptionGTE(v string) predicate.Subject

DescriptionGTE applies the GTE predicate on the "description" field.

func DescriptionHasPrefix

func DescriptionHasPrefix(v string) predicate.Subject

DescriptionHasPrefix applies the HasPrefix predicate on the "description" field.

func DescriptionHasSuffix

func DescriptionHasSuffix(v string) predicate.Subject

DescriptionHasSuffix applies the HasSuffix predicate on the "description" field.

func DescriptionIn

func DescriptionIn(vs ...string) predicate.Subject

DescriptionIn applies the In predicate on the "description" field.

func DescriptionIsNil

func DescriptionIsNil() predicate.Subject

DescriptionIsNil applies the IsNil predicate on the "description" field.

func DescriptionLT

func DescriptionLT(v string) predicate.Subject

DescriptionLT applies the LT predicate on the "description" field.

func DescriptionLTE

func DescriptionLTE(v string) predicate.Subject

DescriptionLTE applies the LTE predicate on the "description" field.

func DescriptionNEQ

func DescriptionNEQ(v string) predicate.Subject

DescriptionNEQ applies the NEQ predicate on the "description" field.

func DescriptionNotIn

func DescriptionNotIn(vs ...string) predicate.Subject

DescriptionNotIn applies the NotIn predicate on the "description" field.

func DescriptionNotNil

func DescriptionNotNil() predicate.Subject

DescriptionNotNil applies the NotNil predicate on the "description" field.

func Domain

func Domain(v string) predicate.Subject

Domain applies equality check predicate on the "domain" field. It's identical to DomainEQ.

func DomainContains

func DomainContains(v string) predicate.Subject

DomainContains applies the Contains predicate on the "domain" field.

func DomainContainsFold

func DomainContainsFold(v string) predicate.Subject

DomainContainsFold applies the ContainsFold predicate on the "domain" field.

func DomainEQ

func DomainEQ(v string) predicate.Subject

DomainEQ applies the EQ predicate on the "domain" field.

func DomainEqualFold

func DomainEqualFold(v string) predicate.Subject

DomainEqualFold applies the EqualFold predicate on the "domain" field.

func DomainGT

func DomainGT(v string) predicate.Subject

DomainGT applies the GT predicate on the "domain" field.

func DomainGTE

func DomainGTE(v string) predicate.Subject

DomainGTE applies the GTE predicate on the "domain" field.

func DomainHasPrefix

func DomainHasPrefix(v string) predicate.Subject

DomainHasPrefix applies the HasPrefix predicate on the "domain" field.

func DomainHasSuffix

func DomainHasSuffix(v string) predicate.Subject

DomainHasSuffix applies the HasSuffix predicate on the "domain" field.

func DomainIn

func DomainIn(vs ...string) predicate.Subject

DomainIn applies the In predicate on the "domain" field.

func DomainLT

func DomainLT(v string) predicate.Subject

DomainLT applies the LT predicate on the "domain" field.

func DomainLTE

func DomainLTE(v string) predicate.Subject

DomainLTE applies the LTE predicate on the "domain" field.

func DomainNEQ

func DomainNEQ(v string) predicate.Subject

DomainNEQ applies the NEQ predicate on the "domain" field.

func DomainNotIn

func DomainNotIn(vs ...string) predicate.Subject

DomainNotIn applies the NotIn predicate on the "domain" field.

func HasRoles

func HasRoles() predicate.Subject

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

func HasRolesWith

func HasRolesWith(preds ...predicate.SubjectRoleRelationship) predicate.Subject

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

func HasTokens

func HasTokens() predicate.Subject

HasTokens applies the HasEdge predicate on the "tokens" edge.

func HasTokensWith

func HasTokensWith(preds ...predicate.Token) predicate.Subject

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

func ID

func ID(id object.ID) predicate.Subject

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id object.ID) predicate.Subject

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id object.ID) predicate.Subject

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id object.ID) predicate.Subject

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...object.ID) predicate.Subject

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id object.ID) predicate.Subject

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id object.ID) predicate.Subject

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id object.ID) predicate.Subject

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...object.ID) predicate.Subject

IDNotIn applies the NotIn predicate on the ID field.

func Kind

func Kind(v string) predicate.Subject

Kind applies equality check predicate on the "kind" field. It's identical to KindEQ.

func KindContains

func KindContains(v string) predicate.Subject

KindContains applies the Contains predicate on the "kind" field.

func KindContainsFold

func KindContainsFold(v string) predicate.Subject

KindContainsFold applies the ContainsFold predicate on the "kind" field.

func KindEQ

func KindEQ(v string) predicate.Subject

KindEQ applies the EQ predicate on the "kind" field.

func KindEqualFold

func KindEqualFold(v string) predicate.Subject

KindEqualFold applies the EqualFold predicate on the "kind" field.

func KindGT

func KindGT(v string) predicate.Subject

KindGT applies the GT predicate on the "kind" field.

func KindGTE

func KindGTE(v string) predicate.Subject

KindGTE applies the GTE predicate on the "kind" field.

func KindHasPrefix

func KindHasPrefix(v string) predicate.Subject

KindHasPrefix applies the HasPrefix predicate on the "kind" field.

func KindHasSuffix

func KindHasSuffix(v string) predicate.Subject

KindHasSuffix applies the HasSuffix predicate on the "kind" field.

func KindIn

func KindIn(vs ...string) predicate.Subject

KindIn applies the In predicate on the "kind" field.

func KindLT

func KindLT(v string) predicate.Subject

KindLT applies the LT predicate on the "kind" field.

func KindLTE

func KindLTE(v string) predicate.Subject

KindLTE applies the LTE predicate on the "kind" field.

func KindNEQ

func KindNEQ(v string) predicate.Subject

KindNEQ applies the NEQ predicate on the "kind" field.

func KindNotIn

func KindNotIn(vs ...string) predicate.Subject

KindNotIn applies the NotIn predicate on the "kind" field.

func Name

func Name(v string) predicate.Subject

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

func NameContains

func NameContains(v string) predicate.Subject

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

func NameContainsFold

func NameContainsFold(v string) predicate.Subject

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

func NameEQ

func NameEQ(v string) predicate.Subject

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

func NameEqualFold

func NameEqualFold(v string) predicate.Subject

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

func NameGT

func NameGT(v string) predicate.Subject

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

func NameGTE

func NameGTE(v string) predicate.Subject

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Subject

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Subject

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Subject

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

func NameLTE

func NameLTE(v string) predicate.Subject

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

func NameNEQ

func NameNEQ(v string) predicate.Subject

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

func NameNotIn

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

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

Or groups predicates with the OR operator between them.

func UpdateTime

func UpdateTime(v time.Time) predicate.Subject

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

func UpdateTimeEQ

func UpdateTimeEQ(v time.Time) predicate.Subject

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

func UpdateTimeGT

func UpdateTimeGT(v time.Time) predicate.Subject

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

func UpdateTimeGTE

func UpdateTimeGTE(v time.Time) predicate.Subject

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

func UpdateTimeIn

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

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

func UpdateTimeLT

func UpdateTimeLT(v time.Time) predicate.Subject

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

func UpdateTimeLTE

func UpdateTimeLTE(v time.Time) predicate.Subject

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

func UpdateTimeNEQ

func UpdateTimeNEQ(v time.Time) predicate.Subject

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

func UpdateTimeNotIn

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

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

func WithoutFields

func WithoutFields(ignores ...string) []string

WithoutFields returns the fields ignored the given list.

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Subject queries.

func ByBuiltin

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

ByBuiltin orders the results by the builtin field.

func ByCreateTime

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

ByCreateTime orders the results by the create_time field.

func ByDescription

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

ByDescription orders the results by the description field.

func ByDomain

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

ByDomain orders the results by the domain field.

func ByID

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

ByID orders the results by the id field.

func ByKind

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

ByKind orders the results by the kind field.

func ByName

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

ByName orders the results by the name 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 ByTokens

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

ByTokens orders the results by tokens terms.

func ByTokensCount

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

ByTokensCount orders the results by tokens count.

func ByUpdateTime

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

ByUpdateTime orders the results by the update_time field.

Jump to

Keyboard shortcuts

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