Help us shape the future of Go! Take the 2026 Go Developer Survey

apitoken

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the apitoken type in the database.
	Label = "api_token"
	// 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"
	// FieldWorkspaceID holds the string denoting the workspace_id field in the database.
	FieldWorkspaceID = "workspace_id"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldPrefix holds the string denoting the prefix field in the database.
	FieldPrefix = "prefix"
	// FieldSecretHash holds the string denoting the secret_hash field in the database.
	FieldSecretHash = "secret_hash"
	// FieldScopes holds the string denoting the scopes field in the database.
	FieldScopes = "scopes"
	// FieldExpiresAt holds the string denoting the expires_at field in the database.
	FieldExpiresAt = "expires_at"
	// FieldRevokedAt holds the string denoting the revoked_at field in the database.
	FieldRevokedAt = "revoked_at"
	// FieldLastUsedAt holds the string denoting the last_used_at field in the database.
	FieldLastUsedAt = "last_used_at"
	// EdgeWorkspace holds the string denoting the workspace edge name in mutations.
	EdgeWorkspace = "workspace"
	// Table holds the table name of the apitoken in the database.
	Table = "api_tokens"
	// WorkspaceTable is the table that holds the workspace relation/edge.
	WorkspaceTable = "api_tokens"
	// WorkspaceInverseTable is the table name for the Workspace entity.
	// It exists in this package in order to avoid circular dependency with the "workspace" package.
	WorkspaceInverseTable = "workspaces"
	// WorkspaceColumn is the table column denoting the workspace relation/edge.
	WorkspaceColumn = "workspace_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
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// PrefixValidator is a validator for the "prefix" field. It is called by the builders before save.
	PrefixValidator func(string) error
	// SecretHashValidator is a validator for the "secret_hash" field. It is called by the builders before save.
	SecretHashValidator func(string) error
	// DefaultScopes holds the default value on creation for the "scopes" field.
	DefaultScopes []string
)

Columns holds all SQL columns for apitoken fields.

Functions

func And

func And(predicates ...predicate.ApiToken) predicate.ApiToken

And groups predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.ApiToken

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.ApiToken

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.ApiToken

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.ApiToken

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.ApiToken

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.ApiToken

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.ApiToken

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

func CreatedAtNotIn

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

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

func ExpiresAt

func ExpiresAt(v time.Time) predicate.ApiToken

ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ.

func ExpiresAtEQ

func ExpiresAtEQ(v time.Time) predicate.ApiToken

ExpiresAtEQ applies the EQ predicate on the "expires_at" field.

func ExpiresAtGT

func ExpiresAtGT(v time.Time) predicate.ApiToken

ExpiresAtGT applies the GT predicate on the "expires_at" field.

func ExpiresAtGTE

func ExpiresAtGTE(v time.Time) predicate.ApiToken

ExpiresAtGTE applies the GTE predicate on the "expires_at" field.

func ExpiresAtIn

func ExpiresAtIn(vs ...time.Time) predicate.ApiToken

ExpiresAtIn applies the In predicate on the "expires_at" field.

func ExpiresAtIsNil

func ExpiresAtIsNil() predicate.ApiToken

ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field.

func ExpiresAtLT

func ExpiresAtLT(v time.Time) predicate.ApiToken

ExpiresAtLT applies the LT predicate on the "expires_at" field.

func ExpiresAtLTE

func ExpiresAtLTE(v time.Time) predicate.ApiToken

ExpiresAtLTE applies the LTE predicate on the "expires_at" field.

func ExpiresAtNEQ

func ExpiresAtNEQ(v time.Time) predicate.ApiToken

ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field.

func ExpiresAtNotIn

func ExpiresAtNotIn(vs ...time.Time) predicate.ApiToken

ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field.

func ExpiresAtNotNil

func ExpiresAtNotNil() predicate.ApiToken

ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field.

func HasWorkspace

