ent

package
v0.0.0-...-0149ed5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 23 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.
	TypeAuthCode     = "AuthCode"
	TypeConsent      = "Consent"
	TypeRedirectURI  = "RedirectURI"
	TypeRelyingParty = "RelyingParty"
	TypeUser         = "User"
)

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 AuthCode

type AuthCode struct {

	// ID of the ent.
	ID typedef.AuthCodeID `json:"id,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"-"`
	// UserID holds the value of the "user_id" field.
	UserID typedef.UserID `json:"user_id,omitempty"`
	// ExpireAt holds the value of the "expire_at" field.
	ExpireAt time.Time `json:"expire_at,omitempty"`
	// UsedAt holds the value of the "used_at" field.
	UsedAt *time.Time `json:"used_at,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ModifiedAt holds the value of the "modified_at" field.
	ModifiedAt time.Time `json:"modified_at,omitempty"`
	// RelyingPartyID holds the value of the "relying_party_id" field.
	RelyingPartyID typedef.RelyingPartyID `json:"relying_party_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthCodeQuery when eager-loading is set.
	Edges AuthCodeEdges `json:"edges"`
	// contains filtered or unexported fields
}

AuthCode is the model entity for the AuthCode schema.

func (*AuthCode) QueryRelyingParty

func (ac *AuthCode) QueryRelyingParty() *RelyingPartyQuery

QueryRelyingParty queries the "relying_party" edge of the AuthCode entity.

func (*AuthCode) String

func (ac *AuthCode) String() string

String implements the fmt.Stringer.

func (*AuthCode) Unwrap

func (ac *AuthCode) Unwrap() *AuthCode

Unwrap unwraps the AuthCode 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 (*AuthCode) Update

func (ac *AuthCode) Update() *AuthCodeUpdateOne

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

func (*AuthCode) Value

func (ac *AuthCode) Value(name string) (ent.Value, error)

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

type AuthCodeClient

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

AuthCodeClient is a client for the AuthCode schema.

func NewAuthCodeClient

func NewAuthCodeClient(c config) *AuthCodeClient

NewAuthCodeClient returns a client for the AuthCode from the given config.

func (*AuthCodeClient) Create

func (c *AuthCodeClient) Create() *AuthCodeCreate

Create returns a builder for creating a AuthCode entity.

func (*AuthCodeClient) CreateBulk

func (c *AuthCodeClient) CreateBulk(builders ...*AuthCodeCreate) *AuthCodeCreateBulk

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

func (*AuthCodeClient) Delete

func (c *AuthCodeClient) Delete() *AuthCodeDelete

Delete returns a delete builder for AuthCode.

func (*AuthCodeClient) DeleteOne

func (c *AuthCodeClient) DeleteOne(ac *AuthCode) *AuthCodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthCodeClient) DeleteOneID

func (c *AuthCodeClient) DeleteOneID(id typedef.AuthCodeID) *AuthCodeDeleteOne

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

func (*AuthCodeClient) Get

Get returns a AuthCode entity by its id.

func (*AuthCodeClient) GetX

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

func (*AuthCodeClient) Hooks

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

Hooks returns the client hooks.

func (*AuthCodeClient) Intercept

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

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

func (*AuthCodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuthCodeClient) MapCreateBulk

func (c *AuthCodeClient) MapCreateBulk(slice any, setFunc func(*AuthCodeCreate, int)) *AuthCodeCreateBulk

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 (*AuthCodeClient) Query

func (c *AuthCodeClient) Query() *AuthCodeQuery

Query returns a query builder for AuthCode.

func (*AuthCodeClient) QueryRelyingParty

func (c *AuthCodeClient) QueryRelyingParty(ac *AuthCode) *RelyingPartyQuery

QueryRelyingParty queries the relying_party edge of a AuthCode.

func (*AuthCodeClient) Update

func (c *AuthCodeClient) Update() *AuthCodeUpdate

Update returns an update builder for AuthCode.

func (*AuthCodeClient) UpdateOne

func (c *AuthCodeClient) UpdateOne(ac *AuthCode) *AuthCodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthCodeClient) UpdateOneID

func (c *AuthCodeClient) UpdateOneID(id typedef.AuthCodeID) *AuthCodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuthCodeClient) Use

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

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

type AuthCodeCreate

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

AuthCodeCreate is the builder for creating a AuthCode entity.

func (*AuthCodeCreate) Exec

func (acc *AuthCodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthCodeCreate) ExecX

func (acc *AuthCodeCreate) ExecX(ctx context.Context)

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

func (*AuthCodeCreate) Mutation

func (acc *AuthCodeCreate) Mutation() *AuthCodeMutation

Mutation returns the AuthCodeMutation object of the builder.

func (*AuthCodeCreate) Save

func (acc *AuthCodeCreate) Save(ctx context.Context) (*AuthCode, error)

Save creates the AuthCode in the database.

func (*AuthCodeCreate) SaveX

func (acc *AuthCodeCreate) SaveX(ctx context.Context) *AuthCode

SaveX calls Save and panics if Save returns an error.

func (*AuthCodeCreate) SetCode

func (acc *AuthCodeCreate) SetCode(s string) *AuthCodeCreate

SetCode sets the "code" field.

func (*AuthCodeCreate) SetCreatedAt

func (acc *AuthCodeCreate) SetCreatedAt(t time.Time) *AuthCodeCreate

SetCreatedAt sets the "created_at" field.

func (*AuthCodeCreate) SetExpireAt

func (acc *AuthCodeCreate) SetExpireAt(t time.Time) *AuthCodeCreate

SetExpireAt sets the "expire_at" field.

func (*AuthCodeCreate) SetID

SetID sets the "id" field.

func (*AuthCodeCreate) SetModifiedAt

func (acc *AuthCodeCreate) SetModifiedAt(t time.Time) *AuthCodeCreate

SetModifiedAt sets the "modified_at" field.

func (*AuthCodeCreate) SetNillableCreatedAt

func (acc *AuthCodeCreate) SetNillableCreatedAt(t *time.Time) *AuthCodeCreate

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

func (*AuthCodeCreate) SetNillableExpireAt

func (acc *AuthCodeCreate) SetNillableExpireAt(t *time.Time) *AuthCodeCreate

SetNillableExpireAt sets the "expire_at" field if the given value is not nil.

func (*AuthCodeCreate) SetNillableModifiedAt

func (acc *AuthCodeCreate) SetNillableModifiedAt(t *time.Time) *AuthCodeCreate

SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.

func (*AuthCodeCreate) SetNillableUsedAt

func (acc *AuthCodeCreate) SetNillableUsedAt(t *time.Time) *AuthCodeCreate

SetNillableUsedAt sets the "used_at" field if the given value is not nil.

func (*AuthCodeCreate) SetRelyingParty

func (acc *AuthCodeCreate) SetRelyingParty(r *RelyingParty) *AuthCodeCreate

SetRelyingParty sets the "relying_party" edge to the RelyingParty entity.

func (*AuthCodeCreate) SetRelyingPartyID

func (acc *AuthCodeCreate) SetRelyingPartyID(tpi typedef.RelyingPartyID) *AuthCodeCreate

SetRelyingPartyID sets the "relying_party_id" field.

func (*AuthCodeCreate) SetUsedAt

func (acc *AuthCodeCreate) SetUsedAt(t time.Time) *AuthCodeCreate

SetUsedAt sets the "used_at" field.

func (*AuthCodeCreate) SetUserID

func (acc *AuthCodeCreate) SetUserID(ti typedef.UserID) *AuthCodeCreate

SetUserID sets the "user_id" field.

type AuthCodeCreateBulk

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

AuthCodeCreateBulk is the builder for creating many AuthCode entities in bulk.

func (*AuthCodeCreateBulk) Exec

func (accb *AuthCodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthCodeCreateBulk) ExecX

func (accb *AuthCodeCreateBulk) ExecX(ctx context.Context)

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

func (*AuthCodeCreateBulk) Save

func (accb *AuthCodeCreateBulk) Save(ctx context.Context) ([]*AuthCode, error)

Save creates the AuthCode entities in the database.

func (*AuthCodeCreateBulk) SaveX

func (accb *AuthCodeCreateBulk) SaveX(ctx context.Context) []*AuthCode

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

type AuthCodeDelete

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

AuthCodeDelete is the builder for deleting a AuthCode entity.

func (*AuthCodeDelete) Exec

func (acd *AuthCodeDelete) Exec(ctx context.Context) (int, error)

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

func (*AuthCodeDelete) ExecX

func (acd *AuthCodeDelete) ExecX(ctx context.Context) int

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

func (*AuthCodeDelete) Where

func (acd *AuthCodeDelete) Where(ps ...predicate.AuthCode) *AuthCodeDelete

Where appends a list predicates to the AuthCodeDelete builder.

type AuthCodeDeleteOne

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

AuthCodeDeleteOne is the builder for deleting a single AuthCode entity.

func (*AuthCodeDeleteOne) Exec

func (acdo *AuthCodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AuthCodeDeleteOne) ExecX

func (acdo *AuthCodeDeleteOne) ExecX(ctx context.Context)

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

func (*AuthCodeDeleteOne) Where

Where appends a list predicates to the AuthCodeDelete builder.

type AuthCodeEdges

