ent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeDataKey    = "DataKey"
	TypeKEK        = "KEK"
	TypeKEKVersion = "KEKVersion"
	TypeSentinel   = "Sentinel"
	TypeShred      = "Shred"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// DataKey is the client for interacting with the DataKey builders.
	DataKey *DataKeyClient
	// KEK is the client for interacting with the KEK builders.
	KEK *KEKClient
	// KEKVersion is the client for interacting with the KEKVersion builders.
	KEKVersion *KEKVersionClient
	// Sentinel is the client for interacting with the Sentinel builders.
	Sentinel *SentinelClient
	// Shred is the client for interacting with the Shred builders.
	Shred *ShredClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	DataKey.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type DataKey

type DataKey struct {

	// ID of the ent.
	ID envelope.ID `json:"id,omitempty"`
	// Purpose holds the value of the "purpose" field.
	Purpose string `json:"purpose,omitempty"`
	// Subject holds the value of the "subject" field.
	Subject string `json:"subject,omitempty"`
	// Epoch holds the value of the "epoch" field.
	Epoch uint32 `json:"epoch,omitempty"`
	// Algorithm holds the value of the "algorithm" field.
	Algorithm uint8 `json:"algorithm,omitempty"`
	// KekID holds the value of the "kek_id" field.
	KekID envelope.ID `json:"kek_id,omitempty"`
	// KekVersion holds the value of the "kek_version" field.
	KekVersion uint32 `json:"kek_version,omitempty"`
	// Wrapped holds the value of the "wrapped" field.
	Wrapped []byte `json:"wrapped,omitempty"`
	// State holds the value of the "state" field.
	State uint8 `json:"state,omitempty"`
	// Reserved holds the value of the "reserved" field.
	Reserved uint64 `json:"reserved,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// WrappedUnder holds the value of the "wrapped_under" field.
	WrappedUnder []keyforge.KEKVersionRef `json:"wrapped_under,omitempty"`
	// IsCurrent holds the value of the "is_current" field.
	IsCurrent bool `json:"is_current,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DataKeyQuery when eager-loading is set.
	Edges DataKeyEdges `json:"edges"`
	// contains filtered or unexported fields
}

DataKey is the model entity for the DataKey schema.

func (*DataKey) ExecContext

func (c *DataKey) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKey) QueryContext

func (c *DataKey) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKey) QueryKek

func (_m *DataKey) QueryKek() *KEKQuery

QueryKek queries the "kek" edge of the DataKey entity.

func (*DataKey) String

func (_m *DataKey) String() string

String implements the fmt.Stringer.

func (*DataKey) Unwrap

func (_m *DataKey) Unwrap() *DataKey

Unwrap unwraps the DataKey entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*DataKey) Update

func (_m *DataKey) Update() *DataKeyUpdateOne

Update returns a builder for updating this DataKey. Note that you need to call DataKey.Unwrap() before calling this method if this DataKey was returned from a transaction, and the transaction was committed or rolled back.

func (*DataKey) Value

func (_m *DataKey) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the DataKey. This includes values selected through modifiers, order, etc.

type DataKeyClient

type DataKeyClient struct {
	// contains filtered or unexported fields
}

DataKeyClient is a client for the DataKey schema.

func NewDataKeyClient

func NewDataKeyClient(c config) *DataKeyClient

NewDataKeyClient returns a client for the DataKey from the given config.

func (*DataKeyClient) Create

func (c *DataKeyClient) Create() *DataKeyCreate

Create returns a builder for creating a DataKey entity.

func (*DataKeyClient) CreateBulk

func (c *DataKeyClient) CreateBulk(builders ...*DataKeyCreate) *DataKeyCreateBulk

CreateBulk returns a builder for creating a bulk of DataKey entities.

func (*DataKeyClient) Delete

func (c *DataKeyClient) Delete() *DataKeyDelete

Delete returns a delete builder for DataKey.

func (*DataKeyClient) DeleteOne

func (c *DataKeyClient) DeleteOne(_m *DataKey) *DataKeyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DataKeyClient) DeleteOneID

func (c *DataKeyClient) DeleteOneID(id envelope.ID) *DataKeyDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DataKeyClient) ExecContext

func (c *DataKeyClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyClient) Get

func (c *DataKeyClient) Get(ctx context.Context, id envelope.ID) (*DataKey, error)

Get returns a DataKey entity by its id.

func (*DataKeyClient) GetX

func (c *DataKeyClient) GetX(ctx context.Context, id envelope.ID) *DataKey

GetX is like Get, but panics if an error occurs.

func (*DataKeyClient) Hooks

func (c *DataKeyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DataKeyClient) Intercept

func (c *DataKeyClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `datakey.Intercept(f(g(h())))`.

func (*DataKeyClient) Interceptors

func (c *DataKeyClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DataKeyClient) MapCreateBulk

func (c *DataKeyClient) MapCreateBulk(slice any, setFunc func(*DataKeyCreate, int)) *DataKeyCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DataKeyClient) Query

func (c *DataKeyClient) Query() *DataKeyQuery

Query returns a query builder for DataKey.

func (*DataKeyClient) QueryContext

func (c *DataKeyClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyClient) QueryKek

func (c *DataKeyClient) QueryKek(_m *DataKey) *KEKQuery

QueryKek queries the kek edge of a DataKey.

func (*DataKeyClient) Update

func (c *DataKeyClient) Update() *DataKeyUpdate

Update returns an update builder for DataKey.

func (*DataKeyClient) UpdateOne

func (c *DataKeyClient) UpdateOne(_m *DataKey) *DataKeyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DataKeyClient) UpdateOneID

func (c *DataKeyClient) UpdateOneID(id envelope.ID) *DataKeyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DataKeyClient) Use

func (c *DataKeyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `datakey.Hooks(f(g(h())))`.

type DataKeyCreate

type DataKeyCreate struct {
	// contains filtered or unexported fields
}

DataKeyCreate is the builder for creating a DataKey entity.

func (*DataKeyCreate) Exec

func (_c *DataKeyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DataKeyCreate) ExecContext

func (c *DataKeyCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyCreate) ExecX

func (_c *DataKeyCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyCreate) Mutation

func (_c *DataKeyCreate) Mutation() *DataKeyMutation

Mutation returns the DataKeyMutation object of the builder.

func (*DataKeyCreate) OnConflict

func (_c *DataKeyCreate) OnConflict(opts ...sql.ConflictOption) *DataKeyUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DataKey.Create().
	SetPurpose(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DataKeyUpsert) {
		SetPurpose(v+v).
	}).
	Exec(ctx)

func (*DataKeyCreate) OnConflictColumns

func (_c *DataKeyCreate) OnConflictColumns(columns ...string) *DataKeyUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DataKey.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DataKeyCreate) QueryContext

func (c *DataKeyCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyCreate) Save

func (_c *DataKeyCreate) Save(ctx context.Context) (*DataKey, error)

Save creates the DataKey in the database.

func (*DataKeyCreate) SaveX

func (_c *DataKeyCreate) SaveX(ctx context.Context) *DataKey

SaveX calls Save and panics if Save returns an error.

func (*DataKeyCreate) SetAlgorithm

func (_c *DataKeyCreate) SetAlgorithm(v uint8) *DataKeyCreate

SetAlgorithm sets the "algorithm" field.

func (*DataKeyCreate) SetCreatedAt

func (_c *DataKeyCreate) SetCreatedAt(v time.Time) *DataKeyCreate

SetCreatedAt sets the "created_at" field.

func (*DataKeyCreate) SetEpoch

func (_c *DataKeyCreate) SetEpoch(v uint32) *DataKeyCreate

SetEpoch sets the "epoch" field.

func (*DataKeyCreate) SetID

func (_c *DataKeyCreate) SetID(v envelope.ID) *DataKeyCreate

SetID sets the "id" field.

func (*DataKeyCreate) SetIsCurrent

func (_c *DataKeyCreate) SetIsCurrent(v bool) *DataKeyCreate

SetIsCurrent sets the "is_current" field.

func (*DataKeyCreate) SetKek

func (_c *DataKeyCreate) SetKek(v *KEK) *DataKeyCreate

SetKek sets the "kek" edge to the KEK entity.

func (*DataKeyCreate) SetKekID

func (_c *DataKeyCreate) SetKekID(v envelope.ID) *DataKeyCreate

SetKekID sets the "kek_id" field.

func (*DataKeyCreate) SetKekVersion

func (_c *DataKeyCreate) SetKekVersion(v uint32) *DataKeyCreate

SetKekVersion sets the "kek_version" field.

func (*DataKeyCreate) SetNillableIsCurrent

func (_c *DataKeyCreate) SetNillableIsCurrent(v *bool) *DataKeyCreate

SetNillableIsCurrent sets the "is_current" field if the given value is not nil.

func (*DataKeyCreate) SetNillableReserved

func (_c *DataKeyCreate) SetNillableReserved(v *uint64) *DataKeyCreate

SetNillableReserved sets the "reserved" field if the given value is not nil.

func (*DataKeyCreate) SetNillableSubject

func (_c *DataKeyCreate) SetNillableSubject(v *string) *DataKeyCreate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*DataKeyCreate) SetPurpose

func (_c *DataKeyCreate) SetPurpose(v string) *DataKeyCreate

SetPurpose sets the "purpose" field.

func (*DataKeyCreate) SetReserved

func (_c *DataKeyCreate) SetReserved(v uint64) *DataKeyCreate

SetReserved sets the "reserved" field.

func (*DataKeyCreate) SetState

func (_c *DataKeyCreate) SetState(v uint8) *DataKeyCreate

SetState sets the "state" field.

func (*DataKeyCreate) SetSubject

func (_c *DataKeyCreate) SetSubject(v string) *DataKeyCreate

SetSubject sets the "subject" field.

func (*DataKeyCreate) SetWrapped

func (_c *DataKeyCreate) SetWrapped(v []byte) *DataKeyCreate

SetWrapped sets the "wrapped" field.

func (*DataKeyCreate) SetWrappedUnder

func (_c *DataKeyCreate) SetWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyCreate

SetWrappedUnder sets the "wrapped_under" field.

type DataKeyCreateBulk

type DataKeyCreateBulk struct {
	// contains filtered or unexported fields
}

DataKeyCreateBulk is the builder for creating many DataKey entities in bulk.

func (*DataKeyCreateBulk) Exec

func (_c *DataKeyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DataKeyCreateBulk) ExecContext

func (c *DataKeyCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyCreateBulk) ExecX

func (_c *DataKeyCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyCreateBulk) OnConflict

func (_c *DataKeyCreateBulk) OnConflict(opts ...sql.ConflictOption) *DataKeyUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DataKey.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DataKeyUpsert) {
		SetPurpose(v+v).
	}).
	Exec(ctx)

func (*DataKeyCreateBulk) OnConflictColumns

func (_c *DataKeyCreateBulk) OnConflictColumns(columns ...string) *DataKeyUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DataKey.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DataKeyCreateBulk) QueryContext

func (c *DataKeyCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyCreateBulk) Save

func (_c *DataKeyCreateBulk) Save(ctx context.Context) ([]*DataKey, error)

Save creates the DataKey entities in the database.

func (*DataKeyCreateBulk) SaveX

func (_c *DataKeyCreateBulk) SaveX(ctx context.Context) []*DataKey

SaveX is like Save, but panics if an error occurs.

type DataKeyDelete

type DataKeyDelete struct {
	// contains filtered or unexported fields
}

DataKeyDelete is the builder for deleting a DataKey entity.

func (*DataKeyDelete) Exec

func (_d *DataKeyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DataKeyDelete) ExecContext

func (c *DataKeyDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyDelete) ExecX

func (_d *DataKeyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyDelete) QueryContext

func (c *DataKeyDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyDelete) Where

func (_d *DataKeyDelete) Where(ps ...predicate.DataKey) *DataKeyDelete

Where appends a list predicates to the DataKeyDelete builder.

type DataKeyDeleteOne

type DataKeyDeleteOne struct {
	// contains filtered or unexported fields
}

DataKeyDeleteOne is the builder for deleting a single DataKey entity.

func (*DataKeyDeleteOne) Exec

func (_d *DataKeyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DataKeyDeleteOne) ExecX

func (_d *DataKeyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyDeleteOne) Where

Where appends a list predicates to the DataKeyDelete builder.

type DataKeyEdges

type DataKeyEdges struct {
	// Kek holds the value of the kek edge.
	Kek *KEK `json:"kek,omitempty"`
	// contains filtered or unexported fields
}

DataKeyEdges holds the relations/edges for other nodes in the graph.

func (DataKeyEdges) KekOrErr

func (e DataKeyEdges) KekOrErr() (*KEK, error)

KekOrErr returns the Kek value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type DataKeyGroupBy

type DataKeyGroupBy struct {
	// contains filtered or unexported fields
}

DataKeyGroupBy is the group-by builder for DataKey entities.

func (*DataKeyGroupBy) Aggregate

func (_g *DataKeyGroupBy) Aggregate(fns ...AggregateFunc) *DataKeyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DataKeyGroupBy) Bool

func (s *DataKeyGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) BoolX

func (s *DataKeyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DataKeyGroupBy) Bools

func (s *DataKeyGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) BoolsX

func (s *DataKeyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DataKeyGroupBy) Float64

func (s *DataKeyGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) Float64X

func (s *DataKeyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DataKeyGroupBy) Float64s

func (s *DataKeyGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) Float64sX

func (s *DataKeyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DataKeyGroupBy) Int

func (s *DataKeyGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) IntX

func (s *DataKeyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DataKeyGroupBy) Ints

func (s *DataKeyGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) IntsX

func (s *DataKeyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DataKeyGroupBy) Scan

func (_g *DataKeyGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DataKeyGroupBy) ScanX

func (s *DataKeyGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DataKeyGroupBy) String

func (s *DataKeyGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) StringX

func (s *DataKeyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DataKeyGroupBy) Strings

func (s *DataKeyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DataKeyGroupBy) StringsX

func (s *DataKeyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DataKeyMutation

type DataKeyMutation struct {
	// contains filtered or unexported fields
}

DataKeyMutation represents an operation that mutates the DataKey nodes in the graph.

func (*DataKeyMutation) AddAlgorithm

func (m *DataKeyMutation) AddAlgorithm(u int8)

AddAlgorithm adds u to the "algorithm" field.

func (*DataKeyMutation) AddEpoch

func (m *DataKeyMutation) AddEpoch(u int32)

AddEpoch adds u to the "epoch" field.

func (*DataKeyMutation) AddField

func (m *DataKeyMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DataKeyMutation) AddKekVersion

func (m *DataKeyMutation) AddKekVersion(u int32)

AddKekVersion adds u to the "kek_version" field.

func (*DataKeyMutation) AddReserved

func (m *DataKeyMutation) AddReserved(u int64)

AddReserved adds u to the "reserved" field.

func (*DataKeyMutation) AddState

func (m *DataKeyMutation) AddState(u int8)

AddState adds u to the "state" field.

func (*DataKeyMutation) AddedAlgorithm

func (m *DataKeyMutation) AddedAlgorithm() (r int8, exists bool)

AddedAlgorithm returns the value that was added to the "algorithm" field in this mutation.

func (*DataKeyMutation) AddedEdges

func (m *DataKeyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DataKeyMutation) AddedEpoch

func (m *DataKeyMutation) AddedEpoch() (r int32, exists bool)

AddedEpoch returns the value that was added to the "epoch" field in this mutation.

func (*DataKeyMutation) AddedField

func (m *DataKeyMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DataKeyMutation) AddedFields

func (m *DataKeyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DataKeyMutation) AddedIDs

func (m *DataKeyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DataKeyMutation) AddedKekVersion

func (m *DataKeyMutation) AddedKekVersion() (r int32, exists bool)

AddedKekVersion returns the value that was added to the "kek_version" field in this mutation.

func (*DataKeyMutation) AddedReserved

func (m *DataKeyMutation) AddedReserved() (r int64, exists bool)

AddedReserved returns the value that was added to the "reserved" field in this mutation.

func (*DataKeyMutation) AddedState

func (m *DataKeyMutation) AddedState() (r int8, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*DataKeyMutation) Algorithm

func (m *DataKeyMutation) Algorithm() (r uint8, exists bool)

Algorithm returns the value of the "algorithm" field in the mutation.

func (*DataKeyMutation) AppendWrappedUnder

func (m *DataKeyMutation) AppendWrappedUnder(kvr []keyforge.KEKVersionRef)

AppendWrappedUnder adds kvr to the "wrapped_under" field.

func (*DataKeyMutation) AppendedWrappedUnder

func (m *DataKeyMutation) AppendedWrappedUnder() ([]keyforge.KEKVersionRef, bool)

AppendedWrappedUnder returns the list of values that were appended to the "wrapped_under" field in this mutation.

func (*DataKeyMutation) ClearEdge

func (m *DataKeyMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*DataKeyMutation) ClearField

func (m *DataKeyMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*DataKeyMutation) ClearKek

func (m *DataKeyMutation) ClearKek()

ClearKek clears the "kek" edge to the KEK entity.

func (*DataKeyMutation) ClearWrapped

func (m *DataKeyMutation) ClearWrapped()

ClearWrapped clears the value of the "wrapped" field.

func (*DataKeyMutation) ClearedEdges

func (m *DataKeyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DataKeyMutation) ClearedFields

func (m *DataKeyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DataKeyMutation) Client

func (m DataKeyMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*DataKeyMutation) CreatedAt

func (m *DataKeyMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DataKeyMutation) EdgeCleared

func (m *DataKeyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DataKeyMutation) Epoch

func (m *DataKeyMutation) Epoch() (r uint32, exists bool)

Epoch returns the value of the "epoch" field in the mutation.

func (*DataKeyMutation) ExecContext

func (c *DataKeyMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyMutation) Field

func (m *DataKeyMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DataKeyMutation) FieldCleared

func (m *DataKeyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DataKeyMutation) Fields

func (m *DataKeyMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*DataKeyMutation) ID

func (m *DataKeyMutation) ID() (id envelope.ID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*DataKeyMutation) IDs

func (m *DataKeyMutation) IDs(ctx context.Context) ([]envelope.ID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DataKeyMutation) IsCurrent

func (m *DataKeyMutation) IsCurrent() (r bool, exists bool)

IsCurrent returns the value of the "is_current" field in the mutation.

func (*DataKeyMutation) KekCleared

func (m *DataKeyMutation) KekCleared() bool

KekCleared reports if the "kek" edge to the KEK entity was cleared.

func (*DataKeyMutation) KekID

func (m *DataKeyMutation) KekID() (r envelope.ID, exists bool)

KekID returns the value of the "kek_id" field in the mutation.

func (*DataKeyMutation) KekIDs

func (m *DataKeyMutation) KekIDs() (ids []envelope.ID)

KekIDs returns the "kek" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use KekID instead. It exists only for internal usage by the builders.

func (*DataKeyMutation) KekVersion

func (m *DataKeyMutation) KekVersion() (r uint32, exists bool)

KekVersion returns the value of the "kek_version" field in the mutation.

func (*DataKeyMutation) OldAlgorithm

func (m *DataKeyMutation) OldAlgorithm(ctx context.Context) (v uint8, err error)

OldAlgorithm returns the old "algorithm" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldCreatedAt

func (m *DataKeyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldEpoch

func (m *DataKeyMutation) OldEpoch(ctx context.Context) (v uint32, err error)

OldEpoch returns the old "epoch" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldField

func (m *DataKeyMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*DataKeyMutation) OldIsCurrent

func (m *DataKeyMutation) OldIsCurrent(ctx context.Context) (v bool, err error)

OldIsCurrent returns the old "is_current" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldKekID

func (m *DataKeyMutation) OldKekID(ctx context.Context) (v envelope.ID, err error)

OldKekID returns the old "kek_id" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldKekVersion

func (m *DataKeyMutation) OldKekVersion(ctx context.Context) (v uint32, err error)

OldKekVersion returns the old "kek_version" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldPurpose

func (m *DataKeyMutation) OldPurpose(ctx context.Context) (v string, err error)

OldPurpose returns the old "purpose" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldReserved

func (m *DataKeyMutation) OldReserved(ctx context.Context) (v uint64, err error)

OldReserved returns the old "reserved" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldState

func (m *DataKeyMutation) OldState(ctx context.Context) (v uint8, err error)

OldState returns the old "state" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldSubject

func (m *DataKeyMutation) OldSubject(ctx context.Context) (v string, err error)

OldSubject returns the old "subject" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldWrapped

func (m *DataKeyMutation) OldWrapped(ctx context.Context) (v []byte, err error)

OldWrapped returns the old "wrapped" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) OldWrappedUnder

func (m *DataKeyMutation) OldWrappedUnder(ctx context.Context) (v []keyforge.KEKVersionRef, err error)

OldWrappedUnder returns the old "wrapped_under" field's value of the DataKey entity. If the DataKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataKeyMutation) Op

func (m *DataKeyMutation) Op() Op

Op returns the operation name.

func (*DataKeyMutation) Purpose

func (m *DataKeyMutation) Purpose() (r string, exists bool)

Purpose returns the value of the "purpose" field in the mutation.

func (*DataKeyMutation) QueryContext

func (c *DataKeyMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyMutation) RemovedEdges

func (m *DataKeyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DataKeyMutation) RemovedIDs

func (m *DataKeyMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*DataKeyMutation) Reserved

func (m *DataKeyMutation) Reserved() (r uint64, exists bool)

Reserved returns the value of the "reserved" field in the mutation.

func (*DataKeyMutation) ResetAlgorithm

func (m *DataKeyMutation) ResetAlgorithm()

ResetAlgorithm resets all changes to the "algorithm" field.

func (*DataKeyMutation) ResetCreatedAt

func (m *DataKeyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DataKeyMutation) ResetEdge

func (m *DataKeyMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*DataKeyMutation) ResetEpoch

func (m *DataKeyMutation) ResetEpoch()

ResetEpoch resets all changes to the "epoch" field.

func (*DataKeyMutation) ResetField

func (m *DataKeyMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*DataKeyMutation) ResetIsCurrent

func (m *DataKeyMutation) ResetIsCurrent()

ResetIsCurrent resets all changes to the "is_current" field.

func (*DataKeyMutation) ResetKek

func (m *DataKeyMutation) ResetKek()

ResetKek resets all changes to the "kek" edge.

func (*DataKeyMutation) ResetKekID

func (m *DataKeyMutation) ResetKekID()

ResetKekID resets all changes to the "kek_id" field.

func (*DataKeyMutation) ResetKekVersion

func (m *DataKeyMutation) ResetKekVersion()

ResetKekVersion resets all changes to the "kek_version" field.

func (*DataKeyMutation) ResetPurpose

func (m *DataKeyMutation) ResetPurpose()

ResetPurpose resets all changes to the "purpose" field.

func (*DataKeyMutation) ResetReserved

func (m *DataKeyMutation) ResetReserved()

ResetReserved resets all changes to the "reserved" field.

func (*DataKeyMutation) ResetState

func (m *DataKeyMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*DataKeyMutation) ResetSubject

func (m *DataKeyMutation) ResetSubject()

ResetSubject resets all changes to the "subject" field.

func (*DataKeyMutation) ResetWrapped

func (m *DataKeyMutation) ResetWrapped()

ResetWrapped resets all changes to the "wrapped" field.

func (*DataKeyMutation) ResetWrappedUnder

func (m *DataKeyMutation) ResetWrappedUnder()

ResetWrappedUnder resets all changes to the "wrapped_under" field.

func (*DataKeyMutation) SetAlgorithm

func (m *DataKeyMutation) SetAlgorithm(u uint8)

SetAlgorithm sets the "algorithm" field.

func (*DataKeyMutation) SetCreatedAt

func (m *DataKeyMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DataKeyMutation) SetEpoch

func (m *DataKeyMutation) SetEpoch(u uint32)

SetEpoch sets the "epoch" field.

func (*DataKeyMutation) SetField

func (m *DataKeyMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DataKeyMutation) SetID

func (m *DataKeyMutation) SetID(id envelope.ID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DataKey entities.

func (*DataKeyMutation) SetIsCurrent

func (m *DataKeyMutation) SetIsCurrent(b bool)

SetIsCurrent sets the "is_current" field.

func (*DataKeyMutation) SetKekID

func (m *DataKeyMutation) SetKekID(e envelope.ID)

SetKekID sets the "kek_id" field.

func (*DataKeyMutation) SetKekVersion

func (m *DataKeyMutation) SetKekVersion(u uint32)

SetKekVersion sets the "kek_version" field.

func (*DataKeyMutation) SetOp

func (m *DataKeyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DataKeyMutation) SetPurpose

func (m *DataKeyMutation) SetPurpose(s string)

SetPurpose sets the "purpose" field.

func (*DataKeyMutation) SetReserved

func (m *DataKeyMutation) SetReserved(u uint64)

SetReserved sets the "reserved" field.

func (*DataKeyMutation) SetState

func (m *DataKeyMutation) SetState(u uint8)

SetState sets the "state" field.

func (*DataKeyMutation) SetSubject

func (m *DataKeyMutation) SetSubject(s string)

SetSubject sets the "subject" field.

func (*DataKeyMutation) SetWrapped

func (m *DataKeyMutation) SetWrapped(b []byte)

SetWrapped sets the "wrapped" field.

func (*DataKeyMutation) SetWrappedUnder

func (m *DataKeyMutation) SetWrappedUnder(kvr []keyforge.KEKVersionRef)

SetWrappedUnder sets the "wrapped_under" field.

func (*DataKeyMutation) State

func (m *DataKeyMutation) State() (r uint8, exists bool)

State returns the value of the "state" field in the mutation.

func (*DataKeyMutation) Subject

func (m *DataKeyMutation) Subject() (r string, exists bool)

Subject returns the value of the "subject" field in the mutation.

func (DataKeyMutation) Tx

func (m DataKeyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DataKeyMutation) Type

func (m *DataKeyMutation) Type() string

Type returns the node type of this mutation (DataKey).

func (*DataKeyMutation) Where

func (m *DataKeyMutation) Where(ps ...predicate.DataKey)

Where appends a list predicates to the DataKeyMutation builder.

func (*DataKeyMutation) WhereP

func (m *DataKeyMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DataKeyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*DataKeyMutation) Wrapped

func (m *DataKeyMutation) Wrapped() (r []byte, exists bool)

Wrapped returns the value of the "wrapped" field in the mutation.

func (*DataKeyMutation) WrappedCleared

func (m *DataKeyMutation) WrappedCleared() bool

WrappedCleared returns if the "wrapped" field was cleared in this mutation.

func (*DataKeyMutation) WrappedUnder

func (m *DataKeyMutation) WrappedUnder() (r []keyforge.KEKVersionRef, exists bool)

WrappedUnder returns the value of the "wrapped_under" field in the mutation.

type DataKeyQuery

type DataKeyQuery struct {
	// contains filtered or unexported fields
}

DataKeyQuery is the builder for querying DataKey entities.

func (*DataKeyQuery) Aggregate

func (_q *DataKeyQuery) Aggregate(fns ...AggregateFunc) *DataKeySelect

Aggregate returns a DataKeySelect configured with the given aggregations.

func (*DataKeyQuery) All

func (_q *DataKeyQuery) All(ctx context.Context) ([]*DataKey, error)

All executes the query and returns a list of DataKeys.

func (*DataKeyQuery) AllX

func (_q *DataKeyQuery) AllX(ctx context.Context) []*DataKey

AllX is like All, but panics if an error occurs.

func (*DataKeyQuery) Clone

func (_q *DataKeyQuery) Clone() *DataKeyQuery

Clone returns a duplicate of the DataKeyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DataKeyQuery) Count

func (_q *DataKeyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DataKeyQuery) CountX

func (_q *DataKeyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DataKeyQuery) ExecContext

func (c *DataKeyQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyQuery) Exist

func (_q *DataKeyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DataKeyQuery) ExistX

func (_q *DataKeyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DataKeyQuery) First

func (_q *DataKeyQuery) First(ctx context.Context) (*DataKey, error)

First returns the first DataKey entity from the query. Returns a *NotFoundError when no DataKey was found.

func (*DataKeyQuery) FirstID

func (_q *DataKeyQuery) FirstID(ctx context.Context) (id envelope.ID, err error)

FirstID returns the first DataKey ID from the query. Returns a *NotFoundError when no DataKey ID was found.

func (*DataKeyQuery) FirstIDX

func (_q *DataKeyQuery) FirstIDX(ctx context.Context) envelope.ID

FirstIDX is like FirstID, but panics if an error occurs.

func (*DataKeyQuery) FirstX

func (_q *DataKeyQuery) FirstX(ctx context.Context) *DataKey

FirstX is like First, but panics if an error occurs.

func (*DataKeyQuery) ForShare

func (_q *DataKeyQuery) ForShare(opts ...sql.LockOption) *DataKeyQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*DataKeyQuery) ForUpdate

func (_q *DataKeyQuery) ForUpdate(opts ...sql.LockOption) *DataKeyQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*DataKeyQuery) GroupBy

