token

package
v0.0.0-...-83be90a Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the token type in the database.
	Label = "token"
	// FieldID holds the string denoting the id field in the database.
	FieldID          = "id"          // FieldName holds the string denoting the name vertex property in the database.
	FieldName        = "name"        // FieldSecret holds the string denoting the secret vertex property in the database.
	FieldSecret      = "secret"      // FieldPermissions holds the string denoting the permissions vertex property in the database.
	FieldPermissions = "permissions" // FieldCreatedAt holds the string denoting the created_at vertex property in the database.
	FieldCreatedAt   = "created_at"  // FieldLastUsed holds the string denoting the last_used vertex property in the database.
	FieldLastUsed    = "last_used"

	// EdgeUser holds the string denoting the user edge name in mutations.
	EdgeUser = "user"

	// Table holds the table name of the token in the database.
	Table = "tokens"
	// UserTable is the table the holds the user relation/edge.
	UserTable = "tokens"
	// 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"
	// UserColumn is the table column denoting the user relation/edge.
	UserColumn = "user_tokens"
)
View Source
const DefaultPermissions = PermissionsReadWrite

PermissionsReadWrite is the default Permissions.

Variables

View Source
var (
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// SecretValidator is a validator for the "secret" field. It is called by the builders before save.
	SecretValidator func(string) error
	// DefaultCreatedAt holds the default value on creation for the created_at field.
	DefaultCreatedAt func() time.Time
)

Columns holds all SQL columns for token fields.

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

ForeignKeys holds the SQL foreign-keys that are owned by the Token type.

Functions

func And

func And(predicates ...predicate.Token) predicate.Token

And groups list of predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.Token

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Token

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Token

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Token

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Token

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Token

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Token

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

func CreatedAtNotIn

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

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

func HasUser

func HasUser() predicate.Token

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

func HasUserWith

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

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

func ID

func ID(id uuid.UUID) predicate.Token

ID filters vertices based on their identifier.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Token

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Token

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Token

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...uuid.UUID) predicate.Token

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Token

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Token

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Token

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...uuid.UUID) predicate.Token

IDNotIn applies the NotIn predicate on the ID field.

func LastUsed

func LastUsed(v time.Time) predicate.Token

LastUsed applies equality check predicate on the "last_used" field. It's identical to LastUsedEQ.

func LastUsedEQ

func LastUsedEQ(v time.Time) predicate.Token

LastUsedEQ applies the EQ predicate on the "last_used" field.

func LastUsedGT

func LastUsedGT(v time.Time) predicate.Token

LastUsedGT applies the GT predicate on the "last_used" field.

func LastUsedGTE

func LastUsedGTE(v time.Time) predicate.Token

LastUsedGTE applies the GTE predicate on the "last_used" field.

func LastUsedIn

func LastUsedIn(vs ...time.Time) predicate.Token

LastUsedIn applies the In predicate on the "last_used" field.

func LastUsedIsNil

func LastUsedIsNil() predicate.Token

LastUsedIsNil applies the IsNil predicate on the "last_used" field.

func LastUsedLT

func LastUsedLT(v time.Time) predicate.Token

LastUsedLT applies the LT predicate on the "last_used" field.

func LastUsedLTE

func LastUsedLTE(v time.Time) predicate.Token

LastUsedLTE applies the LTE predicate on the "last_used" field.

func LastUsedNEQ

func LastUsedNEQ(v time.Time) predicate.Token

LastUsedNEQ applies the NEQ predicate on the "last_used" field.

func LastUsedNotIn

func LastUsedNotIn(vs ...time.Time) predicate.Token

LastUsedNotIn applies the NotIn predicate on the "last_used" field.

func LastUsedNotNil

func LastUsedNotNil() predicate.Token

LastUsedNotNil applies the NotNil predicate on the "last_used" field.

func Name

func Name(v string) predicate.Token

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

func NameContains

func NameContains(v string) predicate.Token

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

func NameContainsFold

func NameContainsFold(v string) predicate.Token

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

func NameEQ

func NameEQ(v string) predicate.Token

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

func NameEqualFold

func NameEqualFold(v string) predicate.Token

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

func NameGT

func NameGT(v string) predicate.Token

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

func NameGTE

func NameGTE(v string) predicate.Token

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Token

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Token

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Token

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

func NameLTE

func NameLTE(v string) predicate.Token

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

func NameNEQ

func NameNEQ(v string) predicate.Token

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

func NameNotIn

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

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

Or groups list of predicates with the OR operator between them.

func PermissionsEQ

func PermissionsEQ(v Permissions) predicate.Token

PermissionsEQ applies the EQ predicate on the "permissions" field.

func PermissionsIn

func PermissionsIn(vs ...Permissions) predicate.Token

PermissionsIn applies the In predicate on the "permissions" field.

func PermissionsNEQ

func PermissionsNEQ(v Permissions) predicate.Token

PermissionsNEQ applies the NEQ predicate on the "permissions" field.

func PermissionsNotIn

func PermissionsNotIn(vs ...Permissions) predicate.Token

PermissionsNotIn applies the NotIn predicate on the "permissions" field.

func PermissionsValidator

func PermissionsValidator(pe Permissions) error

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

func Secret

func Secret(v string) predicate.Token

Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ.

func SecretContains

func SecretContains(v string) predicate.Token

SecretContains applies the Contains predicate on the "secret" field.

func SecretContainsFold

func SecretContainsFold(v string) predicate.Token

SecretContainsFold applies the ContainsFold predicate on the "secret" field.

func SecretEQ

func SecretEQ(v string) predicate.Token

SecretEQ applies the EQ predicate on the "secret" field.

func SecretEqualFold

func SecretEqualFold(v string) predicate.Token

SecretEqualFold applies the EqualFold predicate on the "secret" field.

func SecretGT

func SecretGT(v string) predicate.Token

SecretGT applies the GT predicate on the "secret" field.

func SecretGTE

func SecretGTE(v string) predicate.Token

SecretGTE applies the GTE predicate on the "secret" field.

func SecretHasPrefix

func SecretHasPrefix(v string) predicate.Token

SecretHasPrefix applies the HasPrefix predicate on the "secret" field.

func SecretHasSuffix

func SecretHasSuffix(v string) predicate.Token

SecretHasSuffix applies the HasSuffix predicate on the "secret" field.

func SecretIn

func SecretIn(vs ...string) predicate.Token

SecretIn applies the In predicate on the "secret" field.

func SecretLT

func SecretLT(v string) predicate.Token

SecretLT applies the LT predicate on the "secret" field.

func SecretLTE

func SecretLTE(v string) predicate.Token

SecretLTE applies the LTE predicate on the "secret" field.

func SecretNEQ

func SecretNEQ(v string) predicate.Token

SecretNEQ applies the NEQ predicate on the "secret" field.

func SecretNotIn

func SecretNotIn(vs ...string) predicate.Token

SecretNotIn applies the NotIn predicate on the "secret" field.

Types

type Permissions

type Permissions string

Permissions defines the type for the permissions enum field.

const (
	PermissionsRead      Permissions = "Read"
	PermissionsWrite     Permissions = "Write"
	PermissionsReadWrite Permissions = "ReadWrite"
)

Permissions values.

func (Permissions) String

func (s Permissions) String() string

Jump to

Keyboard shortcuts

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