type AuthCodeEdges struct {
	// RelyingParty holds the value of the relying_party edge.
	RelyingParty *RelyingParty `json:"relying_party,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthCodeEdges) RelyingPartyOrErr

func (e AuthCodeEdges) RelyingPartyOrErr() (*RelyingParty, error)

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

type AuthCodeGroupBy

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

AuthCodeGroupBy is the group-by builder for AuthCode entities.

func (*AuthCodeGroupBy) Aggregate

func (acgb *AuthCodeGroupBy) Aggregate(fns ...AggregateFunc) *AuthCodeGroupBy

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

func (*AuthCodeGroupBy) Bool

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

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

func (*AuthCodeGroupBy) BoolX

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

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

func (*AuthCodeGroupBy) Bools

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

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

func (*AuthCodeGroupBy) BoolsX

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

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

func (*AuthCodeGroupBy) Float64

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

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

func (*AuthCodeGroupBy) Float64X

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

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

func (*AuthCodeGroupBy) Float64s

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

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

func (*AuthCodeGroupBy) Float64sX

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

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

func (*AuthCodeGroupBy) Int

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

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

func (*AuthCodeGroupBy) IntX

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

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

func (*AuthCodeGroupBy) Ints

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

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

func (*AuthCodeGroupBy) IntsX

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

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

func (*AuthCodeGroupBy) Scan

func (acgb *AuthCodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuthCodeGroupBy) ScanX

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

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

func (*AuthCodeGroupBy) String

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

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

func (*AuthCodeGroupBy) StringX

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

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

func (*AuthCodeGroupBy) Strings

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

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

func (*AuthCodeGroupBy) StringsX

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

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

type AuthCodeMutation

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

AuthCodeMutation represents an operation that mutates the AuthCode nodes in the graph.

func (*AuthCodeMutation) AddField

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) AddUserID

func (m *AuthCodeMutation) AddUserID(ti typedef.UserID)

AddUserID adds ti to the "user_id" field.

func (*AuthCodeMutation) AddedEdges

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

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

func (*AuthCodeMutation) AddedField

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) AddedFields

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

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

func (*AuthCodeMutation) AddedIDs

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

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

func (*AuthCodeMutation) AddedUserID

func (m *AuthCodeMutation) AddedUserID() (r typedef.UserID, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*AuthCodeMutation) ClearEdge

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) ClearField

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) ClearRelyingParty

func (m *AuthCodeMutation) ClearRelyingParty()

ClearRelyingParty clears the "relying_party" edge to the RelyingParty entity.

func (*AuthCodeMutation) ClearUsedAt

func (m *AuthCodeMutation) ClearUsedAt()

ClearUsedAt clears the value of the "used_at" field.

func (*AuthCodeMutation) ClearedEdges

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

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

func (*AuthCodeMutation) ClearedFields

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

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

func (AuthCodeMutation) Client

func (m AuthCodeMutation) 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 (*AuthCodeMutation) Code

func (m *AuthCodeMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*AuthCodeMutation) CreatedAt

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

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

func (*AuthCodeMutation) EdgeCleared

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

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

func (*AuthCodeMutation) ExpireAt

func (m *AuthCodeMutation) ExpireAt() (r time.Time, exists bool)

ExpireAt returns the value of the "expire_at" field in the mutation.

func (*AuthCodeMutation) Field

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) FieldCleared

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

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

func (*AuthCodeMutation) Fields

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) ID

func (m *AuthCodeMutation) ID() (id typedef.AuthCodeID, 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 (*AuthCodeMutation) IDs

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 (*AuthCodeMutation) ModifiedAt

func (m *AuthCodeMutation) ModifiedAt() (r time.Time, exists bool)

ModifiedAt returns the value of the "modified_at" field in the mutation.

func (*AuthCodeMutation) OldCode

func (m *AuthCodeMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the AuthCode entity. If the AuthCode 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 (*AuthCodeMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the AuthCode entity. If the AuthCode 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 (*AuthCodeMutation) OldExpireAt

func (m *AuthCodeMutation) OldExpireAt(ctx context.Context) (v time.Time, err error)

OldExpireAt returns the old "expire_at" field's value of the AuthCode entity. If the AuthCode 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 (*AuthCodeMutation) OldField

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) OldModifiedAt

func (m *AuthCodeMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)

OldModifiedAt returns the old "modified_at" field's value of the AuthCode entity. If the AuthCode 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 (*AuthCodeMutation) OldRelyingPartyID

func (m *AuthCodeMutation) OldRelyingPartyID(ctx context.Context) (v typedef.RelyingPartyID, err error)

OldRelyingPartyID returns the old "relying_party_id" field's value of the AuthCode entity. If the AuthCode 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 (*AuthCodeMutation) OldUsedAt

func (m *AuthCodeMutation) OldUsedAt(ctx context.Context) (v *time.Time, err error)

OldUsedAt returns the old "used_at" field's value of the AuthCode entity. If the AuthCode 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 (*AuthCodeMutation) OldUserID

func (m *AuthCodeMutation) OldUserID(ctx context.Context) (v typedef.UserID, err error)

OldUserID returns the old "user_id" field's value of the AuthCode entity. If the AuthCode 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 (*AuthCodeMutation) Op

func (m *AuthCodeMutation) Op() Op

Op returns the operation name.

func (*AuthCodeMutation) RelyingPartyCleared

func (m *AuthCodeMutation) RelyingPartyCleared() bool

RelyingPartyCleared reports if the "relying_party" edge to the RelyingParty entity was cleared.

func (*AuthCodeMutation) RelyingPartyID

func (m *AuthCodeMutation) RelyingPartyID() (r typedef.RelyingPartyID, exists bool)

RelyingPartyID returns the value of the "relying_party_id" field in the mutation.

func (*AuthCodeMutation) RelyingPartyIDs

func (m *AuthCodeMutation) RelyingPartyIDs() (ids []typedef.RelyingPartyID)

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

func (*AuthCodeMutation) RemovedEdges

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

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

func (*AuthCodeMutation) RemovedIDs

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) ResetCode

func (m *AuthCodeMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*AuthCodeMutation) ResetCreatedAt

func (m *AuthCodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AuthCodeMutation) ResetEdge

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) ResetExpireAt

func (m *AuthCodeMutation) ResetExpireAt()

ResetExpireAt resets all changes to the "expire_at" field.

func (*AuthCodeMutation) ResetField

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) ResetModifiedAt

func (m *AuthCodeMutation) ResetModifiedAt()

ResetModifiedAt resets all changes to the "modified_at" field.

func (*AuthCodeMutation) ResetRelyingParty

func (m *AuthCodeMutation) ResetRelyingParty()

ResetRelyingParty resets all changes to the "relying_party" edge.

func (*AuthCodeMutation) ResetRelyingPartyID

func (m *AuthCodeMutation) ResetRelyingPartyID()

ResetRelyingPartyID resets all changes to the "relying_party_id" field.

func (*AuthCodeMutation) ResetUsedAt

func (m *AuthCodeMutation) ResetUsedAt()

ResetUsedAt resets all changes to the "used_at" field.

func (*AuthCodeMutation) ResetUserID

func (m *AuthCodeMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*AuthCodeMutation) SetCode

func (m *AuthCodeMutation) SetCode(s string)

SetCode sets the "code" field.

func (*AuthCodeMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AuthCodeMutation) SetExpireAt

func (m *AuthCodeMutation) SetExpireAt(t time.Time)

SetExpireAt sets the "expire_at" field.

func (*AuthCodeMutation) SetField

func (m *AuthCodeMutation) 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 (*AuthCodeMutation) SetID

func (m *AuthCodeMutation) SetID(id typedef.AuthCodeID)

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

func (*AuthCodeMutation) SetModifiedAt

func (m *AuthCodeMutation) SetModifiedAt(t time.Time)

SetModifiedAt sets the "modified_at" field.

func (*AuthCodeMutation) SetOp

func (m *AuthCodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthCodeMutation) SetRelyingPartyID

func (m *AuthCodeMutation) SetRelyingPartyID(tpi typedef.RelyingPartyID)

SetRelyingPartyID sets the "relying_party_id" field.

func (*AuthCodeMutation) SetUsedAt

func (m *AuthCodeMutation) SetUsedAt(t time.Time)

SetUsedAt sets the "used_at" field.

func (*AuthCodeMutation) SetUserID

func (m *AuthCodeMutation) SetUserID(ti typedef.UserID)

SetUserID sets the "user_id" field.

func (AuthCodeMutation) Tx

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

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

func (*AuthCodeMutation) Type

func (m *AuthCodeMutation) Type() string

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

func (*AuthCodeMutation) UsedAt

func (m *AuthCodeMutation) UsedAt() (r time.Time, exists bool)

UsedAt returns the value of the "used_at" field in the mutation.

func (*AuthCodeMutation) UsedAtCleared

func (m *AuthCodeMutation) UsedAtCleared() bool

UsedAtCleared returns if the "used_at" field was cleared in this mutation.

func (*AuthCodeMutation) UserID

func (m *AuthCodeMutation) UserID() (r typedef.UserID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*AuthCodeMutation) Where

func (m *AuthCodeMutation) Where(ps ...predicate.AuthCode)

Where appends a list predicates to the AuthCodeMutation builder.

func (*AuthCodeMutation) WhereP

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

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

type AuthCodeQuery

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

AuthCodeQuery is the builder for querying AuthCode entities.

func (*AuthCodeQuery) Aggregate

func (acq *AuthCodeQuery) Aggregate(fns ...AggregateFunc) *AuthCodeSelect

Aggregate returns a AuthCodeSelect configured with the given aggregations.

func (*AuthCodeQuery) All

func (acq *AuthCodeQuery) All(ctx context.Context) ([]*AuthCode, error)

All executes the query and returns a list of AuthCodes.

func (*AuthCodeQuery) AllX

func (acq *AuthCodeQuery) AllX(ctx context.Context) []*AuthCode

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

func (*AuthCodeQuery) Clone

func (acq *AuthCodeQuery) Clone() *AuthCodeQuery

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

func (*AuthCodeQuery) Count

func (acq *AuthCodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuthCodeQuery) CountX

func (acq *AuthCodeQuery) CountX(ctx context.Context) int

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

func (*AuthCodeQuery) Exist

func (acq *AuthCodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuthCodeQuery) ExistX

func (acq *AuthCodeQuery) ExistX(ctx context.Context) bool

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

func (*AuthCodeQuery) First

func (acq *AuthCodeQuery) First(ctx context.Context) (*AuthCode, error)

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

func (*AuthCodeQuery) FirstID

func (acq *AuthCodeQuery) FirstID(ctx context.Context) (id typedef.AuthCodeID, err error)

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

func (*AuthCodeQuery) FirstIDX

func (acq *AuthCodeQuery) FirstIDX(ctx context.Context) typedef.AuthCodeID

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

func (*AuthCodeQuery) FirstX

func (acq *AuthCodeQuery) FirstX(ctx context.Context) *AuthCode

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

func (*AuthCodeQuery) ForShare

func (acq *AuthCodeQuery) ForShare(opts ...sql.LockOption) *AuthCodeQuery

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 (*AuthCodeQuery) ForUpdate

func (acq *AuthCodeQuery) ForUpdate(opts ...sql.LockOption) *AuthCodeQuery

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 (*AuthCodeQuery) GroupBy

func (acq *AuthCodeQuery) GroupBy(field string, fields ...string) *AuthCodeGroupBy

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 {
	Code string `json:"code,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AuthCode.Query().
	GroupBy(authcode.FieldCode).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuthCodeQuery) IDs

func (acq *AuthCodeQuery) IDs(ctx context.Context) (ids []typedef.AuthCodeID, err error)

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

func (*AuthCodeQuery) IDsX

func (acq *AuthCodeQuery) IDsX(ctx context.Context) []typedef.AuthCodeID

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

func (*AuthCodeQuery) Limit

func (acq *AuthCodeQuery) Limit(limit int) *AuthCodeQuery

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

func (*AuthCodeQuery) Offset

func (acq *AuthCodeQuery) Offset(offset int) *AuthCodeQuery

Offset to start from.

func (*AuthCodeQuery) Only

func (acq *AuthCodeQuery) Only(ctx context.Context) (*AuthCode, error)

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

func (*AuthCodeQuery) OnlyID

func (acq *AuthCodeQuery) OnlyID(ctx context.Context) (id typedef.AuthCodeID, err error)

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

func (*AuthCodeQuery) OnlyIDX

func (acq *AuthCodeQuery) OnlyIDX(ctx context.Context) typedef.AuthCodeID

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

func (*AuthCodeQuery) OnlyX

func (acq *AuthCodeQuery) OnlyX(ctx context.Context) *AuthCode

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

func (*AuthCodeQuery) Order

func (acq *AuthCodeQuery) Order(o ...authcode.OrderOption) *AuthCodeQuery

Order specifies how the records should be ordered.

func (*AuthCodeQuery) QueryRelyingParty

func (acq *AuthCodeQuery) QueryRelyingParty() *RelyingPartyQuery

QueryRelyingParty chains the current query on the "relying_party" edge.

func (*AuthCodeQuery) Select

func (acq *AuthCodeQuery) Select(fields ...string) *AuthCodeSelect

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 {
	Code string `json:"code,omitempty"`
}

client.AuthCode.Query().
	Select(authcode.FieldCode).
	Scan(ctx, &v)

func (*AuthCodeQuery) Unique

func (acq *AuthCodeQuery) Unique(unique bool) *AuthCodeQuery

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 (*AuthCodeQuery) Where

func (acq *AuthCodeQuery) Where(ps ...predicate.AuthCode) *AuthCodeQuery

Where adds a new predicate for the AuthCodeQuery builder.

func (*AuthCodeQuery) WithRelyingParty

func (acq *AuthCodeQuery) WithRelyingParty(opts ...func(*RelyingPartyQuery)) *AuthCodeQuery

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

type AuthCodeSelect

type AuthCodeSelect struct {
	*AuthCodeQuery
	// contains filtered or unexported fields
}

AuthCodeSelect is the builder for selecting fields of AuthCode entities.

func (*AuthCodeSelect) Aggregate

func (acs *AuthCodeSelect) Aggregate(fns ...AggregateFunc) *AuthCodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuthCodeSelect) Bool

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

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

func (*AuthCodeSelect) BoolX

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

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

func (*AuthCodeSelect) Bools

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

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

func (*AuthCodeSelect) BoolsX

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

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

func (*AuthCodeSelect) Float64

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

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

func (*AuthCodeSelect) Float64X

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

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

func (*AuthCodeSelect) Float64s

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

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

func (*AuthCodeSelect) Float64sX

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

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

func (*AuthCodeSelect) Int

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

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

func (*AuthCodeSelect) IntX

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

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

func (*AuthCodeSelect) Ints

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

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

func (*AuthCodeSelect) IntsX

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

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

func (*AuthCodeSelect) Scan

func (acs *AuthCodeSelect) Scan(ctx context.Context, v any) error

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

func (*AuthCodeSelect) ScanX

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

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

func (*AuthCodeSelect) String

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

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

func (*AuthCodeSelect) StringX

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

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

func (*AuthCodeSelect) Strings

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

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

func (*AuthCodeSelect) StringsX

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

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

type AuthCodeUpdate

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

AuthCodeUpdate is the builder for updating AuthCode entities.

func (*AuthCodeUpdate) ClearUsedAt

func (acu *AuthCodeUpdate) ClearUsedAt() *AuthCodeUpdate

ClearUsedAt clears the value of the "used_at" field.

func (*AuthCodeUpdate) Exec

func (acu *AuthCodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthCodeUpdate) ExecX

func (acu *AuthCodeUpdate) ExecX(ctx context.Context)

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

func (*AuthCodeUpdate) Mutation

func (acu *AuthCodeUpdate) Mutation() *AuthCodeMutation

Mutation returns the AuthCodeMutation object of the builder.

func (*AuthCodeUpdate) Save

func (acu *AuthCodeUpdate) Save(ctx context.Context) (int, error)

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

func (*AuthCodeUpdate) SaveX

func (acu *AuthCodeUpdate) SaveX(ctx context.Context) int

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

func (*AuthCodeUpdate) SetModifiedAt

func (acu *AuthCodeUpdate) SetModifiedAt(t time.Time) *AuthCodeUpdate

SetModifiedAt sets the "modified_at" field.

func (*AuthCodeUpdate) SetNillableUsedAt

func (acu *AuthCodeUpdate) SetNillableUsedAt(t *time.Time) *AuthCodeUpdate

SetNillableUsedAt sets the "used_at" field if the given value is not nil.

func (*AuthCodeUpdate) SetUsedAt

func (acu *AuthCodeUpdate) SetUsedAt(t time.Time) *AuthCodeUpdate

SetUsedAt sets the "used_at" field.

func (*AuthCodeUpdate) Where

func (acu *AuthCodeUpdate) Where(ps ...predicate.AuthCode) *AuthCodeUpdate

Where appends a list predicates to the AuthCodeUpdate builder.

type AuthCodeUpdateOne

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

AuthCodeUpdateOne is the builder for updating a single AuthCode entity.

func (*AuthCodeUpdateOne) ClearUsedAt

func (acuo *AuthCodeUpdateOne) ClearUsedAt() *AuthCodeUpdateOne

ClearUsedAt clears the value of the "used_at" field.

func (*AuthCodeUpdateOne) Exec

func (acuo *AuthCodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AuthCodeUpdateOne) ExecX

func (acuo *AuthCodeUpdateOne) ExecX(ctx context.Context)

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

func (*AuthCodeUpdateOne) Mutation

func (acuo *AuthCodeUpdateOne) Mutation() *AuthCodeMutation

Mutation returns the AuthCodeMutation object of the builder.

func (*AuthCodeUpdateOne) Save

func (acuo *AuthCodeUpdateOne) Save(ctx context.Context) (*AuthCode, error)

Save executes the query and returns the updated AuthCode entity.

func (*AuthCodeUpdateOne) SaveX

func (acuo *AuthCodeUpdateOne) SaveX(ctx context.Context) *AuthCode

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

func (*AuthCodeUpdateOne) Select

func (acuo *AuthCodeUpdateOne) Select(field string, fields ...string) *AuthCodeUpdateOne

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

func (*AuthCodeUpdateOne) SetModifiedAt

func (acuo *AuthCodeUpdateOne) SetModifiedAt(t time.Time) *AuthCodeUpdateOne

SetModifiedAt sets the "modified_at" field.

func (*AuthCodeUpdateOne) SetNillableUsedAt

func (acuo *AuthCodeUpdateOne) SetNillableUsedAt(t *time.Time) *AuthCodeUpdateOne

SetNillableUsedAt sets the "used_at" field if the given value is not nil.

func (*AuthCodeUpdateOne) SetUsedAt

func (acuo *AuthCodeUpdateOne) SetUsedAt(t time.Time) *AuthCodeUpdateOne

SetUsedAt sets the "used_at" field.

func (*AuthCodeUpdateOne) Where

Where appends a list predicates to the AuthCodeUpdate builder.