func (_q *DataKeyQuery) GroupBy(field string, fields ...string) *DataKeyGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Purpose string `json:"purpose,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DataKey.Query().
	GroupBy(datakey.FieldPurpose).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DataKeyQuery) IDs

func (_q *DataKeyQuery) IDs(ctx context.Context) (ids []envelope.ID, err error)

IDs executes the query and returns a list of DataKey IDs.

func (*DataKeyQuery) IDsX

func (_q *DataKeyQuery) IDsX(ctx context.Context) []envelope.ID

IDsX is like IDs, but panics if an error occurs.

func (*DataKeyQuery) Limit

func (_q *DataKeyQuery) Limit(limit int) *DataKeyQuery

Limit the number of records to be returned by this query.

func (*DataKeyQuery) Offset

func (_q *DataKeyQuery) Offset(offset int) *DataKeyQuery

Offset to start from.

func (*DataKeyQuery) Only

func (_q *DataKeyQuery) Only(ctx context.Context) (*DataKey, error)

Only returns a single DataKey entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DataKey entity is found. Returns a *NotFoundError when no DataKey entities are found.

func (*DataKeyQuery) OnlyID

func (_q *DataKeyQuery) OnlyID(ctx context.Context) (id envelope.ID, err error)

OnlyID is like Only, but returns the only DataKey ID in the query. Returns a *NotSingularError when more than one DataKey ID is found. Returns a *NotFoundError when no entities are found.

func (*DataKeyQuery) OnlyIDX

func (_q *DataKeyQuery) OnlyIDX(ctx context.Context) envelope.ID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DataKeyQuery) OnlyX

func (_q *DataKeyQuery) OnlyX(ctx context.Context) *DataKey

OnlyX is like Only, but panics if an error occurs.

func (*DataKeyQuery) Order

func (_q *DataKeyQuery) Order(o ...datakey.OrderOption) *DataKeyQuery

Order specifies how the records should be ordered.

func (*DataKeyQuery) QueryContext

func (c *DataKeyQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyQuery) QueryKek

func (_q *DataKeyQuery) QueryKek() *KEKQuery

QueryKek chains the current query on the "kek" edge.

func (*DataKeyQuery) Select

func (_q *DataKeyQuery) Select(fields ...string) *DataKeySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Purpose string `json:"purpose,omitempty"`
}

client.DataKey.Query().
	Select(datakey.FieldPurpose).
	Scan(ctx, &v)

func (*DataKeyQuery) Unique

func (_q *DataKeyQuery) Unique(unique bool) *DataKeyQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DataKeyQuery) Where

func (_q *DataKeyQuery) Where(ps ...predicate.DataKey) *DataKeyQuery

Where adds a new predicate for the DataKeyQuery builder.

func (*DataKeyQuery) WithKek

func (_q *DataKeyQuery) WithKek(opts ...func(*KEKQuery)) *DataKeyQuery

WithKek tells the query-builder to eager-load the nodes that are connected to the "kek" edge. The optional arguments are used to configure the query builder of the edge.

type DataKeySelect

type DataKeySelect struct {
	*DataKeyQuery
	// contains filtered or unexported fields
}

DataKeySelect is the builder for selecting fields of DataKey entities.

func (*DataKeySelect) Aggregate

func (_s *DataKeySelect) Aggregate(fns ...AggregateFunc) *DataKeySelect

Aggregate adds the given aggregation functions to the selector query.

func (*DataKeySelect) Bool

func (s *DataKeySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) BoolX

func (s *DataKeySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DataKeySelect) Bools

func (s *DataKeySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) BoolsX

func (s *DataKeySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (DataKeySelect) ExecContext

func (c DataKeySelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeySelect) Float64

func (s *DataKeySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) Float64X

func (s *DataKeySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DataKeySelect) Float64s

func (s *DataKeySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) Float64sX

func (s *DataKeySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DataKeySelect) Int

func (s *DataKeySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) IntX

func (s *DataKeySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DataKeySelect) Ints

func (s *DataKeySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) IntsX

func (s *DataKeySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (DataKeySelect) QueryContext

func (c DataKeySelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeySelect) Scan

func (_s *DataKeySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DataKeySelect) ScanX

func (s *DataKeySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DataKeySelect) String

func (s *DataKeySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) StringX

func (s *DataKeySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DataKeySelect) Strings

func (s *DataKeySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DataKeySelect) StringsX

func (s *DataKeySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DataKeyUpdate

type DataKeyUpdate struct {
	// contains filtered or unexported fields
}

DataKeyUpdate is the builder for updating DataKey entities.

func (*DataKeyUpdate) AddAlgorithm

func (_u *DataKeyUpdate) AddAlgorithm(v int8) *DataKeyUpdate

AddAlgorithm adds value to the "algorithm" field.

func (*DataKeyUpdate) AddEpoch

func (_u *DataKeyUpdate) AddEpoch(v int32) *DataKeyUpdate

AddEpoch adds value to the "epoch" field.

func (*DataKeyUpdate) AddKekVersion

func (_u *DataKeyUpdate) AddKekVersion(v int32) *DataKeyUpdate

AddKekVersion adds value to the "kek_version" field.

func (*DataKeyUpdate) AddReserved

func (_u *DataKeyUpdate) AddReserved(v int64) *DataKeyUpdate

AddReserved adds value to the "reserved" field.

func (*DataKeyUpdate) AddState

func (_u *DataKeyUpdate) AddState(v int8) *DataKeyUpdate

AddState adds value to the "state" field.

func (*DataKeyUpdate) AppendWrappedUnder

func (_u *DataKeyUpdate) AppendWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyUpdate

AppendWrappedUnder appends value to the "wrapped_under" field.

func (*DataKeyUpdate) ClearKek

func (_u *DataKeyUpdate) ClearKek() *DataKeyUpdate

ClearKek clears the "kek" edge to the KEK entity.

func (*DataKeyUpdate) ClearWrapped

func (_u *DataKeyUpdate) ClearWrapped() *DataKeyUpdate

ClearWrapped clears the value of the "wrapped" field.

func (*DataKeyUpdate) Exec

func (_u *DataKeyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DataKeyUpdate) ExecContext

func (c *DataKeyUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyUpdate) ExecX

func (_u *DataKeyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyUpdate) Mutation

func (_u *DataKeyUpdate) Mutation() *DataKeyMutation

Mutation returns the DataKeyMutation object of the builder.

func (*DataKeyUpdate) QueryContext

func (c *DataKeyUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyUpdate) Save

func (_u *DataKeyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DataKeyUpdate) SaveX

func (_u *DataKeyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DataKeyUpdate) SetAlgorithm

func (_u *DataKeyUpdate) SetAlgorithm(v uint8) *DataKeyUpdate

SetAlgorithm sets the "algorithm" field.

func (*DataKeyUpdate) SetCreatedAt

func (_u *DataKeyUpdate) SetCreatedAt(v time.Time) *DataKeyUpdate

SetCreatedAt sets the "created_at" field.

func (*DataKeyUpdate) SetEpoch

func (_u *DataKeyUpdate) SetEpoch(v uint32) *DataKeyUpdate

SetEpoch sets the "epoch" field.

func (*DataKeyUpdate) SetIsCurrent

func (_u *DataKeyUpdate) SetIsCurrent(v bool) *DataKeyUpdate

SetIsCurrent sets the "is_current" field.

func (*DataKeyUpdate) SetKek

func (_u *DataKeyUpdate) SetKek(v *KEK) *DataKeyUpdate

SetKek sets the "kek" edge to the KEK entity.

func (*DataKeyUpdate) SetKekID

func (_u *DataKeyUpdate) SetKekID(v envelope.ID) *DataKeyUpdate

SetKekID sets the "kek_id" field.

func (*DataKeyUpdate) SetKekVersion

func (_u *DataKeyUpdate) SetKekVersion(v uint32) *DataKeyUpdate

SetKekVersion sets the "kek_version" field.

func (*DataKeyUpdate) SetNillableAlgorithm

func (_u *DataKeyUpdate) SetNillableAlgorithm(v *uint8) *DataKeyUpdate

SetNillableAlgorithm sets the "algorithm" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableCreatedAt

func (_u *DataKeyUpdate) SetNillableCreatedAt(v *time.Time) *DataKeyUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableEpoch

func (_u *DataKeyUpdate) SetNillableEpoch(v *uint32) *DataKeyUpdate

SetNillableEpoch sets the "epoch" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableIsCurrent

func (_u *DataKeyUpdate) SetNillableIsCurrent(v *bool) *DataKeyUpdate

SetNillableIsCurrent sets the "is_current" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableKekID

func (_u *DataKeyUpdate) SetNillableKekID(v *envelope.ID) *DataKeyUpdate

SetNillableKekID sets the "kek_id" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableKekVersion

func (_u *DataKeyUpdate) SetNillableKekVersion(v *uint32) *DataKeyUpdate

SetNillableKekVersion sets the "kek_version" field if the given value is not nil.

func (*DataKeyUpdate) SetNillablePurpose

func (_u *DataKeyUpdate) SetNillablePurpose(v *string) *DataKeyUpdate

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableReserved

func (_u *DataKeyUpdate) SetNillableReserved(v *uint64) *DataKeyUpdate

SetNillableReserved sets the "reserved" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableState

func (_u *DataKeyUpdate) SetNillableState(v *uint8) *DataKeyUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*DataKeyUpdate) SetNillableSubject

func (_u *DataKeyUpdate) SetNillableSubject(v *string) *DataKeyUpdate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*DataKeyUpdate) SetPurpose

func (_u *DataKeyUpdate) SetPurpose(v string) *DataKeyUpdate

SetPurpose sets the "purpose" field.

func (*DataKeyUpdate) SetReserved

func (_u *DataKeyUpdate) SetReserved(v uint64) *DataKeyUpdate

SetReserved sets the "reserved" field.

func (*DataKeyUpdate) SetState

func (_u *DataKeyUpdate) SetState(v uint8) *DataKeyUpdate

SetState sets the "state" field.

func (*DataKeyUpdate) SetSubject

func (_u *DataKeyUpdate) SetSubject(v string) *DataKeyUpdate

SetSubject sets the "subject" field.

func (*DataKeyUpdate) SetWrapped

func (_u *DataKeyUpdate) SetWrapped(v []byte) *DataKeyUpdate

SetWrapped sets the "wrapped" field.

func (*DataKeyUpdate) SetWrappedUnder

func (_u *DataKeyUpdate) SetWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyUpdate

SetWrappedUnder sets the "wrapped_under" field.

func (*DataKeyUpdate) Where

func (_u *DataKeyUpdate) Where(ps ...predicate.DataKey) *DataKeyUpdate

Where appends a list predicates to the DataKeyUpdate builder.

type DataKeyUpdateOne

type DataKeyUpdateOne struct {
	// contains filtered or unexported fields
}

DataKeyUpdateOne is the builder for updating a single DataKey entity.

func (*DataKeyUpdateOne) AddAlgorithm

func (_u *DataKeyUpdateOne) AddAlgorithm(v int8) *DataKeyUpdateOne

AddAlgorithm adds value to the "algorithm" field.

func (*DataKeyUpdateOne) AddEpoch

func (_u *DataKeyUpdateOne) AddEpoch(v int32) *DataKeyUpdateOne

AddEpoch adds value to the "epoch" field.

func (*DataKeyUpdateOne) AddKekVersion

func (_u *DataKeyUpdateOne) AddKekVersion(v int32) *DataKeyUpdateOne

AddKekVersion adds value to the "kek_version" field.

func (*DataKeyUpdateOne) AddReserved

func (_u *DataKeyUpdateOne) AddReserved(v int64) *DataKeyUpdateOne

AddReserved adds value to the "reserved" field.

func (*DataKeyUpdateOne) AddState

func (_u *DataKeyUpdateOne) AddState(v int8) *DataKeyUpdateOne

AddState adds value to the "state" field.

func (*DataKeyUpdateOne) AppendWrappedUnder

func (_u *DataKeyUpdateOne) AppendWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyUpdateOne

AppendWrappedUnder appends value to the "wrapped_under" field.

func (*DataKeyUpdateOne) ClearKek

func (_u *DataKeyUpdateOne) ClearKek() *DataKeyUpdateOne

ClearKek clears the "kek" edge to the KEK entity.

func (*DataKeyUpdateOne) ClearWrapped

func (_u *DataKeyUpdateOne) ClearWrapped() *DataKeyUpdateOne

ClearWrapped clears the value of the "wrapped" field.

func (*DataKeyUpdateOne) Exec

func (_u *DataKeyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DataKeyUpdateOne) ExecContext

func (c *DataKeyUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DataKeyUpdateOne) ExecX

func (_u *DataKeyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyUpdateOne) Mutation

func (_u *DataKeyUpdateOne) Mutation() *DataKeyMutation

Mutation returns the DataKeyMutation object of the builder.

func (*DataKeyUpdateOne) QueryContext

func (c *DataKeyUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DataKeyUpdateOne) Save

func (_u *DataKeyUpdateOne) Save(ctx context.Context) (*DataKey, error)

Save executes the query and returns the updated DataKey entity.

func (*DataKeyUpdateOne) SaveX

func (_u *DataKeyUpdateOne) SaveX(ctx context.Context) *DataKey

SaveX is like Save, but panics if an error occurs.

func (*DataKeyUpdateOne) Select

func (_u *DataKeyUpdateOne) Select(field string, fields ...string) *DataKeyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DataKeyUpdateOne) SetAlgorithm

func (_u *DataKeyUpdateOne) SetAlgorithm(v uint8) *DataKeyUpdateOne

SetAlgorithm sets the "algorithm" field.

func (*DataKeyUpdateOne) SetCreatedAt

func (_u *DataKeyUpdateOne) SetCreatedAt(v time.Time) *DataKeyUpdateOne

SetCreatedAt sets the "created_at" field.

func (*DataKeyUpdateOne) SetEpoch

func (_u *DataKeyUpdateOne) SetEpoch(v uint32) *DataKeyUpdateOne

SetEpoch sets the "epoch" field.

func (*DataKeyUpdateOne) SetIsCurrent

func (_u *DataKeyUpdateOne) SetIsCurrent(v bool) *DataKeyUpdateOne

SetIsCurrent sets the "is_current" field.

func (*DataKeyUpdateOne) SetKek

func (_u *DataKeyUpdateOne) SetKek(v *KEK) *DataKeyUpdateOne

SetKek sets the "kek" edge to the KEK entity.

func (*DataKeyUpdateOne) SetKekID

func (_u *DataKeyUpdateOne) SetKekID(v envelope.ID) *DataKeyUpdateOne

SetKekID sets the "kek_id" field.

func (*DataKeyUpdateOne) SetKekVersion

func (_u *DataKeyUpdateOne) SetKekVersion(v uint32) *DataKeyUpdateOne

SetKekVersion sets the "kek_version" field.

func (*DataKeyUpdateOne) SetNillableAlgorithm

func (_u *DataKeyUpdateOne) SetNillableAlgorithm(v *uint8) *DataKeyUpdateOne

SetNillableAlgorithm sets the "algorithm" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableCreatedAt

func (_u *DataKeyUpdateOne) SetNillableCreatedAt(v *time.Time) *DataKeyUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableEpoch

func (_u *DataKeyUpdateOne) SetNillableEpoch(v *uint32) *DataKeyUpdateOne

SetNillableEpoch sets the "epoch" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableIsCurrent

func (_u *DataKeyUpdateOne) SetNillableIsCurrent(v *bool) *DataKeyUpdateOne

SetNillableIsCurrent sets the "is_current" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableKekID

func (_u *DataKeyUpdateOne) SetNillableKekID(v *envelope.ID) *DataKeyUpdateOne

SetNillableKekID sets the "kek_id" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableKekVersion

func (_u *DataKeyUpdateOne) SetNillableKekVersion(v *uint32) *DataKeyUpdateOne

SetNillableKekVersion sets the "kek_version" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillablePurpose

func (_u *DataKeyUpdateOne) SetNillablePurpose(v *string) *DataKeyUpdateOne

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableReserved

func (_u *DataKeyUpdateOne) SetNillableReserved(v *uint64) *DataKeyUpdateOne

SetNillableReserved sets the "reserved" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableState

func (_u *DataKeyUpdateOne) SetNillableState(v *uint8) *DataKeyUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*DataKeyUpdateOne) SetNillableSubject

func (_u *DataKeyUpdateOne) SetNillableSubject(v *string) *DataKeyUpdateOne

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*DataKeyUpdateOne) SetPurpose

func (_u *DataKeyUpdateOne) SetPurpose(v string) *DataKeyUpdateOne

SetPurpose sets the "purpose" field.

func (*DataKeyUpdateOne) SetReserved

func (_u *DataKeyUpdateOne) SetReserved(v uint64) *DataKeyUpdateOne

SetReserved sets the "reserved" field.

func (*DataKeyUpdateOne) SetState

func (_u *DataKeyUpdateOne) SetState(v uint8) *DataKeyUpdateOne

SetState sets the "state" field.

func (*DataKeyUpdateOne) SetSubject

func (_u *DataKeyUpdateOne) SetSubject(v string) *DataKeyUpdateOne

SetSubject sets the "subject" field.

func (*DataKeyUpdateOne) SetWrapped

func (_u *DataKeyUpdateOne) SetWrapped(v []byte) *DataKeyUpdateOne

SetWrapped sets the "wrapped" field.

func (*DataKeyUpdateOne) SetWrappedUnder

func (_u *DataKeyUpdateOne) SetWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyUpdateOne

SetWrappedUnder sets the "wrapped_under" field.

func (*DataKeyUpdateOne) Where

Where appends a list predicates to the DataKeyUpdate builder.

type DataKeyUpsert

type DataKeyUpsert struct {
	*sql.UpdateSet
}

DataKeyUpsert is the "OnConflict" setter.

func (*DataKeyUpsert) AddAlgorithm

func (u *DataKeyUpsert) AddAlgorithm(v uint8) *DataKeyUpsert

AddAlgorithm adds v to the "algorithm" field.

func (*DataKeyUpsert) AddEpoch

func (u *DataKeyUpsert) AddEpoch(v uint32) *DataKeyUpsert

AddEpoch adds v to the "epoch" field.

func (*DataKeyUpsert) AddKekVersion

func (u *DataKeyUpsert) AddKekVersion(v uint32) *DataKeyUpsert

AddKekVersion adds v to the "kek_version" field.

func (*DataKeyUpsert) AddReserved

func (u *DataKeyUpsert) AddReserved(v uint64) *DataKeyUpsert

AddReserved adds v to the "reserved" field.

func (*DataKeyUpsert) AddState

func (u *DataKeyUpsert) AddState(v uint8) *DataKeyUpsert

AddState adds v to the "state" field.

func (*DataKeyUpsert) ClearWrapped

func (u *DataKeyUpsert) ClearWrapped() *DataKeyUpsert

ClearWrapped clears the value of the "wrapped" field.

func (*DataKeyUpsert) SetAlgorithm

func (u *DataKeyUpsert) SetAlgorithm(v uint8) *DataKeyUpsert

SetAlgorithm sets the "algorithm" field.

func (*DataKeyUpsert) SetCreatedAt

func (u *DataKeyUpsert) SetCreatedAt(v time.Time) *DataKeyUpsert

SetCreatedAt sets the "created_at" field.

func (*DataKeyUpsert) SetEpoch

func (u *DataKeyUpsert) SetEpoch(v uint32) *DataKeyUpsert

SetEpoch sets the "epoch" field.

func (*DataKeyUpsert) SetIsCurrent

func (u *DataKeyUpsert) SetIsCurrent(v bool) *DataKeyUpsert

SetIsCurrent sets the "is_current" field.

func (*DataKeyUpsert) SetKekID

func (u *DataKeyUpsert) SetKekID(v envelope.ID) *DataKeyUpsert

SetKekID sets the "kek_id" field.

func (*DataKeyUpsert) SetKekVersion

func (u *DataKeyUpsert) SetKekVersion(v uint32) *DataKeyUpsert

SetKekVersion sets the "kek_version" field.

func (*DataKeyUpsert) SetPurpose

func (u *DataKeyUpsert) SetPurpose(v string) *DataKeyUpsert

SetPurpose sets the "purpose" field.

func (*DataKeyUpsert) SetReserved

func (u *DataKeyUpsert) SetReserved(v uint64) *DataKeyUpsert

SetReserved sets the "reserved" field.

func (*DataKeyUpsert) SetState

func (u *DataKeyUpsert) SetState(v uint8) *DataKeyUpsert

SetState sets the "state" field.

func (*DataKeyUpsert) SetSubject

func (u *DataKeyUpsert) SetSubject(v string) *DataKeyUpsert

SetSubject sets the "subject" field.

func (*DataKeyUpsert) SetWrapped

func (u *DataKeyUpsert) SetWrapped(v []byte) *DataKeyUpsert

SetWrapped sets the "wrapped" field.

func (*DataKeyUpsert) SetWrappedUnder

func (u *DataKeyUpsert) SetWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyUpsert

SetWrappedUnder sets the "wrapped_under" field.

func (*DataKeyUpsert) UpdateAlgorithm

func (u *DataKeyUpsert) UpdateAlgorithm() *DataKeyUpsert

UpdateAlgorithm sets the "algorithm" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateCreatedAt

func (u *DataKeyUpsert) UpdateCreatedAt() *DataKeyUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateEpoch

func (u *DataKeyUpsert) UpdateEpoch() *DataKeyUpsert

UpdateEpoch sets the "epoch" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateIsCurrent

func (u *DataKeyUpsert) UpdateIsCurrent() *DataKeyUpsert

UpdateIsCurrent sets the "is_current" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateKekID

func (u *DataKeyUpsert) UpdateKekID() *DataKeyUpsert

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateKekVersion

func (u *DataKeyUpsert) UpdateKekVersion() *DataKeyUpsert

UpdateKekVersion sets the "kek_version" field to the value that was provided on create.

func (*DataKeyUpsert) UpdatePurpose

func (u *DataKeyUpsert) UpdatePurpose() *DataKeyUpsert

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateReserved

func (u *DataKeyUpsert) UpdateReserved() *DataKeyUpsert

UpdateReserved sets the "reserved" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateState

func (u *DataKeyUpsert) UpdateState() *DataKeyUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateSubject

func (u *DataKeyUpsert) UpdateSubject() *DataKeyUpsert

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateWrapped

func (u *DataKeyUpsert) UpdateWrapped() *DataKeyUpsert

UpdateWrapped sets the "wrapped" field to the value that was provided on create.

func (*DataKeyUpsert) UpdateWrappedUnder

func (u *DataKeyUpsert) UpdateWrappedUnder() *DataKeyUpsert

UpdateWrappedUnder sets the "wrapped_under" field to the value that was provided on create.

type DataKeyUpsertBulk

type DataKeyUpsertBulk struct {
	// contains filtered or unexported fields
}

DataKeyUpsertBulk is the builder for "upsert"-ing a bulk of DataKey nodes.

func (*DataKeyUpsertBulk) AddAlgorithm

func (u *DataKeyUpsertBulk) AddAlgorithm(v uint8) *DataKeyUpsertBulk

AddAlgorithm adds v to the "algorithm" field.

func (*DataKeyUpsertBulk) AddEpoch

func (u *DataKeyUpsertBulk) AddEpoch(v uint32) *DataKeyUpsertBulk

AddEpoch adds v to the "epoch" field.

func (*DataKeyUpsertBulk) AddKekVersion

func (u *DataKeyUpsertBulk) AddKekVersion(v uint32) *DataKeyUpsertBulk

AddKekVersion adds v to the "kek_version" field.

func (*DataKeyUpsertBulk) AddReserved

func (u *DataKeyUpsertBulk) AddReserved(v uint64) *DataKeyUpsertBulk

AddReserved adds v to the "reserved" field.

func (*DataKeyUpsertBulk) AddState

func (u *DataKeyUpsertBulk) AddState(v uint8) *DataKeyUpsertBulk

AddState adds v to the "state" field.

func (*DataKeyUpsertBulk) ClearWrapped

func (u *DataKeyUpsertBulk) ClearWrapped() *DataKeyUpsertBulk

ClearWrapped clears the value of the "wrapped" field.

func (*DataKeyUpsertBulk) DoNothing

func (u *DataKeyUpsertBulk) DoNothing() *DataKeyUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DataKeyUpsertBulk) Exec

func (u *DataKeyUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DataKeyUpsertBulk) ExecX

func (u *DataKeyUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyUpsertBulk) Ignore

func (u *DataKeyUpsertBulk) Ignore() *DataKeyUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DataKey.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*DataKeyUpsertBulk) SetAlgorithm

func (u *DataKeyUpsertBulk) SetAlgorithm(v uint8) *DataKeyUpsertBulk

SetAlgorithm sets the "algorithm" field.

func (*DataKeyUpsertBulk) SetCreatedAt

func (u *DataKeyUpsertBulk) SetCreatedAt(v time.Time) *DataKeyUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*DataKeyUpsertBulk) SetEpoch

func (u *DataKeyUpsertBulk) SetEpoch(v uint32) *DataKeyUpsertBulk

SetEpoch sets the "epoch" field.

func (*DataKeyUpsertBulk) SetIsCurrent

func (u *DataKeyUpsertBulk) SetIsCurrent(v bool) *DataKeyUpsertBulk

SetIsCurrent sets the "is_current" field.

func (*DataKeyUpsertBulk) SetKekID

SetKekID sets the "kek_id" field.

func (*DataKeyUpsertBulk) SetKekVersion

func (u *DataKeyUpsertBulk) SetKekVersion(v uint32) *DataKeyUpsertBulk

SetKekVersion sets the "kek_version" field.

func (*DataKeyUpsertBulk) SetPurpose

func (u *DataKeyUpsertBulk) SetPurpose(v string) *DataKeyUpsertBulk

SetPurpose sets the "purpose" field.

func (*DataKeyUpsertBulk) SetReserved

func (u *DataKeyUpsertBulk) SetReserved(v uint64) *DataKeyUpsertBulk

SetReserved sets the "reserved" field.

func (*DataKeyUpsertBulk) SetState

func (u *DataKeyUpsertBulk) SetState(v uint8) *DataKeyUpsertBulk

SetState sets the "state" field.

func (*DataKeyUpsertBulk) SetSubject

func (u *DataKeyUpsertBulk) SetSubject(v string) *DataKeyUpsertBulk

SetSubject sets the "subject" field.

func (*DataKeyUpsertBulk) SetWrapped

func (u *DataKeyUpsertBulk) SetWrapped(v []byte) *DataKeyUpsertBulk

SetWrapped sets the "wrapped" field.

func (*DataKeyUpsertBulk) SetWrappedUnder

func (u *DataKeyUpsertBulk) SetWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyUpsertBulk

SetWrappedUnder sets the "wrapped_under" field.

func (*DataKeyUpsertBulk) Update

func (u *DataKeyUpsertBulk) Update(set func(*DataKeyUpsert)) *DataKeyUpsertBulk

Update allows overriding fields `UPDATE` values. See the DataKeyCreateBulk.OnConflict documentation for more info.

func (*DataKeyUpsertBulk) UpdateAlgorithm

func (u *DataKeyUpsertBulk) UpdateAlgorithm() *DataKeyUpsertBulk

UpdateAlgorithm sets the "algorithm" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateCreatedAt

func (u *DataKeyUpsertBulk) UpdateCreatedAt() *DataKeyUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateEpoch

func (u *DataKeyUpsertBulk) UpdateEpoch() *DataKeyUpsertBulk

UpdateEpoch sets the "epoch" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateIsCurrent

func (u *DataKeyUpsertBulk) UpdateIsCurrent() *DataKeyUpsertBulk

UpdateIsCurrent sets the "is_current" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateKekID

func (u *DataKeyUpsertBulk) UpdateKekID() *DataKeyUpsertBulk

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateKekVersion

func (u *DataKeyUpsertBulk) UpdateKekVersion() *DataKeyUpsertBulk

UpdateKekVersion sets the "kek_version" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateNewValues

func (u *DataKeyUpsertBulk) UpdateNewValues() *DataKeyUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.DataKey.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(datakey.FieldID)
		}),
	).
	Exec(ctx)

func (*DataKeyUpsertBulk) UpdatePurpose

func (u *DataKeyUpsertBulk) UpdatePurpose() *DataKeyUpsertBulk

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateReserved

func (u *DataKeyUpsertBulk) UpdateReserved() *DataKeyUpsertBulk

UpdateReserved sets the "reserved" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateState

func (u *DataKeyUpsertBulk) UpdateState() *DataKeyUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateSubject

func (u *DataKeyUpsertBulk) UpdateSubject() *DataKeyUpsertBulk

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateWrapped

func (u *DataKeyUpsertBulk) UpdateWrapped() *DataKeyUpsertBulk

UpdateWrapped sets the "wrapped" field to the value that was provided on create.

func (*DataKeyUpsertBulk) UpdateWrappedUnder

func (u *DataKeyUpsertBulk) UpdateWrappedUnder() *DataKeyUpsertBulk

UpdateWrappedUnder sets the "wrapped_under" field to the value that was provided on create.

type DataKeyUpsertOne

type DataKeyUpsertOne struct {
	// contains filtered or unexported fields
}

DataKeyUpsertOne is the builder for "upsert"-ing

one DataKey node.

func (*DataKeyUpsertOne) AddAlgorithm

func (u *DataKeyUpsertOne) AddAlgorithm(v uint8) *DataKeyUpsertOne

AddAlgorithm adds v to the "algorithm" field.

func (*DataKeyUpsertOne) AddEpoch

func (u *DataKeyUpsertOne) AddEpoch(v uint32) *DataKeyUpsertOne

AddEpoch adds v to the "epoch" field.

func (*DataKeyUpsertOne) AddKekVersion

func (u *DataKeyUpsertOne) AddKekVersion(v uint32) *DataKeyUpsertOne

AddKekVersion adds v to the "kek_version" field.

func (*DataKeyUpsertOne) AddReserved

func (u *DataKeyUpsertOne) AddReserved(v uint64) *DataKeyUpsertOne

AddReserved adds v to the "reserved" field.

func (*DataKeyUpsertOne) AddState

func (u *DataKeyUpsertOne) AddState(v uint8) *DataKeyUpsertOne

AddState adds v to the "state" field.

func (*DataKeyUpsertOne) ClearWrapped

func (u *DataKeyUpsertOne) ClearWrapped() *DataKeyUpsertOne

ClearWrapped clears the value of the "wrapped" field.

func (*DataKeyUpsertOne) DoNothing

func (u *DataKeyUpsertOne) DoNothing() *DataKeyUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DataKeyUpsertOne) Exec

func (u *DataKeyUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*DataKeyUpsertOne) ExecX

func (u *DataKeyUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DataKeyUpsertOne) ID

func (u *DataKeyUpsertOne) ID(ctx context.Context) (id envelope.ID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*DataKeyUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*DataKeyUpsertOne) Ignore

func (u *DataKeyUpsertOne) Ignore() *DataKeyUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DataKey.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*DataKeyUpsertOne) SetAlgorithm

func (u *DataKeyUpsertOne) SetAlgorithm(v uint8) *DataKeyUpsertOne

SetAlgorithm sets the "algorithm" field.

func (*DataKeyUpsertOne) SetCreatedAt

func (u *DataKeyUpsertOne) SetCreatedAt(v time.Time) *DataKeyUpsertOne

SetCreatedAt sets the "created_at" field.

func (*DataKeyUpsertOne) SetEpoch

func (u *DataKeyUpsertOne) SetEpoch(v uint32) *DataKeyUpsertOne

SetEpoch sets the "epoch" field.

func (*DataKeyUpsertOne) SetIsCurrent

func (u *DataKeyUpsertOne) SetIsCurrent(v bool) *DataKeyUpsertOne

SetIsCurrent sets the "is_current" field.

func (*DataKeyUpsertOne) SetKekID

func (u *DataKeyUpsertOne) SetKekID(v envelope.ID) *DataKeyUpsertOne

SetKekID sets the "kek_id" field.

func (*DataKeyUpsertOne) SetKekVersion

func (u *DataKeyUpsertOne) SetKekVersion(v uint32) *DataKeyUpsertOne

SetKekVersion sets the "kek_version" field.

func (*DataKeyUpsertOne) SetPurpose

func (u *DataKeyUpsertOne) SetPurpose(v string) *DataKeyUpsertOne

SetPurpose sets the "purpose" field.

func (*DataKeyUpsertOne) SetReserved

func (u *DataKeyUpsertOne) SetReserved(v uint64) *DataKeyUpsertOne

SetReserved sets the "reserved" field.

func (*DataKeyUpsertOne) SetState

func (u *DataKeyUpsertOne) SetState(v uint8) *DataKeyUpsertOne

SetState sets the "state" field.

func (*DataKeyUpsertOne) SetSubject

func (u *DataKeyUpsertOne) SetSubject(v string) *DataKeyUpsertOne

SetSubject sets the "subject" field.

func (*DataKeyUpsertOne) SetWrapped

func (u *DataKeyUpsertOne) SetWrapped(v []byte) *DataKeyUpsertOne

SetWrapped sets the "wrapped" field.

func (*DataKeyUpsertOne) SetWrappedUnder

func (u *DataKeyUpsertOne) SetWrappedUnder(v []keyforge.KEKVersionRef) *DataKeyUpsertOne

SetWrappedUnder sets the "wrapped_under" field.

func (*DataKeyUpsertOne) Update

func (u *DataKeyUpsertOne) Update(set func(*DataKeyUpsert)) *DataKeyUpsertOne

Update allows overriding fields `UPDATE` values. See the DataKeyCreate.OnConflict documentation for more info.

func (*DataKeyUpsertOne) UpdateAlgorithm

func (u *DataKeyUpsertOne) UpdateAlgorithm() *DataKeyUpsertOne

UpdateAlgorithm sets the "algorithm" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateCreatedAt

func (u *DataKeyUpsertOne) UpdateCreatedAt() *DataKeyUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateEpoch

func (u *DataKeyUpsertOne) UpdateEpoch() *DataKeyUpsertOne

UpdateEpoch sets the "epoch" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateIsCurrent

func (u *DataKeyUpsertOne) UpdateIsCurrent() *DataKeyUpsertOne

UpdateIsCurrent sets the "is_current" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateKekID

func (u *DataKeyUpsertOne) UpdateKekID() *DataKeyUpsertOne

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateKekVersion

func (u *DataKeyUpsertOne) UpdateKekVersion() *DataKeyUpsertOne

UpdateKekVersion sets the "kek_version" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateNewValues

func (u *DataKeyUpsertOne) UpdateNewValues() *DataKeyUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.DataKey.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(datakey.FieldID)
		}),
	).
	Exec(ctx)

func (*DataKeyUpsertOne) UpdatePurpose

func (u *DataKeyUpsertOne) UpdatePurpose() *DataKeyUpsertOne

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateReserved

func (u *DataKeyUpsertOne) UpdateReserved() *DataKeyUpsertOne

UpdateReserved sets the "reserved" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateState

func (u *DataKeyUpsertOne) UpdateState() *DataKeyUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateSubject

func (u *DataKeyUpsertOne) UpdateSubject() *DataKeyUpsertOne

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateWrapped

func (u *DataKeyUpsertOne) UpdateWrapped() *DataKeyUpsertOne

UpdateWrapped sets the "wrapped" field to the value that was provided on create.

func (*DataKeyUpsertOne) UpdateWrappedUnder

func (u *DataKeyUpsertOne) UpdateWrappedUnder() *DataKeyUpsertOne

UpdateWrappedUnder sets the "wrapped_under" field to the value that was provided on create.

type DataKeys

type DataKeys []*DataKey

DataKeys is a parsable slice of DataKey.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type KEK

type KEK struct {

	// ID of the ent.
	ID envelope.ID `json:"id,omitempty"`
	// Purpose holds the value of the "purpose" field.
	Purpose string `json:"purpose,omitempty"`
	// Provider holds the value of the "provider" field.
	Provider string `json:"provider,omitempty"`
	// ProviderRef holds the value of the "provider_ref" field.
	ProviderRef string `json:"provider_ref,omitempty"`
	// State holds the value of the "state" field.
	State uint8 `json:"state,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the KEKQuery when eager-loading is set.
	Edges KEKEdges `json:"edges"`
	// contains filtered or unexported fields
}