func HasWorkspace() predicate.ApiToken

HasWorkspace applies the HasEdge predicate on the "workspace" edge.

func HasWorkspaceWith

func HasWorkspaceWith(preds ...predicate.Workspace) predicate.ApiToken

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

func ID

func ID(id int64) predicate.ApiToken

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int64) predicate.ApiToken

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int64) predicate.ApiToken

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int64) predicate.ApiToken

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int64) predicate.ApiToken

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int64) predicate.ApiToken

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int64) predicate.ApiToken

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int64) predicate.ApiToken

IDNotIn applies the NotIn predicate on the ID field.

func LastUsedAt

func LastUsedAt(v time.Time) predicate.ApiToken

LastUsedAt applies equality check predicate on the "last_used_at" field. It's identical to LastUsedAtEQ.

func LastUsedAtEQ

func LastUsedAtEQ(v time.Time) predicate.ApiToken

LastUsedAtEQ applies the EQ predicate on the "last_used_at" field.

func LastUsedAtGT

func LastUsedAtGT(v time.Time) predicate.ApiToken

LastUsedAtGT applies the GT predicate on the "last_used_at" field.

func LastUsedAtGTE

func LastUsedAtGTE(v time.Time) predicate.ApiToken

LastUsedAtGTE applies the GTE predicate on the "last_used_at" field.

func LastUsedAtIn

func LastUsedAtIn(vs ...time.Time) predicate.ApiToken

LastUsedAtIn applies the In predicate on the "last_used_at" field.

func LastUsedAtIsNil

func LastUsedAtIsNil() predicate.ApiToken

LastUsedAtIsNil applies the IsNil predicate on the "last_used_at" field.

func LastUsedAtLT

func LastUsedAtLT(v time.Time) predicate.ApiToken

LastUsedAtLT applies the LT predicate on the "last_used_at" field.

func LastUsedAtLTE

func LastUsedAtLTE(v time.Time) predicate.ApiToken

LastUsedAtLTE applies the LTE predicate on the "last_used_at" field.

func LastUsedAtNEQ

func LastUsedAtNEQ(v time.Time) predicate.ApiToken

LastUsedAtNEQ applies the NEQ predicate on the "last_used_at" field.

func LastUsedAtNotIn

func LastUsedAtNotIn(vs ...time.Time) predicate.ApiToken

LastUsedAtNotIn applies the NotIn predicate on the "last_used_at" field.

func LastUsedAtNotNil

func LastUsedAtNotNil() predicate.ApiToken

LastUsedAtNotNil applies the NotNil predicate on the "last_used_at" field.

func Name

func Name(v string) predicate.ApiToken

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

func NameContains

func NameContains(v string) predicate.ApiToken

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

func NameContainsFold

func NameContainsFold(v string) predicate.ApiToken

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

func NameEQ

func NameEQ(v string) predicate.ApiToken

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

func NameEqualFold

func NameEqualFold(v string) predicate.ApiToken

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

func NameGT

func NameGT(v string) predicate.ApiToken

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

func NameGTE

func NameGTE(v string) predicate.ApiToken

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.ApiToken

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.ApiToken

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.ApiToken

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

func NameLTE

func NameLTE(v string) predicate.ApiToken

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

func NameNEQ

func NameNEQ(v string) predicate.ApiToken

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

func NameNotIn

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

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

Or groups predicates with the OR operator between them.

func Prefix

func Prefix(v string) predicate.ApiToken

Prefix applies equality check predicate on the "prefix" field. It's identical to PrefixEQ.

func PrefixContains

func PrefixContains(v string) predicate.ApiToken

PrefixContains applies the Contains predicate on the "prefix" field.

func PrefixContainsFold

func PrefixContainsFold(v string) predicate.ApiToken

PrefixContainsFold applies the ContainsFold predicate on the "prefix" field.

func PrefixEQ

func PrefixEQ(v string) predicate.ApiToken