type AuthCodes

type AuthCodes []*AuthCode

AuthCodes is a parsable slice of AuthCode.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AuthCode is the client for interacting with the AuthCode builders.
	AuthCode *AuthCodeClient
	// Consent is the client for interacting with the Consent builders.
	Consent *ConsentClient
	// RedirectURI is the client for interacting with the RedirectURI builders.
	RedirectURI *RedirectURIClient
	// RelyingParty is the client for interacting with the RelyingParty builders.
	RelyingParty *RelyingPartyClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	AuthCode.
	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(...)`.

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

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 Consent struct {

	// ID of the ent.
	ID typedef.ConsentID `json:"id,omitempty"`
	// ClientID holds the value of the "client_id" field.
	ClientID typedef.ClientID `json:"client_id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID typedef.UserID `json:"user_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ConsentQuery when eager-loading is set.
	Edges ConsentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Consent is the model entity for the Consent schema.

func (*Consent) QueryUser

func (c *Consent) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Consent entity.

func (*Consent) String

func (c *Consent) String() string

String implements the fmt.Stringer.

func (*Consent) Unwrap

func (c *Consent) Unwrap() *Consent

Unwrap unwraps the Consent 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 (*Consent) Update

func (c *Consent) Update() *ConsentUpdateOne

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

func (*Consent) Value

func (c *Consent) Value(name string) (ent.Value, error)

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

type ConsentClient

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

ConsentClient is a client for the Consent schema.

func NewConsentClient

func NewConsentClient(c config) *ConsentClient

NewConsentClient returns a client for the Consent from the given config.

func (*ConsentClient) Create

func (c *ConsentClient) Create() *ConsentCreate

Create returns a builder for creating a Consent entity.

func (*ConsentClient) CreateBulk

func (c *ConsentClient) CreateBulk(builders ...*ConsentCreate) *ConsentCreateBulk

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

func (*ConsentClient) Delete

func (c *ConsentClient) Delete() *ConsentDelete

Delete returns a delete builder for Consent.

func (*ConsentClient) DeleteOne

func (c *ConsentClient) DeleteOne(co *Consent) *ConsentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ConsentClient) DeleteOneID

func (c *ConsentClient) DeleteOneID(id typedef.ConsentID) *ConsentDeleteOne

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

func (*ConsentClient) Get

Get returns a Consent entity by its id.

func (*ConsentClient) GetX

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

func (*ConsentClient) Hooks

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

Hooks returns the client hooks.

func (*ConsentClient) Intercept

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

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

func (*ConsentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ConsentClient) MapCreateBulk

func (c *ConsentClient) MapCreateBulk(slice any, setFunc func(*ConsentCreate, int)) *ConsentCreateBulk

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 (*ConsentClient) Query

func (c *ConsentClient) Query() *ConsentQuery

Query returns a query builder for Consent.

func (*ConsentClient) QueryUser

func (c *ConsentClient) QueryUser(co *Consent) *UserQuery

QueryUser queries the user edge of a Consent.

func (*ConsentClient) Update

func (c *ConsentClient) Update() *ConsentUpdate

Update returns an update builder for Consent.

func (*ConsentClient) UpdateOne

func (c *ConsentClient) UpdateOne(co *Consent) *ConsentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ConsentClient) UpdateOneID

func (c *ConsentClient) UpdateOneID(id typedef.ConsentID) *ConsentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ConsentClient) Use

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

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

type ConsentCreate

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

ConsentCreate is the builder for creating a Consent entity.

func (*ConsentCreate) Exec

func (cc *ConsentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConsentCreate) ExecX

func (cc *ConsentCreate) ExecX(ctx context.Context)

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

func (*ConsentCreate) Mutation

func (cc *ConsentCreate) Mutation() *ConsentMutation

Mutation returns the ConsentMutation object of the builder.

func (*ConsentCreate) Save

func (cc *ConsentCreate) Save(ctx context.Context) (*Consent, error)

Save creates the Consent in the database.

func (*ConsentCreate) SaveX

func (cc *ConsentCreate) SaveX(ctx context.Context) *Consent

SaveX calls Save and panics if Save returns an error.

func (*ConsentCreate) SetClientID

func (cc *ConsentCreate) SetClientID(ti typedef.ClientID) *ConsentCreate

SetClientID sets the "client_id" field.

func (*ConsentCreate) SetCreatedAt

func (cc *ConsentCreate) SetCreatedAt(t time.Time) *ConsentCreate

SetCreatedAt sets the "created_at" field.

func (*ConsentCreate) SetID

SetID sets the "id" field.

func (*ConsentCreate) SetNillableCreatedAt

func (cc *ConsentCreate) SetNillableCreatedAt(t *time.Time) *ConsentCreate

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

func (*ConsentCreate) SetUser

func (cc *ConsentCreate) SetUser(u *User) *ConsentCreate

SetUser sets the "user" edge to the User entity.

func (*ConsentCreate) SetUserID

func (cc *ConsentCreate) SetUserID(ti typedef.UserID) *ConsentCreate

SetUserID sets the "user_id" field.

type ConsentCreateBulk

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

ConsentCreateBulk is the builder for creating many Consent entities in bulk.

func (*ConsentCreateBulk) Exec

func (ccb *ConsentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ConsentCreateBulk) ExecX

func (ccb *ConsentCreateBulk) ExecX(ctx context.Context)

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

func (*ConsentCreateBulk) Save

func (ccb *ConsentCreateBulk) Save(ctx context.Context) ([]*Consent, error)

Save creates the Consent entities in the database.

func (*ConsentCreateBulk) SaveX

func (ccb *ConsentCreateBulk) SaveX(ctx context.Context) []*Consent

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

type ConsentDelete

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

ConsentDelete is the builder for deleting a Consent entity.

func (*ConsentDelete) Exec

func (cd *ConsentDelete) Exec(ctx context.Context) (int, error)

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

func (*ConsentDelete) ExecX

func (cd *ConsentDelete) ExecX(ctx context.Context) int

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

func (*ConsentDelete) Where

func (cd *ConsentDelete) Where(ps ...predicate.Consent) *ConsentDelete

Where appends a list predicates to the ConsentDelete builder.

type ConsentDeleteOne

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

ConsentDeleteOne is the builder for deleting a single Consent entity.

func (*ConsentDeleteOne) Exec

func (cdo *ConsentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ConsentDeleteOne) ExecX

func (cdo *ConsentDeleteOne) ExecX(ctx context.Context)

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

func (*ConsentDeleteOne) Where

Where appends a list predicates to the ConsentDelete builder.

type ConsentEdges

type ConsentEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

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

func (ConsentEdges) UserOrErr

func (e ConsentEdges) UserOrErr() (*User, error)

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

type ConsentGroupBy

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

ConsentGroupBy is the group-by builder for Consent entities.

func (*ConsentGroupBy) Aggregate

func (cgb *ConsentGroupBy) Aggregate(fns ...AggregateFunc) *ConsentGroupBy

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

func (*ConsentGroupBy) Bool

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

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

func (*ConsentGroupBy) BoolX

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

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

func (*ConsentGroupBy) Bools

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

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

func (*ConsentGroupBy) BoolsX

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

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

func (*ConsentGroupBy) Float64

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

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

func (*ConsentGroupBy) Float64X

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

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

func (*ConsentGroupBy) Float64s

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

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

func (*ConsentGroupBy) Float64sX

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

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

func (*ConsentGroupBy) Int

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

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

func (*ConsentGroupBy) IntX

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

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

func (*ConsentGroupBy) Ints

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

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

func (*ConsentGroupBy) IntsX

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

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

func (*ConsentGroupBy) Scan

func (cgb *ConsentGroupBy) Scan(ctx context.Context, v any) error

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

func (*ConsentGroupBy) ScanX

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

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

func (*ConsentGroupBy) String

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

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

func (*ConsentGroupBy) StringX

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

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

func (*ConsentGroupBy) Strings

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

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

func (*ConsentGroupBy) StringsX

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

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

type ConsentMutation

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

ConsentMutation represents an operation that mutates the Consent nodes in the graph.

func (*ConsentMutation) AddField

func (m *ConsentMutation) 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 (*ConsentMutation) AddedEdges

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

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

func (*ConsentMutation) AddedField

func (m *ConsentMutation) 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 (*ConsentMutation) AddedFields

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

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

func (*ConsentMutation) AddedIDs

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

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

func (*ConsentMutation) ClearEdge

func (m *ConsentMutation) 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 (*ConsentMutation) ClearField

func (m *ConsentMutation) 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 (*ConsentMutation) ClearUser

func (m *ConsentMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ConsentMutation) ClearedEdges

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

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

func (*ConsentMutation) ClearedFields

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

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

func (ConsentMutation) Client

func (m ConsentMutation) 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 (*ConsentMutation) ClientID

func (m *ConsentMutation) ClientID() (r typedef.ClientID, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*ConsentMutation) CreatedAt

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

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

func (*ConsentMutation) EdgeCleared

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

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

func (*ConsentMutation) Field

func (m *ConsentMutation) 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 (*ConsentMutation) FieldCleared

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

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

func (*ConsentMutation) Fields

func (m *ConsentMutation) 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 (*ConsentMutation) ID