KEK is the model entity for the KEK schema.

func (*KEK) ExecContext

func (c *KEK) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEK) QueryContext

func (c *KEK) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEK) QueryDataKeys

func (_m *KEK) QueryDataKeys() *DataKeyQuery

QueryDataKeys queries the "data_keys" edge of the KEK entity.

func (*KEK) QuerySentinels

func (_m *KEK) QuerySentinels() *SentinelQuery

QuerySentinels queries the "sentinels" edge of the KEK entity.

func (*KEK) QueryVersions

func (_m *KEK) QueryVersions() *KEKVersionQuery

QueryVersions queries the "versions" edge of the KEK entity.

func (*KEK) String

func (_m *KEK) String() string

String implements the fmt.Stringer.

func (*KEK) Unwrap

func (_m *KEK) Unwrap() *KEK

Unwrap unwraps the KEK entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*KEK) Update

func (_m *KEK) Update() *KEKUpdateOne

Update returns a builder for updating this KEK. Note that you need to call KEK.Unwrap() before calling this method if this KEK was returned from a transaction, and the transaction was committed or rolled back.

func (*KEK) Value

func (_m *KEK) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the KEK. This includes values selected through modifiers, order, etc.

type KEKClient

type KEKClient struct {
	// contains filtered or unexported fields
}

KEKClient is a client for the KEK schema.

func NewKEKClient

func NewKEKClient(c config) *KEKClient

NewKEKClient returns a client for the KEK from the given config.

func (*KEKClient) Create

func (c *KEKClient) Create() *KEKCreate

Create returns a builder for creating a KEK entity.

func (*KEKClient) CreateBulk

func (c *KEKClient) CreateBulk(builders ...*KEKCreate) *KEKCreateBulk

CreateBulk returns a builder for creating a bulk of KEK entities.

func (*KEKClient) Delete

func (c *KEKClient) Delete() *KEKDelete

Delete returns a delete builder for KEK.

func (*KEKClient) DeleteOne

func (c *KEKClient) DeleteOne(_m *KEK) *KEKDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*KEKClient) DeleteOneID

func (c *KEKClient) DeleteOneID(id envelope.ID) *KEKDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*KEKClient) ExecContext

func (c *KEKClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKClient) Get

func (c *KEKClient) Get(ctx context.Context, id envelope.ID) (*KEK, error)

Get returns a KEK entity by its id.

func (*KEKClient) GetX

func (c *KEKClient) GetX(ctx context.Context, id envelope.ID) *KEK

GetX is like Get, but panics if an error occurs.

func (*KEKClient) Hooks

func (c *KEKClient) Hooks() []Hook

Hooks returns the client hooks.

func (*KEKClient) Intercept

func (c *KEKClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `kek.Intercept(f(g(h())))`.

func (*KEKClient) Interceptors

func (c *KEKClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*KEKClient) MapCreateBulk

func (c *KEKClient) MapCreateBulk(slice any, setFunc func(*KEKCreate, int)) *KEKCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*KEKClient) Query

func (c *KEKClient) Query() *KEKQuery

Query returns a query builder for KEK.

func (*KEKClient) QueryContext

func (c *KEKClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKClient) QueryDataKeys

func (c *KEKClient) QueryDataKeys(_m *KEK) *DataKeyQuery

QueryDataKeys queries the data_keys edge of a KEK.

func (*KEKClient) QuerySentinels

func (c *KEKClient) QuerySentinels(_m *KEK) *SentinelQuery

QuerySentinels queries the sentinels edge of a KEK.

func (*KEKClient) QueryVersions

func (c *KEKClient) QueryVersions(_m *KEK) *KEKVersionQuery

QueryVersions queries the versions edge of a KEK.

func (*KEKClient) Update

func (c *KEKClient) Update() *KEKUpdate

Update returns an update builder for KEK.

func (*KEKClient) UpdateOne

func (c *KEKClient) UpdateOne(_m *KEK) *KEKUpdateOne

UpdateOne returns an update builder for the given entity.

func (*KEKClient) UpdateOneID

func (c *KEKClient) UpdateOneID(id envelope.ID) *KEKUpdateOne

UpdateOneID returns an update builder for the given id.

func (*KEKClient) Use

func (c *KEKClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `kek.Hooks(f(g(h())))`.

type KEKCreate

type KEKCreate struct {
	// contains filtered or unexported fields
}

KEKCreate is the builder for creating a KEK entity.

func (*KEKCreate) AddDataKeyIDs

func (_c *KEKCreate) AddDataKeyIDs(ids ...envelope.ID) *KEKCreate

AddDataKeyIDs adds the "data_keys" edge to the DataKey entity by IDs.

func (*KEKCreate) AddDataKeys

func (_c *KEKCreate) AddDataKeys(v ...*DataKey) *KEKCreate

AddDataKeys adds the "data_keys" edges to the DataKey entity.

func (*KEKCreate) AddSentinelIDs

func (_c *KEKCreate) AddSentinelIDs(ids ...int) *KEKCreate

AddSentinelIDs adds the "sentinels" edge to the Sentinel entity by IDs.

func (*KEKCreate) AddSentinels

func (_c *KEKCreate) AddSentinels(v ...*Sentinel) *KEKCreate

AddSentinels adds the "sentinels" edges to the Sentinel entity.

func (*KEKCreate) AddVersionIDs

func (_c *KEKCreate) AddVersionIDs(ids ...int) *KEKCreate

AddVersionIDs adds the "versions" edge to the KEKVersion entity by IDs.

func (*KEKCreate) AddVersions

func (_c *KEKCreate) AddVersions(v ...*KEKVersion) *KEKCreate

AddVersions adds the "versions" edges to the KEKVersion entity.

func (*KEKCreate) Exec

func (_c *KEKCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKCreate) ExecContext

func (c *KEKCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKCreate) ExecX

func (_c *KEKCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKCreate) Mutation

func (_c *KEKCreate) Mutation() *KEKMutation

Mutation returns the KEKMutation object of the builder.

func (*KEKCreate) OnConflict

func (_c *KEKCreate) OnConflict(opts ...sql.ConflictOption) *KEKUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.KEK.Create().
	SetPurpose(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.KEKUpsert) {
		SetPurpose(v+v).
	}).
	Exec(ctx)

func (*KEKCreate) OnConflictColumns

func (_c *KEKCreate) OnConflictColumns(columns ...string) *KEKUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.KEK.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*KEKCreate) QueryContext

func (c *KEKCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKCreate) Save

func (_c *KEKCreate) Save(ctx context.Context) (*KEK, error)

Save creates the KEK in the database.

func (*KEKCreate) SaveX

func (_c *KEKCreate) SaveX(ctx context.Context) *KEK

SaveX calls Save and panics if Save returns an error.

func (*KEKCreate) SetCreatedAt

func (_c *KEKCreate) SetCreatedAt(v time.Time) *KEKCreate

SetCreatedAt sets the "created_at" field.

func (*KEKCreate) SetID

func (_c *KEKCreate) SetID(v envelope.ID) *KEKCreate

SetID sets the "id" field.

func (*KEKCreate) SetProvider

func (_c *KEKCreate) SetProvider(v string) *KEKCreate

SetProvider sets the "provider" field.

func (*KEKCreate) SetProviderRef

func (_c *KEKCreate) SetProviderRef(v string) *KEKCreate

SetProviderRef sets the "provider_ref" field.

func (*KEKCreate) SetPurpose

func (_c *KEKCreate) SetPurpose(v string) *KEKCreate

SetPurpose sets the "purpose" field.

func (*KEKCreate) SetState

func (_c *KEKCreate) SetState(v uint8) *KEKCreate

SetState sets the "state" field.

type KEKCreateBulk

type KEKCreateBulk struct {
	// contains filtered or unexported fields
}

KEKCreateBulk is the builder for creating many KEK entities in bulk.

func (*KEKCreateBulk) Exec

func (_c *KEKCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKCreateBulk) ExecContext

func (c *KEKCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKCreateBulk) ExecX

func (_c *KEKCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKCreateBulk) OnConflict

func (_c *KEKCreateBulk) OnConflict(opts ...sql.ConflictOption) *KEKUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.KEK.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.KEKUpsert) {
		SetPurpose(v+v).
	}).
	Exec(ctx)

func (*KEKCreateBulk) OnConflictColumns

func (_c *KEKCreateBulk) OnConflictColumns(columns ...string) *KEKUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.KEK.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*KEKCreateBulk) QueryContext

func (c *KEKCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKCreateBulk) Save

func (_c *KEKCreateBulk) Save(ctx context.Context) ([]*KEK, error)

Save creates the KEK entities in the database.

func (*KEKCreateBulk) SaveX

func (_c *KEKCreateBulk) SaveX(ctx context.Context) []*KEK

SaveX is like Save, but panics if an error occurs.

type KEKDelete

type KEKDelete struct {
	// contains filtered or unexported fields
}

KEKDelete is the builder for deleting a KEK entity.

func (*KEKDelete) Exec

func (_d *KEKDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*KEKDelete) ExecContext

func (c *KEKDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKDelete) ExecX

func (_d *KEKDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*KEKDelete) QueryContext

func (c *KEKDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKDelete) Where

func (_d *KEKDelete) Where(ps ...predicate.KEK) *KEKDelete

Where appends a list predicates to the KEKDelete builder.

type KEKDeleteOne

type KEKDeleteOne struct {
	// contains filtered or unexported fields
}

KEKDeleteOne is the builder for deleting a single KEK entity.

func (*KEKDeleteOne) Exec

func (_d *KEKDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*KEKDeleteOne) ExecX

func (_d *KEKDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKDeleteOne) Where

func (_d *KEKDeleteOne) Where(ps ...predicate.KEK) *KEKDeleteOne

Where appends a list predicates to the KEKDelete builder.

type KEKEdges

type KEKEdges struct {
	// Versions holds the value of the versions edge.
	Versions []*KEKVersion `json:"versions,omitempty"`
	// DataKeys holds the value of the data_keys edge.
	DataKeys []*DataKey `json:"data_keys,omitempty"`
	// Sentinels holds the value of the sentinels edge.
	Sentinels []*Sentinel `json:"sentinels,omitempty"`
	// contains filtered or unexported fields
}

KEKEdges holds the relations/edges for other nodes in the graph.

func (KEKEdges) DataKeysOrErr

func (e KEKEdges) DataKeysOrErr() ([]*DataKey, error)

DataKeysOrErr returns the DataKeys value or an error if the edge was not loaded in eager-loading.

func (KEKEdges) SentinelsOrErr

func (e KEKEdges) SentinelsOrErr() ([]*Sentinel, error)

SentinelsOrErr returns the Sentinels value or an error if the edge was not loaded in eager-loading.

func (KEKEdges) VersionsOrErr

func (e KEKEdges) VersionsOrErr() ([]*KEKVersion, error)

VersionsOrErr returns the Versions value or an error if the edge was not loaded in eager-loading.

type KEKGroupBy

type KEKGroupBy struct {
	// contains filtered or unexported fields
}

KEKGroupBy is the group-by builder for KEK entities.

func (*KEKGroupBy) Aggregate

func (_g *KEKGroupBy) Aggregate(fns ...AggregateFunc) *KEKGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*KEKGroupBy) Bool

func (s *KEKGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) BoolX

func (s *KEKGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KEKGroupBy) Bools

func (s *KEKGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) BoolsX

func (s *KEKGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*KEKGroupBy) Float64

func (s *KEKGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) Float64X

func (s *KEKGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KEKGroupBy) Float64s

func (s *KEKGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) Float64sX

func (s *KEKGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KEKGroupBy) Int

func (s *KEKGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) IntX

func (s *KEKGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KEKGroupBy) Ints

func (s *KEKGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) IntsX

func (s *KEKGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*KEKGroupBy) Scan

func (_g *KEKGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KEKGroupBy) ScanX

func (s *KEKGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KEKGroupBy) String

func (s *KEKGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) StringX

func (s *KEKGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KEKGroupBy) Strings

func (s *KEKGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KEKGroupBy) StringsX

func (s *KEKGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KEKMutation

type KEKMutation struct {
	// contains filtered or unexported fields
}

KEKMutation represents an operation that mutates the KEK nodes in the graph.

func (*KEKMutation) AddDataKeyIDs

func (m *KEKMutation) AddDataKeyIDs(ids ...envelope.ID)

AddDataKeyIDs adds the "data_keys" edge to the DataKey entity by ids.

func (*KEKMutation) AddField

func (m *KEKMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*KEKMutation) AddSentinelIDs

func (m *KEKMutation) AddSentinelIDs(ids ...int)

AddSentinelIDs adds the "sentinels" edge to the Sentinel entity by ids.

func (*KEKMutation) AddState

func (m *KEKMutation) AddState(u int8)

AddState adds u to the "state" field.

func (*KEKMutation) AddVersionIDs

func (m *KEKMutation) AddVersionIDs(ids ...int)

AddVersionIDs adds the "versions" edge to the KEKVersion entity by ids.

func (*KEKMutation) AddedEdges

func (m *KEKMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*KEKMutation) AddedField

func (m *KEKMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*KEKMutation) AddedFields

func (m *KEKMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*KEKMutation) AddedIDs

func (m *KEKMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*KEKMutation) AddedState

func (m *KEKMutation) AddedState() (r int8, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*KEKMutation) ClearDataKeys

func (m *KEKMutation) ClearDataKeys()

ClearDataKeys clears the "data_keys" edge to the DataKey entity.

func (*KEKMutation) ClearEdge

func (m *KEKMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*KEKMutation) ClearField

func (m *KEKMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*KEKMutation) ClearSentinels

func (m *KEKMutation) ClearSentinels()

ClearSentinels clears the "sentinels" edge to the Sentinel entity.

func (*KEKMutation) ClearVersions

func (m *KEKMutation) ClearVersions()

ClearVersions clears the "versions" edge to the KEKVersion entity.

func (*KEKMutation) ClearedEdges

func (m *KEKMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*KEKMutation) ClearedFields

func (m *KEKMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (KEKMutation) Client

func (m KEKMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*KEKMutation) CreatedAt

func (m *KEKMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*KEKMutation) DataKeysCleared

func (m *KEKMutation) DataKeysCleared() bool

DataKeysCleared reports if the "data_keys" edge to the DataKey entity was cleared.

func (*KEKMutation) DataKeysIDs

func (m *KEKMutation) DataKeysIDs() (ids []envelope.ID)

DataKeysIDs returns the "data_keys" edge IDs in the mutation.

func (*KEKMutation) EdgeCleared

func (m *KEKMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*KEKMutation) ExecContext

func (c *KEKMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKMutation) Field

func (m *KEKMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*KEKMutation) FieldCleared

func (m *KEKMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*KEKMutation) Fields

func (m *KEKMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*KEKMutation) ID

func (m *KEKMutation) ID() (id envelope.ID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*KEKMutation) IDs

func (m *KEKMutation) IDs(ctx context.Context) ([]envelope.ID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*KEKMutation) OldCreatedAt

func (m *KEKMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the KEK entity. If the KEK object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKMutation) OldField

func (m *KEKMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*KEKMutation) OldProvider

func (m *KEKMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the KEK entity. If the KEK object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKMutation) OldProviderRef

func (m *KEKMutation) OldProviderRef(ctx context.Context) (v string, err error)

OldProviderRef returns the old "provider_ref" field's value of the KEK entity. If the KEK object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKMutation) OldPurpose

func (m *KEKMutation) OldPurpose(ctx context.Context) (v string, err error)

OldPurpose returns the old "purpose" field's value of the KEK entity. If the KEK object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKMutation) OldState

func (m *KEKMutation) OldState(ctx context.Context) (v uint8, err error)

OldState returns the old "state" field's value of the KEK entity. If the KEK object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKMutation) Op

func (m *KEKMutation) Op() Op

Op returns the operation name.

func (*KEKMutation) Provider

func (m *KEKMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*KEKMutation) ProviderRef

func (m *KEKMutation) ProviderRef() (r string, exists bool)

ProviderRef returns the value of the "provider_ref" field in the mutation.

func (*KEKMutation) Purpose

func (m *KEKMutation) Purpose() (r string, exists bool)

Purpose returns the value of the "purpose" field in the mutation.

func (*KEKMutation) QueryContext

func (c *KEKMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKMutation) RemoveDataKeyIDs

func (m *KEKMutation) RemoveDataKeyIDs(ids ...envelope.ID)

RemoveDataKeyIDs removes the "data_keys" edge to the DataKey entity by IDs.

func (*KEKMutation) RemoveSentinelIDs

func (m *KEKMutation) RemoveSentinelIDs(ids ...int)

RemoveSentinelIDs removes the "sentinels" edge to the Sentinel entity by IDs.

func (*KEKMutation) RemoveVersionIDs

func (m *KEKMutation) RemoveVersionIDs(ids ...int)

RemoveVersionIDs removes the "versions" edge to the KEKVersion entity by IDs.

func (*KEKMutation) RemovedDataKeysIDs

func (m *KEKMutation) RemovedDataKeysIDs() (ids []envelope.ID)

RemovedDataKeys returns the removed IDs of the "data_keys" edge to the DataKey entity.

func (*KEKMutation) RemovedEdges

func (m *KEKMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*KEKMutation) RemovedIDs

func (m *KEKMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*KEKMutation) RemovedSentinelsIDs

func (m *KEKMutation) RemovedSentinelsIDs() (ids []int)

RemovedSentinels returns the removed IDs of the "sentinels" edge to the Sentinel entity.

func (*KEKMutation) RemovedVersionsIDs

func (m *KEKMutation) RemovedVersionsIDs() (ids []int)

RemovedVersions returns the removed IDs of the "versions" edge to the KEKVersion entity.

func (*KEKMutation) ResetCreatedAt

func (m *KEKMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*KEKMutation) ResetDataKeys

func (m *KEKMutation) ResetDataKeys()

ResetDataKeys resets all changes to the "data_keys" edge.

func (*KEKMutation) ResetEdge

func (m *KEKMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*KEKMutation) ResetField

func (m *KEKMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*KEKMutation) ResetProvider

func (m *KEKMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*KEKMutation) ResetProviderRef

func (m *KEKMutation) ResetProviderRef()

ResetProviderRef resets all changes to the "provider_ref" field.

func (*KEKMutation) ResetPurpose

func (m *KEKMutation) ResetPurpose()

ResetPurpose resets all changes to the "purpose" field.

func (*KEKMutation) ResetSentinels

func (m *KEKMutation) ResetSentinels()

ResetSentinels resets all changes to the "sentinels" edge.

func (*KEKMutation) ResetState

func (m *KEKMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*KEKMutation) ResetVersions

func (m *KEKMutation) ResetVersions()

ResetVersions resets all changes to the "versions" edge.

func (*KEKMutation) SentinelsCleared

func (m *KEKMutation) SentinelsCleared() bool

SentinelsCleared reports if the "sentinels" edge to the Sentinel entity was cleared.

func (*KEKMutation) SentinelsIDs

func (m *KEKMutation) SentinelsIDs() (ids []int)

SentinelsIDs returns the "sentinels" edge IDs in the mutation.

func (*KEKMutation) SetCreatedAt

func (m *KEKMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*KEKMutation) SetField

func (m *KEKMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*KEKMutation) SetID

func (m *KEKMutation) SetID(id envelope.ID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of KEK entities.

func (*KEKMutation) SetOp

func (m *KEKMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*KEKMutation) SetProvider

func (m *KEKMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*KEKMutation) SetProviderRef

func (m *KEKMutation) SetProviderRef(s string)

SetProviderRef sets the "provider_ref" field.

func (*KEKMutation) SetPurpose

func (m *KEKMutation) SetPurpose(s string)

SetPurpose sets the "purpose" field.

func (*KEKMutation) SetState

func (m *KEKMutation) SetState(u uint8)

SetState sets the "state" field.

func (*KEKMutation) State

func (m *KEKMutation) State() (r uint8, exists bool)

State returns the value of the "state" field in the mutation.

func (KEKMutation) Tx

func (m KEKMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*KEKMutation) Type

func (m *KEKMutation) Type() string

Type returns the node type of this mutation (KEK).

func (*KEKMutation) VersionsCleared

func (m *KEKMutation) VersionsCleared() bool

VersionsCleared reports if the "versions" edge to the KEKVersion entity was cleared.

func (*KEKMutation) VersionsIDs

func (m *KEKMutation) VersionsIDs() (ids []int)

VersionsIDs returns the "versions" edge IDs in the mutation.

func (*KEKMutation) Where

func (m *KEKMutation) Where(ps ...predicate.KEK)

Where appends a list predicates to the KEKMutation builder.

func (*KEKMutation) WhereP

func (m *KEKMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the KEKMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type KEKQuery

type KEKQuery struct {
	// contains filtered or unexported fields
}

KEKQuery is the builder for querying KEK entities.

func (*KEKQuery) Aggregate

func (_q *KEKQuery) Aggregate(fns ...AggregateFunc) *KEKSelect

Aggregate returns a KEKSelect configured with the given aggregations.

func (*KEKQuery) All

func (_q *KEKQuery) All(ctx context.Context) ([]*KEK, error)

All executes the query and returns a list of KEKs.

func (*KEKQuery) AllX

func (_q *KEKQuery) AllX(ctx context.Context) []*KEK

AllX is like All, but panics if an error occurs.

func (*KEKQuery) Clone

func (_q *KEKQuery) Clone() *KEKQuery

Clone returns a duplicate of the KEKQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*KEKQuery) Count

func (_q *KEKQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*KEKQuery) CountX

func (_q *KEKQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*KEKQuery) ExecContext

func (c *KEKQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKQuery) Exist

func (_q *KEKQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*KEKQuery) ExistX

func (_q *KEKQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*KEKQuery) First

func (_q *KEKQuery) First(ctx context.Context) (*KEK, error)

First returns the first KEK entity from the query. Returns a *NotFoundError when no KEK was found.

func (*KEKQuery) FirstID

func (_q *KEKQuery) FirstID(ctx context.Context) (id envelope.ID, err error)

FirstID returns the first KEK ID from the query. Returns a *NotFoundError when no KEK ID was found.

func (*KEKQuery) FirstIDX

func (_q *KEKQuery) FirstIDX(ctx context.Context) envelope.ID

FirstIDX is like FirstID, but panics if an error occurs.

func (*KEKQuery) FirstX

func (_q *KEKQuery) FirstX(ctx context.Context) *KEK

FirstX is like First, but panics if an error occurs.

func (*KEKQuery) ForShare

func (_q *KEKQuery) ForShare(opts ...sql.LockOption) *KEKQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*KEKQuery) ForUpdate

func (_q *KEKQuery) ForUpdate(opts ...sql.LockOption) *KEKQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*KEKQuery) GroupBy

func (_q *KEKQuery) GroupBy(field string, fields ...string) *KEKGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Purpose string `json:"purpose,omitempty"`
	Count int `json:"count,omitempty"`
}

client.KEK.Query().
	GroupBy(kek.FieldPurpose).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*KEKQuery) IDs

func (_q *KEKQuery) IDs(ctx context.Context) (ids []envelope.ID, err error)

IDs executes the query and returns a list of KEK IDs.

func (*KEKQuery) IDsX

func (_q *KEKQuery) IDsX(ctx context.Context) []envelope.ID

IDsX is like IDs, but panics if an error occurs.

func (*KEKQuery) Limit

func (_q *KEKQuery) Limit(limit int) *KEKQuery

Limit the number of records to be returned by this query.

func (*KEKQuery) Offset

func (_q *KEKQuery) Offset(offset int) *KEKQuery

Offset to start from.

func (*KEKQuery) Only

func (_q *KEKQuery) Only(ctx context.Context) (*KEK, error)

Only returns a single KEK entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one KEK entity is found. Returns a *NotFoundError when no KEK entities are found.