PrefixEQ applies the EQ predicate on the "prefix" field.

func PrefixEqualFold

func PrefixEqualFold(v string) predicate.ApiToken

PrefixEqualFold applies the EqualFold predicate on the "prefix" field.

func PrefixGT

func PrefixGT(v string) predicate.ApiToken

PrefixGT applies the GT predicate on the "prefix" field.

func PrefixGTE

func PrefixGTE(v string) predicate.ApiToken

PrefixGTE applies the GTE predicate on the "prefix" field.

func PrefixHasPrefix

func PrefixHasPrefix(v string) predicate.ApiToken

PrefixHasPrefix applies the HasPrefix predicate on the "prefix" field.

func PrefixHasSuffix

func PrefixHasSuffix(v string) predicate.ApiToken

PrefixHasSuffix applies the HasSuffix predicate on the "prefix" field.

func PrefixIn

func PrefixIn(vs ...string) predicate.ApiToken

PrefixIn applies the In predicate on the "prefix" field.

func PrefixLT

func PrefixLT(v string) predicate.ApiToken

PrefixLT applies the LT predicate on the "prefix" field.

func PrefixLTE

func PrefixLTE(v string) predicate.ApiToken

PrefixLTE applies the LTE predicate on the "prefix" field.

func PrefixNEQ

func PrefixNEQ(v string) predicate.ApiToken

PrefixNEQ applies the NEQ predicate on the "prefix" field.

func PrefixNotIn

func PrefixNotIn(vs ...string) predicate.ApiToken

PrefixNotIn applies the NotIn predicate on the "prefix" field.

func RevokedAt

func RevokedAt(v time.Time) predicate.ApiToken

RevokedAt applies equality check predicate on the "revoked_at" field. It's identical to RevokedAtEQ.

func RevokedAtEQ

func RevokedAtEQ(v time.Time) predicate.ApiToken

RevokedAtEQ applies the EQ predicate on the "revoked_at" field.

func RevokedAtGT

func RevokedAtGT(v time.Time) predicate.ApiToken

RevokedAtGT applies the GT predicate on the "revoked_at" field.

func RevokedAtGTE

func RevokedAtGTE(v time.Time) predicate.ApiToken

RevokedAtGTE applies the GTE predicate on the "revoked_at" field.

func RevokedAtIn

func RevokedAtIn(vs ...time.Time) predicate.ApiToken

RevokedAtIn applies the In predicate on the "revoked_at" field.

func RevokedAtIsNil

func RevokedAtIsNil() predicate.ApiToken

RevokedAtIsNil applies the IsNil predicate on the "revoked_at" field.

func RevokedAtLT

func RevokedAtLT(v time.Time) predicate.ApiToken

RevokedAtLT applies the LT predicate on the "revoked_at" field.

func RevokedAtLTE

func RevokedAtLTE(v time.Time) predicate.ApiToken

RevokedAtLTE applies the LTE predicate on the "revoked_at" field.

func RevokedAtNEQ

func RevokedAtNEQ(v time.Time) predicate.ApiToken

RevokedAtNEQ applies the NEQ predicate on the "revoked_at" field.

func RevokedAtNotIn

func RevokedAtNotIn(vs ...time.Time) predicate.ApiToken

RevokedAtNotIn applies the NotIn predicate on the "revoked_at" field.

func RevokedAtNotNil

func RevokedAtNotNil() predicate.ApiToken

RevokedAtNotNil applies the NotNil predicate on the "revoked_at" field.

func SecretHash

func SecretHash(v string) predicate.ApiToken

SecretHash applies equality check predicate on the "secret_hash" field. It's identical to SecretHashEQ.

func SecretHashContains

func SecretHashContains(v string) predicate.ApiToken

SecretHashContains applies the Contains predicate on the "secret_hash" field.

func SecretHashContainsFold

func SecretHashContainsFold(v string) predicate.ApiToken