func (m *ConsentMutation) ID() (id typedef.ConsentID, 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 (*ConsentMutation) IDs

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 (*ConsentMutation) OldClientID

func (m *ConsentMutation) OldClientID(ctx context.Context) (v typedef.ClientID, err error)

OldClientID returns the old "client_id" field's value of the Consent entity. If the Consent 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 (*ConsentMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Consent entity. If the Consent 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 (*ConsentMutation) OldField

func (m *ConsentMutation) 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 (*ConsentMutation) OldUserID

func (m *ConsentMutation) OldUserID(ctx context.Context) (v typedef.UserID, err error)

OldUserID returns the old "user_id" field's value of the Consent entity. If the Consent 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 (*ConsentMutation) Op

func (m *ConsentMutation) Op() Op

Op returns the operation name.

func (*ConsentMutation) RemovedEdges

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

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

func (*ConsentMutation) RemovedIDs

func (m *ConsentMutation) 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 (*ConsentMutation) ResetClientID

func (m *ConsentMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*ConsentMutation) ResetCreatedAt

func (m *ConsentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ConsentMutation) ResetEdge

func (m *ConsentMutation) 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 (*ConsentMutation) ResetField

func (m *ConsentMutation) 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 (*ConsentMutation) ResetUser

func (m *ConsentMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ConsentMutation) ResetUserID

func (m *ConsentMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ConsentMutation) SetClientID

func (m *ConsentMutation) SetClientID(ti typedef.ClientID)

SetClientID sets the "client_id" field.

func (*ConsentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ConsentMutation) SetField

func (m *ConsentMutation) 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 (*ConsentMutation) SetID

func (m *ConsentMutation) SetID(id typedef.ConsentID)

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

func (*ConsentMutation) SetOp

func (m *ConsentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ConsentMutation) SetUserID

func (m *ConsentMutation) SetUserID(ti typedef.UserID)

SetUserID sets the "user_id" field.

func (ConsentMutation) Tx

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

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

func (*ConsentMutation) Type

func (m *ConsentMutation) Type() string

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

func (*ConsentMutation) UserCleared

func (m *ConsentMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ConsentMutation) UserID

func (m *ConsentMutation) UserID() (r typedef.UserID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ConsentMutation) UserIDs

func (m *ConsentMutation) UserIDs() (ids []typedef.UserID)

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

func (*ConsentMutation) Where

func (m *ConsentMutation) Where(ps ...predicate.Consent)

Where appends a list predicates to the ConsentMutation builder.

func (*ConsentMutation) WhereP

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

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

type ConsentQuery

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

ConsentQuery is the builder for querying Consent entities.

func (*ConsentQuery) Aggregate

func (cq *ConsentQuery) Aggregate(fns ...AggregateFunc) *ConsentSelect

Aggregate returns a ConsentSelect configured with the given aggregations.

func (*ConsentQuery) All

func (cq *ConsentQuery) All(ctx context.Context) ([]*Consent, error)

All executes the query and returns a list of Consents.

func (*ConsentQuery) AllX

func (cq *ConsentQuery) AllX(ctx context.Context) []*Consent

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

func (*ConsentQuery) Clone

func (cq *ConsentQuery) Clone() *ConsentQuery

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

func (*ConsentQuery) Count

func (cq *ConsentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ConsentQuery) CountX

func (cq *ConsentQuery) CountX(ctx context.Context) int

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

func (*ConsentQuery) Exist

func (cq *ConsentQuery) Exist(ctx context.Context) (bool, error)

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

func (*ConsentQuery) ExistX

func (cq *ConsentQuery) ExistX(ctx context.Context) bool

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

func (*ConsentQuery) First

func (cq *ConsentQuery) First(ctx context.Context) (*Consent, error)

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

func (*ConsentQuery) FirstID

func (cq *ConsentQuery) FirstID(ctx context.Context) (id typedef.ConsentID, err error)

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

func (*ConsentQuery) FirstIDX

func (cq *ConsentQuery) FirstIDX(ctx context.Context) typedef.ConsentID

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

func (*ConsentQuery) FirstX

func (cq *ConsentQuery) FirstX(ctx context.Context) *Consent

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

func (*ConsentQuery) ForShare

func (cq *ConsentQuery) ForShare(opts ...sql.LockOption) *ConsentQuery

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 (*ConsentQuery) ForUpdate

func (cq *ConsentQuery) ForUpdate(opts ...sql.LockOption) *ConsentQuery

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 (*ConsentQuery) GroupBy

func (cq *ConsentQuery) GroupBy(field string, fields ...string) *ConsentGroupBy

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 {
	ClientID typedef.ClientID `json:"client_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Consent.Query().
	GroupBy(consent.FieldClientID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ConsentQuery) IDs

func (cq *ConsentQuery) IDs(ctx context.Context) (ids []typedef.ConsentID, err error)

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

func (*ConsentQuery) IDsX

func (cq *ConsentQuery) IDsX(ctx context.Context) []typedef.ConsentID

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

func (*ConsentQuery) Limit

func (cq *ConsentQuery) Limit(limit int) *ConsentQuery

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

func (*ConsentQuery) Offset

func (cq *ConsentQuery) Offset(offset int) *ConsentQuery

Offset to start from.

func (*ConsentQuery) Only

func (cq *ConsentQuery) Only(ctx context.Context) (*Consent, error)

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

func (*ConsentQuery) OnlyID

func (cq *ConsentQuery) OnlyID(ctx context.Context) (id typedef.ConsentID, err error)

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

func (*ConsentQuery) OnlyIDX

func (cq *ConsentQuery) OnlyIDX(ctx context.Context) typedef.ConsentID

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

func (*ConsentQuery) OnlyX

func (cq *ConsentQuery) OnlyX(ctx context.Context) *Consent

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

func (*ConsentQuery) Order

func (cq *ConsentQuery) Order(o ...consent.OrderOption) *ConsentQuery

Order specifies how the records should be ordered.

func (*ConsentQuery) QueryUser

func (cq *ConsentQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ConsentQuery) Select

func (cq *ConsentQuery) Select(fields ...string) *ConsentSelect

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 {
	ClientID typedef.ClientID `json:"client_id,omitempty"`
}

client.Consent.Query().
	Select(consent.FieldClientID).
	Scan(ctx, &v)

func (*ConsentQuery) Unique

func (cq *ConsentQuery) Unique(unique bool) *ConsentQuery

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 (*ConsentQuery) Where

func (cq *ConsentQuery) Where(ps ...predicate.Consent) *ConsentQuery

Where adds a new predicate for the ConsentQuery builder.

func (*ConsentQuery) WithUser

func (cq *ConsentQuery) WithUser(opts ...func(*UserQuery)) *ConsentQuery

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

type ConsentSelect

type ConsentSelect struct {
	*ConsentQuery
	// contains filtered or unexported fields
}

ConsentSelect is the builder for selecting fields of Consent entities.

func (*ConsentSelect) Aggregate

func (cs *ConsentSelect) Aggregate(fns ...AggregateFunc) *ConsentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ConsentSelect) Bool

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

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

func (*ConsentSelect) BoolX

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

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

func (*ConsentSelect) Bools

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

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

func (*ConsentSelect) BoolsX

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

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

func (*ConsentSelect) Float64

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

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

func (*ConsentSelect) Float64X

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

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

func (*ConsentSelect) Float64s

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

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

func (*ConsentSelect) Float64sX

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

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

func (*ConsentSelect) Int

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

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

func (*ConsentSelect) IntX

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

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

func (*ConsentSelect) Ints

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

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

func (*ConsentSelect) IntsX

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

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

func (*ConsentSelect) Scan

func (cs *ConsentSelect) Scan(ctx context.Context, v any) error

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

func (*ConsentSelect) ScanX

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

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

func (*ConsentSelect) String

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

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

func (*ConsentSelect) StringX

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

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

func (*ConsentSelect) Strings

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

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

func (*ConsentSelect) StringsX

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

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

type ConsentUpdate

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

ConsentUpdate is the builder for updating Consent entities.

func (*ConsentUpdate) Exec

func (cu *ConsentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConsentUpdate) ExecX

func (cu *ConsentUpdate) ExecX(ctx context.Context)

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

func (*ConsentUpdate) Mutation

func (cu *ConsentUpdate) Mutation() *ConsentMutation

Mutation returns the ConsentMutation object of the builder.

func (*ConsentUpdate) Save

func (cu *ConsentUpdate) Save(ctx context.Context) (int, error)

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

func (*ConsentUpdate) SaveX

func (cu *ConsentUpdate) SaveX(ctx context.Context) int

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

func (*ConsentUpdate) Where

func (cu *ConsentUpdate) Where(ps ...predicate.Consent) *ConsentUpdate

Where appends a list predicates to the ConsentUpdate builder.

type ConsentUpdateOne

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

ConsentUpdateOne is the builder for updating a single Consent entity.

func (*ConsentUpdateOne) Exec

func (cuo *ConsentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ConsentUpdateOne) ExecX

func (cuo *ConsentUpdateOne) ExecX(ctx context.Context)

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

func (*ConsentUpdateOne) Mutation

func (cuo *ConsentUpdateOne) Mutation() *ConsentMutation

Mutation returns the ConsentMutation object of the builder.

func (*ConsentUpdateOne) Save

func (cuo *ConsentUpdateOne) Save(ctx context.Context) (*Consent, error)

Save executes the query and returns the updated Consent entity.

func (*ConsentUpdateOne) SaveX

func (cuo *ConsentUpdateOne) SaveX(ctx context.Context) *Consent

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

func (*ConsentUpdateOne) Select

func (cuo *ConsentUpdateOne) Select(field string, fields ...string) *ConsentUpdateOne

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

func (*ConsentUpdateOne) Where

Where appends a list predicates to the ConsentUpdate builder.

type Consents

type Consents []*Consent

Consents is a parsable slice of Consent.

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 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 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 RedirectURI

type RedirectURI struct {

	// ID of the ent.
	ID typedef.RedirectURIID `json:"id,omitempty"`
	// URI holds the value of the "uri" field.
	URI string `json:"uri,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ModifiedAt holds the value of the "modified_at" field.
	ModifiedAt time.Time `json:"modified_at,omitempty"`
	// RelyingPartyID holds the value of the "relying_party_id" field.
	RelyingPartyID typedef.RelyingPartyID `json:"relying_party_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RedirectURIQuery when eager-loading is set.
	Edges RedirectURIEdges `json:"edges"`
	// contains filtered or unexported fields
}

RedirectURI is the model entity for the RedirectURI schema.

func (*RedirectURI) QueryRelyingParty

func (ru *RedirectURI) QueryRelyingParty() *RelyingPartyQuery

QueryRelyingParty queries the "relying_party" edge of the RedirectURI entity.

func (*RedirectURI) String

func (ru *RedirectURI) String() string

String implements the fmt.Stringer.

func (*RedirectURI) Unwrap

func (ru *RedirectURI) Unwrap() *RedirectURI

Unwrap unwraps the RedirectURI 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 (*RedirectURI) Update

func (ru *RedirectURI) Update() *RedirectURIUpdateOne

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

func (*RedirectURI) Value

func (ru *RedirectURI) Value(name string) (ent.Value, error)

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

type RedirectURIClient

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

RedirectURIClient is a client for the RedirectURI schema.

func NewRedirectURIClient

func NewRedirectURIClient(c config) *RedirectURIClient

NewRedirectURIClient returns a client for the RedirectURI from the given config.

func (*RedirectURIClient) Create

func (c *RedirectURIClient) Create() *RedirectURICreate

Create returns a builder for creating a RedirectURI entity.

func (*RedirectURIClient) CreateBulk

func (c *RedirectURIClient) CreateBulk(builders ...*RedirectURICreate) *RedirectURICreateBulk

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

func (*RedirectURIClient) Delete

func (c *RedirectURIClient) Delete() *RedirectURIDelete

Delete returns a delete builder for RedirectURI.

func (*RedirectURIClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RedirectURIClient) DeleteOneID

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

func (*RedirectURIClient) Get

Get returns a RedirectURI entity by its id.

func (*RedirectURIClient) GetX

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

func (*RedirectURIClient) Hooks

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

Hooks returns the client hooks.

func (*RedirectURIClient) Intercept

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

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

func (*RedirectURIClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RedirectURIClient) MapCreateBulk

func (c *RedirectURIClient) MapCreateBulk(slice any, setFunc func(*RedirectURICreate, int)) *RedirectURICreateBulk

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 (*RedirectURIClient) Query

func (c *RedirectURIClient) Query() *RedirectURIQuery

Query returns a query builder for RedirectURI.

func (*RedirectURIClient) QueryRelyingParty

func (c *RedirectURIClient) QueryRelyingParty(ru *RedirectURI) *RelyingPartyQuery

QueryRelyingParty queries the relying_party edge of a RedirectURI.

func (*RedirectURIClient) Update

func (c *RedirectURIClient) Update() *RedirectURIUpdate

Update returns an update builder for RedirectURI.

func (*RedirectURIClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RedirectURIClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RedirectURIClient) Use

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

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

type RedirectURICreate

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

RedirectURICreate is the builder for creating a RedirectURI entity.

func (*RedirectURICreate) Exec

func (ruc *RedirectURICreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RedirectURICreate) ExecX

func (ruc *RedirectURICreate) ExecX(ctx context.Context)

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

func (*RedirectURICreate) Mutation

func (ruc *RedirectURICreate) Mutation() *RedirectURIMutation

Mutation returns the RedirectURIMutation object of the builder.

func (*RedirectURICreate) Save

func (ruc *RedirectURICreate) Save(ctx context.Context) (*RedirectURI, error)

Save creates the RedirectURI in the database.

func (*RedirectURICreate) SaveX

func (ruc *RedirectURICreate) SaveX(ctx context.Context) *RedirectURI

SaveX calls Save and panics if Save returns an error.

func (*RedirectURICreate) SetCreatedAt

func (ruc *RedirectURICreate) SetCreatedAt(t time.Time) *RedirectURICreate

SetCreatedAt sets the "created_at" field.

func (*RedirectURICreate) SetID

SetID sets the "id" field.

func (*RedirectURICreate) SetModifiedAt

func (ruc *RedirectURICreate) SetModifiedAt(t time.Time) *RedirectURICreate

SetModifiedAt sets the "modified_at" field.

func (*RedirectURICreate) SetNillableCreatedAt

func (ruc *RedirectURICreate) SetNillableCreatedAt(t *time.Time) *RedirectURICreate

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

func (*RedirectURICreate) SetNillableModifiedAt

func (ruc *RedirectURICreate) SetNillableModifiedAt(t *time.Time) *RedirectURICreate

SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.

func (*RedirectURICreate) SetRelyingParty

func (ruc *RedirectURICreate) SetRelyingParty(r *RelyingParty) *RedirectURICreate

SetRelyingParty sets the "relying_party" edge to the RelyingParty entity.

func (*RedirectURICreate) SetRelyingPartyID

func (ruc *RedirectURICreate) SetRelyingPartyID(tpi typedef.RelyingPartyID) *RedirectURICreate

SetRelyingPartyID sets the "relying_party_id" field.

func (*RedirectURICreate) SetURI

func (ruc *RedirectURICreate) SetURI(s string) *RedirectURICreate

SetURI sets the "uri" field.

type RedirectURICreateBulk

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

RedirectURICreateBulk is the builder for creating many RedirectURI entities in bulk.

func (*RedirectURICreateBulk) Exec

func (rucb *RedirectURICreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RedirectURICreateBulk) ExecX

func (rucb *RedirectURICreateBulk) ExecX(ctx context.Context)

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

func (*RedirectURICreateBulk) Save

func (rucb *RedirectURICreateBulk) Save(ctx context.Context) ([]*RedirectURI, error)

Save creates the RedirectURI entities in the database.

func (*RedirectURICreateBulk) SaveX

func (rucb *RedirectURICreateBulk) SaveX(ctx context.Context) []*RedirectURI

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

type RedirectURIDelete

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

RedirectURIDelete is the builder for deleting a RedirectURI entity.

func (*RedirectURIDelete) Exec

func (rud *RedirectURIDelete) Exec(ctx context.Context) (int, error)

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

func (*RedirectURIDelete) ExecX

func (rud *RedirectURIDelete) ExecX(ctx context.Context) int

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

func (*RedirectURIDelete) Where

Where appends a list predicates to the RedirectURIDelete builder.

type RedirectURIDeleteOne

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

RedirectURIDeleteOne is the builder for deleting a single RedirectURI entity.

func (*RedirectURIDeleteOne) Exec

func (rudo *RedirectURIDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RedirectURIDeleteOne) ExecX

func (rudo *RedirectURIDeleteOne) ExecX(ctx context.Context)

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

func (*RedirectURIDeleteOne) Where

Where appends a list predicates to the RedirectURIDelete builder.

type RedirectURIEdges

type RedirectURIEdges struct {
	// RelyingParty holds the value of the relying_party edge.
	RelyingParty *RelyingParty `json:"relying_party,omitempty"`
	// contains filtered or unexported fields
}

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

func (RedirectURIEdges) RelyingPartyOrErr

func (e RedirectURIEdges) RelyingPartyOrErr() (*RelyingParty, error)

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

type RedirectURIGroupBy

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

RedirectURIGroupBy is the group-by builder for RedirectURI entities.

func (*RedirectURIGroupBy) Aggregate

func (rugb *RedirectURIGroupBy) Aggregate(fns ...AggregateFunc) *RedirectURIGroupBy

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

func (*RedirectURIGroupBy) Bool

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

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

func (*RedirectURIGroupBy) BoolX

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

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

func (*RedirectURIGroupBy) Bools

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

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

func (*RedirectURIGroupBy) BoolsX

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

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

func (*RedirectURIGroupBy) Float64

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

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

func (*RedirectURIGroupBy) Float64X

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

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

func (*RedirectURIGroupBy) Float64s

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

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

func (*RedirectURIGroupBy) Float64sX

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

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

func (*RedirectURIGroupBy) Int

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

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

func (*RedirectURIGroupBy) IntX

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

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

func (*RedirectURIGroupBy) Ints

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

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

func (*RedirectURIGroupBy) IntsX

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

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

func (*RedirectURIGroupBy) Scan

func (rugb *RedirectURIGroupBy) Scan(ctx context.Context, v any) error

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

func (*RedirectURIGroupBy) ScanX

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

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

func (*RedirectURIGroupBy) String

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

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

func (*RedirectURIGroupBy) StringX

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

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

func (*RedirectURIGroupBy) Strings

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

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

func (*RedirectURIGroupBy) StringsX

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

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

type RedirectURIMutation

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

RedirectURIMutation represents an operation that mutates the RedirectURI nodes in the graph.

func (*RedirectURIMutation) AddField

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) AddedEdges

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

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

func (*RedirectURIMutation) AddedField

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) AddedFields

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

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

func (*RedirectURIMutation) AddedIDs

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

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

func (*RedirectURIMutation) ClearEdge

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) ClearField

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) ClearRelyingParty

func (m *RedirectURIMutation) ClearRelyingParty()

ClearRelyingParty clears the "relying_party" edge to the RelyingParty entity.

func (*RedirectURIMutation) ClearedEdges

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

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

func (*RedirectURIMutation) ClearedFields

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

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

func (RedirectURIMutation) Client

func (m RedirectURIMutation) 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 (*RedirectURIMutation) CreatedAt

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

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

func (*RedirectURIMutation) EdgeCleared

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

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

func (*RedirectURIMutation) Field

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) FieldCleared

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

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

func (*RedirectURIMutation) Fields

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) ID

func (m *RedirectURIMutation) ID() (id typedef.RedirectURIID, 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 (*RedirectURIMutation) IDs

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 (*RedirectURIMutation) ModifiedAt

func (m *RedirectURIMutation) ModifiedAt() (r time.Time, exists bool)

ModifiedAt returns the value of the "modified_at" field in the mutation.

func (*RedirectURIMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the RedirectURI entity. If the RedirectURI 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 (*RedirectURIMutation) OldField

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) OldModifiedAt

func (m *RedirectURIMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)

OldModifiedAt returns the old "modified_at" field's value of the RedirectURI entity. If the RedirectURI 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 (*RedirectURIMutation) OldRelyingPartyID

func (m *RedirectURIMutation) OldRelyingPartyID(ctx context.Context) (v typedef.RelyingPartyID, err error)

OldRelyingPartyID returns the old "relying_party_id" field's value of the RedirectURI entity. If the RedirectURI 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 (*RedirectURIMutation) OldURI

func (m *RedirectURIMutation) OldURI(ctx context.Context) (v string, err error)

OldURI returns the old "uri" field's value of the RedirectURI entity. If the RedirectURI 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 (*RedirectURIMutation) Op

func (m *RedirectURIMutation) Op() Op

Op returns the operation name.

func (*RedirectURIMutation) RelyingPartyCleared

func (m *RedirectURIMutation) RelyingPartyCleared() bool

RelyingPartyCleared reports if the "relying_party" edge to the RelyingParty entity was cleared.

func (*RedirectURIMutation) RelyingPartyID

func (m *RedirectURIMutation) RelyingPartyID() (r typedef.RelyingPartyID, exists bool)

RelyingPartyID returns the value of the "relying_party_id" field in the mutation.

func (*RedirectURIMutation) RelyingPartyIDs

func (m *RedirectURIMutation) RelyingPartyIDs() (ids []typedef.RelyingPartyID)

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

func (*RedirectURIMutation) RemovedEdges

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

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

func (*RedirectURIMutation) RemovedIDs

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) ResetCreatedAt

func (m *RedirectURIMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RedirectURIMutation) ResetEdge

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) ResetField

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) ResetModifiedAt

func (m *RedirectURIMutation) ResetModifiedAt()

ResetModifiedAt resets all changes to the "modified_at" field.

func (*RedirectURIMutation) ResetRelyingParty

func (m *RedirectURIMutation) ResetRelyingParty()

ResetRelyingParty resets all changes to the "relying_party" edge.

func (*RedirectURIMutation) ResetRelyingPartyID

func (m *RedirectURIMutation) ResetRelyingPartyID()

ResetRelyingPartyID resets all changes to the "relying_party_id" field.

func (*RedirectURIMutation) ResetURI

func (m *RedirectURIMutation) ResetURI()

ResetURI resets all changes to the "uri" field.

func (*RedirectURIMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*RedirectURIMutation) SetField

func (m *RedirectURIMutation) 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 (*RedirectURIMutation) SetID

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

func (*RedirectURIMutation) SetModifiedAt

func (m *RedirectURIMutation) SetModifiedAt(t time.Time)

SetModifiedAt sets the "modified_at" field.

func (*RedirectURIMutation) SetOp

func (m *RedirectURIMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RedirectURIMutation) SetRelyingPartyID

func (m *RedirectURIMutation) SetRelyingPartyID(tpi typedef.RelyingPartyID)

SetRelyingPartyID sets the "relying_party_id" field.

func (*RedirectURIMutation) SetURI

func (m *RedirectURIMutation) SetURI(s string)

SetURI sets the "uri" field.

func (RedirectURIMutation) Tx

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

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

func (*RedirectURIMutation) Type

func (m *RedirectURIMutation) Type() string

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

func (*RedirectURIMutation) URI

func (m *RedirectURIMutation) URI() (r string, exists bool)

URI returns the value of the "uri" field in the mutation.

func (*RedirectURIMutation) Where

func (m *RedirectURIMutation) Where(ps ...predicate.RedirectURI)

Where appends a list predicates to the RedirectURIMutation builder.

func (*RedirectURIMutation) WhereP

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

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

type RedirectURIQuery

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

RedirectURIQuery is the builder for querying RedirectURI entities.

func (*RedirectURIQuery) Aggregate

func (ruq *RedirectURIQuery) Aggregate(fns ...AggregateFunc) *RedirectURISelect

Aggregate returns a RedirectURISelect configured with the given aggregations.

func (*RedirectURIQuery) All

func (ruq *RedirectURIQuery) All(ctx context.Context) ([]*RedirectURI, error)

All executes the query and returns a list of RedirectURIs.

func (*RedirectURIQuery) AllX

func (ruq *RedirectURIQuery) AllX(ctx context.Context) []*RedirectURI

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

func (*RedirectURIQuery) Clone

func (ruq *RedirectURIQuery) Clone() *RedirectURIQuery

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

func (*RedirectURIQuery) Count

func (ruq *RedirectURIQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RedirectURIQuery) CountX

func (ruq *RedirectURIQuery) CountX(ctx context.Context) int

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

func (*RedirectURIQuery) Exist

func (ruq *RedirectURIQuery) Exist(ctx context.Context) (bool, error)

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

func (*RedirectURIQuery) ExistX

func (ruq *RedirectURIQuery) ExistX(ctx context.Context) bool

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

func (*RedirectURIQuery) First

func (ruq *RedirectURIQuery) First(ctx context.Context) (*RedirectURI, error)

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

func (*RedirectURIQuery) FirstID

func (ruq *RedirectURIQuery) FirstID(ctx context.Context) (id typedef.RedirectURIID, err error)

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

func (*RedirectURIQuery) FirstIDX

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

func (*RedirectURIQuery) FirstX

func (ruq *RedirectURIQuery) FirstX(ctx context.Context) *RedirectURI

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

func (*RedirectURIQuery) ForShare

func (ruq *RedirectURIQuery) ForShare(opts ...sql.LockOption) *RedirectURIQuery

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 (*RedirectURIQuery) ForUpdate

func (ruq *RedirectURIQuery) ForUpdate(opts ...sql.LockOption) *RedirectURIQuery

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 (*RedirectURIQuery) GroupBy

func (ruq *RedirectURIQuery) GroupBy(field string, fields ...string) *RedirectURIGroupBy

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 {
	URI string `json:"uri,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RedirectURI.Query().
	GroupBy(redirecturi.FieldURI).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RedirectURIQuery) IDs

func (ruq *RedirectURIQuery) IDs(ctx context.Context) (ids []typedef.RedirectURIID, err error)

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

func (*RedirectURIQuery) IDsX

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

func (*RedirectURIQuery) Limit

func (ruq *RedirectURIQuery) Limit(limit int) *RedirectURIQuery

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

func (*RedirectURIQuery) Offset

func (ruq *RedirectURIQuery) Offset(offset int) *RedirectURIQuery

Offset to start from.

func (*RedirectURIQuery) Only

func (ruq *RedirectURIQuery) Only(ctx context.Context) (*RedirectURI, error)

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

func (*RedirectURIQuery) OnlyID

func (ruq *RedirectURIQuery) OnlyID(ctx context.Context) (id typedef.RedirectURIID, err error)

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

func (*RedirectURIQuery) OnlyIDX

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

func (*RedirectURIQuery) OnlyX

func (ruq *RedirectURIQuery) OnlyX(ctx context.Context) *RedirectURI

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

func (*RedirectURIQuery) Order

Order specifies how the records should be ordered.

func (*RedirectURIQuery) QueryRelyingParty

func (ruq *RedirectURIQuery) QueryRelyingParty() *RelyingPartyQuery

QueryRelyingParty chains the current query on the "relying_party" edge.

func (*RedirectURIQuery) Select

func (ruq *RedirectURIQuery) Select(fields ...string) *RedirectURISelect

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 {
	URI string `json:"uri,omitempty"`
}

client.RedirectURI.Query().
	Select(redirecturi.FieldURI).
	Scan(ctx, &v)

func (*RedirectURIQuery) Unique

func (ruq *RedirectURIQuery) Unique(unique bool) *RedirectURIQuery

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 (*RedirectURIQuery) Where

Where adds a new predicate for the RedirectURIQuery builder.

func (*RedirectURIQuery) WithRelyingParty

func (ruq *RedirectURIQuery) WithRelyingParty(opts ...func(*RelyingPartyQuery)) *RedirectURIQuery

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

type RedirectURISelect

type RedirectURISelect struct {
	*RedirectURIQuery
	// contains filtered or unexported fields
}

RedirectURISelect is the builder for selecting fields of RedirectURI entities.

func (*RedirectURISelect) Aggregate

func (rus *RedirectURISelect) Aggregate(fns ...AggregateFunc) *RedirectURISelect

Aggregate adds the given aggregation functions to the selector query.

func (*RedirectURISelect) Bool

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

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

func (*RedirectURISelect) BoolX

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

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

func (*RedirectURISelect) Bools

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

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

func (*RedirectURISelect) BoolsX

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

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

func (*RedirectURISelect) Float64

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

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

func (*RedirectURISelect) Float64X

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

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

func (*RedirectURISelect) Float64s

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

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

func (*RedirectURISelect) Float64sX

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

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

func (*RedirectURISelect) Int

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

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

func (*RedirectURISelect) IntX

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

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

func (*RedirectURISelect) Ints

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

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

func (*RedirectURISelect) IntsX

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

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

func (*RedirectURISelect) Scan

func (rus *RedirectURISelect) Scan(ctx context.Context, v any) error

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

func (*RedirectURISelect) ScanX

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

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

func (*RedirectURISelect) String

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

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

func (*RedirectURISelect) StringX

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

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

func (*RedirectURISelect) Strings

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

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

func (*RedirectURISelect) StringsX

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

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

type RedirectURIUpdate

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

RedirectURIUpdate is the builder for updating RedirectURI entities.

func (*RedirectURIUpdate) Exec

func (ruu *RedirectURIUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RedirectURIUpdate) ExecX

func (ruu *RedirectURIUpdate) ExecX(ctx context.Context)

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

func (*RedirectURIUpdate) Mutation

func (ruu *RedirectURIUpdate) Mutation() *RedirectURIMutation

Mutation returns the RedirectURIMutation object of the builder.

func (*RedirectURIUpdate) Save

func (ruu *RedirectURIUpdate) Save(ctx context.Context) (int, error)

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

func (*RedirectURIUpdate) SaveX

func (ruu *RedirectURIUpdate) SaveX(ctx context.Context) int

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

func (*RedirectURIUpdate) SetModifiedAt

func (ruu *RedirectURIUpdate) SetModifiedAt(t time.Time) *RedirectURIUpdate

SetModifiedAt sets the "modified_at" field.

func (*RedirectURIUpdate) SetNillableURI

func (ruu *RedirectURIUpdate) SetNillableURI(s *string) *RedirectURIUpdate

SetNillableURI sets the "uri" field if the given value is not nil.

func (*RedirectURIUpdate) SetURI

func (ruu *RedirectURIUpdate) SetURI(s string) *RedirectURIUpdate

SetURI sets the "uri" field.

func (*RedirectURIUpdate) Where

Where appends a list predicates to the RedirectURIUpdate builder.

type RedirectURIUpdateOne

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

RedirectURIUpdateOne is the builder for updating a single RedirectURI entity.

func (*RedirectURIUpdateOne) Exec

func (ruuo *RedirectURIUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RedirectURIUpdateOne) ExecX

func (ruuo *RedirectURIUpdateOne) ExecX(ctx context.Context)

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

func (*RedirectURIUpdateOne) Mutation

func (ruuo *RedirectURIUpdateOne) Mutation() *RedirectURIMutation

Mutation returns the RedirectURIMutation object of the builder.

func (*RedirectURIUpdateOne) Save

Save executes the query and returns the updated RedirectURI entity.

func (*RedirectURIUpdateOne) SaveX

func (ruuo *RedirectURIUpdateOne) SaveX(ctx context.Context) *RedirectURI

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

func (*RedirectURIUpdateOne) Select

func (ruuo *RedirectURIUpdateOne) Select(field string, fields ...string) *RedirectURIUpdateOne

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

func (*RedirectURIUpdateOne) SetModifiedAt

func (ruuo *RedirectURIUpdateOne) SetModifiedAt(t time.Time) *RedirectURIUpdateOne

SetModifiedAt sets the "modified_at" field.

func (*RedirectURIUpdateOne) SetNillableURI

func (ruuo *RedirectURIUpdateOne) SetNillableURI(s *string) *RedirectURIUpdateOne

SetNillableURI sets the "uri" field if the given value is not nil.

func (*RedirectURIUpdateOne) SetURI

SetURI sets the "uri" field.

func (*RedirectURIUpdateOne) Where

Where appends a list predicates to the RedirectURIUpdate builder.

type RedirectURIs

type RedirectURIs []*RedirectURI

RedirectURIs is a parsable slice of RedirectURI.

type RelyingParties

type RelyingParties []*RelyingParty

RelyingParties is a parsable slice of RelyingParty.

type RelyingParty

type RelyingParty struct {

	// ID of the ent.
	ID typedef.RelyingPartyID `json:"id,omitempty"`
	// ClientID holds the value of the "client_id" field.
	ClientID typedef.ClientID `json:"client_id,omitempty"`
	// ClientSecret holds the value of the "client_secret" field.
	ClientSecret string `json:"-"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ModifiedAt holds the value of the "modified_at" field.
	ModifiedAt time.Time `json:"modified_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RelyingPartyQuery when eager-loading is set.
	Edges RelyingPartyEdges `json:"edges"`
	// contains filtered or unexported fields
}

RelyingParty is the model entity for the RelyingParty schema.

func (*RelyingParty) QueryAuthCodes

func (rp *RelyingParty) QueryAuthCodes() *AuthCodeQuery

QueryAuthCodes queries the "auth_codes" edge of the RelyingParty entity.

func (*RelyingParty) QueryRedirectUris

func (rp *RelyingParty) QueryRedirectUris() *RedirectURIQuery

QueryRedirectUris queries the "redirect_uris" edge of the RelyingParty entity.

func (*RelyingParty) String

func (rp *RelyingParty) String() string

String implements the fmt.Stringer.

func (*RelyingParty) Unwrap

func (rp *RelyingParty) Unwrap() *RelyingParty

Unwrap unwraps the RelyingParty 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 (*RelyingParty) Update

func (rp *RelyingParty) Update() *RelyingPartyUpdateOne

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

func (*RelyingParty) Value

func (rp *RelyingParty) Value(name string) (ent.Value, error)

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

type RelyingPartyClient

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

RelyingPartyClient is a client for the RelyingParty schema.

func NewRelyingPartyClient

func NewRelyingPartyClient(c config) *RelyingPartyClient

NewRelyingPartyClient returns a client for the RelyingParty from the given config.

func (*RelyingPartyClient) Create

Create returns a builder for creating a RelyingParty entity.

func (*RelyingPartyClient) CreateBulk

func (c *RelyingPartyClient) CreateBulk(builders ...*RelyingPartyCreate) *RelyingPartyCreateBulk

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

func (*RelyingPartyClient) Delete

Delete returns a delete builder for RelyingParty.

func (*RelyingPartyClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RelyingPartyClient) DeleteOneID

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

func (*RelyingPartyClient) Get

Get returns a RelyingParty entity by its id.

func (*RelyingPartyClient) GetX

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

func (*RelyingPartyClient) Hooks

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

Hooks returns the client hooks.

func (*RelyingPartyClient) Intercept

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

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

func (*RelyingPartyClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RelyingPartyClient) MapCreateBulk

func (c *RelyingPartyClient) MapCreateBulk(slice any, setFunc func(*RelyingPartyCreate, int)) *RelyingPartyCreateBulk

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 (*RelyingPartyClient) Query

Query returns a query builder for RelyingParty.

func (*RelyingPartyClient) QueryAuthCodes

func (c *RelyingPartyClient) QueryAuthCodes(rp *RelyingParty) *AuthCodeQuery

QueryAuthCodes queries the auth_codes edge of a RelyingParty.

func (*RelyingPartyClient) QueryRedirectUris

func (c *RelyingPartyClient) QueryRedirectUris(rp *RelyingParty) *RedirectURIQuery

QueryRedirectUris queries the redirect_uris edge of a RelyingParty.

func (*RelyingPartyClient) Update

Update returns an update builder for RelyingParty.

func (*RelyingPartyClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RelyingPartyClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RelyingPartyClient) Use

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

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

type RelyingPartyCreate

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

RelyingPartyCreate is the builder for creating a RelyingParty entity.

func (*RelyingPartyCreate) AddAuthCodeIDs

func (rpc *RelyingPartyCreate) AddAuthCodeIDs(ids ...typedef.AuthCodeID) *RelyingPartyCreate

AddAuthCodeIDs adds the "auth_codes" edge to the AuthCode entity by IDs.

func (*RelyingPartyCreate) AddAuthCodes

func (rpc *RelyingPartyCreate) AddAuthCodes(a ...*AuthCode) *RelyingPartyCreate

AddAuthCodes adds the "auth_codes" edges to the AuthCode entity.

func (*RelyingPartyCreate) AddRedirectURIIDs

func (rpc *RelyingPartyCreate) AddRedirectURIIDs(ids ...typedef.RedirectURIID) *RelyingPartyCreate

AddRedirectURIIDs adds the "redirect_uris" edge to the RedirectURI entity by IDs.

func (*RelyingPartyCreate) AddRedirectUris

func (rpc *RelyingPartyCreate) AddRedirectUris(r ...*RedirectURI) *RelyingPartyCreate

AddRedirectUris adds the "redirect_uris" edges to the RedirectURI entity.

func (*RelyingPartyCreate) Exec

func (rpc *RelyingPartyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RelyingPartyCreate) ExecX

func (rpc *RelyingPartyCreate) ExecX(ctx context.Context)

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

func (*RelyingPartyCreate) Mutation

func (rpc *RelyingPartyCreate) Mutation() *RelyingPartyMutation

Mutation returns the RelyingPartyMutation object of the builder.

func (*RelyingPartyCreate) Save

Save creates the RelyingParty in the database.

func (*RelyingPartyCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RelyingPartyCreate) SetClientID

func (rpc *RelyingPartyCreate) SetClientID(ti typedef.ClientID) *RelyingPartyCreate

SetClientID sets the "client_id" field.

func (*RelyingPartyCreate) SetClientSecret

func (rpc *RelyingPartyCreate) SetClientSecret(s string) *RelyingPartyCreate

SetClientSecret sets the "client_secret" field.

func (*RelyingPartyCreate) SetCreatedAt

func (rpc *RelyingPartyCreate) SetCreatedAt(t time.Time) *RelyingPartyCreate

SetCreatedAt sets the "created_at" field.

func (*RelyingPartyCreate) SetID

SetID sets the "id" field.

func (*RelyingPartyCreate) SetModifiedAt

func (rpc *RelyingPartyCreate) SetModifiedAt(t time.Time) *RelyingPartyCreate

SetModifiedAt sets the "modified_at" field.

func (*RelyingPartyCreate) SetNillableCreatedAt

func (rpc *RelyingPartyCreate) SetNillableCreatedAt(t *time.Time) *RelyingPartyCreate

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

func (*RelyingPartyCreate) SetNillableModifiedAt

func (rpc *RelyingPartyCreate) SetNillableModifiedAt(t *time.Time) *RelyingPartyCreate

SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.

type RelyingPartyCreateBulk

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

RelyingPartyCreateBulk is the builder for creating many RelyingParty entities in bulk.

func (*RelyingPartyCreateBulk) Exec

func (rpcb *RelyingPartyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RelyingPartyCreateBulk) ExecX

func (rpcb *RelyingPartyCreateBulk) ExecX(ctx context.Context)

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

func (*RelyingPartyCreateBulk) Save

Save creates the RelyingParty entities in the database.

func (*RelyingPartyCreateBulk) SaveX

func (rpcb *RelyingPartyCreateBulk) SaveX(ctx context.Context) []*RelyingParty

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

type RelyingPartyDelete

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

RelyingPartyDelete is the builder for deleting a RelyingParty entity.

func (*RelyingPartyDelete) Exec

func (rpd *RelyingPartyDelete) Exec(ctx context.Context) (int, error)

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

func (*RelyingPartyDelete) ExecX

func (rpd *RelyingPartyDelete) ExecX(ctx context.Context) int

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

func (*RelyingPartyDelete) Where

Where appends a list predicates to the RelyingPartyDelete builder.

type RelyingPartyDeleteOne

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

RelyingPartyDeleteOne is the builder for deleting a single RelyingParty entity.

func (*RelyingPartyDeleteOne) Exec

func (rpdo *RelyingPartyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RelyingPartyDeleteOne) ExecX

func (rpdo *RelyingPartyDeleteOne) ExecX(ctx context.Context)

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

func (*RelyingPartyDeleteOne) Where

Where appends a list predicates to the RelyingPartyDelete builder.

type RelyingPartyEdges

type RelyingPartyEdges struct {
	// AuthCodes holds the value of the auth_codes edge.
	AuthCodes []*AuthCode `json:"auth_codes,omitempty"`
	// RedirectUris holds the value of the redirect_uris edge.
	RedirectUris []*RedirectURI `json:"redirect_uris,omitempty"`
	// contains filtered or unexported fields
}

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

func (RelyingPartyEdges) AuthCodesOrErr

func (e RelyingPartyEdges) AuthCodesOrErr() ([]*AuthCode, error)

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

func (RelyingPartyEdges) RedirectUrisOrErr

func (e RelyingPartyEdges) RedirectUrisOrErr() ([]*RedirectURI, error)

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

type RelyingPartyGroupBy

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

RelyingPartyGroupBy is the group-by builder for RelyingParty entities.

func (*RelyingPartyGroupBy) Aggregate

func (rpgb *RelyingPartyGroupBy) Aggregate(fns ...AggregateFunc) *RelyingPartyGroupBy

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

func (*RelyingPartyGroupBy) Bool

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

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

func (*RelyingPartyGroupBy) BoolX

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

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

func (*RelyingPartyGroupBy) Bools

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

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

func (*RelyingPartyGroupBy) BoolsX

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

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

func (*RelyingPartyGroupBy) Float64

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

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

func (*RelyingPartyGroupBy) Float64X

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

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

func (*RelyingPartyGroupBy) Float64s

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

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

func (*RelyingPartyGroupBy) Float64sX

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

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

func (*RelyingPartyGroupBy) Int

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

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

func (*RelyingPartyGroupBy) IntX

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

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

func (*RelyingPartyGroupBy) Ints

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

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

func (*RelyingPartyGroupBy) IntsX

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

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

func (*RelyingPartyGroupBy) Scan

func (rpgb *RelyingPartyGroupBy) Scan(ctx context.Context, v any) error

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

func (*RelyingPartyGroupBy) ScanX

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

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

func (*RelyingPartyGroupBy) String

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

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

func (*RelyingPartyGroupBy) StringX

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

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

func (*RelyingPartyGroupBy) Strings

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

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

func (*RelyingPartyGroupBy) StringsX

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

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

type RelyingPartyMutation

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

RelyingPartyMutation represents an operation that mutates the RelyingParty nodes in the graph.

func (*RelyingPartyMutation) AddAuthCodeIDs

func (m *RelyingPartyMutation) AddAuthCodeIDs(ids ...typedef.AuthCodeID)

AddAuthCodeIDs adds the "auth_codes" edge to the AuthCode entity by ids.

func (*RelyingPartyMutation) AddField

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) AddRedirectURIIDs