func (*KEKQuery) OnlyID

func (_q *KEKQuery) OnlyID(ctx context.Context) (id envelope.ID, err error)

OnlyID is like Only, but returns the only KEK ID in the query. Returns a *NotSingularError when more than one KEK ID is found. Returns a *NotFoundError when no entities are found.

func (*KEKQuery) OnlyIDX

func (_q *KEKQuery) OnlyIDX(ctx context.Context) envelope.ID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*KEKQuery) OnlyX

func (_q *KEKQuery) OnlyX(ctx context.Context) *KEK

OnlyX is like Only, but panics if an error occurs.

func (*KEKQuery) Order

func (_q *KEKQuery) Order(o ...kek.OrderOption) *KEKQuery

Order specifies how the records should be ordered.

func (*KEKQuery) QueryContext

func (c *KEKQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKQuery) QueryDataKeys

func (_q *KEKQuery) QueryDataKeys() *DataKeyQuery

QueryDataKeys chains the current query on the "data_keys" edge.

func (*KEKQuery) QuerySentinels

func (_q *KEKQuery) QuerySentinels() *SentinelQuery

QuerySentinels chains the current query on the "sentinels" edge.

func (*KEKQuery) QueryVersions

func (_q *KEKQuery) QueryVersions() *KEKVersionQuery

QueryVersions chains the current query on the "versions" edge.

func (*KEKQuery) Select

func (_q *KEKQuery) Select(fields ...string) *KEKSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Purpose string `json:"purpose,omitempty"`
}

client.KEK.Query().
	Select(kek.FieldPurpose).
	Scan(ctx, &v)

func (*KEKQuery) Unique

func (_q *KEKQuery) Unique(unique bool) *KEKQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*KEKQuery) Where

func (_q *KEKQuery) Where(ps ...predicate.KEK) *KEKQuery

Where adds a new predicate for the KEKQuery builder.

func (*KEKQuery) WithDataKeys

func (_q *KEKQuery) WithDataKeys(opts ...func(*DataKeyQuery)) *KEKQuery

WithDataKeys tells the query-builder to eager-load the nodes that are connected to the "data_keys" edge. The optional arguments are used to configure the query builder of the edge.

func (*KEKQuery) WithSentinels

func (_q *KEKQuery) WithSentinels(opts ...func(*SentinelQuery)) *KEKQuery

WithSentinels tells the query-builder to eager-load the nodes that are connected to the "sentinels" edge. The optional arguments are used to configure the query builder of the edge.

func (*KEKQuery) WithVersions

func (_q *KEKQuery) WithVersions(opts ...func(*KEKVersionQuery)) *KEKQuery

WithVersions tells the query-builder to eager-load the nodes that are connected to the "versions" edge. The optional arguments are used to configure the query builder of the edge.

type KEKSelect

type KEKSelect struct {
	*KEKQuery
	// contains filtered or unexported fields
}

KEKSelect is the builder for selecting fields of KEK entities.

func (*KEKSelect) Aggregate

func (_s *KEKSelect) Aggregate(fns ...AggregateFunc) *KEKSelect

Aggregate adds the given aggregation functions to the selector query.

func (*KEKSelect) Bool

func (s *KEKSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KEKSelect) BoolX

func (s *KEKSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KEKSelect) Bools

func (s *KEKSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KEKSelect) BoolsX

func (s *KEKSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (KEKSelect) ExecContext

func (c KEKSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKSelect) Float64

func (s *KEKSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KEKSelect) Float64X

func (s *KEKSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KEKSelect) Float64s

func (s *KEKSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KEKSelect) Float64sX

func (s *KEKSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KEKSelect) Int

func (s *KEKSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KEKSelect) IntX

func (s *KEKSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KEKSelect) Ints

func (s *KEKSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KEKSelect) IntsX

func (s *KEKSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (KEKSelect) QueryContext

func (c KEKSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKSelect) Scan

func (_s *KEKSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KEKSelect) ScanX

func (s *KEKSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KEKSelect) String

func (s *KEKSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KEKSelect) StringX

func (s *KEKSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KEKSelect) Strings

func (s *KEKSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KEKSelect) StringsX

func (s *KEKSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KEKUpdate

type KEKUpdate struct {
	// contains filtered or unexported fields
}

KEKUpdate is the builder for updating KEK entities.

func (*KEKUpdate) AddDataKeyIDs

func (_u *KEKUpdate) AddDataKeyIDs(ids ...envelope.ID) *KEKUpdate

AddDataKeyIDs adds the "data_keys" edge to the DataKey entity by IDs.

func (*KEKUpdate) AddDataKeys

func (_u *KEKUpdate) AddDataKeys(v ...*DataKey) *KEKUpdate

AddDataKeys adds the "data_keys" edges to the DataKey entity.

func (*KEKUpdate) AddSentinelIDs

func (_u *KEKUpdate) AddSentinelIDs(ids ...int) *KEKUpdate

AddSentinelIDs adds the "sentinels" edge to the Sentinel entity by IDs.

func (*KEKUpdate) AddSentinels

func (_u *KEKUpdate) AddSentinels(v ...*Sentinel) *KEKUpdate

AddSentinels adds the "sentinels" edges to the Sentinel entity.

func (*KEKUpdate) AddState

func (_u *KEKUpdate) AddState(v int8) *KEKUpdate

AddState adds value to the "state" field.

func (*KEKUpdate) AddVersionIDs

func (_u *KEKUpdate) AddVersionIDs(ids ...int) *KEKUpdate

AddVersionIDs adds the "versions" edge to the KEKVersion entity by IDs.

func (*KEKUpdate) AddVersions

func (_u *KEKUpdate) AddVersions(v ...*KEKVersion) *KEKUpdate

AddVersions adds the "versions" edges to the KEKVersion entity.

func (*KEKUpdate) ClearDataKeys

func (_u *KEKUpdate) ClearDataKeys() *KEKUpdate

ClearDataKeys clears all "data_keys" edges to the DataKey entity.

func (*KEKUpdate) ClearSentinels

func (_u *KEKUpdate) ClearSentinels() *KEKUpdate

ClearSentinels clears all "sentinels" edges to the Sentinel entity.

func (*KEKUpdate) ClearVersions

func (_u *KEKUpdate) ClearVersions() *KEKUpdate

ClearVersions clears all "versions" edges to the KEKVersion entity.

func (*KEKUpdate) Exec

func (_u *KEKUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKUpdate) ExecContext

func (c *KEKUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKUpdate) ExecX

func (_u *KEKUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKUpdate) Mutation

func (_u *KEKUpdate) Mutation() *KEKMutation

Mutation returns the KEKMutation object of the builder.

func (*KEKUpdate) QueryContext

func (c *KEKUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKUpdate) RemoveDataKeyIDs

func (_u *KEKUpdate) RemoveDataKeyIDs(ids ...envelope.ID) *KEKUpdate

RemoveDataKeyIDs removes the "data_keys" edge to DataKey entities by IDs.

func (*KEKUpdate) RemoveDataKeys

func (_u *KEKUpdate) RemoveDataKeys(v ...*DataKey) *KEKUpdate

RemoveDataKeys removes "data_keys" edges to DataKey entities.

func (*KEKUpdate) RemoveSentinelIDs

func (_u *KEKUpdate) RemoveSentinelIDs(ids ...int) *KEKUpdate

RemoveSentinelIDs removes the "sentinels" edge to Sentinel entities by IDs.

func (*KEKUpdate) RemoveSentinels

func (_u *KEKUpdate) RemoveSentinels(v ...*Sentinel) *KEKUpdate

RemoveSentinels removes "sentinels" edges to Sentinel entities.

func (*KEKUpdate) RemoveVersionIDs

func (_u *KEKUpdate) RemoveVersionIDs(ids ...int) *KEKUpdate

RemoveVersionIDs removes the "versions" edge to KEKVersion entities by IDs.

func (*KEKUpdate) RemoveVersions

func (_u *KEKUpdate) RemoveVersions(v ...*KEKVersion) *KEKUpdate

RemoveVersions removes "versions" edges to KEKVersion entities.

func (*KEKUpdate) Save

func (_u *KEKUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*KEKUpdate) SaveX

func (_u *KEKUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*KEKUpdate) SetCreatedAt

func (_u *KEKUpdate) SetCreatedAt(v time.Time) *KEKUpdate

SetCreatedAt sets the "created_at" field.

func (*KEKUpdate) SetNillableCreatedAt

func (_u *KEKUpdate) SetNillableCreatedAt(v *time.Time) *KEKUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*KEKUpdate) SetNillableProvider

func (_u *KEKUpdate) SetNillableProvider(v *string) *KEKUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*KEKUpdate) SetNillableProviderRef

func (_u *KEKUpdate) SetNillableProviderRef(v *string) *KEKUpdate

SetNillableProviderRef sets the "provider_ref" field if the given value is not nil.

func (*KEKUpdate) SetNillablePurpose

func (_u *KEKUpdate) SetNillablePurpose(v *string) *KEKUpdate

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*KEKUpdate) SetNillableState

func (_u *KEKUpdate) SetNillableState(v *uint8) *KEKUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*KEKUpdate) SetProvider

func (_u *KEKUpdate) SetProvider(v string) *KEKUpdate

SetProvider sets the "provider" field.

func (*KEKUpdate) SetProviderRef

func (_u *KEKUpdate) SetProviderRef(v string) *KEKUpdate

SetProviderRef sets the "provider_ref" field.

func (*KEKUpdate) SetPurpose

func (_u *KEKUpdate) SetPurpose(v string) *KEKUpdate

SetPurpose sets the "purpose" field.

func (*KEKUpdate) SetState

func (_u *KEKUpdate) SetState(v uint8) *KEKUpdate

SetState sets the "state" field.

func (*KEKUpdate) Where

func (_u *KEKUpdate) Where(ps ...predicate.KEK) *KEKUpdate

Where appends a list predicates to the KEKUpdate builder.

type KEKUpdateOne

type KEKUpdateOne struct {
	// contains filtered or unexported fields
}

KEKUpdateOne is the builder for updating a single KEK entity.

func (*KEKUpdateOne) AddDataKeyIDs

func (_u *KEKUpdateOne) AddDataKeyIDs(ids ...envelope.ID) *KEKUpdateOne

AddDataKeyIDs adds the "data_keys" edge to the DataKey entity by IDs.

func (*KEKUpdateOne) AddDataKeys

func (_u *KEKUpdateOne) AddDataKeys(v ...*DataKey) *KEKUpdateOne

AddDataKeys adds the "data_keys" edges to the DataKey entity.

func (*KEKUpdateOne) AddSentinelIDs

func (_u *KEKUpdateOne) AddSentinelIDs(ids ...int) *KEKUpdateOne

AddSentinelIDs adds the "sentinels" edge to the Sentinel entity by IDs.

func (*KEKUpdateOne) AddSentinels

func (_u *KEKUpdateOne) AddSentinels(v ...*Sentinel) *KEKUpdateOne

AddSentinels adds the "sentinels" edges to the Sentinel entity.

func (*KEKUpdateOne) AddState

func (_u *KEKUpdateOne) AddState(v int8) *KEKUpdateOne

AddState adds value to the "state" field.

func (*KEKUpdateOne) AddVersionIDs

func (_u *KEKUpdateOne) AddVersionIDs(ids ...int) *KEKUpdateOne

AddVersionIDs adds the "versions" edge to the KEKVersion entity by IDs.

func (*KEKUpdateOne) AddVersions

func (_u *KEKUpdateOne) AddVersions(v ...*KEKVersion) *KEKUpdateOne

AddVersions adds the "versions" edges to the KEKVersion entity.

func (*KEKUpdateOne) ClearDataKeys

func (_u *KEKUpdateOne) ClearDataKeys() *KEKUpdateOne

ClearDataKeys clears all "data_keys" edges to the DataKey entity.

func (*KEKUpdateOne) ClearSentinels

func (_u *KEKUpdateOne) ClearSentinels() *KEKUpdateOne

ClearSentinels clears all "sentinels" edges to the Sentinel entity.

func (*KEKUpdateOne) ClearVersions

func (_u *KEKUpdateOne) ClearVersions() *KEKUpdateOne

ClearVersions clears all "versions" edges to the KEKVersion entity.

func (*KEKUpdateOne) Exec

func (_u *KEKUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*KEKUpdateOne) ExecContext

func (c *KEKUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKUpdateOne) ExecX

func (_u *KEKUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKUpdateOne) Mutation

func (_u *KEKUpdateOne) Mutation() *KEKMutation

Mutation returns the KEKMutation object of the builder.

func (*KEKUpdateOne) QueryContext

func (c *KEKUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKUpdateOne) RemoveDataKeyIDs

func (_u *KEKUpdateOne) RemoveDataKeyIDs(ids ...envelope.ID) *KEKUpdateOne

RemoveDataKeyIDs removes the "data_keys" edge to DataKey entities by IDs.

func (*KEKUpdateOne) RemoveDataKeys

func (_u *KEKUpdateOne) RemoveDataKeys(v ...*DataKey) *KEKUpdateOne

RemoveDataKeys removes "data_keys" edges to DataKey entities.

func (*KEKUpdateOne) RemoveSentinelIDs

func (_u *KEKUpdateOne) RemoveSentinelIDs(ids ...int) *KEKUpdateOne

RemoveSentinelIDs removes the "sentinels" edge to Sentinel entities by IDs.

func (*KEKUpdateOne) RemoveSentinels

func (_u *KEKUpdateOne) RemoveSentinels(v ...*Sentinel) *KEKUpdateOne

RemoveSentinels removes "sentinels" edges to Sentinel entities.

func (*KEKUpdateOne) RemoveVersionIDs

func (_u *KEKUpdateOne) RemoveVersionIDs(ids ...int) *KEKUpdateOne

RemoveVersionIDs removes the "versions" edge to KEKVersion entities by IDs.

func (*KEKUpdateOne) RemoveVersions

func (_u *KEKUpdateOne) RemoveVersions(v ...*KEKVersion) *KEKUpdateOne

RemoveVersions removes "versions" edges to KEKVersion entities.

func (*KEKUpdateOne) Save

func (_u *KEKUpdateOne) Save(ctx context.Context) (*KEK, error)

Save executes the query and returns the updated KEK entity.

func (*KEKUpdateOne) SaveX

func (_u *KEKUpdateOne) SaveX(ctx context.Context) *KEK

SaveX is like Save, but panics if an error occurs.

func (*KEKUpdateOne) Select

func (_u *KEKUpdateOne) Select(field string, fields ...string) *KEKUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*KEKUpdateOne) SetCreatedAt

func (_u *KEKUpdateOne) SetCreatedAt(v time.Time) *KEKUpdateOne

SetCreatedAt sets the "created_at" field.

func (*KEKUpdateOne) SetNillableCreatedAt

func (_u *KEKUpdateOne) SetNillableCreatedAt(v *time.Time) *KEKUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*KEKUpdateOne) SetNillableProvider

func (_u *KEKUpdateOne) SetNillableProvider(v *string) *KEKUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*KEKUpdateOne) SetNillableProviderRef

func (_u *KEKUpdateOne) SetNillableProviderRef(v *string) *KEKUpdateOne

SetNillableProviderRef sets the "provider_ref" field if the given value is not nil.

func (*KEKUpdateOne) SetNillablePurpose

func (_u *KEKUpdateOne) SetNillablePurpose(v *string) *KEKUpdateOne

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*KEKUpdateOne) SetNillableState

func (_u *KEKUpdateOne) SetNillableState(v *uint8) *KEKUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*KEKUpdateOne) SetProvider

func (_u *KEKUpdateOne) SetProvider(v string) *KEKUpdateOne

SetProvider sets the "provider" field.

func (*KEKUpdateOne) SetProviderRef

func (_u *KEKUpdateOne) SetProviderRef(v string) *KEKUpdateOne

SetProviderRef sets the "provider_ref" field.

func (*KEKUpdateOne) SetPurpose

func (_u *KEKUpdateOne) SetPurpose(v string) *KEKUpdateOne

SetPurpose sets the "purpose" field.

func (*KEKUpdateOne) SetState

func (_u *KEKUpdateOne) SetState(v uint8) *KEKUpdateOne

SetState sets the "state" field.

func (*KEKUpdateOne) Where

func (_u *KEKUpdateOne) Where(ps ...predicate.KEK) *KEKUpdateOne

Where appends a list predicates to the KEKUpdate builder.

type KEKUpsert

type KEKUpsert struct {
	*sql.UpdateSet
}

KEKUpsert is the "OnConflict" setter.

func (*KEKUpsert) AddState

func (u *KEKUpsert) AddState(v uint8) *KEKUpsert

AddState adds v to the "state" field.

func (*KEKUpsert) SetCreatedAt

func (u *KEKUpsert) SetCreatedAt(v time.Time) *KEKUpsert

SetCreatedAt sets the "created_at" field.

func (*KEKUpsert) SetProvider

func (u *KEKUpsert) SetProvider(v string) *KEKUpsert

SetProvider sets the "provider" field.

func (*KEKUpsert) SetProviderRef

func (u *KEKUpsert) SetProviderRef(v string) *KEKUpsert

SetProviderRef sets the "provider_ref" field.

func (*KEKUpsert) SetPurpose

func (u *KEKUpsert) SetPurpose(v string) *KEKUpsert

SetPurpose sets the "purpose" field.

func (*KEKUpsert) SetState

func (u *KEKUpsert) SetState(v uint8) *KEKUpsert

SetState sets the "state" field.

func (*KEKUpsert) UpdateCreatedAt

func (u *KEKUpsert) UpdateCreatedAt() *KEKUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*KEKUpsert) UpdateProvider

func (u *KEKUpsert) UpdateProvider() *KEKUpsert

UpdateProvider sets the "provider" field to the value that was provided on create.

func (*KEKUpsert) UpdateProviderRef

func (u *KEKUpsert) UpdateProviderRef() *KEKUpsert

UpdateProviderRef sets the "provider_ref" field to the value that was provided on create.

func (*KEKUpsert) UpdatePurpose

func (u *KEKUpsert) UpdatePurpose() *KEKUpsert

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*KEKUpsert) UpdateState

func (u *KEKUpsert) UpdateState() *KEKUpsert

UpdateState sets the "state" field to the value that was provided on create.

type KEKUpsertBulk

type KEKUpsertBulk struct {
	// contains filtered or unexported fields
}

KEKUpsertBulk is the builder for "upsert"-ing a bulk of KEK nodes.

func (*KEKUpsertBulk) AddState

func (u *KEKUpsertBulk) AddState(v uint8) *KEKUpsertBulk

AddState adds v to the "state" field.

func (*KEKUpsertBulk) DoNothing

func (u *KEKUpsertBulk) DoNothing() *KEKUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*KEKUpsertBulk) Exec

func (u *KEKUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKUpsertBulk) ExecX

func (u *KEKUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKUpsertBulk) Ignore

func (u *KEKUpsertBulk) Ignore() *KEKUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.KEK.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*KEKUpsertBulk) SetCreatedAt

func (u *KEKUpsertBulk) SetCreatedAt(v time.Time) *KEKUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*KEKUpsertBulk) SetProvider

func (u *KEKUpsertBulk) SetProvider(v string) *KEKUpsertBulk

SetProvider sets the "provider" field.

func (*KEKUpsertBulk) SetProviderRef

func (u *KEKUpsertBulk) SetProviderRef(v string) *KEKUpsertBulk

SetProviderRef sets the "provider_ref" field.

func (*KEKUpsertBulk) SetPurpose

func (u *KEKUpsertBulk) SetPurpose(v string) *KEKUpsertBulk

SetPurpose sets the "purpose" field.

func (*KEKUpsertBulk) SetState

func (u *KEKUpsertBulk) SetState(v uint8) *KEKUpsertBulk

SetState sets the "state" field.

func (*KEKUpsertBulk) Update

func (u *KEKUpsertBulk) Update(set func(*KEKUpsert)) *KEKUpsertBulk

Update allows overriding fields `UPDATE` values. See the KEKCreateBulk.OnConflict documentation for more info.

func (*KEKUpsertBulk) UpdateCreatedAt

func (u *KEKUpsertBulk) UpdateCreatedAt() *KEKUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*KEKUpsertBulk) UpdateNewValues

func (u *KEKUpsertBulk) UpdateNewValues() *KEKUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.KEK.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(kek.FieldID)
		}),
	).
	Exec(ctx)

func (*KEKUpsertBulk) UpdateProvider

func (u *KEKUpsertBulk) UpdateProvider() *KEKUpsertBulk

UpdateProvider sets the "provider" field to the value that was provided on create.

func (*KEKUpsertBulk) UpdateProviderRef

func (u *KEKUpsertBulk) UpdateProviderRef() *KEKUpsertBulk

UpdateProviderRef sets the "provider_ref" field to the value that was provided on create.

func (*KEKUpsertBulk) UpdatePurpose

func (u *KEKUpsertBulk) UpdatePurpose() *KEKUpsertBulk

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*KEKUpsertBulk) UpdateState

func (u *KEKUpsertBulk) UpdateState() *KEKUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

type KEKUpsertOne

type KEKUpsertOne struct {
	// contains filtered or unexported fields
}

KEKUpsertOne is the builder for "upsert"-ing

one KEK node.

func (*KEKUpsertOne) AddState

func (u *KEKUpsertOne) AddState(v uint8) *KEKUpsertOne

AddState adds v to the "state" field.

func (*KEKUpsertOne) DoNothing

func (u *KEKUpsertOne) DoNothing() *KEKUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*KEKUpsertOne) Exec

func (u *KEKUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKUpsertOne) ExecX

func (u *KEKUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKUpsertOne) ID

func (u *KEKUpsertOne) ID(ctx context.Context) (id envelope.ID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*KEKUpsertOne) IDX

func (u *KEKUpsertOne) IDX(ctx context.Context) envelope.ID

IDX is like ID, but panics if an error occurs.

func (*KEKUpsertOne) Ignore

func (u *KEKUpsertOne) Ignore() *KEKUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.KEK.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*KEKUpsertOne) SetCreatedAt

func (u *KEKUpsertOne) SetCreatedAt(v time.Time) *KEKUpsertOne

SetCreatedAt sets the "created_at" field.

func (*KEKUpsertOne) SetProvider

func (u *KEKUpsertOne) SetProvider(v string) *KEKUpsertOne

SetProvider sets the "provider" field.

func (*KEKUpsertOne) SetProviderRef

func (u *KEKUpsertOne) SetProviderRef(v string) *KEKUpsertOne

SetProviderRef sets the "provider_ref" field.

func (*KEKUpsertOne) SetPurpose

func (u *KEKUpsertOne) SetPurpose(v string) *KEKUpsertOne

SetPurpose sets the "purpose" field.

func (*KEKUpsertOne) SetState

func (u *KEKUpsertOne) SetState(v uint8) *KEKUpsertOne

SetState sets the "state" field.

func (*KEKUpsertOne) Update

func (u *KEKUpsertOne) Update(set func(*KEKUpsert)) *KEKUpsertOne

Update allows overriding fields `UPDATE` values. See the KEKCreate.OnConflict documentation for more info.

func (*KEKUpsertOne) UpdateCreatedAt

func (u *KEKUpsertOne) UpdateCreatedAt() *KEKUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*KEKUpsertOne) UpdateNewValues

func (u *KEKUpsertOne) UpdateNewValues() *KEKUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.KEK.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(kek.FieldID)
		}),
	).
	Exec(ctx)

func (*KEKUpsertOne) UpdateProvider

func (u *KEKUpsertOne) UpdateProvider() *KEKUpsertOne

UpdateProvider sets the "provider" field to the value that was provided on create.

func (*KEKUpsertOne) UpdateProviderRef

func (u *KEKUpsertOne) UpdateProviderRef() *KEKUpsertOne

UpdateProviderRef sets the "provider_ref" field to the value that was provided on create.

func (*KEKUpsertOne) UpdatePurpose

func (u *KEKUpsertOne) UpdatePurpose() *KEKUpsertOne

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*KEKUpsertOne) UpdateState

func (u *KEKUpsertOne) UpdateState() *KEKUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

type KEKVersion

type KEKVersion struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// KekID holds the value of the "kek_id" field.
	KekID envelope.ID `json:"kek_id,omitempty"`
	// Version holds the value of the "version" field.
	Version uint32 `json:"version,omitempty"`
	// State holds the value of the "state" field.
	State uint8 `json:"state,omitempty"`
	// ProviderRef holds the value of the "provider_ref" field.
	ProviderRef string `json:"provider_ref,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ActivatedAt holds the value of the "activated_at" field.
	ActivatedAt *time.Time `json:"activated_at,omitempty"`
	// RotatedAt holds the value of the "rotated_at" field.
	RotatedAt *time.Time `json:"rotated_at,omitempty"`
	// RetireAfter holds the value of the "retire_after" field.
	RetireAfter *time.Time `json:"retire_after,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the KEKVersionQuery when eager-loading is set.
	Edges KEKVersionEdges `json:"edges"`
	// contains filtered or unexported fields
}

KEKVersion is the model entity for the KEKVersion schema.

func (*KEKVersion) ExecContext

func (c *KEKVersion) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersion) QueryContext

func (c *KEKVersion) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersion) QueryKek

func (_m *KEKVersion) QueryKek() *KEKQuery

QueryKek queries the "kek" edge of the KEKVersion entity.

func (*KEKVersion) String

func (_m *KEKVersion) String() string

String implements the fmt.Stringer.

func (*KEKVersion) Unwrap

func (_m *KEKVersion) Unwrap() *KEKVersion

Unwrap unwraps the KEKVersion entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*KEKVersion) Update

func (_m *KEKVersion) Update() *KEKVersionUpdateOne

Update returns a builder for updating this KEKVersion. Note that you need to call KEKVersion.Unwrap() before calling this method if this KEKVersion was returned from a transaction, and the transaction was committed or rolled back.

func (*KEKVersion) Value

func (_m *KEKVersion) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the KEKVersion. This includes values selected through modifiers, order, etc.

type KEKVersionClient

type KEKVersionClient struct {
	// contains filtered or unexported fields
}

KEKVersionClient is a client for the KEKVersion schema.

func NewKEKVersionClient

func NewKEKVersionClient(c config) *KEKVersionClient

NewKEKVersionClient returns a client for the KEKVersion from the given config.

func (*KEKVersionClient) Create

func (c *KEKVersionClient) Create() *KEKVersionCreate

Create returns a builder for creating a KEKVersion entity.

func (*KEKVersionClient) CreateBulk

func (c *KEKVersionClient) CreateBulk(builders ...*KEKVersionCreate) *KEKVersionCreateBulk

CreateBulk returns a builder for creating a bulk of KEKVersion entities.

func (*KEKVersionClient) Delete

func (c *KEKVersionClient) Delete() *KEKVersionDelete

Delete returns a delete builder for KEKVersion.

func (*KEKVersionClient) DeleteOne

func (c *KEKVersionClient) DeleteOne(_m *KEKVersion) *KEKVersionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*KEKVersionClient) DeleteOneID

func (c *KEKVersionClient) DeleteOneID(id int) *KEKVersionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*KEKVersionClient) ExecContext

func (c *KEKVersionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionClient) Get

func (c *KEKVersionClient) Get(ctx context.Context, id int) (*KEKVersion, error)

Get returns a KEKVersion entity by its id.

func (*KEKVersionClient) GetX

func (c *KEKVersionClient) GetX(ctx context.Context, id int) *KEKVersion

GetX is like Get, but panics if an error occurs.

func (*KEKVersionClient) Hooks

func (c *KEKVersionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*KEKVersionClient) Intercept

func (c *KEKVersionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `kekversion.Intercept(f(g(h())))`.

func (*KEKVersionClient) Interceptors

func (c *KEKVersionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*KEKVersionClient) MapCreateBulk

func (c *KEKVersionClient) MapCreateBulk(slice any, setFunc func(*KEKVersionCreate, int)) *KEKVersionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*KEKVersionClient) Query

func (c *KEKVersionClient) Query() *KEKVersionQuery

Query returns a query builder for KEKVersion.

func (*KEKVersionClient) QueryContext

func (c *KEKVersionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionClient) QueryKek

func (c *KEKVersionClient) QueryKek(_m *KEKVersion) *KEKQuery

QueryKek queries the kek edge of a KEKVersion.

func (*KEKVersionClient) Update

func (c *KEKVersionClient) Update() *KEKVersionUpdate

Update returns an update builder for KEKVersion.

func (*KEKVersionClient) UpdateOne

func (c *KEKVersionClient) UpdateOne(_m *KEKVersion) *KEKVersionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*KEKVersionClient) UpdateOneID

func (c *KEKVersionClient) UpdateOneID(id int) *KEKVersionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*KEKVersionClient) Use

func (c *KEKVersionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `kekversion.Hooks(f(g(h())))`.

type KEKVersionCreate

type KEKVersionCreate struct {
	// contains filtered or unexported fields
}

KEKVersionCreate is the builder for creating a KEKVersion entity.

func (*KEKVersionCreate) Exec

func (_c *KEKVersionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKVersionCreate) ExecContext

func (c *KEKVersionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionCreate) ExecX

func (_c *KEKVersionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionCreate) Mutation

func (_c *KEKVersionCreate) Mutation() *KEKVersionMutation

Mutation returns the KEKVersionMutation object of the builder.

func (*KEKVersionCreate) OnConflict

func (_c *KEKVersionCreate) OnConflict(opts ...sql.ConflictOption) *KEKVersionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.KEKVersion.Create().
	SetKekID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.KEKVersionUpsert) {
		SetKekID(v+v).
	}).
	Exec(ctx)

func (*KEKVersionCreate) OnConflictColumns