SecretHashContainsFold applies the ContainsFold predicate on the "secret_hash" field.

func SecretHashEQ

func SecretHashEQ(v string) predicate.ApiToken

SecretHashEQ applies the EQ predicate on the "secret_hash" field.

func SecretHashEqualFold

func SecretHashEqualFold(v string) predicate.ApiToken

SecretHashEqualFold applies the EqualFold predicate on the "secret_hash" field.

func SecretHashGT

func SecretHashGT(v string) predicate.ApiToken

SecretHashGT applies the GT predicate on the "secret_hash" field.

func SecretHashGTE

func SecretHashGTE(v string) predicate.ApiToken

SecretHashGTE applies the GTE predicate on the "secret_hash" field.

func SecretHashHasPrefix

func SecretHashHasPrefix(v string) predicate.ApiToken

SecretHashHasPrefix applies the HasPrefix predicate on the "secret_hash" field.

func SecretHashHasSuffix

func SecretHashHasSuffix(v string) predicate.ApiToken

SecretHashHasSuffix applies the HasSuffix predicate on the "secret_hash" field.

func SecretHashIn

func SecretHashIn(vs ...string) predicate.ApiToken

SecretHashIn applies the In predicate on the "secret_hash" field.

func SecretHashLT

func SecretHashLT(v string) predicate.ApiToken

SecretHashLT applies the LT predicate on the "secret_hash" field.

func SecretHashLTE

func SecretHashLTE(v string) predicate.ApiToken

SecretHashLTE applies the LTE predicate on the "secret_hash" field.

func SecretHashNEQ

func SecretHashNEQ(v string) predicate.ApiToken

SecretHashNEQ applies the NEQ predicate on the "secret_hash" field.

func SecretHashNotIn

func SecretHashNotIn(vs ...string) predicate.ApiToken

SecretHashNotIn applies the NotIn predicate on the "secret_hash" field.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.ApiToken

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.ApiToken

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.ApiToken

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.ApiToken

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

func UpdatedAtIn

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

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.ApiToken

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.ApiToken

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.ApiToken

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

func UpdatedAtNotIn

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

UpdatedAtNotIn applies the NotIn 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).

func WorkspaceID

func WorkspaceID(v int64) predicate.ApiToken

WorkspaceID applies equality check predicate on the "workspace_id" field. It's identical to WorkspaceIDEQ.

func WorkspaceIDEQ

func WorkspaceIDEQ(v int64) predicate.ApiToken

WorkspaceIDEQ applies the EQ predicate on the "workspace_id" field.

func WorkspaceIDIn

func WorkspaceIDIn(vs ...int64) predicate.ApiToken

WorkspaceIDIn applies the In predicate on the "workspace_id" field.

func WorkspaceIDNEQ

func WorkspaceIDNEQ(v int64) predicate.ApiToken

WorkspaceIDNEQ applies the NEQ predicate on the "workspace_id" field.

func WorkspaceIDNotIn

func WorkspaceIDNotIn(vs ...int64) predicate.ApiToken

WorkspaceIDNotIn applies the NotIn predicate on the "workspace_id" field.

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the ApiToken queries.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at field.

func ByExpiresAt

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

ByExpiresAt orders the results by the expires_at field.

func ByID

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

ByID orders the results by the id field.

func ByLastUsedAt

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

ByLastUsedAt orders the results by the last_used_at field.

func ByName

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

ByName orders the results by the name field.

func ByPrefix

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

ByPrefix orders the results by the prefix field.

func ByRevokedAt

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

ByRevokedAt orders the results by the revoked_at field.

func BySecretHash

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

BySecretHash orders the results by the secret_hash field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

func ByWorkspaceField

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

ByWorkspaceField orders the results by workspace field.

func ByWorkspaceID

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

ByWorkspaceID orders the results by the workspace_id field.

Jump to

Keyboard shortcuts

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