func (m *RelyingPartyMutation) AddRedirectURIIDs(ids ...typedef.RedirectURIID)

AddRedirectURIIDs adds the "redirect_uris" edge to the RedirectURI entity by ids.

func (*RelyingPartyMutation) AddedEdges

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

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

func (*RelyingPartyMutation) AddedField

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) AddedFields

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

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

func (*RelyingPartyMutation) AddedIDs

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

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

func (*RelyingPartyMutation) AuthCodesCleared

func (m *RelyingPartyMutation) AuthCodesCleared() bool

AuthCodesCleared reports if the "auth_codes" edge to the AuthCode entity was cleared.

func (*RelyingPartyMutation) AuthCodesIDs

func (m *RelyingPartyMutation) AuthCodesIDs() (ids []typedef.AuthCodeID)

AuthCodesIDs returns the "auth_codes" edge IDs in the mutation.

func (*RelyingPartyMutation) ClearAuthCodes

func (m *RelyingPartyMutation) ClearAuthCodes()

ClearAuthCodes clears the "auth_codes" edge to the AuthCode entity.

func (*RelyingPartyMutation) ClearEdge

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) ClearField

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) ClearRedirectUris

func (m *RelyingPartyMutation) ClearRedirectUris()

ClearRedirectUris clears the "redirect_uris" edge to the RedirectURI entity.