func (_c *KEKVersionCreate) OnConflictColumns(columns ...string) *KEKVersionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.KEKVersion.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*KEKVersionCreate) QueryContext

func (c *KEKVersionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionCreate) Save

func (_c *KEKVersionCreate) Save(ctx context.Context) (*KEKVersion, error)

Save creates the KEKVersion in the database.

func (*KEKVersionCreate) SaveX

func (_c *KEKVersionCreate) SaveX(ctx context.Context) *KEKVersion

SaveX calls Save and panics if Save returns an error.

func (*KEKVersionCreate) SetActivatedAt

func (_c *KEKVersionCreate) SetActivatedAt(v time.Time) *KEKVersionCreate

SetActivatedAt sets the "activated_at" field.

func (*KEKVersionCreate) SetCreatedAt

func (_c *KEKVersionCreate) SetCreatedAt(v time.Time) *KEKVersionCreate

SetCreatedAt sets the "created_at" field.

func (*KEKVersionCreate) SetKek

func (_c *KEKVersionCreate) SetKek(v *KEK) *KEKVersionCreate

SetKek sets the "kek" edge to the KEK entity.

func (*KEKVersionCreate) SetKekID

func (_c *KEKVersionCreate) SetKekID(v envelope.ID) *KEKVersionCreate

SetKekID sets the "kek_id" field.

func (*KEKVersionCreate) SetNillableActivatedAt

func (_c *KEKVersionCreate) SetNillableActivatedAt(v *time.Time) *KEKVersionCreate

SetNillableActivatedAt sets the "activated_at" field if the given value is not nil.

func (*KEKVersionCreate) SetNillableProviderRef

func (_c *KEKVersionCreate) SetNillableProviderRef(v *string) *KEKVersionCreate

SetNillableProviderRef sets the "provider_ref" field if the given value is not nil.

func (*KEKVersionCreate) SetNillableRetireAfter

func (_c *KEKVersionCreate) SetNillableRetireAfter(v *time.Time) *KEKVersionCreate

SetNillableRetireAfter sets the "retire_after" field if the given value is not nil.

func (*KEKVersionCreate) SetNillableRotatedAt

func (_c *KEKVersionCreate) SetNillableRotatedAt(v *time.Time) *KEKVersionCreate

SetNillableRotatedAt sets the "rotated_at" field if the given value is not nil.

func (*KEKVersionCreate) SetProviderRef

func (_c *KEKVersionCreate) SetProviderRef(v string) *KEKVersionCreate

SetProviderRef sets the "provider_ref" field.

func (*KEKVersionCreate) SetRetireAfter

func (_c *KEKVersionCreate) SetRetireAfter(v time.Time) *KEKVersionCreate

SetRetireAfter sets the "retire_after" field.

func (*KEKVersionCreate) SetRotatedAt

func (_c *KEKVersionCreate) SetRotatedAt(v time.Time) *KEKVersionCreate

SetRotatedAt sets the "rotated_at" field.

func (*KEKVersionCreate) SetState

func (_c *KEKVersionCreate) SetState(v uint8) *KEKVersionCreate

SetState sets the "state" field.

func (*KEKVersionCreate) SetVersion

func (_c *KEKVersionCreate) SetVersion(v uint32) *KEKVersionCreate

SetVersion sets the "version" field.

type KEKVersionCreateBulk

type KEKVersionCreateBulk struct {
	// contains filtered or unexported fields
}

KEKVersionCreateBulk is the builder for creating many KEKVersion entities in bulk.

func (*KEKVersionCreateBulk) Exec

func (_c *KEKVersionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKVersionCreateBulk) ExecContext

func (c *KEKVersionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionCreateBulk) ExecX

func (_c *KEKVersionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.KEKVersion.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.KEKVersionUpsert) {
		SetKekID(v+v).
	}).
	Exec(ctx)

func (*KEKVersionCreateBulk) OnConflictColumns

func (_c *KEKVersionCreateBulk) OnConflictColumns(columns ...string) *KEKVersionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.KEKVersion.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*KEKVersionCreateBulk) QueryContext

func (c *KEKVersionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionCreateBulk) Save

func (_c *KEKVersionCreateBulk) Save(ctx context.Context) ([]*KEKVersion, error)

Save creates the KEKVersion entities in the database.

func (*KEKVersionCreateBulk) SaveX

func (_c *KEKVersionCreateBulk) SaveX(ctx context.Context) []*KEKVersion

SaveX is like Save, but panics if an error occurs.

type KEKVersionDelete

type KEKVersionDelete struct {
	// contains filtered or unexported fields
}

KEKVersionDelete is the builder for deleting a KEKVersion entity.

func (*KEKVersionDelete) Exec

func (_d *KEKVersionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*KEKVersionDelete) ExecContext

func (c *KEKVersionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionDelete) ExecX

func (_d *KEKVersionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionDelete) QueryContext

func (c *KEKVersionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionDelete) Where

Where appends a list predicates to the KEKVersionDelete builder.

type KEKVersionDeleteOne

type KEKVersionDeleteOne struct {
	// contains filtered or unexported fields
}

KEKVersionDeleteOne is the builder for deleting a single KEKVersion entity.

func (*KEKVersionDeleteOne) Exec

func (_d *KEKVersionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*KEKVersionDeleteOne) ExecX

func (_d *KEKVersionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionDeleteOne) Where

Where appends a list predicates to the KEKVersionDelete builder.

type KEKVersionEdges

type KEKVersionEdges struct {
	// Kek holds the value of the kek edge.
	Kek *KEK `json:"kek,omitempty"`
	// contains filtered or unexported fields
}

KEKVersionEdges holds the relations/edges for other nodes in the graph.

func (KEKVersionEdges) KekOrErr

func (e KEKVersionEdges) KekOrErr() (*KEK, error)

KekOrErr returns the Kek value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type KEKVersionGroupBy

type KEKVersionGroupBy struct {
	// contains filtered or unexported fields
}

KEKVersionGroupBy is the group-by builder for KEKVersion entities.

func (*KEKVersionGroupBy) Aggregate

func (_g *KEKVersionGroupBy) Aggregate(fns ...AggregateFunc) *KEKVersionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*KEKVersionGroupBy) Bool

func (s *KEKVersionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) BoolX

func (s *KEKVersionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KEKVersionGroupBy) Bools

func (s *KEKVersionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) BoolsX

func (s *KEKVersionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*KEKVersionGroupBy) Float64

func (s *KEKVersionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) Float64X

func (s *KEKVersionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KEKVersionGroupBy) Float64s

func (s *KEKVersionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) Float64sX

func (s *KEKVersionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KEKVersionGroupBy) Int

func (s *KEKVersionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) IntX

func (s *KEKVersionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KEKVersionGroupBy) Ints

func (s *KEKVersionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) IntsX

func (s *KEKVersionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*KEKVersionGroupBy) Scan

func (_g *KEKVersionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KEKVersionGroupBy) ScanX

func (s *KEKVersionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KEKVersionGroupBy) String

func (s *KEKVersionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) StringX

func (s *KEKVersionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KEKVersionGroupBy) Strings

func (s *KEKVersionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KEKVersionGroupBy) StringsX

func (s *KEKVersionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KEKVersionMutation

type KEKVersionMutation struct {
	// contains filtered or unexported fields
}

KEKVersionMutation represents an operation that mutates the KEKVersion nodes in the graph.

func (*KEKVersionMutation) ActivatedAt

func (m *KEKVersionMutation) ActivatedAt() (r time.Time, exists bool)

ActivatedAt returns the value of the "activated_at" field in the mutation.

func (*KEKVersionMutation) ActivatedAtCleared

func (m *KEKVersionMutation) ActivatedAtCleared() bool

ActivatedAtCleared returns if the "activated_at" field was cleared in this mutation.

func (*KEKVersionMutation) AddField

func (m *KEKVersionMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*KEKVersionMutation) AddState

func (m *KEKVersionMutation) AddState(u int8)

AddState adds u to the "state" field.

func (*KEKVersionMutation) AddVersion

func (m *KEKVersionMutation) AddVersion(u int32)

AddVersion adds u to the "version" field.

func (*KEKVersionMutation) AddedEdges

func (m *KEKVersionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*KEKVersionMutation) AddedField

func (m *KEKVersionMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*KEKVersionMutation) AddedFields

func (m *KEKVersionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*KEKVersionMutation) AddedIDs

func (m *KEKVersionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*KEKVersionMutation) AddedState

func (m *KEKVersionMutation) AddedState() (r int8, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*KEKVersionMutation) AddedVersion

func (m *KEKVersionMutation) AddedVersion() (r int32, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*KEKVersionMutation) ClearActivatedAt

func (m *KEKVersionMutation) ClearActivatedAt()

ClearActivatedAt clears the value of the "activated_at" field.

func (*KEKVersionMutation) ClearEdge

func (m *KEKVersionMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*KEKVersionMutation) ClearField

func (m *KEKVersionMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*KEKVersionMutation) ClearKek

func (m *KEKVersionMutation) ClearKek()

ClearKek clears the "kek" edge to the KEK entity.

func (*KEKVersionMutation) ClearRetireAfter

func (m *KEKVersionMutation) ClearRetireAfter()

ClearRetireAfter clears the value of the "retire_after" field.

func (*KEKVersionMutation) ClearRotatedAt

func (m *KEKVersionMutation) ClearRotatedAt()

ClearRotatedAt clears the value of the "rotated_at" field.

func (*KEKVersionMutation) ClearedEdges

func (m *KEKVersionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*KEKVersionMutation) ClearedFields

func (m *KEKVersionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (KEKVersionMutation) Client

func (m KEKVersionMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*KEKVersionMutation) CreatedAt

func (m *KEKVersionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*KEKVersionMutation) EdgeCleared

func (m *KEKVersionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*KEKVersionMutation) ExecContext

func (c *KEKVersionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionMutation) Field

func (m *KEKVersionMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*KEKVersionMutation) FieldCleared

func (m *KEKVersionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*KEKVersionMutation) Fields

func (m *KEKVersionMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*KEKVersionMutation) ID

func (m *KEKVersionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*KEKVersionMutation) IDs

func (m *KEKVersionMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*KEKVersionMutation) KekCleared

func (m *KEKVersionMutation) KekCleared() bool

KekCleared reports if the "kek" edge to the KEK entity was cleared.

func (*KEKVersionMutation) KekID

func (m *KEKVersionMutation) KekID() (r envelope.ID, exists bool)

KekID returns the value of the "kek_id" field in the mutation.

func (*KEKVersionMutation) KekIDs

func (m *KEKVersionMutation) KekIDs() (ids []envelope.ID)

KekIDs returns the "kek" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use KekID instead. It exists only for internal usage by the builders.

func (*KEKVersionMutation) OldActivatedAt

func (m *KEKVersionMutation) OldActivatedAt(ctx context.Context) (v *time.Time, err error)

OldActivatedAt returns the old "activated_at" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) OldCreatedAt

func (m *KEKVersionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) OldField

func (m *KEKVersionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*KEKVersionMutation) OldKekID

func (m *KEKVersionMutation) OldKekID(ctx context.Context) (v envelope.ID, err error)

OldKekID returns the old "kek_id" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) OldProviderRef

func (m *KEKVersionMutation) OldProviderRef(ctx context.Context) (v string, err error)

OldProviderRef returns the old "provider_ref" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) OldRetireAfter

func (m *KEKVersionMutation) OldRetireAfter(ctx context.Context) (v *time.Time, err error)

OldRetireAfter returns the old "retire_after" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) OldRotatedAt

func (m *KEKVersionMutation) OldRotatedAt(ctx context.Context) (v *time.Time, err error)

OldRotatedAt returns the old "rotated_at" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) OldState

func (m *KEKVersionMutation) OldState(ctx context.Context) (v uint8, err error)

OldState returns the old "state" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) OldVersion

func (m *KEKVersionMutation) OldVersion(ctx context.Context) (v uint32, err error)

OldVersion returns the old "version" field's value of the KEKVersion entity. If the KEKVersion object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*KEKVersionMutation) Op

func (m *KEKVersionMutation) Op() Op

Op returns the operation name.

func (*KEKVersionMutation) ProviderRef

func (m *KEKVersionMutation) ProviderRef() (r string, exists bool)

ProviderRef returns the value of the "provider_ref" field in the mutation.

func (*KEKVersionMutation) QueryContext

func (c *KEKVersionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionMutation) RemovedEdges

func (m *KEKVersionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*KEKVersionMutation) RemovedIDs

func (m *KEKVersionMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*KEKVersionMutation) ResetActivatedAt

func (m *KEKVersionMutation) ResetActivatedAt()

ResetActivatedAt resets all changes to the "activated_at" field.

func (*KEKVersionMutation) ResetCreatedAt

func (m *KEKVersionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*KEKVersionMutation) ResetEdge

func (m *KEKVersionMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*KEKVersionMutation) ResetField

func (m *KEKVersionMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*KEKVersionMutation) ResetKek

func (m *KEKVersionMutation) ResetKek()

ResetKek resets all changes to the "kek" edge.

func (*KEKVersionMutation) ResetKekID

func (m *KEKVersionMutation) ResetKekID()

ResetKekID resets all changes to the "kek_id" field.

func (*KEKVersionMutation) ResetProviderRef

func (m *KEKVersionMutation) ResetProviderRef()

ResetProviderRef resets all changes to the "provider_ref" field.

func (*KEKVersionMutation) ResetRetireAfter

func (m *KEKVersionMutation) ResetRetireAfter()

ResetRetireAfter resets all changes to the "retire_after" field.

func (*KEKVersionMutation) ResetRotatedAt

func (m *KEKVersionMutation) ResetRotatedAt()

ResetRotatedAt resets all changes to the "rotated_at" field.

func (*KEKVersionMutation) ResetState

func (m *KEKVersionMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*KEKVersionMutation) ResetVersion

func (m *KEKVersionMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*KEKVersionMutation) RetireAfter

func (m *KEKVersionMutation) RetireAfter() (r time.Time, exists bool)

RetireAfter returns the value of the "retire_after" field in the mutation.

func (*KEKVersionMutation) RetireAfterCleared

func (m *KEKVersionMutation) RetireAfterCleared() bool

RetireAfterCleared returns if the "retire_after" field was cleared in this mutation.

func (*KEKVersionMutation) RotatedAt

func (m *KEKVersionMutation) RotatedAt() (r time.Time, exists bool)

RotatedAt returns the value of the "rotated_at" field in the mutation.

func (*KEKVersionMutation) RotatedAtCleared

func (m *KEKVersionMutation) RotatedAtCleared() bool

RotatedAtCleared returns if the "rotated_at" field was cleared in this mutation.

func (*KEKVersionMutation) SetActivatedAt

func (m *KEKVersionMutation) SetActivatedAt(t time.Time)

SetActivatedAt sets the "activated_at" field.

func (*KEKVersionMutation) SetCreatedAt

func (m *KEKVersionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*KEKVersionMutation) SetField

func (m *KEKVersionMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*KEKVersionMutation) SetKekID

func (m *KEKVersionMutation) SetKekID(e envelope.ID)

SetKekID sets the "kek_id" field.

func (*KEKVersionMutation) SetOp

func (m *KEKVersionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*KEKVersionMutation) SetProviderRef

func (m *KEKVersionMutation) SetProviderRef(s string)

SetProviderRef sets the "provider_ref" field.

func (*KEKVersionMutation) SetRetireAfter

func (m *KEKVersionMutation) SetRetireAfter(t time.Time)

SetRetireAfter sets the "retire_after" field.

func (*KEKVersionMutation) SetRotatedAt

func (m *KEKVersionMutation) SetRotatedAt(t time.Time)

SetRotatedAt sets the "rotated_at" field.

func (*KEKVersionMutation) SetState

func (m *KEKVersionMutation) SetState(u uint8)

SetState sets the "state" field.

func (*KEKVersionMutation) SetVersion

func (m *KEKVersionMutation) SetVersion(u uint32)

SetVersion sets the "version" field.

func (*KEKVersionMutation) State

func (m *KEKVersionMutation) State() (r uint8, exists bool)

State returns the value of the "state" field in the mutation.

func (KEKVersionMutation) Tx

func (m KEKVersionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*KEKVersionMutation) Type

func (m *KEKVersionMutation) Type() string

Type returns the node type of this mutation (KEKVersion).

func (*KEKVersionMutation) Version

func (m *KEKVersionMutation) Version() (r uint32, exists bool)

Version returns the value of the "version" field in the mutation.

func (*KEKVersionMutation) Where

func (m *KEKVersionMutation) Where(ps ...predicate.KEKVersion)

Where appends a list predicates to the KEKVersionMutation builder.

func (*KEKVersionMutation) WhereP

func (m *KEKVersionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the KEKVersionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type KEKVersionQuery

type KEKVersionQuery struct {
	// contains filtered or unexported fields
}

KEKVersionQuery is the builder for querying KEKVersion entities.

func (*KEKVersionQuery) Aggregate

func (_q *KEKVersionQuery) Aggregate(fns ...AggregateFunc) *KEKVersionSelect

Aggregate returns a KEKVersionSelect configured with the given aggregations.

func (*KEKVersionQuery) All

func (_q *KEKVersionQuery) All(ctx context.Context) ([]*KEKVersion, error)

All executes the query and returns a list of KEKVersions.

func (*KEKVersionQuery) AllX

func (_q *KEKVersionQuery) AllX(ctx context.Context) []*KEKVersion

AllX is like All, but panics if an error occurs.

func (*KEKVersionQuery) Clone

func (_q *KEKVersionQuery) Clone() *KEKVersionQuery

Clone returns a duplicate of the KEKVersionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*KEKVersionQuery) Count

func (_q *KEKVersionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*KEKVersionQuery) CountX

func (_q *KEKVersionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*KEKVersionQuery) ExecContext

func (c *KEKVersionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionQuery) Exist

func (_q *KEKVersionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*KEKVersionQuery) ExistX

func (_q *KEKVersionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*KEKVersionQuery) First

func (_q *KEKVersionQuery) First(ctx context.Context) (*KEKVersion, error)

First returns the first KEKVersion entity from the query. Returns a *NotFoundError when no KEKVersion was found.

func (*KEKVersionQuery) FirstID

func (_q *KEKVersionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first KEKVersion ID from the query. Returns a *NotFoundError when no KEKVersion ID was found.

func (*KEKVersionQuery) FirstIDX

func (_q *KEKVersionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*KEKVersionQuery) FirstX

func (_q *KEKVersionQuery) FirstX(ctx context.Context) *KEKVersion

FirstX is like First, but panics if an error occurs.

func (*KEKVersionQuery) ForShare

func (_q *KEKVersionQuery) ForShare(opts ...sql.LockOption) *KEKVersionQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*KEKVersionQuery) ForUpdate

func (_q *KEKVersionQuery) ForUpdate(opts ...sql.LockOption) *KEKVersionQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*KEKVersionQuery) GroupBy

