Documentation ¶
Index ¶
- Constants
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Secret
- type SecretClient
- func (c *SecretClient) Create() *SecretCreate
- func (c *SecretClient) CreateBulk(builders ...*SecretCreate) *SecretCreateBulk
- func (c *SecretClient) Delete() *SecretDelete
- func (c *SecretClient) DeleteOne(s *Secret) *SecretDeleteOne
- func (c *SecretClient) DeleteOneID(id int) *SecretDeleteOne
- func (c *SecretClient) Get(ctx context.Context, id int) (*Secret, error)
- func (c *SecretClient) GetX(ctx context.Context, id int) *Secret
- func (c *SecretClient) Hooks() []Hook
- func (c *SecretClient) Intercept(interceptors ...Interceptor)
- func (c *SecretClient) Interceptors() []Interceptor
- func (c *SecretClient) Query() *SecretQuery
- func (c *SecretClient) Update() *SecretUpdate
- func (c *SecretClient) UpdateOne(s *Secret) *SecretUpdateOne
- func (c *SecretClient) UpdateOneID(id int) *SecretUpdateOne
- func (c *SecretClient) Use(hooks ...Hook)
- type SecretCreate
- func (sc *SecretCreate) Exec(ctx context.Context) error
- func (sc *SecretCreate) ExecX(ctx context.Context)
- func (sc *SecretCreate) Mutation() *SecretMutation
- func (sc *SecretCreate) Save(ctx context.Context) (*Secret, error)
- func (sc *SecretCreate) SaveX(ctx context.Context) *Secret
- func (sc *SecretCreate) SetAlreadyRead(b bool) *SecretCreate
- func (sc *SecretCreate) SetBurnAfterRead(b bool) *SecretCreate
- func (sc *SecretCreate) SetDeletionToken(s string) *SecretCreate
- func (sc *SecretCreate) SetEncryptedData(s string) *SecretCreate
- func (sc *SecretCreate) SetExpiresAt(t time.Time) *SecretCreate
- func (sc *SecretCreate) SetNonce(s string) *SecretCreate
- func (sc *SecretCreate) SetPublicID(s string) *SecretCreate
- func (sc *SecretCreate) SetRetrievalToken(s string) *SecretCreate
- type SecretCreateBulk
- type SecretDelete
- type SecretDeleteOne
- type SecretGroupBy
- func (sgb *SecretGroupBy) Aggregate(fns ...AggregateFunc) *SecretGroupBy
- func (s *SecretGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SecretGroupBy) BoolX(ctx context.Context) bool
- func (s *SecretGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SecretGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SecretGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SecretGroupBy) Float64X(ctx context.Context) float64
- func (s *SecretGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SecretGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SecretGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SecretGroupBy) IntX(ctx context.Context) int
- func (s *SecretGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SecretGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SecretGroupBy) Scan(ctx context.Context, v any) error
- func (s *SecretGroupBy) ScanX(ctx context.Context, v any)
- func (s *SecretGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SecretGroupBy) StringX(ctx context.Context) string
- func (s *SecretGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SecretGroupBy) StringsX(ctx context.Context) []string
- type SecretMutation
- func (m *SecretMutation) AddField(name string, value ent.Value) error
- func (m *SecretMutation) AddedEdges() []string
- func (m *SecretMutation) AddedField(name string) (ent.Value, bool)
- func (m *SecretMutation) AddedFields() []string
- func (m *SecretMutation) AddedIDs(name string) []ent.Value
- func (m *SecretMutation) AlreadyRead() (r bool, exists bool)
- func (m *SecretMutation) BurnAfterRead() (r bool, exists bool)
- func (m *SecretMutation) ClearEdge(name string) error
- func (m *SecretMutation) ClearField(name string) error
- func (m *SecretMutation) ClearedEdges() []string
- func (m *SecretMutation) ClearedFields() []string
- func (m SecretMutation) Client() *Client
- func (m *SecretMutation) DeletionToken() (r string, exists bool)
- func (m *SecretMutation) EdgeCleared(name string) bool
- func (m *SecretMutation) EncryptedData() (r string, exists bool)
- func (m *SecretMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *SecretMutation) Field(name string) (ent.Value, bool)
- func (m *SecretMutation) FieldCleared(name string) bool
- func (m *SecretMutation) Fields() []string
- func (m *SecretMutation) ID() (id int, exists bool)
- func (m *SecretMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SecretMutation) Nonce() (r string, exists bool)
- func (m *SecretMutation) OldAlreadyRead(ctx context.Context) (v bool, err error)
- func (m *SecretMutation) OldBurnAfterRead(ctx context.Context) (v bool, err error)
- func (m *SecretMutation) OldDeletionToken(ctx context.Context) (v string, err error)
- func (m *SecretMutation) OldEncryptedData(ctx context.Context) (v string, err error)
- func (m *SecretMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *SecretMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SecretMutation) OldNonce(ctx context.Context) (v string, err error)
- func (m *SecretMutation) OldPublicID(ctx context.Context) (v string, err error)
- func (m *SecretMutation) OldRetrievalToken(ctx context.Context) (v string, err error)
- func (m *SecretMutation) Op() Op
- func (m *SecretMutation) PublicID() (r string, exists bool)
- func (m *SecretMutation) RemovedEdges() []string
- func (m *SecretMutation) RemovedIDs(name string) []ent.Value
- func (m *SecretMutation) ResetAlreadyRead()
- func (m *SecretMutation) ResetBurnAfterRead()
- func (m *SecretMutation) ResetDeletionToken()
- func (m *SecretMutation) ResetEdge(name string) error
- func (m *SecretMutation) ResetEncryptedData()
- func (m *SecretMutation) ResetExpiresAt()
- func (m *SecretMutation) ResetField(name string) error
- func (m *SecretMutation) ResetNonce()
- func (m *SecretMutation) ResetPublicID()
- func (m *SecretMutation) ResetRetrievalToken()
- func (m *SecretMutation) RetrievalToken() (r string, exists bool)
- func (m *SecretMutation) SetAlreadyRead(b bool)
- func (m *SecretMutation) SetBurnAfterRead(b bool)
- func (m *SecretMutation) SetDeletionToken(s string)
- func (m *SecretMutation) SetEncryptedData(s string)
- func (m *SecretMutation) SetExpiresAt(t time.Time)
- func (m *SecretMutation) SetField(name string, value ent.Value) error
- func (m *SecretMutation) SetNonce(s string)
- func (m *SecretMutation) SetOp(op Op)
- func (m *SecretMutation) SetPublicID(s string)
- func (m *SecretMutation) SetRetrievalToken(s string)
- func (m SecretMutation) Tx() (*Tx, error)
- func (m *SecretMutation) Type() string
- func (m *SecretMutation) Where(ps ...predicate.Secret)
- func (m *SecretMutation) WhereP(ps ...func(*sql.Selector))
- type SecretQuery
- func (sq *SecretQuery) Aggregate(fns ...AggregateFunc) *SecretSelect
- func (sq *SecretQuery) All(ctx context.Context) ([]*Secret, error)
- func (sq *SecretQuery) AllX(ctx context.Context) []*Secret
- func (sq *SecretQuery) Clone() *SecretQuery
- func (sq *SecretQuery) Count(ctx context.Context) (int, error)
- func (sq *SecretQuery) CountX(ctx context.Context) int
- func (sq *SecretQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SecretQuery) ExistX(ctx context.Context) bool
- func (sq *SecretQuery) First(ctx context.Context) (*Secret, error)
- func (sq *SecretQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *SecretQuery) FirstIDX(ctx context.Context) int
- func (sq *SecretQuery) FirstX(ctx context.Context) *Secret
- func (sq *SecretQuery) GroupBy(field string, fields ...string) *SecretGroupBy
- func (sq *SecretQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *SecretQuery) IDsX(ctx context.Context) []int
- func (sq *SecretQuery) Limit(limit int) *SecretQuery
- func (sq *SecretQuery) Offset(offset int) *SecretQuery
- func (sq *SecretQuery) Only(ctx context.Context) (*Secret, error)
- func (sq *SecretQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *SecretQuery) OnlyIDX(ctx context.Context) int
- func (sq *SecretQuery) OnlyX(ctx context.Context) *Secret
- func (sq *SecretQuery) Order(o ...secret.OrderOption) *SecretQuery
- func (sq *SecretQuery) Select(fields ...string) *SecretSelect
- func (sq *SecretQuery) Unique(unique bool) *SecretQuery
- func (sq *SecretQuery) Where(ps ...predicate.Secret) *SecretQuery
- type SecretSelect
- func (ss *SecretSelect) Aggregate(fns ...AggregateFunc) *SecretSelect
- func (s *SecretSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SecretSelect) BoolX(ctx context.Context) bool
- func (s *SecretSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SecretSelect) BoolsX(ctx context.Context) []bool
- func (s *SecretSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SecretSelect) Float64X(ctx context.Context) float64
- func (s *SecretSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SecretSelect) Float64sX(ctx context.Context) []float64
- func (s *SecretSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SecretSelect) IntX(ctx context.Context) int
- func (s *SecretSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SecretSelect) IntsX(ctx context.Context) []int
- func (ss *SecretSelect) Scan(ctx context.Context, v any) error
- func (s *SecretSelect) ScanX(ctx context.Context, v any)
- func (s *SecretSelect) String(ctx context.Context) (_ string, err error)
- func (s *SecretSelect) StringX(ctx context.Context) string
- func (s *SecretSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SecretSelect) StringsX(ctx context.Context) []string
- type SecretUpdate
- func (su *SecretUpdate) Exec(ctx context.Context) error
- func (su *SecretUpdate) ExecX(ctx context.Context)
- func (su *SecretUpdate) Mutation() *SecretMutation
- func (su *SecretUpdate) Save(ctx context.Context) (int, error)
- func (su *SecretUpdate) SaveX(ctx context.Context) int
- func (su *SecretUpdate) SetAlreadyRead(b bool) *SecretUpdate
- func (su *SecretUpdate) SetBurnAfterRead(b bool) *SecretUpdate
- func (su *SecretUpdate) SetDeletionToken(s string) *SecretUpdate
- func (su *SecretUpdate) SetEncryptedData(s string) *SecretUpdate
- func (su *SecretUpdate) SetExpiresAt(t time.Time) *SecretUpdate
- func (su *SecretUpdate) SetNonce(s string) *SecretUpdate
- func (su *SecretUpdate) SetPublicID(s string) *SecretUpdate
- func (su *SecretUpdate) SetRetrievalToken(s string) *SecretUpdate
- func (su *SecretUpdate) Where(ps ...predicate.Secret) *SecretUpdate
- type SecretUpdateOne
- func (suo *SecretUpdateOne) Exec(ctx context.Context) error
- func (suo *SecretUpdateOne) ExecX(ctx context.Context)
- func (suo *SecretUpdateOne) Mutation() *SecretMutation
- func (suo *SecretUpdateOne) Save(ctx context.Context) (*Secret, error)
- func (suo *SecretUpdateOne) SaveX(ctx context.Context) *Secret
- func (suo *SecretUpdateOne) Select(field string, fields ...string) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetAlreadyRead(b bool) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetBurnAfterRead(b bool) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetDeletionToken(s string) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetEncryptedData(s string) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetExpiresAt(t time.Time) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetNonce(s string) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetPublicID(s string) *SecretUpdateOne
- func (suo *SecretUpdateOne) SetRetrievalToken(s string) *SecretUpdateOne
- func (suo *SecretUpdateOne) Where(ps ...predicate.Secret) *SecretUpdateOne
- type Secrets
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeSecret = "Secret" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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 // Secret is the client for interacting with the Secret builders. Secret *SecretClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Secret. Query(). Count(ctx)
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(...)`.
type CommitFunc ¶
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.
type CommitHook ¶
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 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 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 MutateFunc ¶
type MutateFunc = ent.MutateFunc
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
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 ¶
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.
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 ¶
Rollbacker is the interface that wraps the Rollback method.
type Secret ¶
type Secret struct { // ID of the ent. ID int `json:"id,omitempty"` // PublicID holds the value of the "public_id" field. PublicID string `json:"public_id,omitempty"` // RetrievalToken holds the value of the "retrieval_token" field. RetrievalToken string `json:"retrieval_token,omitempty"` // DeletionToken holds the value of the "deletion_token" field. DeletionToken string `json:"deletion_token,omitempty"` // Nonce holds the value of the "nonce" field. Nonce string `json:"nonce,omitempty"` // EncryptedData holds the value of the "encrypted_data" field. EncryptedData string `json:"encrypted_data,omitempty"` // ExpiresAt holds the value of the "expires_at" field. ExpiresAt time.Time `json:"expires_at,omitempty"` // BurnAfterRead holds the value of the "burn_after_read" field. BurnAfterRead bool `json:"burn_after_read,omitempty"` // AlreadyRead holds the value of the "already_read" field. AlreadyRead bool `json:"already_read,omitempty"` // contains filtered or unexported fields }
Secret is the model entity for the Secret schema.
func (*Secret) Unwrap ¶
Unwrap unwraps the Secret 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 (*Secret) Update ¶
func (s *Secret) Update() *SecretUpdateOne
Update returns a builder for updating this Secret. Note that you need to call Secret.Unwrap() before calling this method if this Secret was returned from a transaction, and the transaction was committed or rolled back.
type SecretClient ¶
type SecretClient struct {
// contains filtered or unexported fields
}
SecretClient is a client for the Secret schema.
func NewSecretClient ¶
func NewSecretClient(c config) *SecretClient
NewSecretClient returns a client for the Secret from the given config.
func (*SecretClient) Create ¶
func (c *SecretClient) Create() *SecretCreate
Create returns a builder for creating a Secret entity.
func (*SecretClient) CreateBulk ¶
func (c *SecretClient) CreateBulk(builders ...*SecretCreate) *SecretCreateBulk
CreateBulk returns a builder for creating a bulk of Secret entities.
func (*SecretClient) Delete ¶
func (c *SecretClient) Delete() *SecretDelete
Delete returns a delete builder for Secret.
func (*SecretClient) DeleteOne ¶
func (c *SecretClient) DeleteOne(s *Secret) *SecretDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SecretClient) DeleteOneID ¶
func (c *SecretClient) DeleteOneID(id int) *SecretDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SecretClient) GetX ¶
func (c *SecretClient) GetX(ctx context.Context, id int) *Secret
GetX is like Get, but panics if an error occurs.
func (*SecretClient) Intercept ¶
func (c *SecretClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `secret.Intercept(f(g(h())))`.
func (*SecretClient) Interceptors ¶
func (c *SecretClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SecretClient) Query ¶
func (c *SecretClient) Query() *SecretQuery
Query returns a query builder for Secret.
func (*SecretClient) Update ¶
func (c *SecretClient) Update() *SecretUpdate
Update returns an update builder for Secret.
func (*SecretClient) UpdateOne ¶
func (c *SecretClient) UpdateOne(s *Secret) *SecretUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SecretClient) UpdateOneID ¶
func (c *SecretClient) UpdateOneID(id int) *SecretUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SecretClient) Use ¶
func (c *SecretClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `secret.Hooks(f(g(h())))`.
type SecretCreate ¶
type SecretCreate struct {
// contains filtered or unexported fields
}
SecretCreate is the builder for creating a Secret entity.
func (*SecretCreate) Exec ¶
func (sc *SecretCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SecretCreate) ExecX ¶
func (sc *SecretCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SecretCreate) Mutation ¶
func (sc *SecretCreate) Mutation() *SecretMutation
Mutation returns the SecretMutation object of the builder.
func (*SecretCreate) Save ¶
func (sc *SecretCreate) Save(ctx context.Context) (*Secret, error)
Save creates the Secret in the database.
func (*SecretCreate) SaveX ¶
func (sc *SecretCreate) SaveX(ctx context.Context) *Secret
SaveX calls Save and panics if Save returns an error.
func (*SecretCreate) SetAlreadyRead ¶
func (sc *SecretCreate) SetAlreadyRead(b bool) *SecretCreate
SetAlreadyRead sets the "already_read" field.
func (*SecretCreate) SetBurnAfterRead ¶
func (sc *SecretCreate) SetBurnAfterRead(b bool) *SecretCreate
SetBurnAfterRead sets the "burn_after_read" field.
func (*SecretCreate) SetDeletionToken ¶
func (sc *SecretCreate) SetDeletionToken(s string) *SecretCreate
SetDeletionToken sets the "deletion_token" field.
func (*SecretCreate) SetEncryptedData ¶
func (sc *SecretCreate) SetEncryptedData(s string) *SecretCreate
SetEncryptedData sets the "encrypted_data" field.
func (*SecretCreate) SetExpiresAt ¶
func (sc *SecretCreate) SetExpiresAt(t time.Time) *SecretCreate
SetExpiresAt sets the "expires_at" field.
func (*SecretCreate) SetNonce ¶
func (sc *SecretCreate) SetNonce(s string) *SecretCreate
SetNonce sets the "nonce" field.
func (*SecretCreate) SetPublicID ¶
func (sc *SecretCreate) SetPublicID(s string) *SecretCreate
SetPublicID sets the "public_id" field.
func (*SecretCreate) SetRetrievalToken ¶
func (sc *SecretCreate) SetRetrievalToken(s string) *SecretCreate
SetRetrievalToken sets the "retrieval_token" field.
type SecretCreateBulk ¶
type SecretCreateBulk struct {
// contains filtered or unexported fields
}
SecretCreateBulk is the builder for creating many Secret entities in bulk.
func (*SecretCreateBulk) Exec ¶
func (scb *SecretCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SecretCreateBulk) ExecX ¶
func (scb *SecretCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SecretDelete ¶
type SecretDelete struct {
// contains filtered or unexported fields
}
SecretDelete is the builder for deleting a Secret entity.
func (*SecretDelete) Exec ¶
func (sd *SecretDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SecretDelete) ExecX ¶
func (sd *SecretDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SecretDelete) Where ¶
func (sd *SecretDelete) Where(ps ...predicate.Secret) *SecretDelete
Where appends a list predicates to the SecretDelete builder.
type SecretDeleteOne ¶
type SecretDeleteOne struct {
// contains filtered or unexported fields
}
SecretDeleteOne is the builder for deleting a single Secret entity.
func (*SecretDeleteOne) Exec ¶
func (sdo *SecretDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SecretDeleteOne) ExecX ¶
func (sdo *SecretDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SecretDeleteOne) Where ¶
func (sdo *SecretDeleteOne) Where(ps ...predicate.Secret) *SecretDeleteOne
Where appends a list predicates to the SecretDelete builder.
type SecretGroupBy ¶
type SecretGroupBy struct {
// contains filtered or unexported fields
}
SecretGroupBy is the group-by builder for Secret entities.
func (*SecretGroupBy) Aggregate ¶
func (sgb *SecretGroupBy) Aggregate(fns ...AggregateFunc) *SecretGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SecretGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SecretGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SecretGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SecretGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SecretGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SecretGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SecretGroupBy) Scan ¶
func (sgb *SecretGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SecretGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SecretMutation ¶
type SecretMutation struct {
// contains filtered or unexported fields
}
SecretMutation represents an operation that mutates the Secret nodes in the graph.
func (*SecretMutation) AddField ¶
func (m *SecretMutation) 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 (*SecretMutation) AddedEdges ¶
func (m *SecretMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SecretMutation) AddedField ¶
func (m *SecretMutation) 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 (*SecretMutation) AddedFields ¶
func (m *SecretMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SecretMutation) AddedIDs ¶
func (m *SecretMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SecretMutation) AlreadyRead ¶
func (m *SecretMutation) AlreadyRead() (r bool, exists bool)
AlreadyRead returns the value of the "already_read" field in the mutation.
func (*SecretMutation) BurnAfterRead ¶
func (m *SecretMutation) BurnAfterRead() (r bool, exists bool)
BurnAfterRead returns the value of the "burn_after_read" field in the mutation.
func (*SecretMutation) ClearEdge ¶
func (m *SecretMutation) 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 (*SecretMutation) ClearField ¶
func (m *SecretMutation) 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 (*SecretMutation) ClearedEdges ¶
func (m *SecretMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SecretMutation) ClearedFields ¶
func (m *SecretMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SecretMutation) Client ¶
func (m SecretMutation) 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 (*SecretMutation) DeletionToken ¶
func (m *SecretMutation) DeletionToken() (r string, exists bool)
DeletionToken returns the value of the "deletion_token" field in the mutation.
func (*SecretMutation) EdgeCleared ¶
func (m *SecretMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SecretMutation) EncryptedData ¶
func (m *SecretMutation) EncryptedData() (r string, exists bool)
EncryptedData returns the value of the "encrypted_data" field in the mutation.
func (*SecretMutation) ExpiresAt ¶
func (m *SecretMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*SecretMutation) Field ¶
func (m *SecretMutation) 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 (*SecretMutation) FieldCleared ¶
func (m *SecretMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SecretMutation) Fields ¶
func (m *SecretMutation) 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 (*SecretMutation) ID ¶
func (m *SecretMutation) 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 (*SecretMutation) IDs ¶
func (m *SecretMutation) 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 (*SecretMutation) Nonce ¶
func (m *SecretMutation) Nonce() (r string, exists bool)
Nonce returns the value of the "nonce" field in the mutation.
func (*SecretMutation) OldAlreadyRead ¶
func (m *SecretMutation) OldAlreadyRead(ctx context.Context) (v bool, err error)
OldAlreadyRead returns the old "already_read" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldBurnAfterRead ¶
func (m *SecretMutation) OldBurnAfterRead(ctx context.Context) (v bool, err error)
OldBurnAfterRead returns the old "burn_after_read" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldDeletionToken ¶
func (m *SecretMutation) OldDeletionToken(ctx context.Context) (v string, err error)
OldDeletionToken returns the old "deletion_token" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldEncryptedData ¶
func (m *SecretMutation) OldEncryptedData(ctx context.Context) (v string, err error)
OldEncryptedData returns the old "encrypted_data" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldField ¶
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 (*SecretMutation) OldNonce ¶
func (m *SecretMutation) OldNonce(ctx context.Context) (v string, err error)
OldNonce returns the old "nonce" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldPublicID ¶
func (m *SecretMutation) OldPublicID(ctx context.Context) (v string, err error)
OldPublicID returns the old "public_id" field's value of the Secret entity. If the Secret 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 (*SecretMutation) OldRetrievalToken ¶
func (m *SecretMutation) OldRetrievalToken(ctx context.Context) (v string, err error)
OldRetrievalToken returns the old "retrieval_token" field's value of the Secret entity. If the Secret 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 (*SecretMutation) PublicID ¶
func (m *SecretMutation) PublicID() (r string, exists bool)
PublicID returns the value of the "public_id" field in the mutation.
func (*SecretMutation) RemovedEdges ¶
func (m *SecretMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SecretMutation) RemovedIDs ¶
func (m *SecretMutation) 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 (*SecretMutation) ResetAlreadyRead ¶
func (m *SecretMutation) ResetAlreadyRead()
ResetAlreadyRead resets all changes to the "already_read" field.
func (*SecretMutation) ResetBurnAfterRead ¶
func (m *SecretMutation) ResetBurnAfterRead()
ResetBurnAfterRead resets all changes to the "burn_after_read" field.
func (*SecretMutation) ResetDeletionToken ¶
func (m *SecretMutation) ResetDeletionToken()
ResetDeletionToken resets all changes to the "deletion_token" field.
func (*SecretMutation) ResetEdge ¶
func (m *SecretMutation) 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 (*SecretMutation) ResetEncryptedData ¶
func (m *SecretMutation) ResetEncryptedData()
ResetEncryptedData resets all changes to the "encrypted_data" field.
func (*SecretMutation) ResetExpiresAt ¶
func (m *SecretMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*SecretMutation) ResetField ¶
func (m *SecretMutation) 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 (*SecretMutation) ResetNonce ¶
func (m *SecretMutation) ResetNonce()
ResetNonce resets all changes to the "nonce" field.
func (*SecretMutation) ResetPublicID ¶
func (m *SecretMutation) ResetPublicID()
ResetPublicID resets all changes to the "public_id" field.
func (*SecretMutation) ResetRetrievalToken ¶
func (m *SecretMutation) ResetRetrievalToken()
ResetRetrievalToken resets all changes to the "retrieval_token" field.
func (*SecretMutation) RetrievalToken ¶
func (m *SecretMutation) RetrievalToken() (r string, exists bool)
RetrievalToken returns the value of the "retrieval_token" field in the mutation.
func (*SecretMutation) SetAlreadyRead ¶
func (m *SecretMutation) SetAlreadyRead(b bool)
SetAlreadyRead sets the "already_read" field.
func (*SecretMutation) SetBurnAfterRead ¶
func (m *SecretMutation) SetBurnAfterRead(b bool)
SetBurnAfterRead sets the "burn_after_read" field.
func (*SecretMutation) SetDeletionToken ¶
func (m *SecretMutation) SetDeletionToken(s string)
SetDeletionToken sets the "deletion_token" field.
func (*SecretMutation) SetEncryptedData ¶
func (m *SecretMutation) SetEncryptedData(s string)
SetEncryptedData sets the "encrypted_data" field.
func (*SecretMutation) SetExpiresAt ¶
func (m *SecretMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*SecretMutation) SetField ¶
func (m *SecretMutation) 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 (*SecretMutation) SetNonce ¶
func (m *SecretMutation) SetNonce(s string)
SetNonce sets the "nonce" field.
func (*SecretMutation) SetOp ¶
func (m *SecretMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SecretMutation) SetPublicID ¶
func (m *SecretMutation) SetPublicID(s string)
SetPublicID sets the "public_id" field.
func (*SecretMutation) SetRetrievalToken ¶
func (m *SecretMutation) SetRetrievalToken(s string)
SetRetrievalToken sets the "retrieval_token" field.
func (SecretMutation) Tx ¶
func (m SecretMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SecretMutation) Type ¶
func (m *SecretMutation) Type() string
Type returns the node type of this mutation (Secret).
func (*SecretMutation) Where ¶
func (m *SecretMutation) Where(ps ...predicate.Secret)
Where appends a list predicates to the SecretMutation builder.
func (*SecretMutation) WhereP ¶
func (m *SecretMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SecretMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SecretQuery ¶
type SecretQuery struct {
// contains filtered or unexported fields
}
SecretQuery is the builder for querying Secret entities.
func (*SecretQuery) Aggregate ¶
func (sq *SecretQuery) Aggregate(fns ...AggregateFunc) *SecretSelect
Aggregate returns a SecretSelect configured with the given aggregations.
func (*SecretQuery) All ¶
func (sq *SecretQuery) All(ctx context.Context) ([]*Secret, error)
All executes the query and returns a list of Secrets.
func (*SecretQuery) AllX ¶
func (sq *SecretQuery) AllX(ctx context.Context) []*Secret
AllX is like All, but panics if an error occurs.
func (*SecretQuery) Clone ¶
func (sq *SecretQuery) Clone() *SecretQuery
Clone returns a duplicate of the SecretQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SecretQuery) Count ¶
func (sq *SecretQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SecretQuery) CountX ¶
func (sq *SecretQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SecretQuery) Exist ¶
func (sq *SecretQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SecretQuery) ExistX ¶
func (sq *SecretQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SecretQuery) First ¶
func (sq *SecretQuery) First(ctx context.Context) (*Secret, error)
First returns the first Secret entity from the query. Returns a *NotFoundError when no Secret was found.
func (*SecretQuery) FirstID ¶
func (sq *SecretQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Secret ID from the query. Returns a *NotFoundError when no Secret ID was found.
func (*SecretQuery) FirstIDX ¶
func (sq *SecretQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SecretQuery) FirstX ¶
func (sq *SecretQuery) FirstX(ctx context.Context) *Secret
FirstX is like First, but panics if an error occurs.
func (*SecretQuery) GroupBy ¶
func (sq *SecretQuery) GroupBy(field string, fields ...string) *SecretGroupBy
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 { PublicID string `json:"public_id,omitempty"` Count int `json:"count,omitempty"` } client.Secret.Query(). GroupBy(secret.FieldPublicID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SecretQuery) IDs ¶
func (sq *SecretQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Secret IDs.
func (*SecretQuery) IDsX ¶
func (sq *SecretQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SecretQuery) Limit ¶
func (sq *SecretQuery) Limit(limit int) *SecretQuery
Limit the number of records to be returned by this query.
func (*SecretQuery) Offset ¶
func (sq *SecretQuery) Offset(offset int) *SecretQuery
Offset to start from.
func (*SecretQuery) Only ¶
func (sq *SecretQuery) Only(ctx context.Context) (*Secret, error)
Only returns a single Secret entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Secret entity is found. Returns a *NotFoundError when no Secret entities are found.
func (*SecretQuery) OnlyID ¶
func (sq *SecretQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Secret ID in the query. Returns a *NotSingularError when more than one Secret ID is found. Returns a *NotFoundError when no entities are found.
func (*SecretQuery) OnlyIDX ¶
func (sq *SecretQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SecretQuery) OnlyX ¶
func (sq *SecretQuery) OnlyX(ctx context.Context) *Secret
OnlyX is like Only, but panics if an error occurs.
func (*SecretQuery) Order ¶
func (sq *SecretQuery) Order(o ...secret.OrderOption) *SecretQuery
Order specifies how the records should be ordered.
func (*SecretQuery) Select ¶
func (sq *SecretQuery) Select(fields ...string) *SecretSelect
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 { PublicID string `json:"public_id,omitempty"` } client.Secret.Query(). Select(secret.FieldPublicID). Scan(ctx, &v)
func (*SecretQuery) Unique ¶
func (sq *SecretQuery) Unique(unique bool) *SecretQuery
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 (*SecretQuery) Where ¶
func (sq *SecretQuery) Where(ps ...predicate.Secret) *SecretQuery
Where adds a new predicate for the SecretQuery builder.
type SecretSelect ¶
type SecretSelect struct { *SecretQuery // contains filtered or unexported fields }
SecretSelect is the builder for selecting fields of Secret entities.
func (*SecretSelect) Aggregate ¶
func (ss *SecretSelect) Aggregate(fns ...AggregateFunc) *SecretSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SecretSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SecretSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SecretSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SecretSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SecretSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SecretSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SecretSelect) Scan ¶
func (ss *SecretSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SecretSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SecretUpdate ¶
type SecretUpdate struct {
// contains filtered or unexported fields
}
SecretUpdate is the builder for updating Secret entities.
func (*SecretUpdate) Exec ¶
func (su *SecretUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SecretUpdate) ExecX ¶
func (su *SecretUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SecretUpdate) Mutation ¶
func (su *SecretUpdate) Mutation() *SecretMutation
Mutation returns the SecretMutation object of the builder.
func (*SecretUpdate) Save ¶
func (su *SecretUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SecretUpdate) SaveX ¶
func (su *SecretUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SecretUpdate) SetAlreadyRead ¶
func (su *SecretUpdate) SetAlreadyRead(b bool) *SecretUpdate
SetAlreadyRead sets the "already_read" field.
func (*SecretUpdate) SetBurnAfterRead ¶
func (su *SecretUpdate) SetBurnAfterRead(b bool) *SecretUpdate
SetBurnAfterRead sets the "burn_after_read" field.
func (*SecretUpdate) SetDeletionToken ¶
func (su *SecretUpdate) SetDeletionToken(s string) *SecretUpdate
SetDeletionToken sets the "deletion_token" field.
func (*SecretUpdate) SetEncryptedData ¶
func (su *SecretUpdate) SetEncryptedData(s string) *SecretUpdate
SetEncryptedData sets the "encrypted_data" field.
func (*SecretUpdate) SetExpiresAt ¶
func (su *SecretUpdate) SetExpiresAt(t time.Time) *SecretUpdate
SetExpiresAt sets the "expires_at" field.
func (*SecretUpdate) SetNonce ¶
func (su *SecretUpdate) SetNonce(s string) *SecretUpdate
SetNonce sets the "nonce" field.
func (*SecretUpdate) SetPublicID ¶
func (su *SecretUpdate) SetPublicID(s string) *SecretUpdate
SetPublicID sets the "public_id" field.
func (*SecretUpdate) SetRetrievalToken ¶
func (su *SecretUpdate) SetRetrievalToken(s string) *SecretUpdate
SetRetrievalToken sets the "retrieval_token" field.
func (*SecretUpdate) Where ¶
func (su *SecretUpdate) Where(ps ...predicate.Secret) *SecretUpdate
Where appends a list predicates to the SecretUpdate builder.
type SecretUpdateOne ¶
type SecretUpdateOne struct {
// contains filtered or unexported fields
}
SecretUpdateOne is the builder for updating a single Secret entity.
func (*SecretUpdateOne) Exec ¶
func (suo *SecretUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SecretUpdateOne) ExecX ¶
func (suo *SecretUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SecretUpdateOne) Mutation ¶
func (suo *SecretUpdateOne) Mutation() *SecretMutation
Mutation returns the SecretMutation object of the builder.
func (*SecretUpdateOne) Save ¶
func (suo *SecretUpdateOne) Save(ctx context.Context) (*Secret, error)
Save executes the query and returns the updated Secret entity.
func (*SecretUpdateOne) SaveX ¶
func (suo *SecretUpdateOne) SaveX(ctx context.Context) *Secret
SaveX is like Save, but panics if an error occurs.
func (*SecretUpdateOne) Select ¶
func (suo *SecretUpdateOne) Select(field string, fields ...string) *SecretUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SecretUpdateOne) SetAlreadyRead ¶
func (suo *SecretUpdateOne) SetAlreadyRead(b bool) *SecretUpdateOne
SetAlreadyRead sets the "already_read" field.
func (*SecretUpdateOne) SetBurnAfterRead ¶
func (suo *SecretUpdateOne) SetBurnAfterRead(b bool) *SecretUpdateOne
SetBurnAfterRead sets the "burn_after_read" field.
func (*SecretUpdateOne) SetDeletionToken ¶
func (suo *SecretUpdateOne) SetDeletionToken(s string) *SecretUpdateOne
SetDeletionToken sets the "deletion_token" field.
func (*SecretUpdateOne) SetEncryptedData ¶
func (suo *SecretUpdateOne) SetEncryptedData(s string) *SecretUpdateOne
SetEncryptedData sets the "encrypted_data" field.
func (*SecretUpdateOne) SetExpiresAt ¶
func (suo *SecretUpdateOne) SetExpiresAt(t time.Time) *SecretUpdateOne
SetExpiresAt sets the "expires_at" field.
func (*SecretUpdateOne) SetNonce ¶
func (suo *SecretUpdateOne) SetNonce(s string) *SecretUpdateOne
SetNonce sets the "nonce" field.
func (*SecretUpdateOne) SetPublicID ¶
func (suo *SecretUpdateOne) SetPublicID(s string) *SecretUpdateOne
SetPublicID sets the "public_id" field.
func (*SecretUpdateOne) SetRetrievalToken ¶
func (suo *SecretUpdateOne) SetRetrievalToken(s string) *SecretUpdateOne
SetRetrievalToken sets the "retrieval_token" field.
func (*SecretUpdateOne) Where ¶
func (suo *SecretUpdateOne) Where(ps ...predicate.Secret) *SecretUpdateOne
Where appends a list predicates to the SecretUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Secret is the client for interacting with the Secret builders. Secret *SecretClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
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.