func (*RelyingPartyMutation) ClearedEdges

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

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

func (*RelyingPartyMutation) ClearedFields

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

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

func (RelyingPartyMutation) Client

func (m RelyingPartyMutation) 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 (*RelyingPartyMutation) ClientID

func (m *RelyingPartyMutation) ClientID() (r typedef.ClientID, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*RelyingPartyMutation) ClientSecret

func (m *RelyingPartyMutation) ClientSecret() (r string, exists bool)

ClientSecret returns the value of the "client_secret" field in the mutation.

func (*RelyingPartyMutation) CreatedAt

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

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

func (*RelyingPartyMutation) EdgeCleared

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

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

func (*RelyingPartyMutation) Field

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) FieldCleared

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

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

func (*RelyingPartyMutation) Fields

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) ID

func (m *RelyingPartyMutation) ID() (id typedef.RelyingPartyID, 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 (*RelyingPartyMutation) IDs

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 (*RelyingPartyMutation) ModifiedAt

func (m *RelyingPartyMutation) ModifiedAt() (r time.Time, exists bool)

ModifiedAt returns the value of the "modified_at" field in the mutation.

func (*RelyingPartyMutation) OldClientID

func (m *RelyingPartyMutation) OldClientID(ctx context.Context) (v typedef.ClientID, err error)

OldClientID returns the old "client_id" field's value of the RelyingParty entity. If the RelyingParty 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 (*RelyingPartyMutation) OldClientSecret

func (m *RelyingPartyMutation) OldClientSecret(ctx context.Context) (v string, err error)

OldClientSecret returns the old "client_secret" field's value of the RelyingParty entity. If the RelyingParty 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 (*RelyingPartyMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the RelyingParty entity. If the RelyingParty 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 (*RelyingPartyMutation) OldField

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) OldModifiedAt

func (m *RelyingPartyMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)

OldModifiedAt returns the old "modified_at" field's value of the RelyingParty entity. If the RelyingParty 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 (*RelyingPartyMutation) Op

func (m *RelyingPartyMutation) Op() Op

Op returns the operation name.

func (*RelyingPartyMutation) RedirectUrisCleared

func (m *RelyingPartyMutation) RedirectUrisCleared() bool

RedirectUrisCleared reports if the "redirect_uris" edge to the RedirectURI entity was cleared.

func (*RelyingPartyMutation) RedirectUrisIDs

func (m *RelyingPartyMutation) RedirectUrisIDs() (ids []typedef.RedirectURIID)

RedirectUrisIDs returns the "redirect_uris" edge IDs in the mutation.

func (*RelyingPartyMutation) RemoveAuthCodeIDs

func (m *RelyingPartyMutation) RemoveAuthCodeIDs(ids ...typedef.AuthCodeID)

RemoveAuthCodeIDs removes the "auth_codes" edge to the AuthCode entity by IDs.