func (_q *KEKVersionQuery) GroupBy(field string, fields ...string) *KEKVersionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	KekID envelope.ID `json:"kek_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.KEKVersion.Query().
	GroupBy(kekversion.FieldKekID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*KEKVersionQuery) IDs

func (_q *KEKVersionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of KEKVersion IDs.

func (*KEKVersionQuery) IDsX

func (_q *KEKVersionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*KEKVersionQuery) Limit

func (_q *KEKVersionQuery) Limit(limit int) *KEKVersionQuery

Limit the number of records to be returned by this query.

func (*KEKVersionQuery) Offset

func (_q *KEKVersionQuery) Offset(offset int) *KEKVersionQuery

Offset to start from.

func (*KEKVersionQuery) Only

func (_q *KEKVersionQuery) Only(ctx context.Context) (*KEKVersion, error)

Only returns a single KEKVersion entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one KEKVersion entity is found. Returns a *NotFoundError when no KEKVersion entities are found.

func (*KEKVersionQuery) OnlyID

func (_q *KEKVersionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only KEKVersion ID in the query. Returns a *NotSingularError when more than one KEKVersion ID is found. Returns a *NotFoundError when no entities are found.

func (*KEKVersionQuery) OnlyIDX

func (_q *KEKVersionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*KEKVersionQuery) OnlyX

func (_q *KEKVersionQuery) OnlyX(ctx context.Context) *KEKVersion

OnlyX is like Only, but panics if an error occurs.

func (*KEKVersionQuery) Order

Order specifies how the records should be ordered.

func (*KEKVersionQuery) QueryContext

func (c *KEKVersionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionQuery) QueryKek

func (_q *KEKVersionQuery) QueryKek() *KEKQuery

QueryKek chains the current query on the "kek" edge.

func (*KEKVersionQuery) Select

func (_q *KEKVersionQuery) Select(fields ...string) *KEKVersionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	KekID envelope.ID `json:"kek_id,omitempty"`
}

client.KEKVersion.Query().
	Select(kekversion.FieldKekID).
	Scan(ctx, &v)

func (*KEKVersionQuery) Unique

func (_q *KEKVersionQuery) Unique(unique bool) *KEKVersionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*KEKVersionQuery) Where

Where adds a new predicate for the KEKVersionQuery builder.

func (*KEKVersionQuery) WithKek

func (_q *KEKVersionQuery) WithKek(opts ...func(*KEKQuery)) *KEKVersionQuery

WithKek tells the query-builder to eager-load the nodes that are connected to the "kek" edge. The optional arguments are used to configure the query builder of the edge.

type KEKVersionSelect

type KEKVersionSelect struct {
	*KEKVersionQuery
	// contains filtered or unexported fields
}

KEKVersionSelect is the builder for selecting fields of KEKVersion entities.

func (*KEKVersionSelect) Aggregate

func (_s *KEKVersionSelect) Aggregate(fns ...AggregateFunc) *KEKVersionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*KEKVersionSelect) Bool

func (s *KEKVersionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) BoolX

func (s *KEKVersionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KEKVersionSelect) Bools

func (s *KEKVersionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) BoolsX

func (s *KEKVersionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (KEKVersionSelect) ExecContext

func (c KEKVersionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionSelect) Float64

func (s *KEKVersionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) Float64X

func (s *KEKVersionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KEKVersionSelect) Float64s

func (s *KEKVersionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) Float64sX

func (s *KEKVersionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KEKVersionSelect) Int

func (s *KEKVersionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) IntX

func (s *KEKVersionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KEKVersionSelect) Ints

func (s *KEKVersionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) IntsX

func (s *KEKVersionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (KEKVersionSelect) QueryContext

func (c KEKVersionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionSelect) Scan

func (_s *KEKVersionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KEKVersionSelect) ScanX

func (s *KEKVersionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KEKVersionSelect) String

func (s *KEKVersionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) StringX

func (s *KEKVersionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KEKVersionSelect) Strings

func (s *KEKVersionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KEKVersionSelect) StringsX

func (s *KEKVersionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KEKVersionUpdate

type KEKVersionUpdate struct {
	// contains filtered or unexported fields
}

KEKVersionUpdate is the builder for updating KEKVersion entities.

func (*KEKVersionUpdate) AddState

func (_u *KEKVersionUpdate) AddState(v int8) *KEKVersionUpdate

AddState adds value to the "state" field.

func (*KEKVersionUpdate) AddVersion

func (_u *KEKVersionUpdate) AddVersion(v int32) *KEKVersionUpdate

AddVersion adds value to the "version" field.

func (*KEKVersionUpdate) ClearActivatedAt

func (_u *KEKVersionUpdate) ClearActivatedAt() *KEKVersionUpdate

ClearActivatedAt clears the value of the "activated_at" field.

func (*KEKVersionUpdate) ClearKek

func (_u *KEKVersionUpdate) ClearKek() *KEKVersionUpdate

ClearKek clears the "kek" edge to the KEK entity.

func (*KEKVersionUpdate) ClearRetireAfter

func (_u *KEKVersionUpdate) ClearRetireAfter() *KEKVersionUpdate

ClearRetireAfter clears the value of the "retire_after" field.

func (*KEKVersionUpdate) ClearRotatedAt

func (_u *KEKVersionUpdate) ClearRotatedAt() *KEKVersionUpdate

ClearRotatedAt clears the value of the "rotated_at" field.

func (*KEKVersionUpdate) Exec

func (_u *KEKVersionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*KEKVersionUpdate) ExecContext

func (c *KEKVersionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionUpdate) ExecX

func (_u *KEKVersionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionUpdate) Mutation

func (_u *KEKVersionUpdate) Mutation() *KEKVersionMutation

Mutation returns the KEKVersionMutation object of the builder.

func (*KEKVersionUpdate) QueryContext

func (c *KEKVersionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionUpdate) Save

func (_u *KEKVersionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*KEKVersionUpdate) SaveX

func (_u *KEKVersionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*KEKVersionUpdate) SetActivatedAt

func (_u *KEKVersionUpdate) SetActivatedAt(v time.Time) *KEKVersionUpdate

SetActivatedAt sets the "activated_at" field.

func (*KEKVersionUpdate) SetCreatedAt

func (_u *KEKVersionUpdate) SetCreatedAt(v time.Time) *KEKVersionUpdate

SetCreatedAt sets the "created_at" field.

func (*KEKVersionUpdate) SetKek

func (_u *KEKVersionUpdate) SetKek(v *KEK) *KEKVersionUpdate

SetKek sets the "kek" edge to the KEK entity.

func (*KEKVersionUpdate) SetKekID

func (_u *KEKVersionUpdate) SetKekID(v envelope.ID) *KEKVersionUpdate

SetKekID sets the "kek_id" field.

func (*KEKVersionUpdate) SetNillableActivatedAt

func (_u *KEKVersionUpdate) SetNillableActivatedAt(v *time.Time) *KEKVersionUpdate

SetNillableActivatedAt sets the "activated_at" field if the given value is not nil.

func (*KEKVersionUpdate) SetNillableCreatedAt

func (_u *KEKVersionUpdate) SetNillableCreatedAt(v *time.Time) *KEKVersionUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*KEKVersionUpdate) SetNillableKekID

func (_u *KEKVersionUpdate) SetNillableKekID(v *envelope.ID) *KEKVersionUpdate

SetNillableKekID sets the "kek_id" field if the given value is not nil.

func (*KEKVersionUpdate) SetNillableProviderRef

func (_u *KEKVersionUpdate) SetNillableProviderRef(v *string) *KEKVersionUpdate

SetNillableProviderRef sets the "provider_ref" field if the given value is not nil.

func (*KEKVersionUpdate) SetNillableRetireAfter

func (_u *KEKVersionUpdate) SetNillableRetireAfter(v *time.Time) *KEKVersionUpdate

SetNillableRetireAfter sets the "retire_after" field if the given value is not nil.

func (*KEKVersionUpdate) SetNillableRotatedAt

func (_u *KEKVersionUpdate) SetNillableRotatedAt(v *time.Time) *KEKVersionUpdate

SetNillableRotatedAt sets the "rotated_at" field if the given value is not nil.

func (*KEKVersionUpdate) SetNillableState

func (_u *KEKVersionUpdate) SetNillableState(v *uint8) *KEKVersionUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*KEKVersionUpdate) SetNillableVersion

func (_u *KEKVersionUpdate) SetNillableVersion(v *uint32) *KEKVersionUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*KEKVersionUpdate) SetProviderRef

func (_u *KEKVersionUpdate) SetProviderRef(v string) *KEKVersionUpdate

SetProviderRef sets the "provider_ref" field.

func (*KEKVersionUpdate) SetRetireAfter

func (_u *KEKVersionUpdate) SetRetireAfter(v time.Time) *KEKVersionUpdate

SetRetireAfter sets the "retire_after" field.

func (*KEKVersionUpdate) SetRotatedAt

func (_u *KEKVersionUpdate) SetRotatedAt(v time.Time) *KEKVersionUpdate

SetRotatedAt sets the "rotated_at" field.

func (*KEKVersionUpdate) SetState

func (_u *KEKVersionUpdate) SetState(v uint8) *KEKVersionUpdate

SetState sets the "state" field.

func (*KEKVersionUpdate) SetVersion

func (_u *KEKVersionUpdate) SetVersion(v uint32) *KEKVersionUpdate

SetVersion sets the "version" field.

func (*KEKVersionUpdate) Where

Where appends a list predicates to the KEKVersionUpdate builder.

type KEKVersionUpdateOne

type KEKVersionUpdateOne struct {
	// contains filtered or unexported fields
}

KEKVersionUpdateOne is the builder for updating a single KEKVersion entity.

func (*KEKVersionUpdateOne) AddState

func (_u *KEKVersionUpdateOne) AddState(v int8) *KEKVersionUpdateOne

AddState adds value to the "state" field.

func (*KEKVersionUpdateOne) AddVersion

func (_u *KEKVersionUpdateOne) AddVersion(v int32) *KEKVersionUpdateOne

AddVersion adds value to the "version" field.

func (*KEKVersionUpdateOne) ClearActivatedAt

func (_u *KEKVersionUpdateOne) ClearActivatedAt() *KEKVersionUpdateOne

ClearActivatedAt clears the value of the "activated_at" field.

func (*KEKVersionUpdateOne) ClearKek

func (_u *KEKVersionUpdateOne) ClearKek() *KEKVersionUpdateOne

ClearKek clears the "kek" edge to the KEK entity.

func (*KEKVersionUpdateOne) ClearRetireAfter

func (_u *KEKVersionUpdateOne) ClearRetireAfter() *KEKVersionUpdateOne

ClearRetireAfter clears the value of the "retire_after" field.

func (*KEKVersionUpdateOne) ClearRotatedAt

func (_u *KEKVersionUpdateOne) ClearRotatedAt() *KEKVersionUpdateOne

ClearRotatedAt clears the value of the "rotated_at" field.

func (*KEKVersionUpdateOne) Exec

func (_u *KEKVersionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*KEKVersionUpdateOne) ExecContext

func (c *KEKVersionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*KEKVersionUpdateOne) ExecX

func (_u *KEKVersionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionUpdateOne) Mutation

func (_u *KEKVersionUpdateOne) Mutation() *KEKVersionMutation

Mutation returns the KEKVersionMutation object of the builder.

func (*KEKVersionUpdateOne) QueryContext

func (c *KEKVersionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*KEKVersionUpdateOne) Save

Save executes the query and returns the updated KEKVersion entity.

func (*KEKVersionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*KEKVersionUpdateOne) Select

func (_u *KEKVersionUpdateOne) Select(field string, fields ...string) *KEKVersionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*KEKVersionUpdateOne) SetActivatedAt

func (_u *KEKVersionUpdateOne) SetActivatedAt(v time.Time) *KEKVersionUpdateOne

SetActivatedAt sets the "activated_at" field.

func (*KEKVersionUpdateOne) SetCreatedAt

func (_u *KEKVersionUpdateOne) SetCreatedAt(v time.Time) *KEKVersionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*KEKVersionUpdateOne) SetKek

SetKek sets the "kek" edge to the KEK entity.

func (*KEKVersionUpdateOne) SetKekID

SetKekID sets the "kek_id" field.

func (*KEKVersionUpdateOne) SetNillableActivatedAt

func (_u *KEKVersionUpdateOne) SetNillableActivatedAt(v *time.Time) *KEKVersionUpdateOne

SetNillableActivatedAt sets the "activated_at" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetNillableCreatedAt

func (_u *KEKVersionUpdateOne) SetNillableCreatedAt(v *time.Time) *KEKVersionUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetNillableKekID

func (_u *KEKVersionUpdateOne) SetNillableKekID(v *envelope.ID) *KEKVersionUpdateOne

SetNillableKekID sets the "kek_id" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetNillableProviderRef

func (_u *KEKVersionUpdateOne) SetNillableProviderRef(v *string) *KEKVersionUpdateOne

SetNillableProviderRef sets the "provider_ref" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetNillableRetireAfter

func (_u *KEKVersionUpdateOne) SetNillableRetireAfter(v *time.Time) *KEKVersionUpdateOne

SetNillableRetireAfter sets the "retire_after" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetNillableRotatedAt

func (_u *KEKVersionUpdateOne) SetNillableRotatedAt(v *time.Time) *KEKVersionUpdateOne

SetNillableRotatedAt sets the "rotated_at" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetNillableState

func (_u *KEKVersionUpdateOne) SetNillableState(v *uint8) *KEKVersionUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetNillableVersion

func (_u *KEKVersionUpdateOne) SetNillableVersion(v *uint32) *KEKVersionUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*KEKVersionUpdateOne) SetProviderRef

func (_u *KEKVersionUpdateOne) SetProviderRef(v string) *KEKVersionUpdateOne

SetProviderRef sets the "provider_ref" field.

func (*KEKVersionUpdateOne) SetRetireAfter

func (_u *KEKVersionUpdateOne) SetRetireAfter(v time.Time) *KEKVersionUpdateOne

SetRetireAfter sets the "retire_after" field.

func (*KEKVersionUpdateOne) SetRotatedAt

func (_u *KEKVersionUpdateOne) SetRotatedAt(v time.Time) *KEKVersionUpdateOne

SetRotatedAt sets the "rotated_at" field.

func (*KEKVersionUpdateOne) SetState

SetState sets the "state" field.

func (*KEKVersionUpdateOne) SetVersion

func (_u *KEKVersionUpdateOne) SetVersion(v uint32) *KEKVersionUpdateOne

SetVersion sets the "version" field.

func (*KEKVersionUpdateOne) Where

Where appends a list predicates to the KEKVersionUpdate builder.

type KEKVersionUpsert

type KEKVersionUpsert struct {
	*sql.UpdateSet
}

KEKVersionUpsert is the "OnConflict" setter.

func (*KEKVersionUpsert) AddState

func (u *KEKVersionUpsert) AddState(v uint8) *KEKVersionUpsert

AddState adds v to the "state" field.

func (*KEKVersionUpsert) AddVersion

func (u *KEKVersionUpsert) AddVersion(v uint32) *KEKVersionUpsert

AddVersion adds v to the "version" field.

func (*KEKVersionUpsert) ClearActivatedAt

func (u *KEKVersionUpsert) ClearActivatedAt() *KEKVersionUpsert

ClearActivatedAt clears the value of the "activated_at" field.

func (*KEKVersionUpsert) ClearRetireAfter

func (u *KEKVersionUpsert) ClearRetireAfter() *KEKVersionUpsert

ClearRetireAfter clears the value of the "retire_after" field.

func (*KEKVersionUpsert) ClearRotatedAt

func (u *KEKVersionUpsert) ClearRotatedAt() *KEKVersionUpsert

ClearRotatedAt clears the value of the "rotated_at" field.

func (*KEKVersionUpsert) SetActivatedAt

func (u *KEKVersionUpsert) SetActivatedAt(v time.Time) *KEKVersionUpsert

SetActivatedAt sets the "activated_at" field.

func (*KEKVersionUpsert) SetCreatedAt

func (u *KEKVersionUpsert) SetCreatedAt(v time.Time) *KEKVersionUpsert

SetCreatedAt sets the "created_at" field.

func (*KEKVersionUpsert) SetKekID

func (u *KEKVersionUpsert) SetKekID(v envelope.ID) *KEKVersionUpsert

SetKekID sets the "kek_id" field.

func (*KEKVersionUpsert) SetProviderRef

func (u *KEKVersionUpsert) SetProviderRef(v string) *KEKVersionUpsert

SetProviderRef sets the "provider_ref" field.

func (*KEKVersionUpsert) SetRetireAfter

func (u *KEKVersionUpsert) SetRetireAfter(v time.Time) *KEKVersionUpsert

SetRetireAfter sets the "retire_after" field.

func (*KEKVersionUpsert) SetRotatedAt

func (u *KEKVersionUpsert) SetRotatedAt(v time.Time) *KEKVersionUpsert

SetRotatedAt sets the "rotated_at" field.

func (*KEKVersionUpsert) SetState

func (u *KEKVersionUpsert) SetState(v uint8) *KEKVersionUpsert

SetState sets the "state" field.

func (*KEKVersionUpsert) SetVersion

func (u *KEKVersionUpsert) SetVersion(v uint32) *KEKVersionUpsert

SetVersion sets the "version" field.

func (*KEKVersionUpsert) UpdateActivatedAt

func (u *KEKVersionUpsert) UpdateActivatedAt() *KEKVersionUpsert

UpdateActivatedAt sets the "activated_at" field to the value that was provided on create.

func (*KEKVersionUpsert) UpdateCreatedAt

func (u *KEKVersionUpsert) UpdateCreatedAt() *KEKVersionUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*KEKVersionUpsert) UpdateKekID

func (u *KEKVersionUpsert) UpdateKekID() *KEKVersionUpsert

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*KEKVersionUpsert) UpdateProviderRef

func (u *KEKVersionUpsert) UpdateProviderRef() *KEKVersionUpsert

UpdateProviderRef sets the "provider_ref" field to the value that was provided on create.

func (*KEKVersionUpsert) UpdateRetireAfter

func (u *KEKVersionUpsert) UpdateRetireAfter() *KEKVersionUpsert

UpdateRetireAfter sets the "retire_after" field to the value that was provided on create.

func (*KEKVersionUpsert) UpdateRotatedAt

func (u *KEKVersionUpsert) UpdateRotatedAt() *KEKVersionUpsert

UpdateRotatedAt sets the "rotated_at" field to the value that was provided on create.

func (*KEKVersionUpsert) UpdateState

func (u *KEKVersionUpsert) UpdateState() *KEKVersionUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*KEKVersionUpsert) UpdateVersion

func (u *KEKVersionUpsert) UpdateVersion() *KEKVersionUpsert

UpdateVersion sets the "version" field to the value that was provided on create.

type KEKVersionUpsertBulk

type KEKVersionUpsertBulk struct {
	// contains filtered or unexported fields
}

KEKVersionUpsertBulk is the builder for "upsert"-ing a bulk of KEKVersion nodes.

func (*KEKVersionUpsertBulk) AddState

AddState adds v to the "state" field.

func (*KEKVersionUpsertBulk) AddVersion

AddVersion adds v to the "version" field.

func (*KEKVersionUpsertBulk) ClearActivatedAt

func (u *KEKVersionUpsertBulk) ClearActivatedAt() *KEKVersionUpsertBulk

ClearActivatedAt clears the value of the "activated_at" field.

func (*KEKVersionUpsertBulk) ClearRetireAfter

func (u *KEKVersionUpsertBulk) ClearRetireAfter() *KEKVersionUpsertBulk

ClearRetireAfter clears the value of the "retire_after" field.

func (*KEKVersionUpsertBulk) ClearRotatedAt

func (u *KEKVersionUpsertBulk) ClearRotatedAt() *KEKVersionUpsertBulk

ClearRotatedAt clears the value of the "rotated_at" field.

func (*KEKVersionUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*KEKVersionUpsertBulk) Exec

Exec executes the query.

func (*KEKVersionUpsertBulk) ExecX

func (u *KEKVersionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.KEKVersion.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*KEKVersionUpsertBulk) SetActivatedAt

func (u *KEKVersionUpsertBulk) SetActivatedAt(v time.Time) *KEKVersionUpsertBulk

SetActivatedAt sets the "activated_at" field.

func (*KEKVersionUpsertBulk) SetCreatedAt

func (u *KEKVersionUpsertBulk) SetCreatedAt(v time.Time) *KEKVersionUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*KEKVersionUpsertBulk) SetKekID

SetKekID sets the "kek_id" field.

func (*KEKVersionUpsertBulk) SetProviderRef

func (u *KEKVersionUpsertBulk) SetProviderRef(v string) *KEKVersionUpsertBulk

SetProviderRef sets the "provider_ref" field.

func (*KEKVersionUpsertBulk) SetRetireAfter

func (u *KEKVersionUpsertBulk) SetRetireAfter(v time.Time) *KEKVersionUpsertBulk

SetRetireAfter sets the "retire_after" field.

func (*KEKVersionUpsertBulk) SetRotatedAt

func (u *KEKVersionUpsertBulk) SetRotatedAt(v time.Time) *KEKVersionUpsertBulk

SetRotatedAt sets the "rotated_at" field.

func (*KEKVersionUpsertBulk) SetState

SetState sets the "state" field.

func (*KEKVersionUpsertBulk) SetVersion

SetVersion sets the "version" field.

func (*KEKVersionUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the KEKVersionCreateBulk.OnConflict documentation for more info.

func (*KEKVersionUpsertBulk) UpdateActivatedAt

func (u *KEKVersionUpsertBulk) UpdateActivatedAt() *KEKVersionUpsertBulk

UpdateActivatedAt sets the "activated_at" field to the value that was provided on create.

func (*KEKVersionUpsertBulk) UpdateCreatedAt

func (u *KEKVersionUpsertBulk) UpdateCreatedAt() *KEKVersionUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*KEKVersionUpsertBulk) UpdateKekID

func (u *KEKVersionUpsertBulk) UpdateKekID() *KEKVersionUpsertBulk

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*KEKVersionUpsertBulk) UpdateNewValues

func (u *KEKVersionUpsertBulk) UpdateNewValues() *KEKVersionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.KEKVersion.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*KEKVersionUpsertBulk) UpdateProviderRef

func (u *KEKVersionUpsertBulk) UpdateProviderRef() *KEKVersionUpsertBulk

UpdateProviderRef sets the "provider_ref" field to the value that was provided on create.

func (*KEKVersionUpsertBulk) UpdateRetireAfter

func (u *KEKVersionUpsertBulk) UpdateRetireAfter() *KEKVersionUpsertBulk

UpdateRetireAfter sets the "retire_after" field to the value that was provided on create.

func (*KEKVersionUpsertBulk) UpdateRotatedAt

func (u *KEKVersionUpsertBulk) UpdateRotatedAt() *KEKVersionUpsertBulk

UpdateRotatedAt sets the "rotated_at" field to the value that was provided on create.

func (*KEKVersionUpsertBulk) UpdateState

func (u *KEKVersionUpsertBulk) UpdateState() *KEKVersionUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*KEKVersionUpsertBulk) UpdateVersion

func (u *KEKVersionUpsertBulk) UpdateVersion() *KEKVersionUpsertBulk

UpdateVersion sets the "version" field to the value that was provided on create.

type KEKVersionUpsertOne

type KEKVersionUpsertOne struct {
	// contains filtered or unexported fields
}

KEKVersionUpsertOne is the builder for "upsert"-ing

one KEKVersion node.

func (*KEKVersionUpsertOne) AddState

AddState adds v to the "state" field.

func (*KEKVersionUpsertOne) AddVersion

AddVersion adds v to the "version" field.

func (*KEKVersionUpsertOne) ClearActivatedAt

func (u *KEKVersionUpsertOne) ClearActivatedAt() *KEKVersionUpsertOne

ClearActivatedAt clears the value of the "activated_at" field.

func (*KEKVersionUpsertOne) ClearRetireAfter

func (u *KEKVersionUpsertOne) ClearRetireAfter() *KEKVersionUpsertOne

ClearRetireAfter clears the value of the "retire_after" field.

func (*KEKVersionUpsertOne) ClearRotatedAt

func (u *KEKVersionUpsertOne) ClearRotatedAt() *KEKVersionUpsertOne

ClearRotatedAt clears the value of the "rotated_at" field.

func (*KEKVersionUpsertOne) DoNothing

func (u *KEKVersionUpsertOne) DoNothing() *KEKVersionUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*KEKVersionUpsertOne) Exec

Exec executes the query.

func (*KEKVersionUpsertOne) ExecX

func (u *KEKVersionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KEKVersionUpsertOne) ID

func (u *KEKVersionUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*KEKVersionUpsertOne) IDX

func (u *KEKVersionUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*KEKVersionUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.KEKVersion.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*KEKVersionUpsertOne) SetActivatedAt

func (u *KEKVersionUpsertOne) SetActivatedAt(v time.Time) *KEKVersionUpsertOne

SetActivatedAt sets the "activated_at" field.

func (*KEKVersionUpsertOne) SetCreatedAt

func (u *KEKVersionUpsertOne) SetCreatedAt(v time.Time) *KEKVersionUpsertOne

SetCreatedAt sets the "created_at" field.

func (*KEKVersionUpsertOne) SetKekID

SetKekID sets the "kek_id" field.

func (*KEKVersionUpsertOne) SetProviderRef

func (u *KEKVersionUpsertOne) SetProviderRef(v string) *KEKVersionUpsertOne

SetProviderRef sets the "provider_ref" field.

func (*KEKVersionUpsertOne) SetRetireAfter

func (u *KEKVersionUpsertOne) SetRetireAfter(v time.Time) *KEKVersionUpsertOne

SetRetireAfter sets the "retire_after" field.

func (*KEKVersionUpsertOne) SetRotatedAt

func (u *KEKVersionUpsertOne) SetRotatedAt(v time.Time) *KEKVersionUpsertOne

SetRotatedAt sets the "rotated_at" field.

func (*KEKVersionUpsertOne) SetState

SetState sets the "state" field.

func (*KEKVersionUpsertOne) SetVersion

SetVersion sets the "version" field.

func (*KEKVersionUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the KEKVersionCreate.OnConflict documentation for more info.

func (*KEKVersionUpsertOne) UpdateActivatedAt

func (u *KEKVersionUpsertOne) UpdateActivatedAt() *KEKVersionUpsertOne

UpdateActivatedAt sets the "activated_at" field to the value that was provided on create.

func (*KEKVersionUpsertOne) UpdateCreatedAt

func (u *KEKVersionUpsertOne) UpdateCreatedAt() *KEKVersionUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*KEKVersionUpsertOne) UpdateKekID

func (u *KEKVersionUpsertOne) UpdateKekID() *KEKVersionUpsertOne

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*KEKVersionUpsertOne) UpdateNewValues

func (u *KEKVersionUpsertOne) UpdateNewValues() *KEKVersionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.KEKVersion.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*KEKVersionUpsertOne) UpdateProviderRef

func (u *KEKVersionUpsertOne) UpdateProviderRef() *KEKVersionUpsertOne

UpdateProviderRef sets the "provider_ref" field to the value that was provided on create.

func (*KEKVersionUpsertOne) UpdateRetireAfter

func (u *KEKVersionUpsertOne) UpdateRetireAfter() *KEKVersionUpsertOne

UpdateRetireAfter sets the "retire_after" field to the value that was provided on create.

func (*KEKVersionUpsertOne) UpdateRotatedAt

func (u *KEKVersionUpsertOne) UpdateRotatedAt() *KEKVersionUpsertOne

UpdateRotatedAt sets the "rotated_at" field to the value that was provided on create.

func (*KEKVersionUpsertOne) UpdateState

func (u *KEKVersionUpsertOne) UpdateState() *KEKVersionUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*KEKVersionUpsertOne) UpdateVersion

func (u *KEKVersionUpsertOne) UpdateVersion() *KEKVersionUpsertOne

UpdateVersion sets the "version" field to the value that was provided on create.

type KEKVersions

type KEKVersions []*KEKVersion

KEKVersions is a parsable slice of KEKVersion.

type KEKs

type KEKs []*KEK

KEKs is a parsable slice of KEK.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Sentinel

type Sentinel struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// KekID holds the value of the "kek_id" field.
	KekID envelope.ID `json:"kek_id,omitempty"`
	// Version holds the value of the "version" field.
	Version uint32 `json:"version,omitempty"`
	// Envelope holds the value of the "envelope" field.
	Envelope string `json:"envelope,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SentinelQuery when eager-loading is set.
	Edges SentinelEdges `json:"edges"`
	// contains filtered or unexported fields
}

Sentinel is the model entity for the Sentinel schema.

func (*Sentinel) ExecContext

func (c *Sentinel) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Sentinel) QueryContext

func (c *Sentinel) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Sentinel) QueryKek

func (_m *Sentinel) QueryKek() *KEKQuery

QueryKek queries the "kek" edge of the Sentinel entity.

func (*Sentinel) String

func (_m *Sentinel) String() string

String implements the fmt.Stringer.

func (*Sentinel) Unwrap

func (_m *Sentinel) Unwrap() *Sentinel

Unwrap unwraps the Sentinel entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Sentinel) Update

func (_m *Sentinel) Update() *SentinelUpdateOne

Update returns a builder for updating this Sentinel. Note that you need to call Sentinel.Unwrap() before calling this method if this Sentinel was returned from a transaction, and the transaction was committed or rolled back.

func (*Sentinel) Value

func (_m *Sentinel) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Sentinel. This includes values selected through modifiers, order, etc.

type SentinelClient

type SentinelClient struct {
	// contains filtered or unexported fields
}

SentinelClient is a client for the Sentinel schema.

func NewSentinelClient

func NewSentinelClient(c config) *SentinelClient

NewSentinelClient returns a client for the Sentinel from the given config.

func (*SentinelClient) Create

func (c *SentinelClient) Create() *SentinelCreate

Create returns a builder for creating a Sentinel entity.

func (*SentinelClient) CreateBulk

func (c *SentinelClient) CreateBulk(builders ...*SentinelCreate) *SentinelCreateBulk

CreateBulk returns a builder for creating a bulk of Sentinel entities.

func (*SentinelClient) Delete

func (c *SentinelClient) Delete() *SentinelDelete

Delete returns a delete builder for Sentinel.

func (*SentinelClient) DeleteOne

func (c *SentinelClient) DeleteOne(_m *Sentinel) *SentinelDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SentinelClient) DeleteOneID

func (c *SentinelClient) DeleteOneID(id int) *SentinelDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SentinelClient) ExecContext

func (c *SentinelClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelClient) Get

func (c *SentinelClient) Get(ctx context.Context, id int) (*Sentinel, error)

Get returns a Sentinel entity by its id.

func (*SentinelClient) GetX

func (c *SentinelClient) GetX(ctx context.Context, id int) *Sentinel

GetX is like Get, but panics if an error occurs.

func (*SentinelClient) Hooks

func (c *SentinelClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SentinelClient) Intercept

func (c *SentinelClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `sentinel.Intercept(f(g(h())))`.

func (*SentinelClient) Interceptors

func (c *SentinelClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SentinelClient) MapCreateBulk

func (c *SentinelClient) MapCreateBulk(slice any, setFunc func(*SentinelCreate, int)) *SentinelCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SentinelClient) Query

func (c *SentinelClient) Query() *SentinelQuery

Query returns a query builder for Sentinel.

func (*SentinelClient) QueryContext

func (c *SentinelClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelClient) QueryKek

func (c *SentinelClient) QueryKek(_m *Sentinel) *KEKQuery

QueryKek queries the kek edge of a Sentinel.

func (*SentinelClient) Update

func (c *SentinelClient) Update() *SentinelUpdate

Update returns an update builder for Sentinel.

func (*SentinelClient) UpdateOne

func (c *SentinelClient) UpdateOne(_m *Sentinel) *SentinelUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SentinelClient) UpdateOneID

func (c *SentinelClient) UpdateOneID(id int) *SentinelUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SentinelClient) Use

func (c *SentinelClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sentinel.Hooks(f(g(h())))`.

type SentinelCreate

type SentinelCreate struct {
	// contains filtered or unexported fields
}

SentinelCreate is the builder for creating a Sentinel entity.

func (*SentinelCreate) Exec

func (_c *SentinelCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SentinelCreate) ExecContext

func (c *SentinelCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelCreate) ExecX

func (_c *SentinelCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SentinelCreate) Mutation

func (_c *SentinelCreate) Mutation() *SentinelMutation

Mutation returns the SentinelMutation object of the builder.

func (*SentinelCreate) OnConflict

func (_c *SentinelCreate) OnConflict(opts ...sql.ConflictOption) *SentinelUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Sentinel.Create().
	SetKekID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SentinelUpsert) {
		SetKekID(v+v).
	}).
	Exec(ctx)

func (*SentinelCreate) OnConflictColumns

func (_c *SentinelCreate) OnConflictColumns(columns ...string) *SentinelUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Sentinel.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SentinelCreate) QueryContext

func (c *SentinelCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelCreate) Save

func (_c *SentinelCreate) Save(ctx context.Context) (*Sentinel, error)

Save creates the Sentinel in the database.

func (*SentinelCreate) SaveX

func (_c *SentinelCreate) SaveX(ctx context.Context) *Sentinel

SaveX calls Save and panics if Save returns an error.

func (*SentinelCreate) SetCreatedAt

func (_c *SentinelCreate) SetCreatedAt(v time.Time) *SentinelCreate

SetCreatedAt sets the "created_at" field.

func (*SentinelCreate) SetEnvelope

func (_c *SentinelCreate) SetEnvelope(v string) *SentinelCreate

SetEnvelope sets the "envelope" field.

func (*SentinelCreate) SetKek

func (_c *SentinelCreate) SetKek(v *KEK) *SentinelCreate

SetKek sets the "kek" edge to the KEK entity.

func (*SentinelCreate) SetKekID

func (_c *SentinelCreate) SetKekID(v envelope.ID) *SentinelCreate

SetKekID sets the "kek_id" field.

func (*SentinelCreate) SetVersion

func (_c *SentinelCreate) SetVersion(v uint32) *SentinelCreate

SetVersion sets the "version" field.

type SentinelCreateBulk

type SentinelCreateBulk struct {
	// contains filtered or unexported fields
}

SentinelCreateBulk is the builder for creating many Sentinel entities in bulk.

func (*SentinelCreateBulk) Exec

func (_c *SentinelCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SentinelCreateBulk) ExecContext

func (c *SentinelCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelCreateBulk) ExecX

func (_c *SentinelCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SentinelCreateBulk) OnConflict

func (_c *SentinelCreateBulk) OnConflict(opts ...sql.ConflictOption) *SentinelUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Sentinel.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SentinelUpsert) {
		SetKekID(v+v).
	}).
	Exec(ctx)

func (*SentinelCreateBulk) OnConflictColumns

func (_c *SentinelCreateBulk) OnConflictColumns(columns ...string) *SentinelUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Sentinel.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SentinelCreateBulk) QueryContext

func (c *SentinelCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelCreateBulk) Save

func (_c *SentinelCreateBulk) Save(ctx context.Context) ([]*Sentinel, error)

Save creates the Sentinel entities in the database.

func (*SentinelCreateBulk) SaveX

func (_c *SentinelCreateBulk) SaveX(ctx context.Context) []*Sentinel

SaveX is like Save, but panics if an error occurs.

type SentinelDelete

type SentinelDelete struct {
	// contains filtered or unexported fields
}

SentinelDelete is the builder for deleting a Sentinel entity.

func (*SentinelDelete) Exec

func (_d *SentinelDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SentinelDelete) ExecContext

func (c *SentinelDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelDelete) ExecX

func (_d *SentinelDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SentinelDelete) QueryContext

func (c *SentinelDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelDelete) Where

func (_d *SentinelDelete) Where(ps ...predicate.Sentinel) *SentinelDelete

Where appends a list predicates to the SentinelDelete builder.

type SentinelDeleteOne

type SentinelDeleteOne struct {
	// contains filtered or unexported fields
}

SentinelDeleteOne is the builder for deleting a single Sentinel entity.

func (*SentinelDeleteOne) Exec

func (_d *SentinelDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SentinelDeleteOne) ExecX

func (_d *SentinelDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SentinelDeleteOne) Where

Where appends a list predicates to the SentinelDelete builder.

type SentinelEdges

type SentinelEdges struct {
	// Kek holds the value of the kek edge.
	Kek *KEK `json:"kek,omitempty"`
	// contains filtered or unexported fields
}

SentinelEdges holds the relations/edges for other nodes in the graph.

func (SentinelEdges) KekOrErr

func (e SentinelEdges) KekOrErr() (*KEK, error)

KekOrErr returns the Kek value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SentinelGroupBy

type SentinelGroupBy struct {
	// contains filtered or unexported fields
}

SentinelGroupBy is the group-by builder for Sentinel entities.

func (*SentinelGroupBy) Aggregate

func (_g *SentinelGroupBy) Aggregate(fns ...AggregateFunc) *SentinelGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SentinelGroupBy) Bool

func (s *SentinelGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) BoolX

func (s *SentinelGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SentinelGroupBy) Bools

func (s *SentinelGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) BoolsX

func (s *SentinelGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SentinelGroupBy) Float64

func (s *SentinelGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) Float64X

func (s *SentinelGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SentinelGroupBy) Float64s

func (s *SentinelGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) Float64sX

func (s *SentinelGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SentinelGroupBy) Int

func (s *SentinelGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) IntX

func (s *SentinelGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SentinelGroupBy) Ints

func (s *SentinelGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) IntsX

func (s *SentinelGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SentinelGroupBy) Scan

func (_g *SentinelGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SentinelGroupBy) ScanX

func (s *SentinelGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SentinelGroupBy) String

func (s *SentinelGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) StringX

func (s *SentinelGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SentinelGroupBy) Strings

func (s *SentinelGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SentinelGroupBy) StringsX

func (s *SentinelGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SentinelMutation

type SentinelMutation struct {
	// contains filtered or unexported fields
}

SentinelMutation represents an operation that mutates the Sentinel nodes in the graph.

func (*SentinelMutation) AddField

func (m *SentinelMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SentinelMutation) AddVersion

func (m *SentinelMutation) AddVersion(u int32)

AddVersion adds u to the "version" field.

func (*SentinelMutation) AddedEdges

func (m *SentinelMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SentinelMutation) AddedField

func (m *SentinelMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SentinelMutation) AddedFields

func (m *SentinelMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SentinelMutation) AddedIDs

func (m *SentinelMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SentinelMutation) AddedVersion

func (m *SentinelMutation) AddedVersion() (r int32, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*SentinelMutation) ClearEdge

func (m *SentinelMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*SentinelMutation) ClearField

func (m *SentinelMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*SentinelMutation) ClearKek

func (m *SentinelMutation) ClearKek()

ClearKek clears the "kek" edge to the KEK entity.

func (*SentinelMutation) ClearedEdges

func (m *SentinelMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SentinelMutation) ClearedFields

func (m *SentinelMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SentinelMutation) Client

func (m SentinelMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*SentinelMutation) CreatedAt

func (m *SentinelMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SentinelMutation) EdgeCleared

func (m *SentinelMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SentinelMutation) Envelope

func (m *SentinelMutation) Envelope() (r string, exists bool)

Envelope returns the value of the "envelope" field in the mutation.

func (*SentinelMutation) ExecContext

func (c *SentinelMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelMutation) Field

func (m *SentinelMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SentinelMutation) FieldCleared

func (m *SentinelMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SentinelMutation) Fields

func (m *SentinelMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*SentinelMutation) ID

func (m *SentinelMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SentinelMutation) IDs

func (m *SentinelMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SentinelMutation) KekCleared

func (m *SentinelMutation) KekCleared() bool

KekCleared reports if the "kek" edge to the KEK entity was cleared.

func (*SentinelMutation) KekID

func (m *SentinelMutation) KekID() (r envelope.ID, exists bool)

KekID returns the value of the "kek_id" field in the mutation.

func (*SentinelMutation) KekIDs

func (m *SentinelMutation) KekIDs() (ids []envelope.ID)

KekIDs returns the "kek" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use KekID instead. It exists only for internal usage by the builders.

func (*SentinelMutation) OldCreatedAt

func (m *SentinelMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Sentinel entity. If the Sentinel object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SentinelMutation) OldEnvelope

func (m *SentinelMutation) OldEnvelope(ctx context.Context) (v string, err error)

OldEnvelope returns the old "envelope" field's value of the Sentinel entity. If the Sentinel object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SentinelMutation) OldField

func (m *SentinelMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*SentinelMutation) OldKekID

func (m *SentinelMutation) OldKekID(ctx context.Context) (v envelope.ID, err error)

OldKekID returns the old "kek_id" field's value of the Sentinel entity. If the Sentinel object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SentinelMutation) OldVersion

func (m *SentinelMutation) OldVersion(ctx context.Context) (v uint32, err error)

OldVersion returns the old "version" field's value of the Sentinel entity. If the Sentinel object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SentinelMutation) Op

func (m *SentinelMutation) Op() Op

Op returns the operation name.

func (*SentinelMutation) QueryContext

func (c *SentinelMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelMutation) RemovedEdges

func (m *SentinelMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SentinelMutation) RemovedIDs

func (m *SentinelMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SentinelMutation) ResetCreatedAt

func (m *SentinelMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SentinelMutation) ResetEdge

func (m *SentinelMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*SentinelMutation) ResetEnvelope

func (m *SentinelMutation) ResetEnvelope()

ResetEnvelope resets all changes to the "envelope" field.

func (*SentinelMutation) ResetField

func (m *SentinelMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*SentinelMutation) ResetKek

func (m *SentinelMutation) ResetKek()

ResetKek resets all changes to the "kek" edge.

func (*SentinelMutation) ResetKekID

func (m *SentinelMutation) ResetKekID()

ResetKekID resets all changes to the "kek_id" field.

func (*SentinelMutation) ResetVersion

func (m *SentinelMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*SentinelMutation) SetCreatedAt

func (m *SentinelMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SentinelMutation) SetEnvelope

func (m *SentinelMutation) SetEnvelope(s string)

SetEnvelope sets the "envelope" field.

func (*SentinelMutation) SetField

func (m *SentinelMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SentinelMutation) SetKekID

func (m *SentinelMutation) SetKekID(e envelope.ID)

SetKekID sets the "kek_id" field.

func (*SentinelMutation) SetOp

func (m *SentinelMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SentinelMutation) SetVersion

func (m *SentinelMutation) SetVersion(u uint32)

SetVersion sets the "version" field.

func (SentinelMutation) Tx

func (m SentinelMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SentinelMutation) Type

func (m *SentinelMutation) Type() string

Type returns the node type of this mutation (Sentinel).

func (*SentinelMutation) Version

func (m *SentinelMutation) Version() (r uint32, exists bool)

Version returns the value of the "version" field in the mutation.

func (*SentinelMutation) Where

func (m *SentinelMutation) Where(ps ...predicate.Sentinel)

Where appends a list predicates to the SentinelMutation builder.

func (*SentinelMutation) WhereP

func (m *SentinelMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SentinelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SentinelQuery

type SentinelQuery struct {
	// contains filtered or unexported fields
}

SentinelQuery is the builder for querying Sentinel entities.

func (*SentinelQuery) Aggregate

func (_q *SentinelQuery) Aggregate(fns ...AggregateFunc) *SentinelSelect

Aggregate returns a SentinelSelect configured with the given aggregations.

func (*SentinelQuery) All

func (_q *SentinelQuery) All(ctx context.Context) ([]*Sentinel, error)

All executes the query and returns a list of Sentinels.

func (*SentinelQuery) AllX

func (_q *SentinelQuery) AllX(ctx context.Context) []*Sentinel

AllX is like All, but panics if an error occurs.

func (*SentinelQuery) Clone

func (_q *SentinelQuery) Clone() *SentinelQuery

Clone returns a duplicate of the SentinelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SentinelQuery) Count

func (_q *SentinelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SentinelQuery) CountX

func (_q *SentinelQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SentinelQuery) ExecContext

func (c *SentinelQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelQuery) Exist

func (_q *SentinelQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SentinelQuery) ExistX

func (_q *SentinelQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SentinelQuery) First

func (_q *SentinelQuery) First(ctx context.Context) (*Sentinel, error)

First returns the first Sentinel entity from the query. Returns a *NotFoundError when no Sentinel was found.

func (*SentinelQuery) FirstID

func (_q *SentinelQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Sentinel ID from the query. Returns a *NotFoundError when no Sentinel ID was found.

func (*SentinelQuery) FirstIDX

func (_q *SentinelQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SentinelQuery) FirstX

func (_q *SentinelQuery) FirstX(ctx context.Context) *Sentinel

FirstX is like First, but panics if an error occurs.

func (*SentinelQuery) ForShare

func (_q *SentinelQuery) ForShare(opts ...sql.LockOption) *SentinelQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*SentinelQuery) ForUpdate

func (_q *SentinelQuery) ForUpdate(opts ...sql.LockOption) *SentinelQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*SentinelQuery) GroupBy

func (_q *SentinelQuery) GroupBy(field string, fields ...string) *SentinelGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	KekID envelope.ID `json:"kek_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Sentinel.Query().
	GroupBy(sentinel.FieldKekID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SentinelQuery) IDs

func (_q *SentinelQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Sentinel IDs.

func (*SentinelQuery) IDsX

func (_q *SentinelQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SentinelQuery) Limit

func (_q *SentinelQuery) Limit(limit int) *SentinelQuery

Limit the number of records to be returned by this query.

func (*SentinelQuery) Offset

func (_q *SentinelQuery) Offset(offset int) *SentinelQuery

Offset to start from.

func (*SentinelQuery) Only

func (_q *SentinelQuery) Only(ctx context.Context) (*Sentinel, error)

Only returns a single Sentinel entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Sentinel entity is found. Returns a *NotFoundError when no Sentinel entities are found.

func (*SentinelQuery) OnlyID

func (_q *SentinelQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Sentinel ID in the query. Returns a *NotSingularError when more than one Sentinel ID is found. Returns a *NotFoundError when no entities are found.

func (*SentinelQuery) OnlyIDX

func (_q *SentinelQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SentinelQuery) OnlyX

func (_q *SentinelQuery) OnlyX(ctx context.Context) *Sentinel

OnlyX is like Only, but panics if an error occurs.

func (*SentinelQuery) Order

Order specifies how the records should be ordered.

func (*SentinelQuery) QueryContext

func (c *SentinelQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelQuery) QueryKek

func (_q *SentinelQuery) QueryKek() *KEKQuery

QueryKek chains the current query on the "kek" edge.

func (*SentinelQuery) Select

func (_q *SentinelQuery) Select(fields ...string) *SentinelSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	KekID envelope.ID `json:"kek_id,omitempty"`
}

client.Sentinel.Query().
	Select(sentinel.FieldKekID).
	Scan(ctx, &v)

func (*SentinelQuery) Unique

func (_q *SentinelQuery) Unique(unique bool) *SentinelQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SentinelQuery) Where

func (_q *SentinelQuery) Where(ps ...predicate.Sentinel) *SentinelQuery

Where adds a new predicate for the SentinelQuery builder.

func (*SentinelQuery) WithKek

func (_q *SentinelQuery) WithKek(opts ...func(*KEKQuery)) *SentinelQuery

WithKek tells the query-builder to eager-load the nodes that are connected to the "kek" edge. The optional arguments are used to configure the query builder of the edge.

type SentinelSelect

type SentinelSelect struct {
	*SentinelQuery
	// contains filtered or unexported fields
}

SentinelSelect is the builder for selecting fields of Sentinel entities.

func (*SentinelSelect) Aggregate

func (_s *SentinelSelect) Aggregate(fns ...AggregateFunc) *SentinelSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SentinelSelect) Bool

