key

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the key type in the database.
	Label = "key"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldRemoteKeyID holds the string denoting the remote_key_id field in the database.
	FieldRemoteKeyID = "remote_key_id"
	// FieldType holds the string denoting the type field in the database.
	FieldType = "type"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldLastUsedAt holds the string denoting the last_used_at field in the database.
	FieldLastUsedAt = "last_used_at"
	// EdgeSecrets holds the string denoting the secrets edge name in mutations.
	EdgeSecrets = "secrets"
	// Table holds the table name of the key in the database.
	Table = "keys"
	// SecretsTable is the table that holds the secrets relation/edge.
	SecretsTable = "secrets"
	// SecretsInverseTable is the table name for the Secret entity.
	// It exists in this package in order to avoid circular dependency with the "secret" package.
	SecretsInverseTable = "secrets"
	// SecretsColumn is the table column denoting the secrets relation/edge.
	SecretsColumn = "key_secrets"
)
View Source
const DefaultType = TypeEncryption

TypeEncryption is the default value of the Type enum.

Variables

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

Columns holds all SQL columns for key fields.

Functions

func And

func And(predicates ...predicate.Key) predicate.Key

And groups predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.Key

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Key

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Key

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Key

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Key

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Key

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Key

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

func CreatedAtNotIn

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

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

func HasSecrets

func HasSecrets() predicate.Key

HasSecrets applies the HasEdge predicate on the "secrets" edge.

func HasSecretsWith

func HasSecretsWith(preds ...predicate.Secret) predicate.Key

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

func ID

func ID(id uuid.UUID) predicate.Key

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Key

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Key

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Key

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Key

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Key

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Key

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func LastUsedAt

func LastUsedAt(v time.Time) predicate.Key

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

func LastUsedAtEQ

func LastUsedAtEQ(v time.Time) predicate.Key

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

func LastUsedAtGT

func LastUsedAtGT(v time.Time) predicate.Key

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

func LastUsedAtGTE

func LastUsedAtGTE(v time.Time) predicate.Key

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

func LastUsedAtIn

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

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

func LastUsedAtIsNil

func LastUsedAtIsNil() predicate.Key

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

func LastUsedAtLT

func LastUsedAtLT(v time.Time) predicate.Key

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

func LastUsedAtLTE

func LastUsedAtLTE(v time.Time) predicate.Key

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

func LastUsedAtNEQ

func LastUsedAtNEQ(v time.Time) predicate.Key

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

func LastUsedAtNotIn

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

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

func LastUsedAtNotNil

func LastUsedAtNotNil() predicate.Key

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

func Name

func Name(v string) predicate.Key

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

func NameContains

func NameContains(v string) predicate.Key

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

func NameContainsFold

func NameContainsFold(v string) predicate.Key

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

func NameEQ

func NameEQ(v string) predicate.Key

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

func NameEqualFold

func NameEqualFold(v string) predicate.Key

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

func NameGT

func NameGT(v string) predicate.Key

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

func NameGTE

func NameGTE(v string) predicate.Key

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Key

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Key

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Key

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

func NameLTE

func NameLTE(v string) predicate.Key

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

func NameNEQ

func NameNEQ(v string) predicate.Key

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

func NameNotIn

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

NameNotIn applies the NotIn predicate on the "name" field.

func Not

func Not(p predicate.Key) predicate.Key

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Key) predicate.Key

Or groups predicates with the OR operator between them.

func RemoteKeyID

func RemoteKeyID(v string) predicate.Key

RemoteKeyID applies equality check predicate on the "remote_key_id" field. It's identical to RemoteKeyIDEQ.

func RemoteKeyIDContains

func RemoteKeyIDContains(v string) predicate.Key

RemoteKeyIDContains applies the Contains predicate on the "remote_key_id" field.

func RemoteKeyIDContainsFold

func RemoteKeyIDContainsFold(v string) predicate.Key

RemoteKeyIDContainsFold applies the ContainsFold predicate on the "remote_key_id" field.

func RemoteKeyIDEQ

func RemoteKeyIDEQ(v string) predicate.Key

RemoteKeyIDEQ applies the EQ predicate on the "remote_key_id" field.

func RemoteKeyIDEqualFold

func RemoteKeyIDEqualFold(v string) predicate.Key

RemoteKeyIDEqualFold applies the EqualFold predicate on the "remote_key_id" field.

func RemoteKeyIDGT

func RemoteKeyIDGT(v string) predicate.Key

RemoteKeyIDGT applies the GT predicate on the "remote_key_id" field.

func RemoteKeyIDGTE

func RemoteKeyIDGTE(v string) predicate.Key

RemoteKeyIDGTE applies the GTE predicate on the "remote_key_id" field.

func RemoteKeyIDHasPrefix

func RemoteKeyIDHasPrefix(v string) predicate.Key

RemoteKeyIDHasPrefix applies the HasPrefix predicate on the "remote_key_id" field.

func RemoteKeyIDHasSuffix

func RemoteKeyIDHasSuffix(v string) predicate.Key

RemoteKeyIDHasSuffix applies the HasSuffix predicate on the "remote_key_id" field.

func RemoteKeyIDIn

func RemoteKeyIDIn(vs ...string) predicate.Key

RemoteKeyIDIn applies the In predicate on the "remote_key_id" field.

func RemoteKeyIDLT

func RemoteKeyIDLT(v string) predicate.Key

RemoteKeyIDLT applies the LT predicate on the "remote_key_id" field.

func RemoteKeyIDLTE

func RemoteKeyIDLTE(v string) predicate.Key

RemoteKeyIDLTE applies the LTE predicate on the "remote_key_id" field.

func RemoteKeyIDNEQ

func RemoteKeyIDNEQ(v string) predicate.Key

RemoteKeyIDNEQ applies the NEQ predicate on the "remote_key_id" field.

func RemoteKeyIDNotIn

func RemoteKeyIDNotIn(vs ...string) predicate.Key

RemoteKeyIDNotIn applies the NotIn predicate on the "remote_key_id" field.

func TypeEQ

func TypeEQ(v Type) predicate.Key

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

func TypeIn

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

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

func TypeNEQ

func TypeNEQ(v Type) predicate.Key

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

func TypeNotIn

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

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

func ByCreatedAt

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

ByCreatedAt orders the results by the created_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 ByRemoteKeyID

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

ByRemoteKeyID orders the results by the remote_key_id field.

func BySecrets

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

BySecrets orders the results by secrets terms.

func BySecretsCount

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

BySecretsCount orders the results by secrets count.

func ByType

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

ByType orders the results by the type field.

type Type

type Type string

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

const (
	TypeEncryption Type = "encryption"
	TypeSigning    Type = "signing"
)

Type values.

func (Type) String

func (_type Type) String() string

Jump to

Keyboard shortcuts

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