func (*RelyingPartyMutation) RemoveRedirectURIIDs

func (m *RelyingPartyMutation) RemoveRedirectURIIDs(ids ...typedef.RedirectURIID)

RemoveRedirectURIIDs removes the "redirect_uris" edge to the RedirectURI entity by IDs.

func (*RelyingPartyMutation) RemovedAuthCodesIDs

func (m *RelyingPartyMutation) RemovedAuthCodesIDs() (ids []typedef.AuthCodeID)

RemovedAuthCodes returns the removed IDs of the "auth_codes" edge to the AuthCode entity.

func (*RelyingPartyMutation) RemovedEdges

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

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

func (*RelyingPartyMutation) RemovedIDs

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) RemovedRedirectUrisIDs

func (m *RelyingPartyMutation) RemovedRedirectUrisIDs() (ids []typedef.RedirectURIID)

RemovedRedirectUris returns the removed IDs of the "redirect_uris" edge to the RedirectURI entity.

func (*RelyingPartyMutation) ResetAuthCodes

func (m *RelyingPartyMutation) ResetAuthCodes()

ResetAuthCodes resets all changes to the "auth_codes" edge.

func (*RelyingPartyMutation) ResetClientID

func (m *RelyingPartyMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*RelyingPartyMutation) ResetClientSecret

func (m *RelyingPartyMutation) ResetClientSecret()

ResetClientSecret resets all changes to the "client_secret" field.

func (*RelyingPartyMutation) ResetCreatedAt

func (m *RelyingPartyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RelyingPartyMutation) ResetEdge

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) ResetField

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) ResetModifiedAt

func (m *RelyingPartyMutation) ResetModifiedAt()

ResetModifiedAt resets all changes to the "modified_at" field.

func (*RelyingPartyMutation) ResetRedirectUris

func (m *RelyingPartyMutation) ResetRedirectUris()

ResetRedirectUris resets all changes to the "redirect_uris" edge.

func (*RelyingPartyMutation) SetClientID

func (m *RelyingPartyMutation) SetClientID(ti typedef.ClientID)

SetClientID sets the "client_id" field.

func (*RelyingPartyMutation) SetClientSecret

func (m *RelyingPartyMutation) SetClientSecret(s string)

SetClientSecret sets the "client_secret" field.

func (*RelyingPartyMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*RelyingPartyMutation) SetField

func (m *RelyingPartyMutation) 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 (*RelyingPartyMutation) SetID

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

func (*RelyingPartyMutation) SetModifiedAt

func (m *RelyingPartyMutation) SetModifiedAt(t time.Time)

SetModifiedAt sets the "modified_at" field.

func (*RelyingPartyMutation) SetOp

func (m *RelyingPartyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (RelyingPartyMutation) Tx

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

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

func (*RelyingPartyMutation) Type

func (m *RelyingPartyMutation) Type() string

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

func (*RelyingPartyMutation) Where

Where appends a list predicates to the RelyingPartyMutation builder.

func (*RelyingPartyMutation) WhereP

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

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

type RelyingPartyQuery

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

RelyingPartyQuery is the builder for querying RelyingParty entities.

func (*RelyingPartyQuery) Aggregate

func (rpq *RelyingPartyQuery) Aggregate(fns ...AggregateFunc) *RelyingPartySelect

Aggregate returns a RelyingPartySelect configured with the given aggregations.

func (*RelyingPartyQuery) All

func (rpq *RelyingPartyQuery) All(ctx context.Context) ([]*RelyingParty, error)

All executes the query and returns a list of RelyingParties.

func (*RelyingPartyQuery) AllX

func (rpq *RelyingPartyQuery) AllX(ctx context.Context) []*RelyingParty

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

func (*RelyingPartyQuery) Clone

func (rpq *RelyingPartyQuery) Clone() *RelyingPartyQuery

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

func (*RelyingPartyQuery) Count

func (rpq *RelyingPartyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RelyingPartyQuery) CountX

func (rpq *RelyingPartyQuery) CountX(ctx context.Context) int

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

func (*RelyingPartyQuery) Exist

func (rpq *RelyingPartyQuery) Exist(ctx context.Context) (bool, error)

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

func (*RelyingPartyQuery) ExistX

func (rpq *RelyingPartyQuery) ExistX(ctx context.Context) bool

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

func (*RelyingPartyQuery) First

func (rpq *RelyingPartyQuery) First(ctx context.Context) (*RelyingParty, error)

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

func (*RelyingPartyQuery) FirstID

func (rpq *RelyingPartyQuery) FirstID(ctx context.Context) (id typedef.RelyingPartyID, err error)

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

func (*RelyingPartyQuery) FirstIDX

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

func (*RelyingPartyQuery) FirstX

func (rpq *RelyingPartyQuery) FirstX(ctx context.Context) *RelyingParty

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

func (*RelyingPartyQuery) ForShare

func (rpq *RelyingPartyQuery) ForShare(opts ...sql.LockOption) *RelyingPartyQuery

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 (*RelyingPartyQuery) ForUpdate

func (rpq *RelyingPartyQuery) ForUpdate(opts ...sql.LockOption) *RelyingPartyQuery

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 (*RelyingPartyQuery) GroupBy

func (rpq *RelyingPartyQuery) GroupBy(field string, fields ...string) *RelyingPartyGroupBy

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 {
	ClientID typedef.ClientID `json:"client_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RelyingParty.Query().
	GroupBy(relyingparty.FieldClientID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RelyingPartyQuery) IDs

func (rpq *RelyingPartyQuery) IDs(ctx context.Context) (ids []typedef.RelyingPartyID, err error)

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

func (*RelyingPartyQuery) IDsX

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

func (*RelyingPartyQuery) Limit

func (rpq *RelyingPartyQuery) Limit(limit int) *RelyingPartyQuery

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

func (*RelyingPartyQuery) Offset

func (rpq *RelyingPartyQuery) Offset(offset int) *RelyingPartyQuery

Offset to start from.

func (*RelyingPartyQuery) Only

func (rpq *RelyingPartyQuery) Only(ctx context.Context) (*RelyingParty, error)

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

func (*RelyingPartyQuery) OnlyID

func (rpq *RelyingPartyQuery) OnlyID(ctx context.Context) (id typedef.RelyingPartyID, err error)

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

func (*RelyingPartyQuery) OnlyIDX

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

func (*RelyingPartyQuery) OnlyX

func (rpq *RelyingPartyQuery) OnlyX(ctx context.Context) *RelyingParty

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

func (*RelyingPartyQuery) Order

Order specifies how the records should be ordered.

func (*RelyingPartyQuery) QueryAuthCodes

func (rpq *RelyingPartyQuery) QueryAuthCodes() *AuthCodeQuery

QueryAuthCodes chains the current query on the "auth_codes" edge.

func (*RelyingPartyQuery) QueryRedirectUris

func (rpq *RelyingPartyQuery) QueryRedirectUris() *RedirectURIQuery

QueryRedirectUris chains the current query on the "redirect_uris" edge.

func (*RelyingPartyQuery) Select

func (rpq *RelyingPartyQuery) Select(fields ...string) *RelyingPartySelect

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 {
	ClientID typedef.ClientID `json:"client_id,omitempty"`
}

client.RelyingParty.Query().
	Select(relyingparty.FieldClientID).
	Scan(ctx, &v)

func (*RelyingPartyQuery) Unique

func (rpq *RelyingPartyQuery) Unique(unique bool) *RelyingPartyQuery

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 (*RelyingPartyQuery) Where

Where adds a new predicate for the RelyingPartyQuery builder.

func (*RelyingPartyQuery) WithAuthCodes

func (rpq *RelyingPartyQuery) WithAuthCodes(opts ...func(*AuthCodeQuery)) *RelyingPartyQuery

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

func (*RelyingPartyQuery) WithRedirectUris

func (rpq *RelyingPartyQuery) WithRedirectUris(opts ...func(*RedirectURIQuery)) *RelyingPartyQuery

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

type RelyingPartySelect

type RelyingPartySelect struct {
	*RelyingPartyQuery
	// contains filtered or unexported fields
}

RelyingPartySelect is the builder for selecting fields of RelyingParty entities.

func (*RelyingPartySelect) Aggregate

func (rps *RelyingPartySelect) Aggregate(fns ...AggregateFunc) *RelyingPartySelect

Aggregate adds the given aggregation functions to the selector query.

func (*RelyingPartySelect) Bool

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

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

func (*RelyingPartySelect) BoolX

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

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

func (*RelyingPartySelect) Bools

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

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

func (*RelyingPartySelect) BoolsX

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

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

func (*RelyingPartySelect) Float64

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

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

func (*RelyingPartySelect) Float64X

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

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

func (*RelyingPartySelect) Float64s

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

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

func (*RelyingPartySelect) Float64sX

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

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

func (*RelyingPartySelect) Int

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

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

func (*RelyingPartySelect) IntX

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

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

func (*RelyingPartySelect) Ints

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

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

func (*RelyingPartySelect) IntsX

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

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

func (*RelyingPartySelect) Scan

func (rps *RelyingPartySelect) Scan(ctx context.Context, v any) error

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

func (*RelyingPartySelect) ScanX

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

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

func (*RelyingPartySelect) String

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

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

func (*RelyingPartySelect) StringX

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

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

func (*RelyingPartySelect) Strings

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

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

func (*RelyingPartySelect) StringsX

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

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

type RelyingPartyUpdate

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

RelyingPartyUpdate is the builder for updating RelyingParty entities.

func (*RelyingPartyUpdate) AddAuthCodeIDs

func (rpu *RelyingPartyUpdate) AddAuthCodeIDs(ids ...typedef.AuthCodeID) *RelyingPartyUpdate

AddAuthCodeIDs adds the "auth_codes" edge to the AuthCode entity by IDs.

func (*RelyingPartyUpdate) AddAuthCodes

func (rpu *RelyingPartyUpdate) AddAuthCodes(a ...*AuthCode) *RelyingPartyUpdate

AddAuthCodes adds the "auth_codes" edges to the AuthCode entity.

func (*RelyingPartyUpdate) AddRedirectURIIDs

func (rpu *RelyingPartyUpdate) AddRedirectURIIDs(ids ...typedef.RedirectURIID) *RelyingPartyUpdate

AddRedirectURIIDs adds the "redirect_uris" edge to the RedirectURI entity by IDs.

func (*RelyingPartyUpdate) AddRedirectUris

func (rpu *RelyingPartyUpdate) AddRedirectUris(r ...*RedirectURI) *RelyingPartyUpdate

AddRedirectUris adds the "redirect_uris" edges to the RedirectURI entity.

func (*RelyingPartyUpdate) ClearAuthCodes

func (rpu *RelyingPartyUpdate) ClearAuthCodes() *RelyingPartyUpdate

ClearAuthCodes clears all "auth_codes" edges to the AuthCode entity.

func (*RelyingPartyUpdate) ClearRedirectUris

func (rpu *RelyingPartyUpdate) ClearRedirectUris() *RelyingPartyUpdate

ClearRedirectUris clears all "redirect_uris" edges to the RedirectURI entity.

func (*RelyingPartyUpdate) Exec

func (rpu *RelyingPartyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RelyingPartyUpdate) ExecX

func (rpu *RelyingPartyUpdate) ExecX(ctx context.Context)

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

func (*RelyingPartyUpdate) Mutation

func (rpu *RelyingPartyUpdate) Mutation() *RelyingPartyMutation

Mutation returns the RelyingPartyMutation object of the builder.

func (*RelyingPartyUpdate) RemoveAuthCodeIDs

func (rpu *RelyingPartyUpdate) RemoveAuthCodeIDs(ids ...typedef.AuthCodeID) *RelyingPartyUpdate

RemoveAuthCodeIDs removes the "auth_codes" edge to AuthCode entities by IDs.

func (*RelyingPartyUpdate) RemoveAuthCodes

func (rpu *RelyingPartyUpdate) RemoveAuthCodes(a ...*AuthCode) *RelyingPartyUpdate

RemoveAuthCodes removes "auth_codes" edges to AuthCode entities.

func (*RelyingPartyUpdate) RemoveRedirectURIIDs

func (rpu *RelyingPartyUpdate) RemoveRedirectURIIDs(ids ...typedef.RedirectURIID) *RelyingPartyUpdate

RemoveRedirectURIIDs removes the "redirect_uris" edge to RedirectURI entities by IDs.

func (*RelyingPartyUpdate) RemoveRedirectUris

func (rpu *RelyingPartyUpdate) RemoveRedirectUris(r ...*RedirectURI) *RelyingPartyUpdate

RemoveRedirectUris removes "redirect_uris" edges to RedirectURI entities.

func (*RelyingPartyUpdate) Save

func (rpu *RelyingPartyUpdate) Save(ctx context.Context) (int, error)

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

func (*RelyingPartyUpdate) SaveX

func (rpu *RelyingPartyUpdate) SaveX(ctx context.Context) int

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

func (*RelyingPartyUpdate) SetClientSecret

func (rpu *RelyingPartyUpdate) SetClientSecret(s string) *RelyingPartyUpdate

SetClientSecret sets the "client_secret" field.

func (*RelyingPartyUpdate) SetModifiedAt

func (rpu *RelyingPartyUpdate) SetModifiedAt(t time.Time) *RelyingPartyUpdate

SetModifiedAt sets the "modified_at" field.

func (*RelyingPartyUpdate) SetNillableClientSecret

func (rpu *RelyingPartyUpdate) SetNillableClientSecret(s *string) *RelyingPartyUpdate

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*RelyingPartyUpdate) Where

Where appends a list predicates to the RelyingPartyUpdate builder.

type RelyingPartyUpdateOne

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

RelyingPartyUpdateOne is the builder for updating a single RelyingParty entity.

func (*RelyingPartyUpdateOne) AddAuthCodeIDs

func (rpuo *RelyingPartyUpdateOne) AddAuthCodeIDs(ids ...typedef.AuthCodeID) *RelyingPartyUpdateOne

AddAuthCodeIDs adds the "auth_codes" edge to the AuthCode entity by IDs.

func (*RelyingPartyUpdateOne) AddAuthCodes

func (rpuo *RelyingPartyUpdateOne) AddAuthCodes(a ...*AuthCode) *RelyingPartyUpdateOne

AddAuthCodes adds the "auth_codes" edges to the AuthCode entity.

func (*RelyingPartyUpdateOne) AddRedirectURIIDs

func (rpuo *RelyingPartyUpdateOne) AddRedirectURIIDs(ids ...typedef.RedirectURIID) *RelyingPartyUpdateOne

AddRedirectURIIDs adds the "redirect_uris" edge to the RedirectURI entity by IDs.

func (*RelyingPartyUpdateOne) AddRedirectUris

func (rpuo *RelyingPartyUpdateOne) AddRedirectUris(r ...*RedirectURI) *RelyingPartyUpdateOne

AddRedirectUris adds the "redirect_uris" edges to the RedirectURI entity.

func (*RelyingPartyUpdateOne) ClearAuthCodes

func (rpuo *RelyingPartyUpdateOne) ClearAuthCodes() *RelyingPartyUpdateOne

ClearAuthCodes clears all "auth_codes" edges to the AuthCode entity.

func (*RelyingPartyUpdateOne) ClearRedirectUris

func (rpuo *RelyingPartyUpdateOne) ClearRedirectUris() *RelyingPartyUpdateOne

ClearRedirectUris clears all "redirect_uris" edges to the RedirectURI entity.

func (*RelyingPartyUpdateOne) Exec

func (rpuo *RelyingPartyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RelyingPartyUpdateOne) ExecX

func (rpuo *RelyingPartyUpdateOne) ExecX(ctx context.Context)

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

func (*RelyingPartyUpdateOne) Mutation

func (rpuo *RelyingPartyUpdateOne) Mutation() *RelyingPartyMutation

Mutation returns the RelyingPartyMutation object of the builder.

func (*RelyingPartyUpdateOne) RemoveAuthCodeIDs

func (rpuo *RelyingPartyUpdateOne) RemoveAuthCodeIDs(ids ...typedef.AuthCodeID) *RelyingPartyUpdateOne

RemoveAuthCodeIDs removes the "auth_codes" edge to AuthCode entities by IDs.

func (*RelyingPartyUpdateOne) RemoveAuthCodes

func (rpuo *RelyingPartyUpdateOne) RemoveAuthCodes(a ...*AuthCode) *RelyingPartyUpdateOne

RemoveAuthCodes removes "auth_codes" edges to AuthCode entities.

func (*RelyingPartyUpdateOne) RemoveRedirectURIIDs

func (rpuo *RelyingPartyUpdateOne) RemoveRedirectURIIDs(ids ...typedef.RedirectURIID) *RelyingPartyUpdateOne

RemoveRedirectURIIDs removes the "redirect_uris" edge to RedirectURI entities by IDs.

func (*RelyingPartyUpdateOne) RemoveRedirectUris

func (rpuo *RelyingPartyUpdateOne) RemoveRedirectUris(r ...*RedirectURI) *RelyingPartyUpdateOne

RemoveRedirectUris removes "redirect_uris" edges to RedirectURI entities.

func (*RelyingPartyUpdateOne) Save

Save executes the query and returns the updated RelyingParty entity.

func (*RelyingPartyUpdateOne) SaveX

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

func (*RelyingPartyUpdateOne) Select

func (rpuo *RelyingPartyUpdateOne) Select(field string, fields ...string) *RelyingPartyUpdateOne

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

func (*RelyingPartyUpdateOne) SetClientSecret

func (rpuo *RelyingPartyUpdateOne) SetClientSecret(s string) *RelyingPartyUpdateOne

SetClientSecret sets the "client_secret" field.

func (*RelyingPartyUpdateOne) SetModifiedAt

func (rpuo *RelyingPartyUpdateOne) SetModifiedAt(t time.Time) *RelyingPartyUpdateOne

SetModifiedAt sets the "modified_at" field.

func (*RelyingPartyUpdateOne) SetNillableClientSecret

func (rpuo *RelyingPartyUpdateOne) SetNillableClientSecret(s *string) *RelyingPartyUpdateOne

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*RelyingPartyUpdateOne) Where

Where appends a list predicates to the RelyingPartyUpdate builder.

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 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 {

	// AuthCode is the client for interacting with the AuthCode builders.
	AuthCode *AuthCodeClient
	// Consent is the client for interacting with the Consent builders.
	Consent *ConsentClient
	// RedirectURI is the client for interacting with the RedirectURI builders.
	RedirectURI *RedirectURIClient
	// RelyingParty is the client for interacting with the RelyingParty builders.
	RelyingParty *RelyingPartyClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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) 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) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID typedef.UserID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// TotpSecret holds the value of the "totp_secret" field.
	TotpSecret string `json:"-"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ModifiedAt holds the value of the "modified_at" field.
	ModifiedAt time.Time `json:"modified_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryConsents

func (u *User) QueryConsents() *ConsentQuery

QueryConsents queries the "consents" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update

func (u *User) Update() *UserUpdateOne

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

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id typedef.UserID) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id typedef.UserID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id typedef.UserID) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

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

func (*UserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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 (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryConsents

func (c *UserClient) QueryConsents(u *User) *ConsentQuery

QueryConsents queries the consents edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id typedef.UserID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddConsentIDs

func (uc *UserCreate) AddConsentIDs(ids ...typedef.ConsentID) *UserCreate

AddConsentIDs adds the "consents" edge to the Consent entity by IDs.

func (*UserCreate) AddConsents

func (uc *UserCreate) AddConsents(c ...*Consent) *UserCreate

AddConsents adds the "consents" edges to the Consent entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(ti typedef.UserID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetModifiedAt

func (uc *UserCreate) SetModifiedAt(t time.Time) *UserCreate

SetModifiedAt sets the "modified_at" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetNillableModifiedAt

func (uc *UserCreate) SetNillableModifiedAt(t *time.Time) *UserCreate

SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.

func (*UserCreate) SetNillableTotpSecret

func (uc *UserCreate) SetNillableTotpSecret(s *string) *UserCreate

SetNillableTotpSecret sets the "totp_secret" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetTotpSecret

func (uc *UserCreate) SetTotpSecret(s string) *UserCreate

SetTotpSecret sets the "totp_secret" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Consents holds the value of the consents edge.
	Consents []*Consent `json:"consents,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) ConsentsOrErr

func (e UserEdges) ConsentsOrErr() ([]*Consent, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

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

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddConsentIDs

func (m *UserMutation) AddConsentIDs(ids ...typedef.ConsentID)

AddConsentIDs adds the "consents" edge to the Consent entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) ClearConsents

func (m *UserMutation) ClearConsents()

ClearConsents clears the "consents" edge to the Consent entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearTotpSecret

func (m *UserMutation) ClearTotpSecret()

ClearTotpSecret clears the value of the "totp_secret" field.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) ConsentsCleared

func (m *UserMutation) ConsentsCleared() bool

ConsentsCleared reports if the "consents" edge to the Consent entity was cleared.

func (*UserMutation) ConsentsIDs

func (m *UserMutation) ConsentsIDs() (ids []typedef.ConsentID)

ConsentsIDs returns the "consents" edge IDs in the mutation.

func (*UserMutation) CreatedAt

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

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

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) ID