func (s *SentinelSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) BoolX

func (s *SentinelSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SentinelSelect) Bools

func (s *SentinelSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) BoolsX

func (s *SentinelSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (SentinelSelect) ExecContext

func (c SentinelSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelSelect) Float64

func (s *SentinelSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) Float64X

func (s *SentinelSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SentinelSelect) Float64s

func (s *SentinelSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) Float64sX

func (s *SentinelSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SentinelSelect) Int

func (s *SentinelSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) IntX

func (s *SentinelSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SentinelSelect) Ints

func (s *SentinelSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) IntsX

func (s *SentinelSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (SentinelSelect) QueryContext

func (c SentinelSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelSelect) Scan

func (_s *SentinelSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SentinelSelect) ScanX

func (s *SentinelSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SentinelSelect) String

func (s *SentinelSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) StringX

func (s *SentinelSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SentinelSelect) Strings

func (s *SentinelSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SentinelSelect) StringsX

func (s *SentinelSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SentinelUpdate

type SentinelUpdate struct {
	// contains filtered or unexported fields
}

SentinelUpdate is the builder for updating Sentinel entities.

func (*SentinelUpdate) AddVersion

func (_u *SentinelUpdate) AddVersion(v int32) *SentinelUpdate

AddVersion adds value to the "version" field.

func (*SentinelUpdate) ClearKek

func (_u *SentinelUpdate) ClearKek() *SentinelUpdate

ClearKek clears the "kek" edge to the KEK entity.

func (*SentinelUpdate) Exec

func (_u *SentinelUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SentinelUpdate) ExecContext

func (c *SentinelUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelUpdate) ExecX

func (_u *SentinelUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SentinelUpdate) Mutation

func (_u *SentinelUpdate) Mutation() *SentinelMutation

Mutation returns the SentinelMutation object of the builder.

func (*SentinelUpdate) QueryContext

func (c *SentinelUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelUpdate) Save

func (_u *SentinelUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SentinelUpdate) SaveX

func (_u *SentinelUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SentinelUpdate) SetCreatedAt

func (_u *SentinelUpdate) SetCreatedAt(v time.Time) *SentinelUpdate

SetCreatedAt sets the "created_at" field.

func (*SentinelUpdate) SetEnvelope

func (_u *SentinelUpdate) SetEnvelope(v string) *SentinelUpdate

SetEnvelope sets the "envelope" field.

func (*SentinelUpdate) SetKek

func (_u *SentinelUpdate) SetKek(v *KEK) *SentinelUpdate

SetKek sets the "kek" edge to the KEK entity.

func (*SentinelUpdate) SetKekID

func (_u *SentinelUpdate) SetKekID(v envelope.ID) *SentinelUpdate

SetKekID sets the "kek_id" field.

func (*SentinelUpdate) SetNillableCreatedAt

func (_u *SentinelUpdate) SetNillableCreatedAt(v *time.Time) *SentinelUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SentinelUpdate) SetNillableEnvelope

func (_u *SentinelUpdate) SetNillableEnvelope(v *string) *SentinelUpdate

SetNillableEnvelope sets the "envelope" field if the given value is not nil.

func (*SentinelUpdate) SetNillableKekID

func (_u *SentinelUpdate) SetNillableKekID(v *envelope.ID) *SentinelUpdate

SetNillableKekID sets the "kek_id" field if the given value is not nil.

func (*SentinelUpdate) SetNillableVersion

func (_u *SentinelUpdate) SetNillableVersion(v *uint32) *SentinelUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*SentinelUpdate) SetVersion

func (_u *SentinelUpdate) SetVersion(v uint32) *SentinelUpdate

SetVersion sets the "version" field.

func (*SentinelUpdate) Where

func (_u *SentinelUpdate) Where(ps ...predicate.Sentinel) *SentinelUpdate

Where appends a list predicates to the SentinelUpdate builder.

type SentinelUpdateOne

type SentinelUpdateOne struct {
	// contains filtered or unexported fields
}

SentinelUpdateOne is the builder for updating a single Sentinel entity.

func (*SentinelUpdateOne) AddVersion

func (_u *SentinelUpdateOne) AddVersion(v int32) *SentinelUpdateOne

AddVersion adds value to the "version" field.

func (*SentinelUpdateOne) ClearKek

func (_u *SentinelUpdateOne) ClearKek() *SentinelUpdateOne

ClearKek clears the "kek" edge to the KEK entity.

func (*SentinelUpdateOne) Exec

func (_u *SentinelUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SentinelUpdateOne) ExecContext

func (c *SentinelUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SentinelUpdateOne) ExecX

func (_u *SentinelUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SentinelUpdateOne) Mutation

func (_u *SentinelUpdateOne) Mutation() *SentinelMutation

Mutation returns the SentinelMutation object of the builder.

func (*SentinelUpdateOne) QueryContext

func (c *SentinelUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SentinelUpdateOne) Save

func (_u *SentinelUpdateOne) Save(ctx context.Context) (*Sentinel, error)

Save executes the query and returns the updated Sentinel entity.

func (*SentinelUpdateOne) SaveX

func (_u *SentinelUpdateOne) SaveX(ctx context.Context) *Sentinel

SaveX is like Save, but panics if an error occurs.

func (*SentinelUpdateOne) Select

func (_u *SentinelUpdateOne) Select(field string, fields ...string) *SentinelUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SentinelUpdateOne) SetCreatedAt

func (_u *SentinelUpdateOne) SetCreatedAt(v time.Time) *SentinelUpdateOne

SetCreatedAt sets the "created_at" field.

func (*SentinelUpdateOne) SetEnvelope

func (_u *SentinelUpdateOne) SetEnvelope(v string) *SentinelUpdateOne

SetEnvelope sets the "envelope" field.

func (*SentinelUpdateOne) SetKek

func (_u *SentinelUpdateOne) SetKek(v *KEK) *SentinelUpdateOne

SetKek sets the "kek" edge to the KEK entity.

func (*SentinelUpdateOne) SetKekID

SetKekID sets the "kek_id" field.

func (*SentinelUpdateOne) SetNillableCreatedAt

func (_u *SentinelUpdateOne) SetNillableCreatedAt(v *time.Time) *SentinelUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SentinelUpdateOne) SetNillableEnvelope

func (_u *SentinelUpdateOne) SetNillableEnvelope(v *string) *SentinelUpdateOne

SetNillableEnvelope sets the "envelope" field if the given value is not nil.

func (*SentinelUpdateOne) SetNillableKekID

func (_u *SentinelUpdateOne) SetNillableKekID(v *envelope.ID) *SentinelUpdateOne

SetNillableKekID sets the "kek_id" field if the given value is not nil.

func (*SentinelUpdateOne) SetNillableVersion

func (_u *SentinelUpdateOne) SetNillableVersion(v *uint32) *SentinelUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*SentinelUpdateOne) SetVersion

func (_u *SentinelUpdateOne) SetVersion(v uint32) *SentinelUpdateOne

SetVersion sets the "version" field.

func (*SentinelUpdateOne) Where

Where appends a list predicates to the SentinelUpdate builder.

type SentinelUpsert

type SentinelUpsert struct {
	*sql.UpdateSet
}

SentinelUpsert is the "OnConflict" setter.

func (*SentinelUpsert) AddVersion

func (u *SentinelUpsert) AddVersion(v uint32) *SentinelUpsert

AddVersion adds v to the "version" field.

func (*SentinelUpsert) SetCreatedAt

func (u *SentinelUpsert) SetCreatedAt(v time.Time) *SentinelUpsert

SetCreatedAt sets the "created_at" field.

func (*SentinelUpsert) SetEnvelope

func (u *SentinelUpsert) SetEnvelope(v string) *SentinelUpsert

SetEnvelope sets the "envelope" field.

func (*SentinelUpsert) SetKekID

func (u *SentinelUpsert) SetKekID(v envelope.ID) *SentinelUpsert

SetKekID sets the "kek_id" field.

func (*SentinelUpsert) SetVersion

func (u *SentinelUpsert) SetVersion(v uint32) *SentinelUpsert

SetVersion sets the "version" field.

func (*SentinelUpsert) UpdateCreatedAt

func (u *SentinelUpsert) UpdateCreatedAt() *SentinelUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*SentinelUpsert) UpdateEnvelope

func (u *SentinelUpsert) UpdateEnvelope() *SentinelUpsert

UpdateEnvelope sets the "envelope" field to the value that was provided on create.

func (*SentinelUpsert) UpdateKekID

func (u *SentinelUpsert) UpdateKekID() *SentinelUpsert

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*SentinelUpsert) UpdateVersion

func (u *SentinelUpsert) UpdateVersion() *SentinelUpsert

UpdateVersion sets the "version" field to the value that was provided on create.

type SentinelUpsertBulk

type SentinelUpsertBulk struct {
	// contains filtered or unexported fields
}

SentinelUpsertBulk is the builder for "upsert"-ing a bulk of Sentinel nodes.

func (*SentinelUpsertBulk) AddVersion

func (u *SentinelUpsertBulk) AddVersion(v uint32) *SentinelUpsertBulk

AddVersion adds v to the "version" field.

func (*SentinelUpsertBulk) DoNothing

func (u *SentinelUpsertBulk) DoNothing() *SentinelUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SentinelUpsertBulk) Exec

func (u *SentinelUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SentinelUpsertBulk) ExecX

func (u *SentinelUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SentinelUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Sentinel.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SentinelUpsertBulk) SetCreatedAt

func (u *SentinelUpsertBulk) SetCreatedAt(v time.Time) *SentinelUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*SentinelUpsertBulk) SetEnvelope

func (u *SentinelUpsertBulk) SetEnvelope(v string) *SentinelUpsertBulk

SetEnvelope sets the "envelope" field.

func (*SentinelUpsertBulk) SetKekID

SetKekID sets the "kek_id" field.

func (*SentinelUpsertBulk) SetVersion

func (u *SentinelUpsertBulk) SetVersion(v uint32) *SentinelUpsertBulk

SetVersion sets the "version" field.

func (*SentinelUpsertBulk) Update

func (u *SentinelUpsertBulk) Update(set func(*SentinelUpsert)) *SentinelUpsertBulk

Update allows overriding fields `UPDATE` values. See the SentinelCreateBulk.OnConflict documentation for more info.

func (*SentinelUpsertBulk) UpdateCreatedAt

func (u *SentinelUpsertBulk) UpdateCreatedAt() *SentinelUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*SentinelUpsertBulk) UpdateEnvelope

func (u *SentinelUpsertBulk) UpdateEnvelope() *SentinelUpsertBulk

UpdateEnvelope sets the "envelope" field to the value that was provided on create.

func (*SentinelUpsertBulk) UpdateKekID

func (u *SentinelUpsertBulk) UpdateKekID() *SentinelUpsertBulk

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*SentinelUpsertBulk) UpdateNewValues

func (u *SentinelUpsertBulk) UpdateNewValues() *SentinelUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Sentinel.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*SentinelUpsertBulk) UpdateVersion

func (u *SentinelUpsertBulk) UpdateVersion() *SentinelUpsertBulk

UpdateVersion sets the "version" field to the value that was provided on create.

type SentinelUpsertOne

type SentinelUpsertOne struct {
	// contains filtered or unexported fields
}

SentinelUpsertOne is the builder for "upsert"-ing

one Sentinel node.

func (*SentinelUpsertOne) AddVersion

func (u *SentinelUpsertOne) AddVersion(v uint32) *SentinelUpsertOne

AddVersion adds v to the "version" field.

func (*SentinelUpsertOne) DoNothing

func (u *SentinelUpsertOne) DoNothing() *SentinelUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SentinelUpsertOne) Exec

func (u *SentinelUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*SentinelUpsertOne) ExecX

func (u *SentinelUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SentinelUpsertOne) ID

func (u *SentinelUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SentinelUpsertOne) IDX

func (u *SentinelUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*SentinelUpsertOne) Ignore

func (u *SentinelUpsertOne) Ignore() *SentinelUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Sentinel.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SentinelUpsertOne) SetCreatedAt

func (u *SentinelUpsertOne) SetCreatedAt(v time.Time) *SentinelUpsertOne

SetCreatedAt sets the "created_at" field.

func (*SentinelUpsertOne) SetEnvelope

func (u *SentinelUpsertOne) SetEnvelope(v string) *SentinelUpsertOne

SetEnvelope sets the "envelope" field.

func (*SentinelUpsertOne) SetKekID

SetKekID sets the "kek_id" field.

func (*SentinelUpsertOne) SetVersion

func (u *SentinelUpsertOne) SetVersion(v uint32) *SentinelUpsertOne

SetVersion sets the "version" field.

func (*SentinelUpsertOne) Update

func (u *SentinelUpsertOne) Update(set func(*SentinelUpsert)) *SentinelUpsertOne

Update allows overriding fields `UPDATE` values. See the SentinelCreate.OnConflict documentation for more info.

func (*SentinelUpsertOne) UpdateCreatedAt

func (u *SentinelUpsertOne) UpdateCreatedAt() *SentinelUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*SentinelUpsertOne) UpdateEnvelope

func (u *SentinelUpsertOne) UpdateEnvelope() *SentinelUpsertOne

UpdateEnvelope sets the "envelope" field to the value that was provided on create.

func (*SentinelUpsertOne) UpdateKekID

func (u *SentinelUpsertOne) UpdateKekID() *SentinelUpsertOne

UpdateKekID sets the "kek_id" field to the value that was provided on create.

func (*SentinelUpsertOne) UpdateNewValues

func (u *SentinelUpsertOne) UpdateNewValues() *SentinelUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Sentinel.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*SentinelUpsertOne) UpdateVersion

func (u *SentinelUpsertOne) UpdateVersion() *SentinelUpsertOne

UpdateVersion sets the "version" field to the value that was provided on create.

type Sentinels

type Sentinels []*Sentinel

Sentinels is a parsable slice of Sentinel.

type Shred

type Shred struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Purpose holds the value of the "purpose" field.
	Purpose string `json:"purpose,omitempty"`
	// Subject holds the value of the "subject" field.
	Subject string `json:"subject,omitempty"`
	// RequestedAt holds the value of the "requested_at" field.
	RequestedAt time.Time `json:"requested_at,omitempty"`
	// Versions holds the value of the "versions" field.
	Versions []keyforge.KEKVersionRef `json:"versions,omitempty"`
	// Deks holds the value of the "deks" field.
	Deks int `json:"deks,omitempty"`
	// CompletedAt holds the value of the "completed_at" field.
	CompletedAt *time.Time `json:"completed_at,omitempty"`
	// contains filtered or unexported fields
}

Shred is the model entity for the Shred schema.

func (*Shred) ExecContext

func (c *Shred) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Shred) QueryContext

func (c *Shred) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Shred) String

func (_m *Shred) String() string

String implements the fmt.Stringer.

func (*Shred) Unwrap

func (_m *Shred) Unwrap() *Shred

Unwrap unwraps the Shred entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Shred) Update

func (_m *Shred) Update() *ShredUpdateOne

Update returns a builder for updating this Shred. Note that you need to call Shred.Unwrap() before calling this method if this Shred was returned from a transaction, and the transaction was committed or rolled back.

func (*Shred) Value

func (_m *Shred) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Shred. This includes values selected through modifiers, order, etc.

type ShredClient

type ShredClient struct {
	// contains filtered or unexported fields
}

ShredClient is a client for the Shred schema.

func NewShredClient

func NewShredClient(c config) *ShredClient

NewShredClient returns a client for the Shred from the given config.

func (*ShredClient) Create

func (c *ShredClient) Create() *ShredCreate

Create returns a builder for creating a Shred entity.

func (*ShredClient) CreateBulk

func (c *ShredClient) CreateBulk(builders ...*ShredCreate) *ShredCreateBulk

CreateBulk returns a builder for creating a bulk of Shred entities.

func (*ShredClient) Delete

func (c *ShredClient) Delete() *ShredDelete

Delete returns a delete builder for Shred.

func (*ShredClient) DeleteOne

func (c *ShredClient) DeleteOne(_m *Shred) *ShredDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ShredClient) DeleteOneID

func (c *ShredClient) DeleteOneID(id int) *ShredDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ShredClient) ExecContext

func (c *ShredClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredClient) Get

func (c *ShredClient) Get(ctx context.Context, id int) (*Shred, error)

Get returns a Shred entity by its id.

func (*ShredClient) GetX

func (c *ShredClient) GetX(ctx context.Context, id int) *Shred

GetX is like Get, but panics if an error occurs.

func (*ShredClient) Hooks

func (c *ShredClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ShredClient) Intercept

func (c *ShredClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `shred.Intercept(f(g(h())))`.

func (*ShredClient) Interceptors

func (c *ShredClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ShredClient) MapCreateBulk

func (c *ShredClient) MapCreateBulk(slice any, setFunc func(*ShredCreate, int)) *ShredCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ShredClient) Query

func (c *ShredClient) Query() *ShredQuery

Query returns a query builder for Shred.

func (*ShredClient) QueryContext

func (c *ShredClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredClient) Update

func (c *ShredClient) Update() *ShredUpdate

Update returns an update builder for Shred.

func (*ShredClient) UpdateOne

func (c *ShredClient) UpdateOne(_m *Shred) *ShredUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ShredClient) UpdateOneID

func (c *ShredClient) UpdateOneID(id int) *ShredUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ShredClient) Use

func (c *ShredClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `shred.Hooks(f(g(h())))`.

type ShredCreate

type ShredCreate struct {
	// contains filtered or unexported fields
}

ShredCreate is the builder for creating a Shred entity.

func (*ShredCreate) Exec

func (_c *ShredCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShredCreate) ExecContext

func (c *ShredCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredCreate) ExecX

func (_c *ShredCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShredCreate) Mutation

func (_c *ShredCreate) Mutation() *ShredMutation

Mutation returns the ShredMutation object of the builder.

func (*ShredCreate) OnConflict

func (_c *ShredCreate) OnConflict(opts ...sql.ConflictOption) *ShredUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Shred.Create().
	SetPurpose(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ShredUpsert) {
		SetPurpose(v+v).
	}).
	Exec(ctx)

func (*ShredCreate) OnConflictColumns

func (_c *ShredCreate) OnConflictColumns(columns ...string) *ShredUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Shred.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ShredCreate) QueryContext

func (c *ShredCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredCreate) Save

func (_c *ShredCreate) Save(ctx context.Context) (*Shred, error)

Save creates the Shred in the database.

func (*ShredCreate) SaveX

func (_c *ShredCreate) SaveX(ctx context.Context) *Shred

SaveX calls Save and panics if Save returns an error.

func (*ShredCreate) SetCompletedAt

func (_c *ShredCreate) SetCompletedAt(v time.Time) *ShredCreate

SetCompletedAt sets the "completed_at" field.

func (*ShredCreate) SetDeks

func (_c *ShredCreate) SetDeks(v int) *ShredCreate

SetDeks sets the "deks" field.

func (*ShredCreate) SetNillableCompletedAt

func (_c *ShredCreate) SetNillableCompletedAt(v *time.Time) *ShredCreate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*ShredCreate) SetNillableDeks

func (_c *ShredCreate) SetNillableDeks(v *int) *ShredCreate

SetNillableDeks sets the "deks" field if the given value is not nil.

func (*ShredCreate) SetPurpose

func (_c *ShredCreate) SetPurpose(v string) *ShredCreate

SetPurpose sets the "purpose" field.

func (*ShredCreate) SetRequestedAt

func (_c *ShredCreate) SetRequestedAt(v time.Time) *ShredCreate

SetRequestedAt sets the "requested_at" field.

func (*ShredCreate) SetSubject

func (_c *ShredCreate) SetSubject(v string) *ShredCreate

SetSubject sets the "subject" field.

func (*ShredCreate) SetVersions

func (_c *ShredCreate) SetVersions(v []keyforge.KEKVersionRef) *ShredCreate

SetVersions sets the "versions" field.

type ShredCreateBulk

type ShredCreateBulk struct {
	// contains filtered or unexported fields
}

ShredCreateBulk is the builder for creating many Shred entities in bulk.

func (*ShredCreateBulk) Exec

func (_c *ShredCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ShredCreateBulk) ExecContext

func (c *ShredCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredCreateBulk) ExecX

func (_c *ShredCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShredCreateBulk) OnConflict

func (_c *ShredCreateBulk) OnConflict(opts ...sql.ConflictOption) *ShredUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Shred.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ShredUpsert) {
		SetPurpose(v+v).
	}).
	Exec(ctx)

func (*ShredCreateBulk) OnConflictColumns

func (_c *ShredCreateBulk) OnConflictColumns(columns ...string) *ShredUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Shred.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ShredCreateBulk) QueryContext

func (c *ShredCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredCreateBulk) Save

func (_c *ShredCreateBulk) Save(ctx context.Context) ([]*Shred, error)

Save creates the Shred entities in the database.

func (*ShredCreateBulk) SaveX

func (_c *ShredCreateBulk) SaveX(ctx context.Context) []*Shred

SaveX is like Save, but panics if an error occurs.

type ShredDelete

type ShredDelete struct {
	// contains filtered or unexported fields
}

ShredDelete is the builder for deleting a Shred entity.

func (*ShredDelete) Exec

func (_d *ShredDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ShredDelete) ExecContext

func (c *ShredDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredDelete) ExecX

func (_d *ShredDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ShredDelete) QueryContext

func (c *ShredDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredDelete) Where

func (_d *ShredDelete) Where(ps ...predicate.Shred) *ShredDelete

Where appends a list predicates to the ShredDelete builder.

type ShredDeleteOne

type ShredDeleteOne struct {
	// contains filtered or unexported fields
}

ShredDeleteOne is the builder for deleting a single Shred entity.

func (*ShredDeleteOne) Exec

func (_d *ShredDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ShredDeleteOne) ExecX

func (_d *ShredDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShredDeleteOne) Where

func (_d *ShredDeleteOne) Where(ps ...predicate.Shred) *ShredDeleteOne

Where appends a list predicates to the ShredDelete builder.

type ShredGroupBy

type ShredGroupBy struct {
	// contains filtered or unexported fields
}

ShredGroupBy is the group-by builder for Shred entities.

func (*ShredGroupBy) Aggregate

func (_g *ShredGroupBy) Aggregate(fns ...AggregateFunc) *ShredGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ShredGroupBy) Bool

func (s *ShredGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) BoolX

func (s *ShredGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShredGroupBy) Bools