func (m *UserMutation) ID() (id typedef.UserID, 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 (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]typedef.UserID, 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 (*UserMutation) ModifiedAt

func (m *UserMutation) ModifiedAt() (r time.Time, exists bool)

ModifiedAt returns the value of the "modified_at" field in the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldModifiedAt

func (m *UserMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)

OldModifiedAt returns the old "modified_at" field's value of the User entity. If the User 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 (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User 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 (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User 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 (*UserMutation) OldTotpSecret

func (m *UserMutation) OldTotpSecret(ctx context.Context) (v string, err error)

OldTotpSecret returns the old "totp_secret" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RemoveConsentIDs

func (m *UserMutation) RemoveConsentIDs(ids ...typedef.ConsentID)

RemoveConsentIDs removes the "consents" edge to the Consent entity by IDs.

func (*UserMutation) RemovedConsentsIDs

func (m *UserMutation) RemovedConsentsIDs() (ids []typedef.ConsentID)

RemovedConsents returns the removed IDs of the "consents" edge to the Consent entity.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) ResetConsents

func (m *UserMutation) ResetConsents()

ResetConsents resets all changes to the "consents" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetModifiedAt

func (m *UserMutation) ResetModifiedAt()

ResetModifiedAt resets all changes to the "modified_at" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetTotpSecret

func (m *UserMutation) ResetTotpSecret()

ResetTotpSecret resets all changes to the "totp_secret" field.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetID

func (m *UserMutation) SetID(id typedef.UserID)

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

func (*UserMutation) SetModifiedAt

func (m *UserMutation) SetModifiedAt(t time.Time)

SetModifiedAt sets the "modified_at" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetTotpSecret

func (m *UserMutation) SetTotpSecret(s string)

SetTotpSecret sets the "totp_secret" field.

func (*UserMutation) TotpSecret

func (m *UserMutation) TotpSecret() (r string, exists bool)

TotpSecret returns the value of the "totp_secret" field in the mutation.

func (*UserMutation) TotpSecretCleared

func (m *UserMutation) TotpSecretCleared() bool

TotpSecretCleared returns if the "totp_secret" field was cleared in this mutation.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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

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

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id typedef.UserID, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) typedef.UserID

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) ForShare

func (uq *UserQuery) ForShare(opts ...sql.LockOption) *UserQuery

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 (*UserQuery) ForUpdate

func (uq *UserQuery) ForUpdate(opts ...sql.LockOption) *UserQuery

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 (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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 {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []typedef.UserID, err error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []typedef.UserID

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

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

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id typedef.UserID, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) typedef.UserID

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryConsents

func (uq *UserQuery) QueryConsents() *ConsentQuery

QueryConsents chains the current query on the "consents" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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 {
	Name string `json:"name,omitempty"`
}

client.User.Query().
	Select(user.FieldName).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithConsents

func (uq *UserQuery) WithConsents(opts ...func(*ConsentQuery)) *UserQuery

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

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

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

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

func (*UserSelect) BoolX

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

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

func (*UserSelect) Bools

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

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

func (*UserSelect) BoolsX

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

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

func (*UserSelect) Float64

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

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

func (*UserSelect) Float64X

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

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

func (*UserSelect) Float64s

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

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

func (*UserSelect) Float64sX

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

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

func (*UserSelect) Int

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

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

func (*UserSelect) IntX

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

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

func (*UserSelect) Ints

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

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

func (*UserSelect) IntsX

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

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

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

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

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

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

func (*UserSelect) StringX

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

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

func (*UserSelect) Strings

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

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

func (*UserSelect) StringsX

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

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddConsentIDs

func (uu *UserUpdate) AddConsentIDs(ids ...typedef.ConsentID) *UserUpdate

AddConsentIDs adds the "consents" edge to the Consent entity by IDs.

func (*UserUpdate) AddConsents

func (uu *UserUpdate) AddConsents(c ...*Consent) *UserUpdate

AddConsents adds the "consents" edges to the Consent entity.

func (*UserUpdate) ClearConsents

func (uu *UserUpdate) ClearConsents() *UserUpdate

ClearConsents clears all "consents" edges to the Consent entity.

func (*UserUpdate) ClearTotpSecret

func (uu *UserUpdate) ClearTotpSecret() *UserUpdate

ClearTotpSecret clears the value of the "totp_secret" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveConsentIDs

func (uu *UserUpdate) RemoveConsentIDs(ids ...typedef.ConsentID) *UserUpdate

RemoveConsentIDs removes the "consents" edge to Consent entities by IDs.

func (*UserUpdate) RemoveConsents

func (uu *UserUpdate) RemoveConsents(c ...*Consent) *UserUpdate

RemoveConsents removes "consents" edges to Consent entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

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

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetModifiedAt

func (uu *UserUpdate) SetModifiedAt(t time.Time) *UserUpdate

SetModifiedAt sets the "modified_at" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableTotpSecret

func (uu *UserUpdate) SetNillableTotpSecret(s *string) *UserUpdate

SetNillableTotpSecret sets the "totp_secret" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetTotpSecret

func (uu *UserUpdate) SetTotpSecret(s string) *UserUpdate

SetTotpSecret sets the "totp_secret" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddConsentIDs

func (uuo *UserUpdateOne) AddConsentIDs(ids ...typedef.ConsentID) *UserUpdateOne

AddConsentIDs adds the "consents" edge to the Consent entity by IDs.

func (*UserUpdateOne) AddConsents

func (uuo *UserUpdateOne) AddConsents(c ...*Consent) *UserUpdateOne

AddConsents adds the "consents" edges to the Consent entity.

func (*UserUpdateOne) ClearConsents

func (uuo *UserUpdateOne) ClearConsents() *UserUpdateOne

ClearConsents clears all "consents" edges to the Consent entity.

func (*UserUpdateOne) ClearTotpSecret

func (uuo *UserUpdateOne) ClearTotpSecret() *UserUpdateOne

ClearTotpSecret clears the value of the "totp_secret" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveConsentIDs

func (uuo *UserUpdateOne) RemoveConsentIDs(ids ...typedef.ConsentID) *UserUpdateOne

RemoveConsentIDs removes the "consents" edge to Consent entities by IDs.

func (*UserUpdateOne) RemoveConsents

func (uuo *UserUpdateOne) RemoveConsents(c ...*Consent) *UserUpdateOne

RemoveConsents removes "consents" edges to Consent entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

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

func (*UserUpdateOne) SetModifiedAt

func (uuo *UserUpdateOne) SetModifiedAt(t time.Time) *UserUpdateOne

SetModifiedAt sets the "modified_at" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTotpSecret

func (uuo *UserUpdateOne) SetNillableTotpSecret(s *string) *UserUpdateOne

SetNillableTotpSecret sets the "totp_secret" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetTotpSecret

func (uuo *UserUpdateOne) SetTotpSecret(s string) *UserUpdateOne

SetTotpSecret sets the "totp_secret" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

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

Jump to

Keyboard shortcuts

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