func (s *ShredGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) BoolsX

func (s *ShredGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShredGroupBy) Float64

func (s *ShredGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) Float64X

func (s *ShredGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShredGroupBy) Float64s

func (s *ShredGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) Float64sX

func (s *ShredGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShredGroupBy) Int

func (s *ShredGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) IntX

func (s *ShredGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShredGroupBy) Ints

func (s *ShredGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) IntsX

func (s *ShredGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShredGroupBy) Scan

func (_g *ShredGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShredGroupBy) ScanX

func (s *ShredGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShredGroupBy) String

func (s *ShredGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) StringX

func (s *ShredGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShredGroupBy) Strings

func (s *ShredGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShredGroupBy) StringsX

func (s *ShredGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShredMutation

type ShredMutation struct {
	// contains filtered or unexported fields
}

ShredMutation represents an operation that mutates the Shred nodes in the graph.

func (*ShredMutation) AddDeks

func (m *ShredMutation) AddDeks(i int)

AddDeks adds i to the "deks" field.

func (*ShredMutation) AddField

func (m *ShredMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ShredMutation) AddedDeks

func (m *ShredMutation) AddedDeks() (r int, exists bool)

AddedDeks returns the value that was added to the "deks" field in this mutation.

func (*ShredMutation) AddedEdges

func (m *ShredMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ShredMutation) AddedField

func (m *ShredMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ShredMutation) AddedFields

func (m *ShredMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ShredMutation) AddedIDs

func (m *ShredMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ShredMutation) AppendVersions

func (m *ShredMutation) AppendVersions(kvr []keyforge.KEKVersionRef)

AppendVersions adds kvr to the "versions" field.

func (*ShredMutation) AppendedVersions

func (m *ShredMutation) AppendedVersions() ([]keyforge.KEKVersionRef, bool)

AppendedVersions returns the list of values that were appended to the "versions" field in this mutation.

func (*ShredMutation) ClearCompletedAt

func (m *ShredMutation) ClearCompletedAt()

ClearCompletedAt clears the value of the "completed_at" field.

func (*ShredMutation) ClearEdge

func (m *ShredMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ShredMutation) ClearField

func (m *ShredMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ShredMutation) ClearedEdges

func (m *ShredMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ShredMutation) ClearedFields

func (m *ShredMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ShredMutation) Client

func (m ShredMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ShredMutation) CompletedAt

func (m *ShredMutation) CompletedAt() (r time.Time, exists bool)

CompletedAt returns the value of the "completed_at" field in the mutation.

func (*ShredMutation) CompletedAtCleared

func (m *ShredMutation) CompletedAtCleared() bool

CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.

func (*ShredMutation) Deks

func (m *ShredMutation) Deks() (r int, exists bool)

Deks returns the value of the "deks" field in the mutation.

func (*ShredMutation) EdgeCleared

func (m *ShredMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ShredMutation) ExecContext

func (c *ShredMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredMutation) Field

func (m *ShredMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ShredMutation) FieldCleared

func (m *ShredMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ShredMutation) Fields

func (m *ShredMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ShredMutation) ID

func (m *ShredMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ShredMutation) IDs

func (m *ShredMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ShredMutation) OldCompletedAt

func (m *ShredMutation) OldCompletedAt(ctx context.Context) (v *time.Time, err error)

OldCompletedAt returns the old "completed_at" field's value of the Shred entity. If the Shred object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ShredMutation) OldDeks

func (m *ShredMutation) OldDeks(ctx context.Context) (v int, err error)

OldDeks returns the old "deks" field's value of the Shred entity. If the Shred object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ShredMutation) OldField

func (m *ShredMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ShredMutation) OldPurpose

func (m *ShredMutation) OldPurpose(ctx context.Context) (v string, err error)

OldPurpose returns the old "purpose" field's value of the Shred entity. If the Shred object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ShredMutation) OldRequestedAt

func (m *ShredMutation) OldRequestedAt(ctx context.Context) (v time.Time, err error)

OldRequestedAt returns the old "requested_at" field's value of the Shred entity. If the Shred object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ShredMutation) OldSubject

func (m *ShredMutation) OldSubject(ctx context.Context) (v string, err error)

OldSubject returns the old "subject" field's value of the Shred entity. If the Shred object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ShredMutation) OldVersions

func (m *ShredMutation) OldVersions(ctx context.Context) (v []keyforge.KEKVersionRef, err error)

OldVersions returns the old "versions" field's value of the Shred entity. If the Shred object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ShredMutation) Op

func (m *ShredMutation) Op() Op

Op returns the operation name.

func (*ShredMutation) Purpose

func (m *ShredMutation) Purpose() (r string, exists bool)

Purpose returns the value of the "purpose" field in the mutation.

func (*ShredMutation) QueryContext

func (c *ShredMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredMutation) RemovedEdges

func (m *ShredMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ShredMutation) RemovedIDs

func (m *ShredMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ShredMutation) RequestedAt

func (m *ShredMutation) RequestedAt() (r time.Time, exists bool)

RequestedAt returns the value of the "requested_at" field in the mutation.

func (*ShredMutation) ResetCompletedAt

func (m *ShredMutation) ResetCompletedAt()

ResetCompletedAt resets all changes to the "completed_at" field.

func (*ShredMutation) ResetDeks

func (m *ShredMutation) ResetDeks()

ResetDeks resets all changes to the "deks" field.

func (*ShredMutation) ResetEdge

func (m *ShredMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ShredMutation) ResetField

func (m *ShredMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ShredMutation) ResetPurpose

func (m *ShredMutation) ResetPurpose()

ResetPurpose resets all changes to the "purpose" field.

func (*ShredMutation) ResetRequestedAt

func (m *ShredMutation) ResetRequestedAt()

ResetRequestedAt resets all changes to the "requested_at" field.

func (*ShredMutation) ResetSubject

func (m *ShredMutation) ResetSubject()

ResetSubject resets all changes to the "subject" field.

func (*ShredMutation) ResetVersions

func (m *ShredMutation) ResetVersions()

ResetVersions resets all changes to the "versions" field.

func (*ShredMutation) SetCompletedAt

func (m *ShredMutation) SetCompletedAt(t time.Time)

SetCompletedAt sets the "completed_at" field.

func (*ShredMutation) SetDeks

func (m *ShredMutation) SetDeks(i int)

SetDeks sets the "deks" field.

func (*ShredMutation) SetField

func (m *ShredMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ShredMutation) SetOp

func (m *ShredMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ShredMutation) SetPurpose

func (m *ShredMutation) SetPurpose(s string)

SetPurpose sets the "purpose" field.

func (*ShredMutation) SetRequestedAt

func (m *ShredMutation) SetRequestedAt(t time.Time)

SetRequestedAt sets the "requested_at" field.

func (*ShredMutation) SetSubject

func (m *ShredMutation) SetSubject(s string)

SetSubject sets the "subject" field.

func (*ShredMutation) SetVersions

func (m *ShredMutation) SetVersions(kvr []keyforge.KEKVersionRef)

SetVersions sets the "versions" field.

func (*ShredMutation) Subject

func (m *ShredMutation) Subject() (r string, exists bool)

Subject returns the value of the "subject" field in the mutation.

func (ShredMutation) Tx

func (m ShredMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ShredMutation) Type

func (m *ShredMutation) Type() string

Type returns the node type of this mutation (Shred).

func (*ShredMutation) Versions

func (m *ShredMutation) Versions() (r []keyforge.KEKVersionRef, exists bool)

Versions returns the value of the "versions" field in the mutation.

func (*ShredMutation) Where

func (m *ShredMutation) Where(ps ...predicate.Shred)

Where appends a list predicates to the ShredMutation builder.

func (*ShredMutation) WhereP

func (m *ShredMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ShredMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ShredQuery

type ShredQuery struct {
	// contains filtered or unexported fields
}

ShredQuery is the builder for querying Shred entities.

func (*ShredQuery) Aggregate

func (_q *ShredQuery) Aggregate(fns ...AggregateFunc) *ShredSelect

Aggregate returns a ShredSelect configured with the given aggregations.

func (*ShredQuery) All

func (_q *ShredQuery) All(ctx context.Context) ([]*Shred, error)

All executes the query and returns a list of Shreds.

func (*ShredQuery) AllX

func (_q *ShredQuery) AllX(ctx context.Context) []*Shred

AllX is like All, but panics if an error occurs.

func (*ShredQuery) Clone

func (_q *ShredQuery) Clone() *ShredQuery

Clone returns a duplicate of the ShredQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ShredQuery) Count

func (_q *ShredQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ShredQuery) CountX

func (_q *ShredQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ShredQuery) ExecContext

func (c *ShredQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredQuery) Exist

func (_q *ShredQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ShredQuery) ExistX

func (_q *ShredQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ShredQuery) First

func (_q *ShredQuery) First(ctx context.Context) (*Shred, error)

First returns the first Shred entity from the query. Returns a *NotFoundError when no Shred was found.

func (*ShredQuery) FirstID

func (_q *ShredQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Shred ID from the query. Returns a *NotFoundError when no Shred ID was found.

func (*ShredQuery) FirstIDX

func (_q *ShredQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ShredQuery) FirstX

func (_q *ShredQuery) FirstX(ctx context.Context) *Shred

FirstX is like First, but panics if an error occurs.

func (*ShredQuery) ForShare

func (_q *ShredQuery) ForShare(opts ...sql.LockOption) *ShredQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ShredQuery) ForUpdate

func (_q *ShredQuery) ForUpdate(opts ...sql.LockOption) *ShredQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ShredQuery) GroupBy

func (_q *ShredQuery) GroupBy(field string, fields ...string) *ShredGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Purpose string `json:"purpose,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Shred.Query().
	GroupBy(shred.FieldPurpose).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ShredQuery) IDs

func (_q *ShredQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Shred IDs.

func (*ShredQuery) IDsX

func (_q *ShredQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ShredQuery) Limit

func (_q *ShredQuery) Limit(limit int) *ShredQuery

Limit the number of records to be returned by this query.

func (*ShredQuery) Offset

func (_q *ShredQuery) Offset(offset int) *ShredQuery

Offset to start from.

func (*ShredQuery) Only

func (_q *ShredQuery) Only(ctx context.Context) (*Shred, error)

Only returns a single Shred entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Shred entity is found. Returns a *NotFoundError when no Shred entities are found.

func (*ShredQuery) OnlyID

func (_q *ShredQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Shred ID in the query. Returns a *NotSingularError when more than one Shred ID is found. Returns a *NotFoundError when no entities are found.

func (*ShredQuery) OnlyIDX

func (_q *ShredQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ShredQuery) OnlyX

func (_q *ShredQuery) OnlyX(ctx context.Context) *Shred

OnlyX is like Only, but panics if an error occurs.

func (*ShredQuery) Order

func (_q *ShredQuery) Order(o ...shred.OrderOption) *ShredQuery

Order specifies how the records should be ordered.

func (*ShredQuery) QueryContext

func (c *ShredQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredQuery) Select

func (_q *ShredQuery) Select(fields ...string) *ShredSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Purpose string `json:"purpose,omitempty"`
}

client.Shred.Query().
	Select(shred.FieldPurpose).
	Scan(ctx, &v)

func (*ShredQuery) Unique

func (_q *ShredQuery) Unique(unique bool) *ShredQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ShredQuery) Where

func (_q *ShredQuery) Where(ps ...predicate.Shred) *ShredQuery

Where adds a new predicate for the ShredQuery builder.

type ShredSelect

type ShredSelect struct {
	*ShredQuery
	// contains filtered or unexported fields
}

ShredSelect is the builder for selecting fields of Shred entities.

func (*ShredSelect) Aggregate

func (_s *ShredSelect) Aggregate(fns ...AggregateFunc) *ShredSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ShredSelect) Bool

func (s *ShredSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShredSelect) BoolX

func (s *ShredSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShredSelect) Bools

func (s *ShredSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShredSelect) BoolsX

func (s *ShredSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (ShredSelect) ExecContext

func (c ShredSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredSelect) Float64

func (s *ShredSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShredSelect) Float64X

func (s *ShredSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShredSelect) Float64s

func (s *ShredSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShredSelect) Float64sX

func (s *ShredSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShredSelect) Int

func (s *ShredSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShredSelect) IntX

func (s *ShredSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShredSelect) Ints

func (s *ShredSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShredSelect) IntsX

func (s *ShredSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (ShredSelect) QueryContext

func (c ShredSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredSelect) Scan

func (_s *ShredSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShredSelect) ScanX

func (s *ShredSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShredSelect) String

func (s *ShredSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShredSelect) StringX

func (s *ShredSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShredSelect) Strings

func (s *ShredSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShredSelect) StringsX

func (s *ShredSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShredUpdate

type ShredUpdate struct {
	// contains filtered or unexported fields
}

ShredUpdate is the builder for updating Shred entities.

func (*ShredUpdate) AddDeks

func (_u *ShredUpdate) AddDeks(v int) *ShredUpdate

AddDeks adds value to the "deks" field.

func (*ShredUpdate) AppendVersions

func (_u *ShredUpdate) AppendVersions(v []keyforge.KEKVersionRef) *ShredUpdate

AppendVersions appends value to the "versions" field.

func (*ShredUpdate) ClearCompletedAt

func (_u *ShredUpdate) ClearCompletedAt() *ShredUpdate

ClearCompletedAt clears the value of the "completed_at" field.

func (*ShredUpdate) Exec

func (_u *ShredUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShredUpdate) ExecContext

func (c *ShredUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredUpdate) ExecX

func (_u *ShredUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShredUpdate) Mutation

func (_u *ShredUpdate) Mutation() *ShredMutation

Mutation returns the ShredMutation object of the builder.

func (*ShredUpdate) QueryContext

func (c *ShredUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredUpdate) Save

func (_u *ShredUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ShredUpdate) SaveX

func (_u *ShredUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ShredUpdate) SetCompletedAt

func (_u *ShredUpdate) SetCompletedAt(v time.Time) *ShredUpdate

SetCompletedAt sets the "completed_at" field.

func (*ShredUpdate) SetDeks

func (_u *ShredUpdate) SetDeks(v int) *ShredUpdate

SetDeks sets the "deks" field.

func (*ShredUpdate) SetNillableCompletedAt

func (_u *ShredUpdate) SetNillableCompletedAt(v *time.Time) *ShredUpdate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*ShredUpdate) SetNillableDeks

func (_u *ShredUpdate) SetNillableDeks(v *int) *ShredUpdate

SetNillableDeks sets the "deks" field if the given value is not nil.

func (*ShredUpdate) SetNillablePurpose

func (_u *ShredUpdate) SetNillablePurpose(v *string) *ShredUpdate

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*ShredUpdate) SetNillableRequestedAt

func (_u *ShredUpdate) SetNillableRequestedAt(v *time.Time) *ShredUpdate

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*ShredUpdate) SetNillableSubject

func (_u *ShredUpdate) SetNillableSubject(v *string) *ShredUpdate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*ShredUpdate) SetPurpose

func (_u *ShredUpdate) SetPurpose(v string) *ShredUpdate

SetPurpose sets the "purpose" field.

func (*ShredUpdate) SetRequestedAt

func (_u *ShredUpdate) SetRequestedAt(v time.Time) *ShredUpdate

SetRequestedAt sets the "requested_at" field.

func (*ShredUpdate) SetSubject

func (_u *ShredUpdate) SetSubject(v string) *ShredUpdate

SetSubject sets the "subject" field.

func (*ShredUpdate) SetVersions

func (_u *ShredUpdate) SetVersions(v []keyforge.KEKVersionRef) *ShredUpdate

SetVersions sets the "versions" field.

func (*ShredUpdate) Where

func (_u *ShredUpdate) Where(ps ...predicate.Shred) *ShredUpdate

Where appends a list predicates to the ShredUpdate builder.

type ShredUpdateOne

type ShredUpdateOne struct {
	// contains filtered or unexported fields
}

ShredUpdateOne is the builder for updating a single Shred entity.

func (*ShredUpdateOne) AddDeks

func (_u *ShredUpdateOne) AddDeks(v int) *ShredUpdateOne

AddDeks adds value to the "deks" field.

func (*ShredUpdateOne) AppendVersions

func (_u *ShredUpdateOne) AppendVersions(v []keyforge.KEKVersionRef) *ShredUpdateOne

AppendVersions appends value to the "versions" field.

func (*ShredUpdateOne) ClearCompletedAt

func (_u *ShredUpdateOne) ClearCompletedAt() *ShredUpdateOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*ShredUpdateOne) Exec

func (_u *ShredUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ShredUpdateOne) ExecContext

func (c *ShredUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ShredUpdateOne) ExecX

func (_u *ShredUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShredUpdateOne) Mutation

func (_u *ShredUpdateOne) Mutation() *ShredMutation

Mutation returns the ShredMutation object of the builder.

func (*ShredUpdateOne) QueryContext

func (c *ShredUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ShredUpdateOne) Save

func (_u *ShredUpdateOne) Save(ctx context.Context) (*Shred, error)

Save executes the query and returns the updated Shred entity.

func (*ShredUpdateOne) SaveX

func (_u *ShredUpdateOne) SaveX(ctx context.Context) *Shred

SaveX is like Save, but panics if an error occurs.

func (*ShredUpdateOne) Select

func (_u *ShredUpdateOne) Select(field string, fields ...string) *ShredUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ShredUpdateOne) SetCompletedAt

func (_u *ShredUpdateOne) SetCompletedAt(v time.Time) *ShredUpdateOne

SetCompletedAt sets the "completed_at" field.

func (*ShredUpdateOne) SetDeks

func (_u *ShredUpdateOne) SetDeks(v int) *ShredUpdateOne

SetDeks sets the "deks" field.

func (*ShredUpdateOne) SetNillableCompletedAt

func (_u *ShredUpdateOne) SetNillableCompletedAt(v *time.Time) *ShredUpdateOne

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*ShredUpdateOne) SetNillableDeks

func (_u *ShredUpdateOne) SetNillableDeks(v *int) *ShredUpdateOne

SetNillableDeks sets the "deks" field if the given value is not nil.

func (*ShredUpdateOne) SetNillablePurpose

func (_u *ShredUpdateOne) SetNillablePurpose(v *string) *ShredUpdateOne

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*ShredUpdateOne) SetNillableRequestedAt

func (_u *ShredUpdateOne) SetNillableRequestedAt(v *time.Time) *ShredUpdateOne

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*ShredUpdateOne) SetNillableSubject

func (_u *ShredUpdateOne) SetNillableSubject(v *string) *ShredUpdateOne

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*ShredUpdateOne) SetPurpose

func (_u *ShredUpdateOne) SetPurpose(v string) *ShredUpdateOne

SetPurpose sets the "purpose" field.

func (*ShredUpdateOne) SetRequestedAt

func (_u *ShredUpdateOne) SetRequestedAt(v time.Time) *ShredUpdateOne

SetRequestedAt sets the "requested_at" field.

func (*ShredUpdateOne) SetSubject

func (_u *ShredUpdateOne) SetSubject(v string) *ShredUpdateOne

SetSubject sets the "subject" field.

func (*ShredUpdateOne) SetVersions

func (_u *ShredUpdateOne) SetVersions(v []keyforge.KEKVersionRef) *ShredUpdateOne

SetVersions sets the "versions" field.

func (*ShredUpdateOne) Where

func (_u *ShredUpdateOne) Where(ps ...predicate.Shred) *ShredUpdateOne

Where appends a list predicates to the ShredUpdate builder.

type ShredUpsert

type ShredUpsert struct {
	*sql.UpdateSet
}

ShredUpsert is the "OnConflict" setter.

func (*ShredUpsert) AddDeks

func (u *ShredUpsert) AddDeks(v int) *ShredUpsert

AddDeks adds v to the "deks" field.

func (*ShredUpsert) ClearCompletedAt

func (u *ShredUpsert) ClearCompletedAt() *ShredUpsert

ClearCompletedAt clears the value of the "completed_at" field.

func (*ShredUpsert) SetCompletedAt

func (u *ShredUpsert) SetCompletedAt(v time.Time) *ShredUpsert

SetCompletedAt sets the "completed_at" field.

func (*ShredUpsert) SetDeks

func (u *ShredUpsert) SetDeks(v int) *ShredUpsert

SetDeks sets the "deks" field.

func (*ShredUpsert) SetPurpose

func (u *ShredUpsert) SetPurpose(v string) *ShredUpsert

SetPurpose sets the "purpose" field.

func (*ShredUpsert) SetRequestedAt

func (u *ShredUpsert) SetRequestedAt(v time.Time) *ShredUpsert

SetRequestedAt sets the "requested_at" field.

func (*ShredUpsert) SetSubject

func (u *ShredUpsert) SetSubject(v string) *ShredUpsert

SetSubject sets the "subject" field.

func (*ShredUpsert) SetVersions

func (u *ShredUpsert) SetVersions(v []keyforge.KEKVersionRef) *ShredUpsert

SetVersions sets the "versions" field.

func (*ShredUpsert) UpdateCompletedAt

func (u *ShredUpsert) UpdateCompletedAt() *ShredUpsert

UpdateCompletedAt sets the "completed_at" field to the value that was provided on create.

func (*ShredUpsert) UpdateDeks

func (u *ShredUpsert) UpdateDeks() *ShredUpsert

UpdateDeks sets the "deks" field to the value that was provided on create.

func (*ShredUpsert) UpdatePurpose

func (u *ShredUpsert) UpdatePurpose() *ShredUpsert

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*ShredUpsert) UpdateRequestedAt

func (u *ShredUpsert) UpdateRequestedAt() *ShredUpsert

UpdateRequestedAt sets the "requested_at" field to the value that was provided on create.

func (*ShredUpsert) UpdateSubject

func (u *ShredUpsert) UpdateSubject() *ShredUpsert

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*ShredUpsert) UpdateVersions

func (u *ShredUpsert) UpdateVersions() *ShredUpsert

UpdateVersions sets the "versions" field to the value that was provided on create.

type ShredUpsertBulk

type ShredUpsertBulk struct {
	// contains filtered or unexported fields
}

ShredUpsertBulk is the builder for "upsert"-ing a bulk of Shred nodes.

func (*ShredUpsertBulk) AddDeks

func (u *ShredUpsertBulk) AddDeks(v int) *ShredUpsertBulk

AddDeks adds v to the "deks" field.

func (*ShredUpsertBulk) ClearCompletedAt

func (u *ShredUpsertBulk) ClearCompletedAt() *ShredUpsertBulk

ClearCompletedAt clears the value of the "completed_at" field.

func (*ShredUpsertBulk) DoNothing

func (u *ShredUpsertBulk) DoNothing() *ShredUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ShredUpsertBulk) Exec

func (u *ShredUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ShredUpsertBulk) ExecX

func (u *ShredUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShredUpsertBulk) Ignore

func (u *ShredUpsertBulk) Ignore() *ShredUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Shred.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ShredUpsertBulk) SetCompletedAt

func (u *ShredUpsertBulk) SetCompletedAt(v time.Time) *ShredUpsertBulk

SetCompletedAt sets the "completed_at" field.

func (*ShredUpsertBulk) SetDeks

func (u *ShredUpsertBulk) SetDeks(v int) *ShredUpsertBulk

SetDeks sets the "deks" field.

func (*ShredUpsertBulk) SetPurpose

func (u *ShredUpsertBulk) SetPurpose(v string) *ShredUpsertBulk

SetPurpose sets the "purpose" field.

func (*ShredUpsertBulk) SetRequestedAt

func (u *ShredUpsertBulk) SetRequestedAt(v time.Time) *ShredUpsertBulk

SetRequestedAt sets the "requested_at" field.

func (*ShredUpsertBulk) SetSubject

func (u *ShredUpsertBulk) SetSubject(v string) *ShredUpsertBulk

SetSubject sets the "subject" field.

func (*ShredUpsertBulk) SetVersions

SetVersions sets the "versions" field.

func (*ShredUpsertBulk) Update

func (u *ShredUpsertBulk) Update(set func(*ShredUpsert)) *ShredUpsertBulk

Update allows overriding fields `UPDATE` values. See the ShredCreateBulk.OnConflict documentation for more info.

func (*ShredUpsertBulk) UpdateCompletedAt

func (u *ShredUpsertBulk) UpdateCompletedAt() *ShredUpsertBulk

UpdateCompletedAt sets the "completed_at" field to the value that was provided on create.

func (*ShredUpsertBulk) UpdateDeks

func (u *ShredUpsertBulk) UpdateDeks() *ShredUpsertBulk

UpdateDeks sets the "deks" field to the value that was provided on create.

func (*ShredUpsertBulk) UpdateNewValues

func (u *ShredUpsertBulk) UpdateNewValues() *ShredUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Shred.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ShredUpsertBulk) UpdatePurpose

func (u *ShredUpsertBulk) UpdatePurpose() *ShredUpsertBulk

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*ShredUpsertBulk) UpdateRequestedAt

func (u *ShredUpsertBulk) UpdateRequestedAt() *ShredUpsertBulk

UpdateRequestedAt sets the "requested_at" field to the value that was provided on create.

func (*ShredUpsertBulk) UpdateSubject

func (u *ShredUpsertBulk) UpdateSubject() *ShredUpsertBulk

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*ShredUpsertBulk) UpdateVersions

func (u *ShredUpsertBulk) UpdateVersions() *ShredUpsertBulk

UpdateVersions sets the "versions" field to the value that was provided on create.

type ShredUpsertOne

type ShredUpsertOne struct {
	// contains filtered or unexported fields
}

ShredUpsertOne is the builder for "upsert"-ing

one Shred node.

func (*ShredUpsertOne) AddDeks

func (u *ShredUpsertOne) AddDeks(v int) *ShredUpsertOne

AddDeks adds v to the "deks" field.

func (*ShredUpsertOne) ClearCompletedAt

func (u *ShredUpsertOne) ClearCompletedAt() *ShredUpsertOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*ShredUpsertOne) DoNothing

func (u *ShredUpsertOne) DoNothing() *ShredUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ShredUpsertOne) Exec

func (u *ShredUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ShredUpsertOne) ExecX

func (u *ShredUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShredUpsertOne) ID

func (u *ShredUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ShredUpsertOne) IDX

func (u *ShredUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*ShredUpsertOne) Ignore

func (u *ShredUpsertOne) Ignore() *ShredUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Shred.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ShredUpsertOne) SetCompletedAt

func (u *ShredUpsertOne) SetCompletedAt(v time.Time) *ShredUpsertOne

SetCompletedAt sets the "completed_at" field.

func (*ShredUpsertOne) SetDeks

func (u *ShredUpsertOne) SetDeks(v int) *ShredUpsertOne

SetDeks sets the "deks" field.

func (*ShredUpsertOne) SetPurpose

func (u *ShredUpsertOne) SetPurpose(v string) *ShredUpsertOne

SetPurpose sets the "purpose" field.

func (*ShredUpsertOne) SetRequestedAt

func (u *ShredUpsertOne) SetRequestedAt(v time.Time) *ShredUpsertOne

SetRequestedAt sets the "requested_at" field.

func (*ShredUpsertOne) SetSubject

func (u *ShredUpsertOne) SetSubject(v string) *ShredUpsertOne

SetSubject sets the "subject" field.

func (*ShredUpsertOne) SetVersions

func (u *ShredUpsertOne) SetVersions(v []keyforge.KEKVersionRef) *ShredUpsertOne

SetVersions sets the "versions" field.

func (*ShredUpsertOne) Update

func (u *ShredUpsertOne) Update(set func(*ShredUpsert)) *ShredUpsertOne

Update allows overriding fields `UPDATE` values. See the ShredCreate.OnConflict documentation for more info.

func (*ShredUpsertOne) UpdateCompletedAt

func (u *ShredUpsertOne) UpdateCompletedAt() *ShredUpsertOne

UpdateCompletedAt sets the "completed_at" field to the value that was provided on create.

func (*ShredUpsertOne) UpdateDeks

func (u *ShredUpsertOne) UpdateDeks() *ShredUpsertOne

UpdateDeks sets the "deks" field to the value that was provided on create.

func (*ShredUpsertOne) UpdateNewValues

func (u *ShredUpsertOne) UpdateNewValues() *ShredUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Shred.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ShredUpsertOne) UpdatePurpose

func (u *ShredUpsertOne) UpdatePurpose() *ShredUpsertOne

UpdatePurpose sets the "purpose" field to the value that was provided on create.

func (*ShredUpsertOne) UpdateRequestedAt

func (u *ShredUpsertOne) UpdateRequestedAt() *ShredUpsertOne

UpdateRequestedAt sets the "requested_at" field to the value that was provided on create.

func (*ShredUpsertOne) UpdateSubject

func (u *ShredUpsertOne) UpdateSubject() *ShredUpsertOne

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*ShredUpsertOne) UpdateVersions

func (u *ShredUpsertOne) UpdateVersions() *ShredUpsertOne

UpdateVersions sets the "versions" field to the value that was provided on create.

type Shreds

type Shreds []*Shred

Shreds is a parsable slice of Shred.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// DataKey is the client for interacting with the DataKey builders.
	DataKey *DataKeyClient
	// KEK is the client for interacting with the KEK builders.
	KEK *KEKClient
	// KEKVersion is the client for interacting with the KEKVersion builders.
	KEKVersion *KEKVersionClient
	// Sentinel is the client for interacting with the Sentinel builders.
	Sentinel *SentinelClient
	// Shred is the client for interacting with the Shred builders.
	Shred *ShredClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) QueryContext

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis
Package schema is keyforge's Ent schema: the registry's records.
Package schema is keyforge's Ent schema: the registry's records.

Jump to

Keyboard shortcuts

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