_test

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 25 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.
	TypeOAuthAccessToken       = "OAuthAccessToken"
	TypeOAuthAuthorizationCode = "OAuthAuthorizationCode"
	TypeOAuthClient            = "OAuthClient"
	TypeOAuthRefreshToken      = "OAuthRefreshToken"
	TypeOAuthSigningKey        = "OAuthSigningKey"
	TypePersonalAccessToken    = "PersonalAccessToken"
)

Variables

View Source
var ErrTxStarted = errors.New("_test: 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(_test.As(_test.Sum(field1), "sum_field1"), (_test.As(_test.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// OAuthAccessToken is the client for interacting with the OAuthAccessToken builders.
	OAuthAccessToken *OAuthAccessTokenClient
	// OAuthAuthorizationCode is the client for interacting with the OAuthAuthorizationCode builders.
	OAuthAuthorizationCode *OAuthAuthorizationCodeClient
	// OAuthClient is the client for interacting with the OAuthClient builders.
	OAuthClient *OAuthClientClient
	// OAuthRefreshToken is the client for interacting with the OAuthRefreshToken builders.
	OAuthRefreshToken *OAuthRefreshTokenClient
	// OAuthSigningKey is the client for interacting with the OAuthSigningKey builders.
	OAuthSigningKey *OAuthSigningKeyClient
	// PersonalAccessToken is the client for interacting with the PersonalAccessToken builders.
	PersonalAccessToken *PersonalAccessTokenClient
	// 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().
	OAuthAccessToken.
	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 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 OAuthAccessToken

type OAuthAccessToken struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type: authorization_code, access_token, refresh_token, pkce, oidc
	SessionType string `json:"session_type,omitempty"`
	// Unique token/code signature for lookup
	Signature string `json:"signature,omitempty"`
	// OAuth client ID that owns this session
	ClientID string `json:"client_id,omitempty"`
	// Optional consumer user ID
	UserID *int `json:"user_id,omitempty"`
	// Fosite request ID for token revocation
	RequestID string `json:"request_id,omitempty"`
	// Space-separated granted scopes
	Scopes string `json:"scopes,omitempty"`
	// Serialized Fosite session data
	SessionData map[string]interface{} `json:"session_data,omitempty"`
	// Whether this session is still valid
	Active bool `json:"active,omitempty"`
	// When this session expires
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// When Fosite created the original request
	RequestedAt *time.Time `json:"requested_at,omitempty"`
	// contains filtered or unexported fields
}

OAuthAccessToken is the model entity for the OAuthAccessToken schema.

func (*OAuthAccessToken) String

func (_m *OAuthAccessToken) String() string

String implements the fmt.Stringer.

func (*OAuthAccessToken) Unwrap

func (_m *OAuthAccessToken) Unwrap() *OAuthAccessToken

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

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

func (*OAuthAccessToken) Value

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

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

type OAuthAccessTokenClient

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

OAuthAccessTokenClient is a client for the OAuthAccessToken schema.

func NewOAuthAccessTokenClient

func NewOAuthAccessTokenClient(c config) *OAuthAccessTokenClient

NewOAuthAccessTokenClient returns a client for the OAuthAccessToken from the given config.

func (*OAuthAccessTokenClient) Create

Create returns a builder for creating a OAuthAccessToken entity.

func (*OAuthAccessTokenClient) CreateBulk

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

func (*OAuthAccessTokenClient) Delete

Delete returns a delete builder for OAuthAccessToken.

func (*OAuthAccessTokenClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OAuthAccessTokenClient) DeleteOneID

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

func (*OAuthAccessTokenClient) Get

Get returns a OAuthAccessToken entity by its id.

func (*OAuthAccessTokenClient) GetX

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

func (*OAuthAccessTokenClient) Hooks

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

Hooks returns the client hooks.

func (*OAuthAccessTokenClient) Intercept

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

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

func (*OAuthAccessTokenClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OAuthAccessTokenClient) MapCreateBulk

func (c *OAuthAccessTokenClient) MapCreateBulk(slice any, setFunc func(*OAuthAccessTokenCreate, int)) *OAuthAccessTokenCreateBulk

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

Query returns a query builder for OAuthAccessToken.

func (*OAuthAccessTokenClient) Update

Update returns an update builder for OAuthAccessToken.

func (*OAuthAccessTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OAuthAccessTokenClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OAuthAccessTokenClient) Use

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

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

type OAuthAccessTokenCreate

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

OAuthAccessTokenCreate is the builder for creating a OAuthAccessToken entity.

func (*OAuthAccessTokenCreate) Exec

Exec executes the query.

func (*OAuthAccessTokenCreate) ExecX

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

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

func (*OAuthAccessTokenCreate) Mutation

Mutation returns the OAuthAccessTokenMutation object of the builder.

func (*OAuthAccessTokenCreate) Save

Save creates the OAuthAccessToken in the database.

func (*OAuthAccessTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OAuthAccessTokenCreate) SetActive

SetActive sets the "active" field.

func (*OAuthAccessTokenCreate) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthAccessTokenCreate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthAccessTokenCreate) SetNillableActive

func (_c *OAuthAccessTokenCreate) SetNillableActive(v *bool) *OAuthAccessTokenCreate

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthAccessTokenCreate) SetNillableExpiresAt

func (_c *OAuthAccessTokenCreate) SetNillableExpiresAt(v *time.Time) *OAuthAccessTokenCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthAccessTokenCreate) SetNillableRequestID

func (_c *OAuthAccessTokenCreate) SetNillableRequestID(v *string) *OAuthAccessTokenCreate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthAccessTokenCreate) SetNillableRequestedAt

func (_c *OAuthAccessTokenCreate) SetNillableRequestedAt(v *time.Time) *OAuthAccessTokenCreate

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthAccessTokenCreate) SetNillableScopes

func (_c *OAuthAccessTokenCreate) SetNillableScopes(v *string) *OAuthAccessTokenCreate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthAccessTokenCreate) SetNillableUserID

func (_c *OAuthAccessTokenCreate) SetNillableUserID(v *int) *OAuthAccessTokenCreate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthAccessTokenCreate) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthAccessTokenCreate) SetRequestedAt

func (_c *OAuthAccessTokenCreate) SetRequestedAt(v time.Time) *OAuthAccessTokenCreate

SetRequestedAt sets the "requested_at" field.

func (*OAuthAccessTokenCreate) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthAccessTokenCreate) SetSessionData

func (_c *OAuthAccessTokenCreate) SetSessionData(v map[string]interface{}) *OAuthAccessTokenCreate

SetSessionData sets the "session_data" field.

func (*OAuthAccessTokenCreate) SetSessionType

func (_c *OAuthAccessTokenCreate) SetSessionType(v string) *OAuthAccessTokenCreate

SetSessionType sets the "session_type" field.

func (*OAuthAccessTokenCreate) SetSignature

SetSignature sets the "signature" field.

func (*OAuthAccessTokenCreate) SetUserID

SetUserID sets the "user_id" field.

type OAuthAccessTokenCreateBulk

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

OAuthAccessTokenCreateBulk is the builder for creating many OAuthAccessToken entities in bulk.

func (*OAuthAccessTokenCreateBulk) Exec

Exec executes the query.

func (*OAuthAccessTokenCreateBulk) ExecX

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

func (*OAuthAccessTokenCreateBulk) Save

Save creates the OAuthAccessToken entities in the database.

func (*OAuthAccessTokenCreateBulk) SaveX

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

type OAuthAccessTokenDelete

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

OAuthAccessTokenDelete is the builder for deleting a OAuthAccessToken entity.

func (*OAuthAccessTokenDelete) Exec

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

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

func (*OAuthAccessTokenDelete) ExecX

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

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

func (*OAuthAccessTokenDelete) Where

Where appends a list predicates to the OAuthAccessTokenDelete builder.

type OAuthAccessTokenDeleteOne

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

OAuthAccessTokenDeleteOne is the builder for deleting a single OAuthAccessToken entity.

func (*OAuthAccessTokenDeleteOne) Exec

Exec executes the deletion query.

func (*OAuthAccessTokenDeleteOne) ExecX

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

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

func (*OAuthAccessTokenDeleteOne) Where

Where appends a list predicates to the OAuthAccessTokenDelete builder.

type OAuthAccessTokenGroupBy

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

OAuthAccessTokenGroupBy is the group-by builder for OAuthAccessToken entities.

func (*OAuthAccessTokenGroupBy) Aggregate

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

func (*OAuthAccessTokenGroupBy) Bool

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

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

func (*OAuthAccessTokenGroupBy) BoolX

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

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

func (*OAuthAccessTokenGroupBy) Bools

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

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

func (*OAuthAccessTokenGroupBy) BoolsX

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

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

func (*OAuthAccessTokenGroupBy) Float64

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

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

func (*OAuthAccessTokenGroupBy) Float64X

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

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

func (*OAuthAccessTokenGroupBy) Float64s

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

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

func (*OAuthAccessTokenGroupBy) Float64sX

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

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

func (*OAuthAccessTokenGroupBy) Int

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

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

func (*OAuthAccessTokenGroupBy) IntX

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

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

func (*OAuthAccessTokenGroupBy) Ints

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

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

func (*OAuthAccessTokenGroupBy) IntsX

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

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

func (*OAuthAccessTokenGroupBy) Scan

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

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

func (*OAuthAccessTokenGroupBy) ScanX

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

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

func (*OAuthAccessTokenGroupBy) String

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

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

func (*OAuthAccessTokenGroupBy) StringX

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

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

func (*OAuthAccessTokenGroupBy) Strings

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

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

func (*OAuthAccessTokenGroupBy) StringsX

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

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

type OAuthAccessTokenMutation

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

OAuthAccessTokenMutation represents an operation that mutates the OAuthAccessToken nodes in the graph.

func (*OAuthAccessTokenMutation) Active

func (m *OAuthAccessTokenMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*OAuthAccessTokenMutation) AddField

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

func (m *OAuthAccessTokenMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*OAuthAccessTokenMutation) AddedEdges

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

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

func (*OAuthAccessTokenMutation) AddedField

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

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

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

func (*OAuthAccessTokenMutation) AddedIDs

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

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

func (*OAuthAccessTokenMutation) AddedUserID

func (m *OAuthAccessTokenMutation) AddedUserID() (r int, exists bool)

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

func (*OAuthAccessTokenMutation) ClearEdge

func (m *OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) ClearExpiresAt

func (m *OAuthAccessTokenMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthAccessTokenMutation) ClearField

func (m *OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) ClearRequestedAt

func (m *OAuthAccessTokenMutation) ClearRequestedAt()

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthAccessTokenMutation) ClearUserID

func (m *OAuthAccessTokenMutation) ClearUserID()

ClearUserID clears the value of the "user_id" field.

func (*OAuthAccessTokenMutation) ClearedEdges

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

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

func (*OAuthAccessTokenMutation) ClearedFields

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

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

func (OAuthAccessTokenMutation) Client

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

func (m *OAuthAccessTokenMutation) ClientID() (r string, exists bool)

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

func (*OAuthAccessTokenMutation) EdgeCleared

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

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

func (*OAuthAccessTokenMutation) ExpiresAt

func (m *OAuthAccessTokenMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*OAuthAccessTokenMutation) ExpiresAtCleared

func (m *OAuthAccessTokenMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*OAuthAccessTokenMutation) Field

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

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

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

func (*OAuthAccessTokenMutation) Fields

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

func (m *OAuthAccessTokenMutation) ID() (id int, exists bool)

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

func (*OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) OldActive

func (m *OAuthAccessTokenMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldClientID

func (m *OAuthAccessTokenMutation) OldClientID(ctx context.Context) (v string, err error)

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

func (m *OAuthAccessTokenMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldField

func (m *OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) OldRequestID

func (m *OAuthAccessTokenMutation) OldRequestID(ctx context.Context) (v string, err error)

OldRequestID returns the old "request_id" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldRequestedAt

func (m *OAuthAccessTokenMutation) OldRequestedAt(ctx context.Context) (v *time.Time, err error)

OldRequestedAt returns the old "requested_at" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldScopes

func (m *OAuthAccessTokenMutation) OldScopes(ctx context.Context) (v string, err error)

OldScopes returns the old "scopes" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldSessionData

func (m *OAuthAccessTokenMutation) OldSessionData(ctx context.Context) (v map[string]interface{}, err error)

OldSessionData returns the old "session_data" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldSessionType

func (m *OAuthAccessTokenMutation) OldSessionType(ctx context.Context) (v string, err error)

OldSessionType returns the old "session_type" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldSignature

func (m *OAuthAccessTokenMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old "signature" field's value of the OAuthAccessToken entity. If the OAuthAccessToken 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 (*OAuthAccessTokenMutation) OldUserID

func (m *OAuthAccessTokenMutation) OldUserID(ctx context.Context) (v *int, err error)

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

func (m *OAuthAccessTokenMutation) Op() Op

Op returns the operation name.

func (*OAuthAccessTokenMutation) RemovedEdges

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

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

func (*OAuthAccessTokenMutation) RemovedIDs

func (m *OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) RequestID

func (m *OAuthAccessTokenMutation) RequestID() (r string, exists bool)

RequestID returns the value of the "request_id" field in the mutation.

func (*OAuthAccessTokenMutation) RequestedAt

func (m *OAuthAccessTokenMutation) RequestedAt() (r time.Time, exists bool)

RequestedAt returns the value of the "requested_at" field in the mutation.

func (*OAuthAccessTokenMutation) RequestedAtCleared

func (m *OAuthAccessTokenMutation) RequestedAtCleared() bool

RequestedAtCleared returns if the "requested_at" field was cleared in this mutation.

func (*OAuthAccessTokenMutation) ResetActive

func (m *OAuthAccessTokenMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*OAuthAccessTokenMutation) ResetClientID

func (m *OAuthAccessTokenMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OAuthAccessTokenMutation) ResetEdge

func (m *OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) ResetExpiresAt

func (m *OAuthAccessTokenMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*OAuthAccessTokenMutation) ResetField

func (m *OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) ResetRequestID

func (m *OAuthAccessTokenMutation) ResetRequestID()

ResetRequestID resets all changes to the "request_id" field.

func (*OAuthAccessTokenMutation) ResetRequestedAt

func (m *OAuthAccessTokenMutation) ResetRequestedAt()

ResetRequestedAt resets all changes to the "requested_at" field.

func (*OAuthAccessTokenMutation) ResetScopes

func (m *OAuthAccessTokenMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OAuthAccessTokenMutation) ResetSessionData

func (m *OAuthAccessTokenMutation) ResetSessionData()

ResetSessionData resets all changes to the "session_data" field.

func (*OAuthAccessTokenMutation) ResetSessionType

func (m *OAuthAccessTokenMutation) ResetSessionType()

ResetSessionType resets all changes to the "session_type" field.

func (*OAuthAccessTokenMutation) ResetSignature

func (m *OAuthAccessTokenMutation) ResetSignature()

ResetSignature resets all changes to the "signature" field.

func (*OAuthAccessTokenMutation) ResetUserID

func (m *OAuthAccessTokenMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*OAuthAccessTokenMutation) Scopes

func (m *OAuthAccessTokenMutation) Scopes() (r string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*OAuthAccessTokenMutation) SessionData

func (m *OAuthAccessTokenMutation) SessionData() (r map[string]interface{}, exists bool)

SessionData returns the value of the "session_data" field in the mutation.

func (*OAuthAccessTokenMutation) SessionType

func (m *OAuthAccessTokenMutation) SessionType() (r string, exists bool)

SessionType returns the value of the "session_type" field in the mutation.

func (*OAuthAccessTokenMutation) SetActive

func (m *OAuthAccessTokenMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*OAuthAccessTokenMutation) SetClientID

func (m *OAuthAccessTokenMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OAuthAccessTokenMutation) SetExpiresAt

func (m *OAuthAccessTokenMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*OAuthAccessTokenMutation) SetField

func (m *OAuthAccessTokenMutation) 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 (*OAuthAccessTokenMutation) SetOp

func (m *OAuthAccessTokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OAuthAccessTokenMutation) SetRequestID

func (m *OAuthAccessTokenMutation) SetRequestID(s string)

SetRequestID sets the "request_id" field.

func (*OAuthAccessTokenMutation) SetRequestedAt

func (m *OAuthAccessTokenMutation) SetRequestedAt(t time.Time)

SetRequestedAt sets the "requested_at" field.

func (*OAuthAccessTokenMutation) SetScopes

func (m *OAuthAccessTokenMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*OAuthAccessTokenMutation) SetSessionData

func (m *OAuthAccessTokenMutation) SetSessionData(value map[string]interface{})

SetSessionData sets the "session_data" field.

func (*OAuthAccessTokenMutation) SetSessionType

func (m *OAuthAccessTokenMutation) SetSessionType(s string)

SetSessionType sets the "session_type" field.

func (*OAuthAccessTokenMutation) SetSignature

func (m *OAuthAccessTokenMutation) SetSignature(s string)

SetSignature sets the "signature" field.

func (*OAuthAccessTokenMutation) SetUserID

func (m *OAuthAccessTokenMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*OAuthAccessTokenMutation) Signature

func (m *OAuthAccessTokenMutation) Signature() (r string, exists bool)

Signature returns the value of the "signature" field in the mutation.

func (OAuthAccessTokenMutation) Tx

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

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

func (*OAuthAccessTokenMutation) Type

func (m *OAuthAccessTokenMutation) Type() string

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

func (*OAuthAccessTokenMutation) UserID

func (m *OAuthAccessTokenMutation) UserID() (r int, exists bool)

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

func (*OAuthAccessTokenMutation) UserIDCleared

func (m *OAuthAccessTokenMutation) UserIDCleared() bool

UserIDCleared returns if the "user_id" field was cleared in this mutation.

func (*OAuthAccessTokenMutation) Where

Where appends a list predicates to the OAuthAccessTokenMutation builder.

func (*OAuthAccessTokenMutation) WhereP

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

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

type OAuthAccessTokenQuery

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

OAuthAccessTokenQuery is the builder for querying OAuthAccessToken entities.

func (*OAuthAccessTokenQuery) Aggregate

Aggregate returns a OAuthAccessTokenSelect configured with the given aggregations.

func (*OAuthAccessTokenQuery) All

All executes the query and returns a list of OAuthAccessTokens.

func (*OAuthAccessTokenQuery) AllX

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

func (*OAuthAccessTokenQuery) Clone

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

func (*OAuthAccessTokenQuery) Count

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

Count returns the count of the given query.

func (*OAuthAccessTokenQuery) CountX

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

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

func (*OAuthAccessTokenQuery) Exist

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

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

func (*OAuthAccessTokenQuery) ExistX

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

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

func (*OAuthAccessTokenQuery) First

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

func (*OAuthAccessTokenQuery) FirstID

func (_q *OAuthAccessTokenQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OAuthAccessTokenQuery) FirstIDX

func (_q *OAuthAccessTokenQuery) FirstIDX(ctx context.Context) int

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

func (*OAuthAccessTokenQuery) FirstX

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

func (*OAuthAccessTokenQuery) GroupBy

func (_q *OAuthAccessTokenQuery) GroupBy(field string, fields ...string) *OAuthAccessTokenGroupBy

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

client.OAuthAccessToken.Query().
	GroupBy(oauthaccesstoken.FieldSessionType).
	Aggregate(_test.Count()).
	Scan(ctx, &v)

func (*OAuthAccessTokenQuery) IDs

func (_q *OAuthAccessTokenQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*OAuthAccessTokenQuery) IDsX

func (_q *OAuthAccessTokenQuery) IDsX(ctx context.Context) []int

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

func (*OAuthAccessTokenQuery) Limit

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

func (*OAuthAccessTokenQuery) Offset

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

Offset to start from.

func (*OAuthAccessTokenQuery) Only

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

func (*OAuthAccessTokenQuery) OnlyID

func (_q *OAuthAccessTokenQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OAuthAccessTokenQuery) OnlyIDX

func (_q *OAuthAccessTokenQuery) OnlyIDX(ctx context.Context) int

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

func (*OAuthAccessTokenQuery) OnlyX

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

func (*OAuthAccessTokenQuery) Order

Order specifies how the records should be ordered.

func (*OAuthAccessTokenQuery) Select

func (_q *OAuthAccessTokenQuery) Select(fields ...string) *OAuthAccessTokenSelect

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

client.OAuthAccessToken.Query().
	Select(oauthaccesstoken.FieldSessionType).
	Scan(ctx, &v)

func (*OAuthAccessTokenQuery) Unique

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

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

Where adds a new predicate for the OAuthAccessTokenQuery builder.

type OAuthAccessTokenSelect

type OAuthAccessTokenSelect struct {
	*OAuthAccessTokenQuery
	// contains filtered or unexported fields
}

OAuthAccessTokenSelect is the builder for selecting fields of OAuthAccessToken entities.

func (*OAuthAccessTokenSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*OAuthAccessTokenSelect) Bool

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

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

func (*OAuthAccessTokenSelect) BoolX

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

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

func (*OAuthAccessTokenSelect) Bools

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

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

func (*OAuthAccessTokenSelect) BoolsX

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

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

func (*OAuthAccessTokenSelect) Float64

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

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

func (*OAuthAccessTokenSelect) Float64X

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

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

func (*OAuthAccessTokenSelect) Float64s

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

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

func (*OAuthAccessTokenSelect) Float64sX

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

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

func (*OAuthAccessTokenSelect) Int

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

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

func (*OAuthAccessTokenSelect) IntX

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

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

func (*OAuthAccessTokenSelect) Ints

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

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

func (*OAuthAccessTokenSelect) IntsX

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

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

func (*OAuthAccessTokenSelect) Scan

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

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

func (*OAuthAccessTokenSelect) ScanX

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

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

func (*OAuthAccessTokenSelect) String

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

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

func (*OAuthAccessTokenSelect) StringX

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

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

func (*OAuthAccessTokenSelect) Strings

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

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

func (*OAuthAccessTokenSelect) StringsX

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

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

type OAuthAccessTokenUpdate

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

OAuthAccessTokenUpdate is the builder for updating OAuthAccessToken entities.

func (*OAuthAccessTokenUpdate) AddUserID

AddUserID adds value to the "user_id" field.

func (*OAuthAccessTokenUpdate) ClearExpiresAt

func (_u *OAuthAccessTokenUpdate) ClearExpiresAt() *OAuthAccessTokenUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthAccessTokenUpdate) ClearRequestedAt

func (_u *OAuthAccessTokenUpdate) ClearRequestedAt() *OAuthAccessTokenUpdate

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthAccessTokenUpdate) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*OAuthAccessTokenUpdate) Exec

Exec executes the query.

func (*OAuthAccessTokenUpdate) ExecX

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

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

func (*OAuthAccessTokenUpdate) Mutation

Mutation returns the OAuthAccessTokenMutation object of the builder.

func (*OAuthAccessTokenUpdate) Save

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

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

func (*OAuthAccessTokenUpdate) SaveX

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

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

func (*OAuthAccessTokenUpdate) SetActive

SetActive sets the "active" field.

func (*OAuthAccessTokenUpdate) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthAccessTokenUpdate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthAccessTokenUpdate) SetNillableActive

func (_u *OAuthAccessTokenUpdate) SetNillableActive(v *bool) *OAuthAccessTokenUpdate

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableClientID

func (_u *OAuthAccessTokenUpdate) SetNillableClientID(v *string) *OAuthAccessTokenUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableExpiresAt

func (_u *OAuthAccessTokenUpdate) SetNillableExpiresAt(v *time.Time) *OAuthAccessTokenUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableRequestID

func (_u *OAuthAccessTokenUpdate) SetNillableRequestID(v *string) *OAuthAccessTokenUpdate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableRequestedAt

func (_u *OAuthAccessTokenUpdate) SetNillableRequestedAt(v *time.Time) *OAuthAccessTokenUpdate

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableScopes

func (_u *OAuthAccessTokenUpdate) SetNillableScopes(v *string) *OAuthAccessTokenUpdate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableSessionType

func (_u *OAuthAccessTokenUpdate) SetNillableSessionType(v *string) *OAuthAccessTokenUpdate

SetNillableSessionType sets the "session_type" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableSignature

func (_u *OAuthAccessTokenUpdate) SetNillableSignature(v *string) *OAuthAccessTokenUpdate

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetNillableUserID

func (_u *OAuthAccessTokenUpdate) SetNillableUserID(v *int) *OAuthAccessTokenUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthAccessTokenUpdate) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthAccessTokenUpdate) SetRequestedAt

func (_u *OAuthAccessTokenUpdate) SetRequestedAt(v time.Time) *OAuthAccessTokenUpdate

SetRequestedAt sets the "requested_at" field.

func (*OAuthAccessTokenUpdate) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthAccessTokenUpdate) SetSessionData

func (_u *OAuthAccessTokenUpdate) SetSessionData(v map[string]interface{}) *OAuthAccessTokenUpdate

SetSessionData sets the "session_data" field.

func (*OAuthAccessTokenUpdate) SetSessionType

func (_u *OAuthAccessTokenUpdate) SetSessionType(v string) *OAuthAccessTokenUpdate

SetSessionType sets the "session_type" field.

func (*OAuthAccessTokenUpdate) SetSignature

SetSignature sets the "signature" field.

func (*OAuthAccessTokenUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*OAuthAccessTokenUpdate) Where

Where appends a list predicates to the OAuthAccessTokenUpdate builder.

type OAuthAccessTokenUpdateOne

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

OAuthAccessTokenUpdateOne is the builder for updating a single OAuthAccessToken entity.

func (*OAuthAccessTokenUpdateOne) AddUserID

AddUserID adds value to the "user_id" field.

func (*OAuthAccessTokenUpdateOne) ClearExpiresAt

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthAccessTokenUpdateOne) ClearRequestedAt

func (_u *OAuthAccessTokenUpdateOne) ClearRequestedAt() *OAuthAccessTokenUpdateOne

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthAccessTokenUpdateOne) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*OAuthAccessTokenUpdateOne) Exec

Exec executes the query on the entity.

func (*OAuthAccessTokenUpdateOne) ExecX

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

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

func (*OAuthAccessTokenUpdateOne) Mutation

Mutation returns the OAuthAccessTokenMutation object of the builder.

func (*OAuthAccessTokenUpdateOne) Save

Save executes the query and returns the updated OAuthAccessToken entity.

func (*OAuthAccessTokenUpdateOne) SaveX

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

func (*OAuthAccessTokenUpdateOne) Select

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

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

func (*OAuthAccessTokenUpdateOne) SetActive

SetActive sets the "active" field.

func (*OAuthAccessTokenUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthAccessTokenUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthAccessTokenUpdateOne) SetNillableActive

func (_u *OAuthAccessTokenUpdateOne) SetNillableActive(v *bool) *OAuthAccessTokenUpdateOne

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableClientID

func (_u *OAuthAccessTokenUpdateOne) SetNillableClientID(v *string) *OAuthAccessTokenUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableExpiresAt

func (_u *OAuthAccessTokenUpdateOne) SetNillableExpiresAt(v *time.Time) *OAuthAccessTokenUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableRequestID

func (_u *OAuthAccessTokenUpdateOne) SetNillableRequestID(v *string) *OAuthAccessTokenUpdateOne

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableRequestedAt

func (_u *OAuthAccessTokenUpdateOne) SetNillableRequestedAt(v *time.Time) *OAuthAccessTokenUpdateOne

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableScopes

func (_u *OAuthAccessTokenUpdateOne) SetNillableScopes(v *string) *OAuthAccessTokenUpdateOne

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableSessionType

func (_u *OAuthAccessTokenUpdateOne) SetNillableSessionType(v *string) *OAuthAccessTokenUpdateOne

SetNillableSessionType sets the "session_type" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableSignature

func (_u *OAuthAccessTokenUpdateOne) SetNillableSignature(v *string) *OAuthAccessTokenUpdateOne

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetNillableUserID

func (_u *OAuthAccessTokenUpdateOne) SetNillableUserID(v *int) *OAuthAccessTokenUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthAccessTokenUpdateOne) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthAccessTokenUpdateOne) SetRequestedAt

SetRequestedAt sets the "requested_at" field.

func (*OAuthAccessTokenUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthAccessTokenUpdateOne) SetSessionData

func (_u *OAuthAccessTokenUpdateOne) SetSessionData(v map[string]interface{}) *OAuthAccessTokenUpdateOne

SetSessionData sets the "session_data" field.

func (*OAuthAccessTokenUpdateOne) SetSessionType

SetSessionType sets the "session_type" field.

func (*OAuthAccessTokenUpdateOne) SetSignature

SetSignature sets the "signature" field.

func (*OAuthAccessTokenUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*OAuthAccessTokenUpdateOne) Where

Where appends a list predicates to the OAuthAccessTokenUpdate builder.

type OAuthAccessTokens

type OAuthAccessTokens []*OAuthAccessToken

OAuthAccessTokens is a parsable slice of OAuthAccessToken.

type OAuthAuthorizationCode

type OAuthAuthorizationCode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type: authorization_code, access_token, refresh_token, pkce, oidc
	SessionType string `json:"session_type,omitempty"`
	// Unique token/code signature for lookup
	Signature string `json:"signature,omitempty"`
	// OAuth client ID that owns this session
	ClientID string `json:"client_id,omitempty"`
	// Optional consumer user ID
	UserID *int `json:"user_id,omitempty"`
	// Fosite request ID for token revocation
	RequestID string `json:"request_id,omitempty"`
	// Space-separated granted scopes
	Scopes string `json:"scopes,omitempty"`
	// Serialized Fosite session data
	SessionData map[string]interface{} `json:"session_data,omitempty"`
	// Whether this session is still valid
	Active bool `json:"active,omitempty"`
	// When this session expires
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// When Fosite created the original request
	RequestedAt *time.Time `json:"requested_at,omitempty"`
	// contains filtered or unexported fields
}

OAuthAuthorizationCode is the model entity for the OAuthAuthorizationCode schema.

func (*OAuthAuthorizationCode) String

func (_m *OAuthAuthorizationCode) String() string

String implements the fmt.Stringer.

func (*OAuthAuthorizationCode) Unwrap

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

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

func (*OAuthAuthorizationCode) Value

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

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

type OAuthAuthorizationCodeClient

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

OAuthAuthorizationCodeClient is a client for the OAuthAuthorizationCode schema.

func NewOAuthAuthorizationCodeClient

func NewOAuthAuthorizationCodeClient(c config) *OAuthAuthorizationCodeClient

NewOAuthAuthorizationCodeClient returns a client for the OAuthAuthorizationCode from the given config.

func (*OAuthAuthorizationCodeClient) Create

Create returns a builder for creating a OAuthAuthorizationCode entity.

func (*OAuthAuthorizationCodeClient) CreateBulk

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

func (*OAuthAuthorizationCodeClient) Delete

Delete returns a delete builder for OAuthAuthorizationCode.

func (*OAuthAuthorizationCodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OAuthAuthorizationCodeClient) DeleteOneID

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

func (*OAuthAuthorizationCodeClient) Get

Get returns a OAuthAuthorizationCode entity by its id.

func (*OAuthAuthorizationCodeClient) GetX

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

func (*OAuthAuthorizationCodeClient) Hooks

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

Hooks returns the client hooks.

func (*OAuthAuthorizationCodeClient) Intercept

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

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

func (*OAuthAuthorizationCodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OAuthAuthorizationCodeClient) MapCreateBulk

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

Query returns a query builder for OAuthAuthorizationCode.

func (*OAuthAuthorizationCodeClient) Update

Update returns an update builder for OAuthAuthorizationCode.

func (*OAuthAuthorizationCodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OAuthAuthorizationCodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OAuthAuthorizationCodeClient) Use

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

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

type OAuthAuthorizationCodeCreate

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

OAuthAuthorizationCodeCreate is the builder for creating a OAuthAuthorizationCode entity.

func (*OAuthAuthorizationCodeCreate) Exec

Exec executes the query.

func (*OAuthAuthorizationCodeCreate) ExecX

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

func (*OAuthAuthorizationCodeCreate) Mutation

Mutation returns the OAuthAuthorizationCodeMutation object of the builder.

func (*OAuthAuthorizationCodeCreate) Save

Save creates the OAuthAuthorizationCode in the database.

func (*OAuthAuthorizationCodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OAuthAuthorizationCodeCreate) SetActive

SetActive sets the "active" field.

func (*OAuthAuthorizationCodeCreate) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthAuthorizationCodeCreate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthAuthorizationCodeCreate) SetNillableActive

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthAuthorizationCodeCreate) SetNillableExpiresAt

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthAuthorizationCodeCreate) SetNillableRequestID

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeCreate) SetNillableRequestedAt

func (_c *OAuthAuthorizationCodeCreate) SetNillableRequestedAt(v *time.Time) *OAuthAuthorizationCodeCreate

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthAuthorizationCodeCreate) SetNillableScopes

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthAuthorizationCodeCreate) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeCreate) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthAuthorizationCodeCreate) SetRequestedAt

SetRequestedAt sets the "requested_at" field.

func (*OAuthAuthorizationCodeCreate) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthAuthorizationCodeCreate) SetSessionData

func (_c *OAuthAuthorizationCodeCreate) SetSessionData(v map[string]interface{}) *OAuthAuthorizationCodeCreate

SetSessionData sets the "session_data" field.

func (*OAuthAuthorizationCodeCreate) SetSessionType

SetSessionType sets the "session_type" field.

func (*OAuthAuthorizationCodeCreate) SetSignature

SetSignature sets the "signature" field.

func (*OAuthAuthorizationCodeCreate) SetUserID

SetUserID sets the "user_id" field.

type OAuthAuthorizationCodeCreateBulk

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

OAuthAuthorizationCodeCreateBulk is the builder for creating many OAuthAuthorizationCode entities in bulk.

func (*OAuthAuthorizationCodeCreateBulk) Exec

Exec executes the query.

func (*OAuthAuthorizationCodeCreateBulk) ExecX

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

func (*OAuthAuthorizationCodeCreateBulk) Save

Save creates the OAuthAuthorizationCode entities in the database.

func (*OAuthAuthorizationCodeCreateBulk) SaveX

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

type OAuthAuthorizationCodeDelete

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

OAuthAuthorizationCodeDelete is the builder for deleting a OAuthAuthorizationCode entity.

func (*OAuthAuthorizationCodeDelete) Exec

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

func (*OAuthAuthorizationCodeDelete) ExecX

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

func (*OAuthAuthorizationCodeDelete) Where

Where appends a list predicates to the OAuthAuthorizationCodeDelete builder.

type OAuthAuthorizationCodeDeleteOne

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

OAuthAuthorizationCodeDeleteOne is the builder for deleting a single OAuthAuthorizationCode entity.

func (*OAuthAuthorizationCodeDeleteOne) Exec

Exec executes the deletion query.

func (*OAuthAuthorizationCodeDeleteOne) ExecX

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

func (*OAuthAuthorizationCodeDeleteOne) Where

Where appends a list predicates to the OAuthAuthorizationCodeDelete builder.

type OAuthAuthorizationCodeGroupBy

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

OAuthAuthorizationCodeGroupBy is the group-by builder for OAuthAuthorizationCode entities.

func (*OAuthAuthorizationCodeGroupBy) Aggregate

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

func (*OAuthAuthorizationCodeGroupBy) Bool

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

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

func (*OAuthAuthorizationCodeGroupBy) BoolX

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

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

func (*OAuthAuthorizationCodeGroupBy) Bools

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

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

func (*OAuthAuthorizationCodeGroupBy) BoolsX

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

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

func (*OAuthAuthorizationCodeGroupBy) Float64

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

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

func (*OAuthAuthorizationCodeGroupBy) Float64X

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

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

func (*OAuthAuthorizationCodeGroupBy) Float64s

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

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

func (*OAuthAuthorizationCodeGroupBy) Float64sX

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

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

func (*OAuthAuthorizationCodeGroupBy) Int

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

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

func (*OAuthAuthorizationCodeGroupBy) IntX

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

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

func (*OAuthAuthorizationCodeGroupBy) Ints

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

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

func (*OAuthAuthorizationCodeGroupBy) IntsX

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

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

func (*OAuthAuthorizationCodeGroupBy) Scan

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

func (*OAuthAuthorizationCodeGroupBy) ScanX

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

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

func (*OAuthAuthorizationCodeGroupBy) String

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

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

func (*OAuthAuthorizationCodeGroupBy) StringX

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

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

func (*OAuthAuthorizationCodeGroupBy) Strings

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

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

func (*OAuthAuthorizationCodeGroupBy) StringsX

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

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

type OAuthAuthorizationCodeMutation

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

OAuthAuthorizationCodeMutation represents an operation that mutates the OAuthAuthorizationCode nodes in the graph.

func (*OAuthAuthorizationCodeMutation) Active

func (m *OAuthAuthorizationCodeMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*OAuthAuthorizationCodeMutation) AddField

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

func (m *OAuthAuthorizationCodeMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*OAuthAuthorizationCodeMutation) AddedEdges

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

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

func (*OAuthAuthorizationCodeMutation) AddedField

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

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

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

func (*OAuthAuthorizationCodeMutation) AddedIDs

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

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

func (*OAuthAuthorizationCodeMutation) AddedUserID

func (m *OAuthAuthorizationCodeMutation) AddedUserID() (r int, exists bool)

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

func (*OAuthAuthorizationCodeMutation) ClearEdge

func (m *OAuthAuthorizationCodeMutation) 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 (*OAuthAuthorizationCodeMutation) ClearExpiresAt

func (m *OAuthAuthorizationCodeMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthAuthorizationCodeMutation) ClearField

func (m *OAuthAuthorizationCodeMutation) 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 (*OAuthAuthorizationCodeMutation) ClearRequestedAt

func (m *OAuthAuthorizationCodeMutation) ClearRequestedAt()

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthAuthorizationCodeMutation) ClearUserID

func (m *OAuthAuthorizationCodeMutation) ClearUserID()

ClearUserID clears the value of the "user_id" field.

func (*OAuthAuthorizationCodeMutation) ClearedEdges

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

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

func (*OAuthAuthorizationCodeMutation) ClearedFields

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

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

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

func (m *OAuthAuthorizationCodeMutation) ClientID() (r string, exists bool)

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

func (*OAuthAuthorizationCodeMutation) EdgeCleared

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

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

func (*OAuthAuthorizationCodeMutation) ExpiresAt

func (m *OAuthAuthorizationCodeMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*OAuthAuthorizationCodeMutation) ExpiresAtCleared

func (m *OAuthAuthorizationCodeMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*OAuthAuthorizationCodeMutation) Field

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 (*OAuthAuthorizationCodeMutation) FieldCleared

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

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

func (*OAuthAuthorizationCodeMutation) Fields

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

func (m *OAuthAuthorizationCodeMutation) ID() (id int, exists bool)

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

func (*OAuthAuthorizationCodeMutation) 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 (*OAuthAuthorizationCodeMutation) OldActive

func (m *OAuthAuthorizationCodeMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldClientID

func (m *OAuthAuthorizationCodeMutation) OldClientID(ctx context.Context) (v string, err error)

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

func (m *OAuthAuthorizationCodeMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldField

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

func (*OAuthAuthorizationCodeMutation) OldRequestID

func (m *OAuthAuthorizationCodeMutation) OldRequestID(ctx context.Context) (v string, err error)

OldRequestID returns the old "request_id" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldRequestedAt

func (m *OAuthAuthorizationCodeMutation) OldRequestedAt(ctx context.Context) (v *time.Time, err error)

OldRequestedAt returns the old "requested_at" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldScopes

func (m *OAuthAuthorizationCodeMutation) OldScopes(ctx context.Context) (v string, err error)

OldScopes returns the old "scopes" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldSessionData

func (m *OAuthAuthorizationCodeMutation) OldSessionData(ctx context.Context) (v map[string]interface{}, err error)

OldSessionData returns the old "session_data" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldSessionType

func (m *OAuthAuthorizationCodeMutation) OldSessionType(ctx context.Context) (v string, err error)

OldSessionType returns the old "session_type" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldSignature

func (m *OAuthAuthorizationCodeMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old "signature" field's value of the OAuthAuthorizationCode entity. If the OAuthAuthorizationCode 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 (*OAuthAuthorizationCodeMutation) OldUserID

func (m *OAuthAuthorizationCodeMutation) OldUserID(ctx context.Context) (v *int, err error)

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

Op returns the operation name.

func (*OAuthAuthorizationCodeMutation) RemovedEdges

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

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

func (*OAuthAuthorizationCodeMutation) RemovedIDs

func (m *OAuthAuthorizationCodeMutation) 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 (*OAuthAuthorizationCodeMutation) RequestID

func (m *OAuthAuthorizationCodeMutation) RequestID() (r string, exists bool)

RequestID returns the value of the "request_id" field in the mutation.

func (*OAuthAuthorizationCodeMutation) RequestedAt

func (m *OAuthAuthorizationCodeMutation) RequestedAt() (r time.Time, exists bool)

RequestedAt returns the value of the "requested_at" field in the mutation.

func (*OAuthAuthorizationCodeMutation) RequestedAtCleared

func (m *OAuthAuthorizationCodeMutation) RequestedAtCleared() bool

RequestedAtCleared returns if the "requested_at" field was cleared in this mutation.

func (*OAuthAuthorizationCodeMutation) ResetActive

func (m *OAuthAuthorizationCodeMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*OAuthAuthorizationCodeMutation) ResetClientID

func (m *OAuthAuthorizationCodeMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OAuthAuthorizationCodeMutation) ResetEdge

func (m *OAuthAuthorizationCodeMutation) 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 (*OAuthAuthorizationCodeMutation) ResetExpiresAt

func (m *OAuthAuthorizationCodeMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*OAuthAuthorizationCodeMutation) ResetField

func (m *OAuthAuthorizationCodeMutation) 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 (*OAuthAuthorizationCodeMutation) ResetRequestID

func (m *OAuthAuthorizationCodeMutation) ResetRequestID()

ResetRequestID resets all changes to the "request_id" field.

func (*OAuthAuthorizationCodeMutation) ResetRequestedAt

func (m *OAuthAuthorizationCodeMutation) ResetRequestedAt()

ResetRequestedAt resets all changes to the "requested_at" field.

func (*OAuthAuthorizationCodeMutation) ResetScopes

func (m *OAuthAuthorizationCodeMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OAuthAuthorizationCodeMutation) ResetSessionData

func (m *OAuthAuthorizationCodeMutation) ResetSessionData()

ResetSessionData resets all changes to the "session_data" field.

func (*OAuthAuthorizationCodeMutation) ResetSessionType

func (m *OAuthAuthorizationCodeMutation) ResetSessionType()

ResetSessionType resets all changes to the "session_type" field.

func (*OAuthAuthorizationCodeMutation) ResetSignature

func (m *OAuthAuthorizationCodeMutation) ResetSignature()

ResetSignature resets all changes to the "signature" field.

func (*OAuthAuthorizationCodeMutation) ResetUserID

func (m *OAuthAuthorizationCodeMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*OAuthAuthorizationCodeMutation) Scopes

func (m *OAuthAuthorizationCodeMutation) Scopes() (r string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*OAuthAuthorizationCodeMutation) SessionData

func (m *OAuthAuthorizationCodeMutation) SessionData() (r map[string]interface{}, exists bool)

SessionData returns the value of the "session_data" field in the mutation.

func (*OAuthAuthorizationCodeMutation) SessionType

func (m *OAuthAuthorizationCodeMutation) SessionType() (r string, exists bool)

SessionType returns the value of the "session_type" field in the mutation.

func (*OAuthAuthorizationCodeMutation) SetActive

func (m *OAuthAuthorizationCodeMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*OAuthAuthorizationCodeMutation) SetClientID

func (m *OAuthAuthorizationCodeMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OAuthAuthorizationCodeMutation) SetExpiresAt

func (m *OAuthAuthorizationCodeMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*OAuthAuthorizationCodeMutation) SetField

func (m *OAuthAuthorizationCodeMutation) 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 (*OAuthAuthorizationCodeMutation) SetOp

func (m *OAuthAuthorizationCodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OAuthAuthorizationCodeMutation) SetRequestID

func (m *OAuthAuthorizationCodeMutation) SetRequestID(s string)

SetRequestID sets the "request_id" field.

func (*OAuthAuthorizationCodeMutation) SetRequestedAt

func (m *OAuthAuthorizationCodeMutation) SetRequestedAt(t time.Time)

SetRequestedAt sets the "requested_at" field.

func (*OAuthAuthorizationCodeMutation) SetScopes

func (m *OAuthAuthorizationCodeMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*OAuthAuthorizationCodeMutation) SetSessionData

func (m *OAuthAuthorizationCodeMutation) SetSessionData(value map[string]interface{})

SetSessionData sets the "session_data" field.

func (*OAuthAuthorizationCodeMutation) SetSessionType

func (m *OAuthAuthorizationCodeMutation) SetSessionType(s string)

SetSessionType sets the "session_type" field.

func (*OAuthAuthorizationCodeMutation) SetSignature

func (m *OAuthAuthorizationCodeMutation) SetSignature(s string)

SetSignature sets the "signature" field.

func (*OAuthAuthorizationCodeMutation) SetUserID

func (m *OAuthAuthorizationCodeMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*OAuthAuthorizationCodeMutation) Signature

func (m *OAuthAuthorizationCodeMutation) Signature() (r string, exists bool)

Signature returns the value of the "signature" field in the mutation.

func (OAuthAuthorizationCodeMutation) Tx

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

func (*OAuthAuthorizationCodeMutation) Type

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

func (*OAuthAuthorizationCodeMutation) UserID

func (m *OAuthAuthorizationCodeMutation) UserID() (r int, exists bool)

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

func (*OAuthAuthorizationCodeMutation) UserIDCleared

func (m *OAuthAuthorizationCodeMutation) UserIDCleared() bool

UserIDCleared returns if the "user_id" field was cleared in this mutation.

func (*OAuthAuthorizationCodeMutation) Where

Where appends a list predicates to the OAuthAuthorizationCodeMutation builder.

func (*OAuthAuthorizationCodeMutation) WhereP

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

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

type OAuthAuthorizationCodeQuery

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

OAuthAuthorizationCodeQuery is the builder for querying OAuthAuthorizationCode entities.

func (*OAuthAuthorizationCodeQuery) Aggregate

Aggregate returns a OAuthAuthorizationCodeSelect configured with the given aggregations.

func (*OAuthAuthorizationCodeQuery) All

All executes the query and returns a list of OAuthAuthorizationCodes.

func (*OAuthAuthorizationCodeQuery) AllX

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

func (*OAuthAuthorizationCodeQuery) Clone

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

func (*OAuthAuthorizationCodeQuery) Count

Count returns the count of the given query.

func (*OAuthAuthorizationCodeQuery) CountX

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

func (*OAuthAuthorizationCodeQuery) Exist

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

func (*OAuthAuthorizationCodeQuery) ExistX

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

func (*OAuthAuthorizationCodeQuery) First

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

func (*OAuthAuthorizationCodeQuery) FirstID

func (_q *OAuthAuthorizationCodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OAuthAuthorizationCodeQuery) FirstIDX

func (_q *OAuthAuthorizationCodeQuery) FirstIDX(ctx context.Context) int

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

func (*OAuthAuthorizationCodeQuery) FirstX

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

func (*OAuthAuthorizationCodeQuery) GroupBy

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

client.OAuthAuthorizationCode.Query().
	GroupBy(oauthauthorizationcode.FieldSessionType).
	Aggregate(_test.Count()).
	Scan(ctx, &v)

func (*OAuthAuthorizationCodeQuery) IDs

func (_q *OAuthAuthorizationCodeQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*OAuthAuthorizationCodeQuery) IDsX

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

func (*OAuthAuthorizationCodeQuery) Limit

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

func (*OAuthAuthorizationCodeQuery) Offset

Offset to start from.

func (*OAuthAuthorizationCodeQuery) Only

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

func (*OAuthAuthorizationCodeQuery) OnlyID

func (_q *OAuthAuthorizationCodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OAuthAuthorizationCodeQuery) OnlyIDX

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

func (*OAuthAuthorizationCodeQuery) OnlyX

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

func (*OAuthAuthorizationCodeQuery) Order

Order specifies how the records should be ordered.

func (*OAuthAuthorizationCodeQuery) Select

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

client.OAuthAuthorizationCode.Query().
	Select(oauthauthorizationcode.FieldSessionType).
	Scan(ctx, &v)

func (*OAuthAuthorizationCodeQuery) Unique

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

Where adds a new predicate for the OAuthAuthorizationCodeQuery builder.

type OAuthAuthorizationCodeSelect

type OAuthAuthorizationCodeSelect struct {
	*OAuthAuthorizationCodeQuery
	// contains filtered or unexported fields
}

OAuthAuthorizationCodeSelect is the builder for selecting fields of OAuthAuthorizationCode entities.

func (*OAuthAuthorizationCodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*OAuthAuthorizationCodeSelect) Bool

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

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

func (*OAuthAuthorizationCodeSelect) BoolX

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

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

func (*OAuthAuthorizationCodeSelect) Bools

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

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

func (*OAuthAuthorizationCodeSelect) BoolsX

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

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

func (*OAuthAuthorizationCodeSelect) Float64

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

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

func (*OAuthAuthorizationCodeSelect) Float64X

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

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

func (*OAuthAuthorizationCodeSelect) Float64s

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

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

func (*OAuthAuthorizationCodeSelect) Float64sX

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

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

func (*OAuthAuthorizationCodeSelect) Int

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

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

func (*OAuthAuthorizationCodeSelect) IntX

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

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

func (*OAuthAuthorizationCodeSelect) Ints

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

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

func (*OAuthAuthorizationCodeSelect) IntsX

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

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

func (*OAuthAuthorizationCodeSelect) Scan

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

func (*OAuthAuthorizationCodeSelect) ScanX

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

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

func (*OAuthAuthorizationCodeSelect) String

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

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

func (*OAuthAuthorizationCodeSelect) StringX

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

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

func (*OAuthAuthorizationCodeSelect) Strings

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

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

func (*OAuthAuthorizationCodeSelect) StringsX

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

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

type OAuthAuthorizationCodeUpdate

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

OAuthAuthorizationCodeUpdate is the builder for updating OAuthAuthorizationCode entities.

func (*OAuthAuthorizationCodeUpdate) AddUserID

AddUserID adds value to the "user_id" field.

func (*OAuthAuthorizationCodeUpdate) ClearExpiresAt

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthAuthorizationCodeUpdate) ClearRequestedAt

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthAuthorizationCodeUpdate) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*OAuthAuthorizationCodeUpdate) Exec

Exec executes the query.

func (*OAuthAuthorizationCodeUpdate) ExecX

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

func (*OAuthAuthorizationCodeUpdate) Mutation

Mutation returns the OAuthAuthorizationCodeMutation object of the builder.

func (*OAuthAuthorizationCodeUpdate) Save

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

func (*OAuthAuthorizationCodeUpdate) SaveX

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

func (*OAuthAuthorizationCodeUpdate) SetActive

SetActive sets the "active" field.

func (*OAuthAuthorizationCodeUpdate) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthAuthorizationCodeUpdate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthAuthorizationCodeUpdate) SetNillableActive

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableClientID

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableExpiresAt

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableRequestID

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableRequestedAt

func (_u *OAuthAuthorizationCodeUpdate) SetNillableRequestedAt(v *time.Time) *OAuthAuthorizationCodeUpdate

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableScopes

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableSessionType

func (_u *OAuthAuthorizationCodeUpdate) SetNillableSessionType(v *string) *OAuthAuthorizationCodeUpdate

SetNillableSessionType sets the "session_type" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableSignature

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdate) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthAuthorizationCodeUpdate) SetRequestedAt

SetRequestedAt sets the "requested_at" field.

func (*OAuthAuthorizationCodeUpdate) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthAuthorizationCodeUpdate) SetSessionData

func (_u *OAuthAuthorizationCodeUpdate) SetSessionData(v map[string]interface{}) *OAuthAuthorizationCodeUpdate

SetSessionData sets the "session_data" field.

func (*OAuthAuthorizationCodeUpdate) SetSessionType

SetSessionType sets the "session_type" field.

func (*OAuthAuthorizationCodeUpdate) SetSignature

SetSignature sets the "signature" field.

func (*OAuthAuthorizationCodeUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*OAuthAuthorizationCodeUpdate) Where

Where appends a list predicates to the OAuthAuthorizationCodeUpdate builder.

type OAuthAuthorizationCodeUpdateOne

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

OAuthAuthorizationCodeUpdateOne is the builder for updating a single OAuthAuthorizationCode entity.

func (*OAuthAuthorizationCodeUpdateOne) AddUserID

AddUserID adds value to the "user_id" field.

func (*OAuthAuthorizationCodeUpdateOne) ClearExpiresAt

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthAuthorizationCodeUpdateOne) ClearRequestedAt

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthAuthorizationCodeUpdateOne) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*OAuthAuthorizationCodeUpdateOne) Exec

Exec executes the query on the entity.

func (*OAuthAuthorizationCodeUpdateOne) ExecX

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

func (*OAuthAuthorizationCodeUpdateOne) Mutation

Mutation returns the OAuthAuthorizationCodeMutation object of the builder.

func (*OAuthAuthorizationCodeUpdateOne) Save

Save executes the query and returns the updated OAuthAuthorizationCode entity.

func (*OAuthAuthorizationCodeUpdateOne) SaveX

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

func (*OAuthAuthorizationCodeUpdateOne) Select

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

func (*OAuthAuthorizationCodeUpdateOne) SetActive

SetActive sets the "active" field.

func (*OAuthAuthorizationCodeUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthAuthorizationCodeUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableActive

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableClientID

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableExpiresAt

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableRequestID

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableRequestedAt

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableScopes

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableSessionType

SetNillableSessionType sets the "session_type" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableSignature

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthAuthorizationCodeUpdateOne) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthAuthorizationCodeUpdateOne) SetRequestedAt

SetRequestedAt sets the "requested_at" field.

func (*OAuthAuthorizationCodeUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthAuthorizationCodeUpdateOne) SetSessionData

func (_u *OAuthAuthorizationCodeUpdateOne) SetSessionData(v map[string]interface{}) *OAuthAuthorizationCodeUpdateOne

SetSessionData sets the "session_data" field.

func (*OAuthAuthorizationCodeUpdateOne) SetSessionType

SetSessionType sets the "session_type" field.

func (*OAuthAuthorizationCodeUpdateOne) SetSignature

SetSignature sets the "signature" field.

func (*OAuthAuthorizationCodeUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*OAuthAuthorizationCodeUpdateOne) Where

Where appends a list predicates to the OAuthAuthorizationCodeUpdate builder.

type OAuthAuthorizationCodes

type OAuthAuthorizationCodes []*OAuthAuthorizationCode

OAuthAuthorizationCodes is a parsable slice of OAuthAuthorizationCode.

type OAuthClient

type OAuthClient struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OAuth 2.0 client identifier
	ClientID string `json:"client_id,omitempty"`
	// Hashed client secret, empty for public clients
	ClientSecretHash string `json:"-"`
	// Allowed redirect URIs
	RedirectUris []string `json:"redirect_uris,omitempty"`
	// Allowed grant types
	GrantTypes []string `json:"grant_types,omitempty"`
	// Allowed response types
	ResponseTypes []string `json:"response_types,omitempty"`
	// Space-separated allowed scopes
	Scopes string `json:"scopes,omitempty"`
	// True for public clients
	IsPublic bool `json:"is_public,omitempty"`
	// Human-readable client name
	Name string `json:"name,omitempty"`
	// Optional consumer workspace/tenant ID
	WorkspaceID *int `json:"workspace_id,omitempty"`
	// contains filtered or unexported fields
}

OAuthClient is the model entity for the OAuthClient schema.

func (*OAuthClient) String

func (_m *OAuthClient) String() string

String implements the fmt.Stringer.

func (*OAuthClient) Unwrap

func (_m *OAuthClient) Unwrap() *OAuthClient

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

func (_m *OAuthClient) Update() *OAuthClientUpdateOne

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

func (*OAuthClient) Value

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

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

type OAuthClientClient

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

OAuthClientClient is a client for the OAuthClient schema.

func NewOAuthClientClient

func NewOAuthClientClient(c config) *OAuthClientClient

NewOAuthClientClient returns a client for the OAuthClient from the given config.

func (*OAuthClientClient) Create

func (c *OAuthClientClient) Create() *OAuthClientCreate

Create returns a builder for creating a OAuthClient entity.

func (*OAuthClientClient) CreateBulk

func (c *OAuthClientClient) CreateBulk(builders ...*OAuthClientCreate) *OAuthClientCreateBulk

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

func (*OAuthClientClient) Delete

func (c *OAuthClientClient) Delete() *OAuthClientDelete

Delete returns a delete builder for OAuthClient.

func (*OAuthClientClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OAuthClientClient) DeleteOneID

func (c *OAuthClientClient) DeleteOneID(id int) *OAuthClientDeleteOne

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

func (*OAuthClientClient) Get

func (c *OAuthClientClient) Get(ctx context.Context, id int) (*OAuthClient, error)

Get returns a OAuthClient entity by its id.

func (*OAuthClientClient) GetX

func (c *OAuthClientClient) GetX(ctx context.Context, id int) *OAuthClient

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

func (*OAuthClientClient) Hooks

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

Hooks returns the client hooks.

func (*OAuthClientClient) Intercept

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

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

func (*OAuthClientClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OAuthClientClient) MapCreateBulk

func (c *OAuthClientClient) MapCreateBulk(slice any, setFunc func(*OAuthClientCreate, int)) *OAuthClientCreateBulk

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

func (c *OAuthClientClient) Query() *OAuthClientQuery

Query returns a query builder for OAuthClient.

func (*OAuthClientClient) Update

func (c *OAuthClientClient) Update() *OAuthClientUpdate

Update returns an update builder for OAuthClient.

func (*OAuthClientClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OAuthClientClient) UpdateOneID

func (c *OAuthClientClient) UpdateOneID(id int) *OAuthClientUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OAuthClientClient) Use

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

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

type OAuthClientCreate

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

OAuthClientCreate is the builder for creating a OAuthClient entity.

func (*OAuthClientCreate) Exec

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

Exec executes the query.

func (*OAuthClientCreate) ExecX

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

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

func (*OAuthClientCreate) Mutation

func (_c *OAuthClientCreate) Mutation() *OAuthClientMutation

Mutation returns the OAuthClientMutation object of the builder.

func (*OAuthClientCreate) Save

Save creates the OAuthClient in the database.

func (*OAuthClientCreate) SaveX

func (_c *OAuthClientCreate) SaveX(ctx context.Context) *OAuthClient

SaveX calls Save and panics if Save returns an error.

func (*OAuthClientCreate) SetClientID

func (_c *OAuthClientCreate) SetClientID(v string) *OAuthClientCreate

SetClientID sets the "client_id" field.

func (*OAuthClientCreate) SetClientSecretHash

func (_c *OAuthClientCreate) SetClientSecretHash(v string) *OAuthClientCreate

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuthClientCreate) SetGrantTypes

func (_c *OAuthClientCreate) SetGrantTypes(v []string) *OAuthClientCreate

SetGrantTypes sets the "grant_types" field.

func (*OAuthClientCreate) SetIsPublic

func (_c *OAuthClientCreate) SetIsPublic(v bool) *OAuthClientCreate

SetIsPublic sets the "is_public" field.

func (*OAuthClientCreate) SetName

func (_c *OAuthClientCreate) SetName(v string) *OAuthClientCreate

SetName sets the "name" field.

func (*OAuthClientCreate) SetNillableClientSecretHash

func (_c *OAuthClientCreate) SetNillableClientSecretHash(v *string) *OAuthClientCreate

SetNillableClientSecretHash sets the "client_secret_hash" field if the given value is not nil.

func (*OAuthClientCreate) SetNillableIsPublic

func (_c *OAuthClientCreate) SetNillableIsPublic(v *bool) *OAuthClientCreate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*OAuthClientCreate) SetNillableScopes

func (_c *OAuthClientCreate) SetNillableScopes(v *string) *OAuthClientCreate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthClientCreate) SetNillableWorkspaceID

func (_c *OAuthClientCreate) SetNillableWorkspaceID(v *int) *OAuthClientCreate

SetNillableWorkspaceID sets the "workspace_id" field if the given value is not nil.

func (*OAuthClientCreate) SetRedirectUris

func (_c *OAuthClientCreate) SetRedirectUris(v []string) *OAuthClientCreate

SetRedirectUris sets the "redirect_uris" field.

func (*OAuthClientCreate) SetResponseTypes

func (_c *OAuthClientCreate) SetResponseTypes(v []string) *OAuthClientCreate

SetResponseTypes sets the "response_types" field.

func (*OAuthClientCreate) SetScopes

func (_c *OAuthClientCreate) SetScopes(v string) *OAuthClientCreate

SetScopes sets the "scopes" field.

func (*OAuthClientCreate) SetWorkspaceID

func (_c *OAuthClientCreate) SetWorkspaceID(v int) *OAuthClientCreate

SetWorkspaceID sets the "workspace_id" field.

type OAuthClientCreateBulk

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

OAuthClientCreateBulk is the builder for creating many OAuthClient entities in bulk.

func (*OAuthClientCreateBulk) Exec

Exec executes the query.

func (*OAuthClientCreateBulk) ExecX

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

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

func (*OAuthClientCreateBulk) Save

Save creates the OAuthClient entities in the database.

func (*OAuthClientCreateBulk) SaveX

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

type OAuthClientDelete

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

OAuthClientDelete is the builder for deleting a OAuthClient entity.

func (*OAuthClientDelete) Exec

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

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

func (*OAuthClientDelete) ExecX

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

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

func (*OAuthClientDelete) Where

Where appends a list predicates to the OAuthClientDelete builder.

type OAuthClientDeleteOne

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

OAuthClientDeleteOne is the builder for deleting a single OAuthClient entity.

func (*OAuthClientDeleteOne) Exec

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

Exec executes the deletion query.

func (*OAuthClientDeleteOne) ExecX

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

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

func (*OAuthClientDeleteOne) Where

Where appends a list predicates to the OAuthClientDelete builder.

type OAuthClientGroupBy

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

OAuthClientGroupBy is the group-by builder for OAuthClient entities.

func (*OAuthClientGroupBy) Aggregate

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

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

func (*OAuthClientGroupBy) Bool

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

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

func (*OAuthClientGroupBy) BoolX

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

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

func (*OAuthClientGroupBy) Bools

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

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

func (*OAuthClientGroupBy) BoolsX

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

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

func (*OAuthClientGroupBy) Float64

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

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

func (*OAuthClientGroupBy) Float64X

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

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

func (*OAuthClientGroupBy) Float64s

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

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

func (*OAuthClientGroupBy) Float64sX

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

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

func (*OAuthClientGroupBy) Int

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

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

func (*OAuthClientGroupBy) IntX

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

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

func (*OAuthClientGroupBy) Ints

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

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

func (*OAuthClientGroupBy) IntsX

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

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

func (*OAuthClientGroupBy) Scan

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

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

func (*OAuthClientGroupBy) ScanX

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

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

func (*OAuthClientGroupBy) String

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

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

func (*OAuthClientGroupBy) StringX

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

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

func (*OAuthClientGroupBy) Strings

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

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

func (*OAuthClientGroupBy) StringsX

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

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

type OAuthClientMutation

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

OAuthClientMutation represents an operation that mutates the OAuthClient nodes in the graph.

func (*OAuthClientMutation) AddField

func (m *OAuthClientMutation) 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 (*OAuthClientMutation) AddWorkspaceID

func (m *OAuthClientMutation) AddWorkspaceID(i int)

AddWorkspaceID adds i to the "workspace_id" field.

func (*OAuthClientMutation) AddedEdges

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

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

func (*OAuthClientMutation) AddedField

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

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

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

func (*OAuthClientMutation) AddedIDs

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

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

func (*OAuthClientMutation) AddedWorkspaceID

func (m *OAuthClientMutation) AddedWorkspaceID() (r int, exists bool)

AddedWorkspaceID returns the value that was added to the "workspace_id" field in this mutation.

func (*OAuthClientMutation) AppendGrantTypes

func (m *OAuthClientMutation) AppendGrantTypes(s []string)

AppendGrantTypes adds s to the "grant_types" field.

func (*OAuthClientMutation) AppendRedirectUris

func (m *OAuthClientMutation) AppendRedirectUris(s []string)

AppendRedirectUris adds s to the "redirect_uris" field.

func (*OAuthClientMutation) AppendResponseTypes

func (m *OAuthClientMutation) AppendResponseTypes(s []string)

AppendResponseTypes adds s to the "response_types" field.

func (*OAuthClientMutation) AppendedGrantTypes

func (m *OAuthClientMutation) AppendedGrantTypes() ([]string, bool)

AppendedGrantTypes returns the list of values that were appended to the "grant_types" field in this mutation.

func (*OAuthClientMutation) AppendedRedirectUris

func (m *OAuthClientMutation) AppendedRedirectUris() ([]string, bool)

AppendedRedirectUris returns the list of values that were appended to the "redirect_uris" field in this mutation.

func (*OAuthClientMutation) AppendedResponseTypes

func (m *OAuthClientMutation) AppendedResponseTypes() ([]string, bool)

AppendedResponseTypes returns the list of values that were appended to the "response_types" field in this mutation.

func (*OAuthClientMutation) ClearEdge

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

func (m *OAuthClientMutation) 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 (*OAuthClientMutation) ClearWorkspaceID

func (m *OAuthClientMutation) ClearWorkspaceID()

ClearWorkspaceID clears the value of the "workspace_id" field.

func (*OAuthClientMutation) ClearedEdges

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

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

func (*OAuthClientMutation) ClearedFields

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

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

func (OAuthClientMutation) Client

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

func (m *OAuthClientMutation) ClientID() (r string, exists bool)

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

func (*OAuthClientMutation) ClientSecretHash

func (m *OAuthClientMutation) ClientSecretHash() (r string, exists bool)

ClientSecretHash returns the value of the "client_secret_hash" field in the mutation.

func (*OAuthClientMutation) EdgeCleared

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

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

func (*OAuthClientMutation) Field

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

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

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

func (*OAuthClientMutation) Fields

func (m *OAuthClientMutation) 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 (*OAuthClientMutation) GrantTypes

func (m *OAuthClientMutation) GrantTypes() (r []string, exists bool)

GrantTypes returns the value of the "grant_types" field in the mutation.

func (*OAuthClientMutation) ID

func (m *OAuthClientMutation) ID() (id int, exists bool)

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

func (*OAuthClientMutation) IDs

func (m *OAuthClientMutation) IDs(ctx context.Context) ([]int, error)

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

func (*OAuthClientMutation) IsPublic

func (m *OAuthClientMutation) IsPublic() (r bool, exists bool)

IsPublic returns the value of the "is_public" field in the mutation.

func (*OAuthClientMutation) Name

func (m *OAuthClientMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*OAuthClientMutation) OldClientID

func (m *OAuthClientMutation) OldClientID(ctx context.Context) (v string, err error)

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

func (m *OAuthClientMutation) OldClientSecretHash(ctx context.Context) (v string, err error)

OldClientSecretHash returns the old "client_secret_hash" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) OldField

func (m *OAuthClientMutation) 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 (*OAuthClientMutation) OldGrantTypes

func (m *OAuthClientMutation) OldGrantTypes(ctx context.Context) (v []string, err error)

OldGrantTypes returns the old "grant_types" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) OldIsPublic

func (m *OAuthClientMutation) OldIsPublic(ctx context.Context) (v bool, err error)

OldIsPublic returns the old "is_public" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) OldName

func (m *OAuthClientMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) OldRedirectUris

func (m *OAuthClientMutation) OldRedirectUris(ctx context.Context) (v []string, err error)

OldRedirectUris returns the old "redirect_uris" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) OldResponseTypes

func (m *OAuthClientMutation) OldResponseTypes(ctx context.Context) (v []string, err error)

OldResponseTypes returns the old "response_types" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) OldScopes

func (m *OAuthClientMutation) OldScopes(ctx context.Context) (v string, err error)

OldScopes returns the old "scopes" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) OldWorkspaceID

func (m *OAuthClientMutation) OldWorkspaceID(ctx context.Context) (v *int, err error)

OldWorkspaceID returns the old "workspace_id" field's value of the OAuthClient entity. If the OAuthClient 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 (*OAuthClientMutation) Op

func (m *OAuthClientMutation) Op() Op

Op returns the operation name.

func (*OAuthClientMutation) RedirectUris

func (m *OAuthClientMutation) RedirectUris() (r []string, exists bool)

RedirectUris returns the value of the "redirect_uris" field in the mutation.

func (*OAuthClientMutation) RemovedEdges

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

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

func (*OAuthClientMutation) RemovedIDs

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

func (m *OAuthClientMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OAuthClientMutation) ResetClientSecretHash

func (m *OAuthClientMutation) ResetClientSecretHash()

ResetClientSecretHash resets all changes to the "client_secret_hash" field.

func (*OAuthClientMutation) ResetEdge

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

func (m *OAuthClientMutation) 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 (*OAuthClientMutation) ResetGrantTypes

func (m *OAuthClientMutation) ResetGrantTypes()

ResetGrantTypes resets all changes to the "grant_types" field.

func (*OAuthClientMutation) ResetIsPublic

func (m *OAuthClientMutation) ResetIsPublic()

ResetIsPublic resets all changes to the "is_public" field.

func (*OAuthClientMutation) ResetName

func (m *OAuthClientMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OAuthClientMutation) ResetRedirectUris

func (m *OAuthClientMutation) ResetRedirectUris()

ResetRedirectUris resets all changes to the "redirect_uris" field.

func (*OAuthClientMutation) ResetResponseTypes

func (m *OAuthClientMutation) ResetResponseTypes()

ResetResponseTypes resets all changes to the "response_types" field.

func (*OAuthClientMutation) ResetScopes

func (m *OAuthClientMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OAuthClientMutation) ResetWorkspaceID

func (m *OAuthClientMutation) ResetWorkspaceID()

ResetWorkspaceID resets all changes to the "workspace_id" field.

func (*OAuthClientMutation) ResponseTypes

func (m *OAuthClientMutation) ResponseTypes() (r []string, exists bool)

ResponseTypes returns the value of the "response_types" field in the mutation.

func (*OAuthClientMutation) Scopes

func (m *OAuthClientMutation) Scopes() (r string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*OAuthClientMutation) SetClientID

func (m *OAuthClientMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OAuthClientMutation) SetClientSecretHash

func (m *OAuthClientMutation) SetClientSecretHash(s string)

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuthClientMutation) SetField

func (m *OAuthClientMutation) 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 (*OAuthClientMutation) SetGrantTypes

func (m *OAuthClientMutation) SetGrantTypes(s []string)

SetGrantTypes sets the "grant_types" field.

func (*OAuthClientMutation) SetIsPublic

func (m *OAuthClientMutation) SetIsPublic(b bool)

SetIsPublic sets the "is_public" field.

func (*OAuthClientMutation) SetName

func (m *OAuthClientMutation) SetName(s string)

SetName sets the "name" field.

func (*OAuthClientMutation) SetOp

func (m *OAuthClientMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OAuthClientMutation) SetRedirectUris

func (m *OAuthClientMutation) SetRedirectUris(s []string)

SetRedirectUris sets the "redirect_uris" field.

func (*OAuthClientMutation) SetResponseTypes

func (m *OAuthClientMutation) SetResponseTypes(s []string)

SetResponseTypes sets the "response_types" field.

func (*OAuthClientMutation) SetScopes

func (m *OAuthClientMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*OAuthClientMutation) SetWorkspaceID

func (m *OAuthClientMutation) SetWorkspaceID(i int)

SetWorkspaceID sets the "workspace_id" field.

func (OAuthClientMutation) Tx

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

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

func (*OAuthClientMutation) Type

func (m *OAuthClientMutation) Type() string

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

func (*OAuthClientMutation) Where

func (m *OAuthClientMutation) Where(ps ...predicate.OAuthClient)

Where appends a list predicates to the OAuthClientMutation builder.

func (*OAuthClientMutation) WhereP

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

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

func (*OAuthClientMutation) WorkspaceID

func (m *OAuthClientMutation) WorkspaceID() (r int, exists bool)

WorkspaceID returns the value of the "workspace_id" field in the mutation.

func (*OAuthClientMutation) WorkspaceIDCleared

func (m *OAuthClientMutation) WorkspaceIDCleared() bool

WorkspaceIDCleared returns if the "workspace_id" field was cleared in this mutation.

type OAuthClientQuery

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

OAuthClientQuery is the builder for querying OAuthClient entities.

func (*OAuthClientQuery) Aggregate

func (_q *OAuthClientQuery) Aggregate(fns ...AggregateFunc) *OAuthClientSelect

Aggregate returns a OAuthClientSelect configured with the given aggregations.

func (*OAuthClientQuery) All

func (_q *OAuthClientQuery) All(ctx context.Context) ([]*OAuthClient, error)

All executes the query and returns a list of OAuthClients.

func (*OAuthClientQuery) AllX

func (_q *OAuthClientQuery) AllX(ctx context.Context) []*OAuthClient

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

func (*OAuthClientQuery) Clone

func (_q *OAuthClientQuery) Clone() *OAuthClientQuery

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

func (*OAuthClientQuery) Count

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

Count returns the count of the given query.

func (*OAuthClientQuery) CountX

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

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

func (*OAuthClientQuery) Exist

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

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

func (*OAuthClientQuery) ExistX

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

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

func (*OAuthClientQuery) First

func (_q *OAuthClientQuery) First(ctx context.Context) (*OAuthClient, error)

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

func (*OAuthClientQuery) FirstID

func (_q *OAuthClientQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OAuthClientQuery) FirstIDX

func (_q *OAuthClientQuery) FirstIDX(ctx context.Context) int

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

func (*OAuthClientQuery) FirstX

func (_q *OAuthClientQuery) FirstX(ctx context.Context) *OAuthClient

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

func (*OAuthClientQuery) GroupBy

func (_q *OAuthClientQuery) GroupBy(field string, fields ...string) *OAuthClientGroupBy

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

client.OAuthClient.Query().
	GroupBy(oauthclient.FieldClientID).
	Aggregate(_test.Count()).
	Scan(ctx, &v)

func (*OAuthClientQuery) IDs

func (_q *OAuthClientQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*OAuthClientQuery) IDsX

func (_q *OAuthClientQuery) IDsX(ctx context.Context) []int

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

func (*OAuthClientQuery) Limit

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

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

func (*OAuthClientQuery) Offset

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

Offset to start from.

func (*OAuthClientQuery) Only

func (_q *OAuthClientQuery) Only(ctx context.Context) (*OAuthClient, error)

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

func (*OAuthClientQuery) OnlyID

func (_q *OAuthClientQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OAuthClientQuery) OnlyIDX

func (_q *OAuthClientQuery) OnlyIDX(ctx context.Context) int

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

func (*OAuthClientQuery) OnlyX

func (_q *OAuthClientQuery) OnlyX(ctx context.Context) *OAuthClient

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

func (*OAuthClientQuery) Order

Order specifies how the records should be ordered.

func (*OAuthClientQuery) Select

func (_q *OAuthClientQuery) Select(fields ...string) *OAuthClientSelect

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

client.OAuthClient.Query().
	Select(oauthclient.FieldClientID).
	Scan(ctx, &v)

func (*OAuthClientQuery) Unique

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

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

Where adds a new predicate for the OAuthClientQuery builder.

type OAuthClientSelect

type OAuthClientSelect struct {
	*OAuthClientQuery
	// contains filtered or unexported fields
}

OAuthClientSelect is the builder for selecting fields of OAuthClient entities.

func (*OAuthClientSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*OAuthClientSelect) Bool

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

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

func (*OAuthClientSelect) BoolX

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

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

func (*OAuthClientSelect) Bools

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

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

func (*OAuthClientSelect) BoolsX

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

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

func (*OAuthClientSelect) Float64

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

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

func (*OAuthClientSelect) Float64X

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

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

func (*OAuthClientSelect) Float64s

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

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

func (*OAuthClientSelect) Float64sX

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

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

func (*OAuthClientSelect) Int

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

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

func (*OAuthClientSelect) IntX

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

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

func (*OAuthClientSelect) Ints

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

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

func (*OAuthClientSelect) IntsX

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

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

func (*OAuthClientSelect) Scan

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

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

func (*OAuthClientSelect) ScanX

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

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

func (*OAuthClientSelect) String

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

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

func (*OAuthClientSelect) StringX

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

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

func (*OAuthClientSelect) Strings

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

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

func (*OAuthClientSelect) StringsX

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

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

type OAuthClientUpdate

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

OAuthClientUpdate is the builder for updating OAuthClient entities.

func (*OAuthClientUpdate) AddWorkspaceID

func (_u *OAuthClientUpdate) AddWorkspaceID(v int) *OAuthClientUpdate

AddWorkspaceID adds value to the "workspace_id" field.

func (*OAuthClientUpdate) AppendGrantTypes

func (_u *OAuthClientUpdate) AppendGrantTypes(v []string) *OAuthClientUpdate

AppendGrantTypes appends value to the "grant_types" field.

func (*OAuthClientUpdate) AppendRedirectUris

func (_u *OAuthClientUpdate) AppendRedirectUris(v []string) *OAuthClientUpdate

AppendRedirectUris appends value to the "redirect_uris" field.

func (*OAuthClientUpdate) AppendResponseTypes

func (_u *OAuthClientUpdate) AppendResponseTypes(v []string) *OAuthClientUpdate

AppendResponseTypes appends value to the "response_types" field.

func (*OAuthClientUpdate) ClearWorkspaceID

func (_u *OAuthClientUpdate) ClearWorkspaceID() *OAuthClientUpdate

ClearWorkspaceID clears the value of the "workspace_id" field.

func (*OAuthClientUpdate) Exec

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

Exec executes the query.

func (*OAuthClientUpdate) ExecX

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

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

func (*OAuthClientUpdate) Mutation

func (_u *OAuthClientUpdate) Mutation() *OAuthClientMutation

Mutation returns the OAuthClientMutation object of the builder.

func (*OAuthClientUpdate) Save

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

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

func (*OAuthClientUpdate) SaveX

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

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

func (*OAuthClientUpdate) SetClientID

func (_u *OAuthClientUpdate) SetClientID(v string) *OAuthClientUpdate

SetClientID sets the "client_id" field.

func (*OAuthClientUpdate) SetClientSecretHash

func (_u *OAuthClientUpdate) SetClientSecretHash(v string) *OAuthClientUpdate

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuthClientUpdate) SetGrantTypes

func (_u *OAuthClientUpdate) SetGrantTypes(v []string) *OAuthClientUpdate

SetGrantTypes sets the "grant_types" field.

func (*OAuthClientUpdate) SetIsPublic

func (_u *OAuthClientUpdate) SetIsPublic(v bool) *OAuthClientUpdate

SetIsPublic sets the "is_public" field.

func (*OAuthClientUpdate) SetName

func (_u *OAuthClientUpdate) SetName(v string) *OAuthClientUpdate

SetName sets the "name" field.

func (*OAuthClientUpdate) SetNillableClientID

func (_u *OAuthClientUpdate) SetNillableClientID(v *string) *OAuthClientUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthClientUpdate) SetNillableClientSecretHash

func (_u *OAuthClientUpdate) SetNillableClientSecretHash(v *string) *OAuthClientUpdate

SetNillableClientSecretHash sets the "client_secret_hash" field if the given value is not nil.

func (*OAuthClientUpdate) SetNillableIsPublic

func (_u *OAuthClientUpdate) SetNillableIsPublic(v *bool) *OAuthClientUpdate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*OAuthClientUpdate) SetNillableName

func (_u *OAuthClientUpdate) SetNillableName(v *string) *OAuthClientUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*OAuthClientUpdate) SetNillableScopes

func (_u *OAuthClientUpdate) SetNillableScopes(v *string) *OAuthClientUpdate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthClientUpdate) SetNillableWorkspaceID

func (_u *OAuthClientUpdate) SetNillableWorkspaceID(v *int) *OAuthClientUpdate

SetNillableWorkspaceID sets the "workspace_id" field if the given value is not nil.

func (*OAuthClientUpdate) SetRedirectUris

func (_u *OAuthClientUpdate) SetRedirectUris(v []string) *OAuthClientUpdate

SetRedirectUris sets the "redirect_uris" field.

func (*OAuthClientUpdate) SetResponseTypes

func (_u *OAuthClientUpdate) SetResponseTypes(v []string) *OAuthClientUpdate

SetResponseTypes sets the "response_types" field.

func (*OAuthClientUpdate) SetScopes

func (_u *OAuthClientUpdate) SetScopes(v string) *OAuthClientUpdate

SetScopes sets the "scopes" field.

func (*OAuthClientUpdate) SetWorkspaceID

func (_u *OAuthClientUpdate) SetWorkspaceID(v int) *OAuthClientUpdate

SetWorkspaceID sets the "workspace_id" field.

func (*OAuthClientUpdate) Where

Where appends a list predicates to the OAuthClientUpdate builder.

type OAuthClientUpdateOne

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

OAuthClientUpdateOne is the builder for updating a single OAuthClient entity.

func (*OAuthClientUpdateOne) AddWorkspaceID

func (_u *OAuthClientUpdateOne) AddWorkspaceID(v int) *OAuthClientUpdateOne

AddWorkspaceID adds value to the "workspace_id" field.

func (*OAuthClientUpdateOne) AppendGrantTypes

func (_u *OAuthClientUpdateOne) AppendGrantTypes(v []string) *OAuthClientUpdateOne

AppendGrantTypes appends value to the "grant_types" field.

func (*OAuthClientUpdateOne) AppendRedirectUris

func (_u *OAuthClientUpdateOne) AppendRedirectUris(v []string) *OAuthClientUpdateOne

AppendRedirectUris appends value to the "redirect_uris" field.

func (*OAuthClientUpdateOne) AppendResponseTypes

func (_u *OAuthClientUpdateOne) AppendResponseTypes(v []string) *OAuthClientUpdateOne

AppendResponseTypes appends value to the "response_types" field.

func (*OAuthClientUpdateOne) ClearWorkspaceID

func (_u *OAuthClientUpdateOne) ClearWorkspaceID() *OAuthClientUpdateOne

ClearWorkspaceID clears the value of the "workspace_id" field.

func (*OAuthClientUpdateOne) Exec

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

Exec executes the query on the entity.

func (*OAuthClientUpdateOne) ExecX

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

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

func (*OAuthClientUpdateOne) Mutation

func (_u *OAuthClientUpdateOne) Mutation() *OAuthClientMutation

Mutation returns the OAuthClientMutation object of the builder.

func (*OAuthClientUpdateOne) Save

Save executes the query and returns the updated OAuthClient entity.

func (*OAuthClientUpdateOne) SaveX

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

func (*OAuthClientUpdateOne) Select

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

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

func (*OAuthClientUpdateOne) SetClientID

func (_u *OAuthClientUpdateOne) SetClientID(v string) *OAuthClientUpdateOne

SetClientID sets the "client_id" field.

func (*OAuthClientUpdateOne) SetClientSecretHash

func (_u *OAuthClientUpdateOne) SetClientSecretHash(v string) *OAuthClientUpdateOne

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuthClientUpdateOne) SetGrantTypes

func (_u *OAuthClientUpdateOne) SetGrantTypes(v []string) *OAuthClientUpdateOne

SetGrantTypes sets the "grant_types" field.

func (*OAuthClientUpdateOne) SetIsPublic

func (_u *OAuthClientUpdateOne) SetIsPublic(v bool) *OAuthClientUpdateOne

SetIsPublic sets the "is_public" field.

func (*OAuthClientUpdateOne) SetName

SetName sets the "name" field.

func (*OAuthClientUpdateOne) SetNillableClientID

func (_u *OAuthClientUpdateOne) SetNillableClientID(v *string) *OAuthClientUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthClientUpdateOne) SetNillableClientSecretHash

func (_u *OAuthClientUpdateOne) SetNillableClientSecretHash(v *string) *OAuthClientUpdateOne

SetNillableClientSecretHash sets the "client_secret_hash" field if the given value is not nil.

func (*OAuthClientUpdateOne) SetNillableIsPublic

func (_u *OAuthClientUpdateOne) SetNillableIsPublic(v *bool) *OAuthClientUpdateOne

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*OAuthClientUpdateOne) SetNillableName

func (_u *OAuthClientUpdateOne) SetNillableName(v *string) *OAuthClientUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*OAuthClientUpdateOne) SetNillableScopes

func (_u *OAuthClientUpdateOne) SetNillableScopes(v *string) *OAuthClientUpdateOne

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthClientUpdateOne) SetNillableWorkspaceID

func (_u *OAuthClientUpdateOne) SetNillableWorkspaceID(v *int) *OAuthClientUpdateOne

SetNillableWorkspaceID sets the "workspace_id" field if the given value is not nil.

func (*OAuthClientUpdateOne) SetRedirectUris

func (_u *OAuthClientUpdateOne) SetRedirectUris(v []string) *OAuthClientUpdateOne

SetRedirectUris sets the "redirect_uris" field.

func (*OAuthClientUpdateOne) SetResponseTypes

func (_u *OAuthClientUpdateOne) SetResponseTypes(v []string) *OAuthClientUpdateOne

SetResponseTypes sets the "response_types" field.

func (*OAuthClientUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthClientUpdateOne) SetWorkspaceID

func (_u *OAuthClientUpdateOne) SetWorkspaceID(v int) *OAuthClientUpdateOne

SetWorkspaceID sets the "workspace_id" field.

func (*OAuthClientUpdateOne) Where

Where appends a list predicates to the OAuthClientUpdate builder.

type OAuthClients

type OAuthClients []*OAuthClient

OAuthClients is a parsable slice of OAuthClient.

type OAuthRefreshToken

type OAuthRefreshToken struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type: authorization_code, access_token, refresh_token, pkce, oidc
	SessionType string `json:"session_type,omitempty"`
	// Unique token/code signature for lookup
	Signature string `json:"signature,omitempty"`
	// OAuth client ID that owns this session
	ClientID string `json:"client_id,omitempty"`
	// Optional consumer user ID
	UserID *int `json:"user_id,omitempty"`
	// Fosite request ID for token revocation
	RequestID string `json:"request_id,omitempty"`
	// Space-separated granted scopes
	Scopes string `json:"scopes,omitempty"`
	// Serialized Fosite session data
	SessionData map[string]interface{} `json:"session_data,omitempty"`
	// Whether this session is still valid
	Active bool `json:"active,omitempty"`
	// When this session expires
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// When Fosite created the original request
	RequestedAt *time.Time `json:"requested_at,omitempty"`
	// contains filtered or unexported fields
}

OAuthRefreshToken is the model entity for the OAuthRefreshToken schema.

func (*OAuthRefreshToken) String

func (_m *OAuthRefreshToken) String() string

String implements the fmt.Stringer.

func (*OAuthRefreshToken) Unwrap

func (_m *OAuthRefreshToken) Unwrap() *OAuthRefreshToken

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

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

func (*OAuthRefreshToken) Value

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

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

type OAuthRefreshTokenClient

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

OAuthRefreshTokenClient is a client for the OAuthRefreshToken schema.

func NewOAuthRefreshTokenClient

func NewOAuthRefreshTokenClient(c config) *OAuthRefreshTokenClient

NewOAuthRefreshTokenClient returns a client for the OAuthRefreshToken from the given config.

func (*OAuthRefreshTokenClient) Create

Create returns a builder for creating a OAuthRefreshToken entity.

func (*OAuthRefreshTokenClient) CreateBulk

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

func (*OAuthRefreshTokenClient) Delete

Delete returns a delete builder for OAuthRefreshToken.

func (*OAuthRefreshTokenClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OAuthRefreshTokenClient) DeleteOneID

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

func (*OAuthRefreshTokenClient) Get

Get returns a OAuthRefreshToken entity by its id.

func (*OAuthRefreshTokenClient) GetX

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

func (*OAuthRefreshTokenClient) Hooks

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

Hooks returns the client hooks.

func (*OAuthRefreshTokenClient) Intercept

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

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

func (*OAuthRefreshTokenClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OAuthRefreshTokenClient) MapCreateBulk

func (c *OAuthRefreshTokenClient) MapCreateBulk(slice any, setFunc func(*OAuthRefreshTokenCreate, int)) *OAuthRefreshTokenCreateBulk

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

Query returns a query builder for OAuthRefreshToken.

func (*OAuthRefreshTokenClient) Update

Update returns an update builder for OAuthRefreshToken.

func (*OAuthRefreshTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OAuthRefreshTokenClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OAuthRefreshTokenClient) Use

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

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

type OAuthRefreshTokenCreate

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

OAuthRefreshTokenCreate is the builder for creating a OAuthRefreshToken entity.

func (*OAuthRefreshTokenCreate) Exec

Exec executes the query.

func (*OAuthRefreshTokenCreate) ExecX

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

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

func (*OAuthRefreshTokenCreate) Mutation

Mutation returns the OAuthRefreshTokenMutation object of the builder.

func (*OAuthRefreshTokenCreate) Save

Save creates the OAuthRefreshToken in the database.

func (*OAuthRefreshTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OAuthRefreshTokenCreate) SetActive

SetActive sets the "active" field.

func (*OAuthRefreshTokenCreate) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthRefreshTokenCreate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthRefreshTokenCreate) SetNillableActive

func (_c *OAuthRefreshTokenCreate) SetNillableActive(v *bool) *OAuthRefreshTokenCreate

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthRefreshTokenCreate) SetNillableExpiresAt

func (_c *OAuthRefreshTokenCreate) SetNillableExpiresAt(v *time.Time) *OAuthRefreshTokenCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthRefreshTokenCreate) SetNillableRequestID

func (_c *OAuthRefreshTokenCreate) SetNillableRequestID(v *string) *OAuthRefreshTokenCreate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthRefreshTokenCreate) SetNillableRequestedAt

func (_c *OAuthRefreshTokenCreate) SetNillableRequestedAt(v *time.Time) *OAuthRefreshTokenCreate

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthRefreshTokenCreate) SetNillableScopes

func (_c *OAuthRefreshTokenCreate) SetNillableScopes(v *string) *OAuthRefreshTokenCreate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthRefreshTokenCreate) SetNillableUserID

func (_c *OAuthRefreshTokenCreate) SetNillableUserID(v *int) *OAuthRefreshTokenCreate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthRefreshTokenCreate) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthRefreshTokenCreate) SetRequestedAt

SetRequestedAt sets the "requested_at" field.

func (*OAuthRefreshTokenCreate) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthRefreshTokenCreate) SetSessionData

func (_c *OAuthRefreshTokenCreate) SetSessionData(v map[string]interface{}) *OAuthRefreshTokenCreate

SetSessionData sets the "session_data" field.

func (*OAuthRefreshTokenCreate) SetSessionType

SetSessionType sets the "session_type" field.

func (*OAuthRefreshTokenCreate) SetSignature

SetSignature sets the "signature" field.

func (*OAuthRefreshTokenCreate) SetUserID

SetUserID sets the "user_id" field.

type OAuthRefreshTokenCreateBulk

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

OAuthRefreshTokenCreateBulk is the builder for creating many OAuthRefreshToken entities in bulk.

func (*OAuthRefreshTokenCreateBulk) Exec

Exec executes the query.

func (*OAuthRefreshTokenCreateBulk) ExecX

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

func (*OAuthRefreshTokenCreateBulk) Save

Save creates the OAuthRefreshToken entities in the database.

func (*OAuthRefreshTokenCreateBulk) SaveX

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

type OAuthRefreshTokenDelete

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

OAuthRefreshTokenDelete is the builder for deleting a OAuthRefreshToken entity.

func (*OAuthRefreshTokenDelete) Exec

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

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

func (*OAuthRefreshTokenDelete) ExecX

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

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

func (*OAuthRefreshTokenDelete) Where

Where appends a list predicates to the OAuthRefreshTokenDelete builder.

type OAuthRefreshTokenDeleteOne

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

OAuthRefreshTokenDeleteOne is the builder for deleting a single OAuthRefreshToken entity.

func (*OAuthRefreshTokenDeleteOne) Exec

Exec executes the deletion query.

func (*OAuthRefreshTokenDeleteOne) ExecX

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

func (*OAuthRefreshTokenDeleteOne) Where

Where appends a list predicates to the OAuthRefreshTokenDelete builder.

type OAuthRefreshTokenGroupBy

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

OAuthRefreshTokenGroupBy is the group-by builder for OAuthRefreshToken entities.

func (*OAuthRefreshTokenGroupBy) Aggregate

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

func (*OAuthRefreshTokenGroupBy) Bool

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

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

func (*OAuthRefreshTokenGroupBy) BoolX

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

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

func (*OAuthRefreshTokenGroupBy) Bools

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

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

func (*OAuthRefreshTokenGroupBy) BoolsX

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

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

func (*OAuthRefreshTokenGroupBy) Float64

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

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

func (*OAuthRefreshTokenGroupBy) Float64X

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

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

func (*OAuthRefreshTokenGroupBy) Float64s

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

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

func (*OAuthRefreshTokenGroupBy) Float64sX

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

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

func (*OAuthRefreshTokenGroupBy) Int

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

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

func (*OAuthRefreshTokenGroupBy) IntX

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

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

func (*OAuthRefreshTokenGroupBy) Ints

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

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

func (*OAuthRefreshTokenGroupBy) IntsX

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

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

func (*OAuthRefreshTokenGroupBy) Scan

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

func (*OAuthRefreshTokenGroupBy) ScanX

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

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

func (*OAuthRefreshTokenGroupBy) String

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

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

func (*OAuthRefreshTokenGroupBy) StringX

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

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

func (*OAuthRefreshTokenGroupBy) Strings

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

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

func (*OAuthRefreshTokenGroupBy) StringsX

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

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

type OAuthRefreshTokenMutation

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

OAuthRefreshTokenMutation represents an operation that mutates the OAuthRefreshToken nodes in the graph.

func (*OAuthRefreshTokenMutation) Active

func (m *OAuthRefreshTokenMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*OAuthRefreshTokenMutation) AddField

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

func (m *OAuthRefreshTokenMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*OAuthRefreshTokenMutation) AddedEdges

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

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

func (*OAuthRefreshTokenMutation) AddedField

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

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

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

func (*OAuthRefreshTokenMutation) AddedIDs

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

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

func (*OAuthRefreshTokenMutation) AddedUserID

func (m *OAuthRefreshTokenMutation) AddedUserID() (r int, exists bool)

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

func (*OAuthRefreshTokenMutation) ClearEdge

func (m *OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) ClearExpiresAt

func (m *OAuthRefreshTokenMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthRefreshTokenMutation) ClearField

func (m *OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) ClearRequestedAt

func (m *OAuthRefreshTokenMutation) ClearRequestedAt()

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthRefreshTokenMutation) ClearUserID

func (m *OAuthRefreshTokenMutation) ClearUserID()

ClearUserID clears the value of the "user_id" field.

func (*OAuthRefreshTokenMutation) ClearedEdges

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

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

func (*OAuthRefreshTokenMutation) ClearedFields

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

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

func (OAuthRefreshTokenMutation) Client

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

func (m *OAuthRefreshTokenMutation) ClientID() (r string, exists bool)

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

func (*OAuthRefreshTokenMutation) EdgeCleared

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

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

func (*OAuthRefreshTokenMutation) ExpiresAt

func (m *OAuthRefreshTokenMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*OAuthRefreshTokenMutation) ExpiresAtCleared

func (m *OAuthRefreshTokenMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*OAuthRefreshTokenMutation) Field

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

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

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

func (*OAuthRefreshTokenMutation) Fields

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

func (m *OAuthRefreshTokenMutation) ID() (id int, exists bool)

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

func (*OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) OldActive

func (m *OAuthRefreshTokenMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldClientID

func (m *OAuthRefreshTokenMutation) OldClientID(ctx context.Context) (v string, err error)

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

func (m *OAuthRefreshTokenMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldField

func (m *OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) OldRequestID

func (m *OAuthRefreshTokenMutation) OldRequestID(ctx context.Context) (v string, err error)

OldRequestID returns the old "request_id" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldRequestedAt

func (m *OAuthRefreshTokenMutation) OldRequestedAt(ctx context.Context) (v *time.Time, err error)

OldRequestedAt returns the old "requested_at" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldScopes

func (m *OAuthRefreshTokenMutation) OldScopes(ctx context.Context) (v string, err error)

OldScopes returns the old "scopes" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldSessionData

func (m *OAuthRefreshTokenMutation) OldSessionData(ctx context.Context) (v map[string]interface{}, err error)

OldSessionData returns the old "session_data" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldSessionType

func (m *OAuthRefreshTokenMutation) OldSessionType(ctx context.Context) (v string, err error)

OldSessionType returns the old "session_type" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldSignature

func (m *OAuthRefreshTokenMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old "signature" field's value of the OAuthRefreshToken entity. If the OAuthRefreshToken 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 (*OAuthRefreshTokenMutation) OldUserID

func (m *OAuthRefreshTokenMutation) OldUserID(ctx context.Context) (v *int, err error)

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

func (m *OAuthRefreshTokenMutation) Op() Op

Op returns the operation name.

func (*OAuthRefreshTokenMutation) RemovedEdges

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

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

func (*OAuthRefreshTokenMutation) RemovedIDs

func (m *OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) RequestID

func (m *OAuthRefreshTokenMutation) RequestID() (r string, exists bool)

RequestID returns the value of the "request_id" field in the mutation.

func (*OAuthRefreshTokenMutation) RequestedAt

func (m *OAuthRefreshTokenMutation) RequestedAt() (r time.Time, exists bool)

RequestedAt returns the value of the "requested_at" field in the mutation.

func (*OAuthRefreshTokenMutation) RequestedAtCleared

func (m *OAuthRefreshTokenMutation) RequestedAtCleared() bool

RequestedAtCleared returns if the "requested_at" field was cleared in this mutation.

func (*OAuthRefreshTokenMutation) ResetActive

func (m *OAuthRefreshTokenMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*OAuthRefreshTokenMutation) ResetClientID

func (m *OAuthRefreshTokenMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OAuthRefreshTokenMutation) ResetEdge

func (m *OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) ResetExpiresAt

func (m *OAuthRefreshTokenMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*OAuthRefreshTokenMutation) ResetField

func (m *OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) ResetRequestID

func (m *OAuthRefreshTokenMutation) ResetRequestID()

ResetRequestID resets all changes to the "request_id" field.

func (*OAuthRefreshTokenMutation) ResetRequestedAt

func (m *OAuthRefreshTokenMutation) ResetRequestedAt()

ResetRequestedAt resets all changes to the "requested_at" field.

func (*OAuthRefreshTokenMutation) ResetScopes

func (m *OAuthRefreshTokenMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OAuthRefreshTokenMutation) ResetSessionData

func (m *OAuthRefreshTokenMutation) ResetSessionData()

ResetSessionData resets all changes to the "session_data" field.

func (*OAuthRefreshTokenMutation) ResetSessionType

func (m *OAuthRefreshTokenMutation) ResetSessionType()

ResetSessionType resets all changes to the "session_type" field.

func (*OAuthRefreshTokenMutation) ResetSignature

func (m *OAuthRefreshTokenMutation) ResetSignature()

ResetSignature resets all changes to the "signature" field.

func (*OAuthRefreshTokenMutation) ResetUserID

func (m *OAuthRefreshTokenMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*OAuthRefreshTokenMutation) Scopes

func (m *OAuthRefreshTokenMutation) Scopes() (r string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*OAuthRefreshTokenMutation) SessionData

func (m *OAuthRefreshTokenMutation) SessionData() (r map[string]interface{}, exists bool)

SessionData returns the value of the "session_data" field in the mutation.

func (*OAuthRefreshTokenMutation) SessionType

func (m *OAuthRefreshTokenMutation) SessionType() (r string, exists bool)

SessionType returns the value of the "session_type" field in the mutation.

func (*OAuthRefreshTokenMutation) SetActive

func (m *OAuthRefreshTokenMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*OAuthRefreshTokenMutation) SetClientID

func (m *OAuthRefreshTokenMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OAuthRefreshTokenMutation) SetExpiresAt

func (m *OAuthRefreshTokenMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*OAuthRefreshTokenMutation) SetField

func (m *OAuthRefreshTokenMutation) 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 (*OAuthRefreshTokenMutation) SetOp

func (m *OAuthRefreshTokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OAuthRefreshTokenMutation) SetRequestID

func (m *OAuthRefreshTokenMutation) SetRequestID(s string)

SetRequestID sets the "request_id" field.

func (*OAuthRefreshTokenMutation) SetRequestedAt

func (m *OAuthRefreshTokenMutation) SetRequestedAt(t time.Time)

SetRequestedAt sets the "requested_at" field.

func (*OAuthRefreshTokenMutation) SetScopes

func (m *OAuthRefreshTokenMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*OAuthRefreshTokenMutation) SetSessionData

func (m *OAuthRefreshTokenMutation) SetSessionData(value map[string]interface{})

SetSessionData sets the "session_data" field.

func (*OAuthRefreshTokenMutation) SetSessionType

func (m *OAuthRefreshTokenMutation) SetSessionType(s string)

SetSessionType sets the "session_type" field.

func (*OAuthRefreshTokenMutation) SetSignature

func (m *OAuthRefreshTokenMutation) SetSignature(s string)

SetSignature sets the "signature" field.

func (*OAuthRefreshTokenMutation) SetUserID

func (m *OAuthRefreshTokenMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*OAuthRefreshTokenMutation) Signature

func (m *OAuthRefreshTokenMutation) Signature() (r string, exists bool)

Signature returns the value of the "signature" field in the mutation.

func (OAuthRefreshTokenMutation) Tx

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

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

func (*OAuthRefreshTokenMutation) Type

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

func (*OAuthRefreshTokenMutation) UserID

func (m *OAuthRefreshTokenMutation) UserID() (r int, exists bool)

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

func (*OAuthRefreshTokenMutation) UserIDCleared

func (m *OAuthRefreshTokenMutation) UserIDCleared() bool

UserIDCleared returns if the "user_id" field was cleared in this mutation.

func (*OAuthRefreshTokenMutation) Where

Where appends a list predicates to the OAuthRefreshTokenMutation builder.

func (*OAuthRefreshTokenMutation) WhereP

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

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

type OAuthRefreshTokenQuery

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

OAuthRefreshTokenQuery is the builder for querying OAuthRefreshToken entities.

func (*OAuthRefreshTokenQuery) Aggregate

Aggregate returns a OAuthRefreshTokenSelect configured with the given aggregations.

func (*OAuthRefreshTokenQuery) All

All executes the query and returns a list of OAuthRefreshTokens.

func (*OAuthRefreshTokenQuery) AllX

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

func (*OAuthRefreshTokenQuery) Clone

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

func (*OAuthRefreshTokenQuery) Count

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

Count returns the count of the given query.

func (*OAuthRefreshTokenQuery) CountX

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

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

func (*OAuthRefreshTokenQuery) Exist

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

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

func (*OAuthRefreshTokenQuery) ExistX

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

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

func (*OAuthRefreshTokenQuery) First

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

func (*OAuthRefreshTokenQuery) FirstID

func (_q *OAuthRefreshTokenQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OAuthRefreshTokenQuery) FirstIDX

func (_q *OAuthRefreshTokenQuery) FirstIDX(ctx context.Context) int

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

func (*OAuthRefreshTokenQuery) FirstX

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

func (*OAuthRefreshTokenQuery) GroupBy

func (_q *OAuthRefreshTokenQuery) GroupBy(field string, fields ...string) *OAuthRefreshTokenGroupBy

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

client.OAuthRefreshToken.Query().
	GroupBy(oauthrefreshtoken.FieldSessionType).
	Aggregate(_test.Count()).
	Scan(ctx, &v)

func (*OAuthRefreshTokenQuery) IDs

func (_q *OAuthRefreshTokenQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*OAuthRefreshTokenQuery) IDsX

func (_q *OAuthRefreshTokenQuery) IDsX(ctx context.Context) []int

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

func (*OAuthRefreshTokenQuery) Limit

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

func (*OAuthRefreshTokenQuery) Offset

Offset to start from.

func (*OAuthRefreshTokenQuery) Only

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

func (*OAuthRefreshTokenQuery) OnlyID

func (_q *OAuthRefreshTokenQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OAuthRefreshTokenQuery) OnlyIDX

func (_q *OAuthRefreshTokenQuery) OnlyIDX(ctx context.Context) int

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

func (*OAuthRefreshTokenQuery) OnlyX

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

func (*OAuthRefreshTokenQuery) Order

Order specifies how the records should be ordered.

func (*OAuthRefreshTokenQuery) Select

func (_q *OAuthRefreshTokenQuery) Select(fields ...string) *OAuthRefreshTokenSelect

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

client.OAuthRefreshToken.Query().
	Select(oauthrefreshtoken.FieldSessionType).
	Scan(ctx, &v)

func (*OAuthRefreshTokenQuery) Unique

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

Where adds a new predicate for the OAuthRefreshTokenQuery builder.

type OAuthRefreshTokenSelect

type OAuthRefreshTokenSelect struct {
	*OAuthRefreshTokenQuery
	// contains filtered or unexported fields
}

OAuthRefreshTokenSelect is the builder for selecting fields of OAuthRefreshToken entities.

func (*OAuthRefreshTokenSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*OAuthRefreshTokenSelect) Bool

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

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

func (*OAuthRefreshTokenSelect) BoolX

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

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

func (*OAuthRefreshTokenSelect) Bools

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

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

func (*OAuthRefreshTokenSelect) BoolsX

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

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

func (*OAuthRefreshTokenSelect) Float64

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

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

func (*OAuthRefreshTokenSelect) Float64X

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

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

func (*OAuthRefreshTokenSelect) Float64s

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

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

func (*OAuthRefreshTokenSelect) Float64sX

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

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

func (*OAuthRefreshTokenSelect) Int

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

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

func (*OAuthRefreshTokenSelect) IntX

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

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

func (*OAuthRefreshTokenSelect) Ints

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

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

func (*OAuthRefreshTokenSelect) IntsX

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

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

func (*OAuthRefreshTokenSelect) Scan

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

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

func (*OAuthRefreshTokenSelect) ScanX

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

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

func (*OAuthRefreshTokenSelect) String

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

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

func (*OAuthRefreshTokenSelect) StringX

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

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

func (*OAuthRefreshTokenSelect) Strings

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

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

func (*OAuthRefreshTokenSelect) StringsX

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

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

type OAuthRefreshTokenUpdate

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

OAuthRefreshTokenUpdate is the builder for updating OAuthRefreshToken entities.

func (*OAuthRefreshTokenUpdate) AddUserID

AddUserID adds value to the "user_id" field.

func (*OAuthRefreshTokenUpdate) ClearExpiresAt

func (_u *OAuthRefreshTokenUpdate) ClearExpiresAt() *OAuthRefreshTokenUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthRefreshTokenUpdate) ClearRequestedAt

func (_u *OAuthRefreshTokenUpdate) ClearRequestedAt() *OAuthRefreshTokenUpdate

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthRefreshTokenUpdate) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*OAuthRefreshTokenUpdate) Exec

Exec executes the query.

func (*OAuthRefreshTokenUpdate) ExecX

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

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

func (*OAuthRefreshTokenUpdate) Mutation

Mutation returns the OAuthRefreshTokenMutation object of the builder.

func (*OAuthRefreshTokenUpdate) Save

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

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

func (*OAuthRefreshTokenUpdate) SaveX

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

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

func (*OAuthRefreshTokenUpdate) SetActive

SetActive sets the "active" field.

func (*OAuthRefreshTokenUpdate) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthRefreshTokenUpdate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthRefreshTokenUpdate) SetNillableActive

func (_u *OAuthRefreshTokenUpdate) SetNillableActive(v *bool) *OAuthRefreshTokenUpdate

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableClientID

func (_u *OAuthRefreshTokenUpdate) SetNillableClientID(v *string) *OAuthRefreshTokenUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableExpiresAt

func (_u *OAuthRefreshTokenUpdate) SetNillableExpiresAt(v *time.Time) *OAuthRefreshTokenUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableRequestID

func (_u *OAuthRefreshTokenUpdate) SetNillableRequestID(v *string) *OAuthRefreshTokenUpdate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableRequestedAt

func (_u *OAuthRefreshTokenUpdate) SetNillableRequestedAt(v *time.Time) *OAuthRefreshTokenUpdate

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableScopes

func (_u *OAuthRefreshTokenUpdate) SetNillableScopes(v *string) *OAuthRefreshTokenUpdate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableSessionType

func (_u *OAuthRefreshTokenUpdate) SetNillableSessionType(v *string) *OAuthRefreshTokenUpdate

SetNillableSessionType sets the "session_type" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableSignature

func (_u *OAuthRefreshTokenUpdate) SetNillableSignature(v *string) *OAuthRefreshTokenUpdate

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetNillableUserID

func (_u *OAuthRefreshTokenUpdate) SetNillableUserID(v *int) *OAuthRefreshTokenUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthRefreshTokenUpdate) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthRefreshTokenUpdate) SetRequestedAt

SetRequestedAt sets the "requested_at" field.

func (*OAuthRefreshTokenUpdate) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthRefreshTokenUpdate) SetSessionData

func (_u *OAuthRefreshTokenUpdate) SetSessionData(v map[string]interface{}) *OAuthRefreshTokenUpdate

SetSessionData sets the "session_data" field.

func (*OAuthRefreshTokenUpdate) SetSessionType

SetSessionType sets the "session_type" field.

func (*OAuthRefreshTokenUpdate) SetSignature

SetSignature sets the "signature" field.

func (*OAuthRefreshTokenUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*OAuthRefreshTokenUpdate) Where

Where appends a list predicates to the OAuthRefreshTokenUpdate builder.

type OAuthRefreshTokenUpdateOne

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

OAuthRefreshTokenUpdateOne is the builder for updating a single OAuthRefreshToken entity.

func (*OAuthRefreshTokenUpdateOne) AddUserID

AddUserID adds value to the "user_id" field.

func (*OAuthRefreshTokenUpdateOne) ClearExpiresAt

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthRefreshTokenUpdateOne) ClearRequestedAt

ClearRequestedAt clears the value of the "requested_at" field.

func (*OAuthRefreshTokenUpdateOne) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*OAuthRefreshTokenUpdateOne) Exec

Exec executes the query on the entity.

func (*OAuthRefreshTokenUpdateOne) ExecX

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

func (*OAuthRefreshTokenUpdateOne) Mutation

Mutation returns the OAuthRefreshTokenMutation object of the builder.

func (*OAuthRefreshTokenUpdateOne) Save

Save executes the query and returns the updated OAuthRefreshToken entity.

func (*OAuthRefreshTokenUpdateOne) SaveX

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

func (*OAuthRefreshTokenUpdateOne) Select

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

func (*OAuthRefreshTokenUpdateOne) SetActive

SetActive sets the "active" field.

func (*OAuthRefreshTokenUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*OAuthRefreshTokenUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthRefreshTokenUpdateOne) SetNillableActive

func (_u *OAuthRefreshTokenUpdateOne) SetNillableActive(v *bool) *OAuthRefreshTokenUpdateOne

SetNillableActive sets the "active" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableClientID

func (_u *OAuthRefreshTokenUpdateOne) SetNillableClientID(v *string) *OAuthRefreshTokenUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableExpiresAt

func (_u *OAuthRefreshTokenUpdateOne) SetNillableExpiresAt(v *time.Time) *OAuthRefreshTokenUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableRequestID

func (_u *OAuthRefreshTokenUpdateOne) SetNillableRequestID(v *string) *OAuthRefreshTokenUpdateOne

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableRequestedAt

func (_u *OAuthRefreshTokenUpdateOne) SetNillableRequestedAt(v *time.Time) *OAuthRefreshTokenUpdateOne

SetNillableRequestedAt sets the "requested_at" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableScopes

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableSessionType

func (_u *OAuthRefreshTokenUpdateOne) SetNillableSessionType(v *string) *OAuthRefreshTokenUpdateOne

SetNillableSessionType sets the "session_type" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableSignature

func (_u *OAuthRefreshTokenUpdateOne) SetNillableSignature(v *string) *OAuthRefreshTokenUpdateOne

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetNillableUserID

func (_u *OAuthRefreshTokenUpdateOne) SetNillableUserID(v *int) *OAuthRefreshTokenUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuthRefreshTokenUpdateOne) SetRequestID

SetRequestID sets the "request_id" field.

func (*OAuthRefreshTokenUpdateOne) SetRequestedAt

SetRequestedAt sets the "requested_at" field.

func (*OAuthRefreshTokenUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*OAuthRefreshTokenUpdateOne) SetSessionData

func (_u *OAuthRefreshTokenUpdateOne) SetSessionData(v map[string]interface{}) *OAuthRefreshTokenUpdateOne

SetSessionData sets the "session_data" field.

func (*OAuthRefreshTokenUpdateOne) SetSessionType

SetSessionType sets the "session_type" field.

func (*OAuthRefreshTokenUpdateOne) SetSignature

SetSignature sets the "signature" field.

func (*OAuthRefreshTokenUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*OAuthRefreshTokenUpdateOne) Where

Where appends a list predicates to the OAuthRefreshTokenUpdate builder.

type OAuthRefreshTokens

type OAuthRefreshTokens []*OAuthRefreshToken

OAuthRefreshTokens is a parsable slice of OAuthRefreshToken.

type OAuthSigningKey

type OAuthSigningKey struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Key ID for JWKS
	Kid string `json:"kid,omitempty"`
	// Signing algorithm
	Algorithm string `json:"algorithm,omitempty"`
	// PEM-encoded RSA private key
	PrivateKeyPem string `json:"-"`
	// PEM-encoded RSA public key
	PublicKeyPem string `json:"public_key_pem,omitempty"`
	// Only active keys sign new tokens
	IsActive bool `json:"is_active,omitempty"`
	// Key expiry for rotation
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// Retired keys stay in JWKS until this time passes
	RetiredAt *time.Time `json:"retired_at,omitempty"`
	// contains filtered or unexported fields
}

OAuthSigningKey is the model entity for the OAuthSigningKey schema.

func (*OAuthSigningKey) String

func (_m *OAuthSigningKey) String() string

String implements the fmt.Stringer.

func (*OAuthSigningKey) Unwrap

func (_m *OAuthSigningKey) Unwrap() *OAuthSigningKey

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

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

func (*OAuthSigningKey) Value

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

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

type OAuthSigningKeyClient

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

OAuthSigningKeyClient is a client for the OAuthSigningKey schema.

func NewOAuthSigningKeyClient

func NewOAuthSigningKeyClient(c config) *OAuthSigningKeyClient

NewOAuthSigningKeyClient returns a client for the OAuthSigningKey from the given config.

func (*OAuthSigningKeyClient) Create

Create returns a builder for creating a OAuthSigningKey entity.

func (*OAuthSigningKeyClient) CreateBulk

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

func (*OAuthSigningKeyClient) Delete

Delete returns a delete builder for OAuthSigningKey.

func (*OAuthSigningKeyClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OAuthSigningKeyClient) DeleteOneID

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

func (*OAuthSigningKeyClient) Get

Get returns a OAuthSigningKey entity by its id.

func (*OAuthSigningKeyClient) GetX

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

func (*OAuthSigningKeyClient) Hooks

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

Hooks returns the client hooks.

func (*OAuthSigningKeyClient) Intercept

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

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

func (*OAuthSigningKeyClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OAuthSigningKeyClient) MapCreateBulk

func (c *OAuthSigningKeyClient) MapCreateBulk(slice any, setFunc func(*OAuthSigningKeyCreate, int)) *OAuthSigningKeyCreateBulk

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

Query returns a query builder for OAuthSigningKey.

func (*OAuthSigningKeyClient) Update

Update returns an update builder for OAuthSigningKey.

func (*OAuthSigningKeyClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OAuthSigningKeyClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OAuthSigningKeyClient) Use

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

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

type OAuthSigningKeyCreate

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

OAuthSigningKeyCreate is the builder for creating a OAuthSigningKey entity.

func (*OAuthSigningKeyCreate) Exec

Exec executes the query.

func (*OAuthSigningKeyCreate) ExecX

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

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

func (*OAuthSigningKeyCreate) Mutation

Mutation returns the OAuthSigningKeyMutation object of the builder.

func (*OAuthSigningKeyCreate) Save

Save creates the OAuthSigningKey in the database.

func (*OAuthSigningKeyCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OAuthSigningKeyCreate) SetAlgorithm

func (_c *OAuthSigningKeyCreate) SetAlgorithm(v string) *OAuthSigningKeyCreate

SetAlgorithm sets the "algorithm" field.

func (*OAuthSigningKeyCreate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthSigningKeyCreate) SetIsActive

func (_c *OAuthSigningKeyCreate) SetIsActive(v bool) *OAuthSigningKeyCreate

SetIsActive sets the "is_active" field.

func (*OAuthSigningKeyCreate) SetKid

SetKid sets the "kid" field.

func (*OAuthSigningKeyCreate) SetNillableAlgorithm

func (_c *OAuthSigningKeyCreate) SetNillableAlgorithm(v *string) *OAuthSigningKeyCreate

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

func (*OAuthSigningKeyCreate) SetNillableExpiresAt

func (_c *OAuthSigningKeyCreate) SetNillableExpiresAt(v *time.Time) *OAuthSigningKeyCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthSigningKeyCreate) SetNillableIsActive

func (_c *OAuthSigningKeyCreate) SetNillableIsActive(v *bool) *OAuthSigningKeyCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*OAuthSigningKeyCreate) SetNillableRetiredAt

func (_c *OAuthSigningKeyCreate) SetNillableRetiredAt(v *time.Time) *OAuthSigningKeyCreate

SetNillableRetiredAt sets the "retired_at" field if the given value is not nil.

func (*OAuthSigningKeyCreate) SetPrivateKeyPem

func (_c *OAuthSigningKeyCreate) SetPrivateKeyPem(v string) *OAuthSigningKeyCreate

SetPrivateKeyPem sets the "private_key_pem" field.

func (*OAuthSigningKeyCreate) SetPublicKeyPem

func (_c *OAuthSigningKeyCreate) SetPublicKeyPem(v string) *OAuthSigningKeyCreate

SetPublicKeyPem sets the "public_key_pem" field.

func (*OAuthSigningKeyCreate) SetRetiredAt

SetRetiredAt sets the "retired_at" field.

type OAuthSigningKeyCreateBulk

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

OAuthSigningKeyCreateBulk is the builder for creating many OAuthSigningKey entities in bulk.

func (*OAuthSigningKeyCreateBulk) Exec

Exec executes the query.

func (*OAuthSigningKeyCreateBulk) ExecX

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

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

func (*OAuthSigningKeyCreateBulk) Save

Save creates the OAuthSigningKey entities in the database.

func (*OAuthSigningKeyCreateBulk) SaveX

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

type OAuthSigningKeyDelete

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

OAuthSigningKeyDelete is the builder for deleting a OAuthSigningKey entity.

func (*OAuthSigningKeyDelete) Exec

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

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

func (*OAuthSigningKeyDelete) ExecX

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

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

func (*OAuthSigningKeyDelete) Where

Where appends a list predicates to the OAuthSigningKeyDelete builder.

type OAuthSigningKeyDeleteOne

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

OAuthSigningKeyDeleteOne is the builder for deleting a single OAuthSigningKey entity.

func (*OAuthSigningKeyDeleteOne) Exec

Exec executes the deletion query.

func (*OAuthSigningKeyDeleteOne) ExecX

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

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

func (*OAuthSigningKeyDeleteOne) Where

Where appends a list predicates to the OAuthSigningKeyDelete builder.

type OAuthSigningKeyGroupBy

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

OAuthSigningKeyGroupBy is the group-by builder for OAuthSigningKey entities.

func (*OAuthSigningKeyGroupBy) Aggregate

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

func (*OAuthSigningKeyGroupBy) Bool

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

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

func (*OAuthSigningKeyGroupBy) BoolX

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

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

func (*OAuthSigningKeyGroupBy) Bools

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

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

func (*OAuthSigningKeyGroupBy) BoolsX

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

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

func (*OAuthSigningKeyGroupBy) Float64

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

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

func (*OAuthSigningKeyGroupBy) Float64X

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

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

func (*OAuthSigningKeyGroupBy) Float64s

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

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

func (*OAuthSigningKeyGroupBy) Float64sX

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

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

func (*OAuthSigningKeyGroupBy) Int

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

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

func (*OAuthSigningKeyGroupBy) IntX

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

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

func (*OAuthSigningKeyGroupBy) Ints

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

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

func (*OAuthSigningKeyGroupBy) IntsX

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

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

func (*OAuthSigningKeyGroupBy) Scan

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

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

func (*OAuthSigningKeyGroupBy) ScanX

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

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

func (*OAuthSigningKeyGroupBy) String

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

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

func (*OAuthSigningKeyGroupBy) StringX

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

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

func (*OAuthSigningKeyGroupBy) Strings

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

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

func (*OAuthSigningKeyGroupBy) StringsX

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

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

type OAuthSigningKeyMutation

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

OAuthSigningKeyMutation represents an operation that mutates the OAuthSigningKey nodes in the graph.

func (*OAuthSigningKeyMutation) AddField

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

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

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

func (*OAuthSigningKeyMutation) AddedField

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

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

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

func (*OAuthSigningKeyMutation) AddedIDs

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

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

func (*OAuthSigningKeyMutation) Algorithm

func (m *OAuthSigningKeyMutation) Algorithm() (r string, exists bool)

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

func (*OAuthSigningKeyMutation) ClearEdge

func (m *OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) ClearExpiresAt

func (m *OAuthSigningKeyMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthSigningKeyMutation) ClearField

func (m *OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) ClearRetiredAt

func (m *OAuthSigningKeyMutation) ClearRetiredAt()

ClearRetiredAt clears the value of the "retired_at" field.

func (*OAuthSigningKeyMutation) ClearedEdges

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

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

func (*OAuthSigningKeyMutation) ClearedFields

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

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

func (OAuthSigningKeyMutation) Client

func (m OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) EdgeCleared

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

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

func (*OAuthSigningKeyMutation) ExpiresAt

func (m *OAuthSigningKeyMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*OAuthSigningKeyMutation) ExpiresAtCleared

func (m *OAuthSigningKeyMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*OAuthSigningKeyMutation) Field

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

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

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

func (*OAuthSigningKeyMutation) Fields

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

func (m *OAuthSigningKeyMutation) ID() (id int, exists bool)

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

func (*OAuthSigningKeyMutation) IDs

func (m *OAuthSigningKeyMutation) IDs(ctx context.Context) ([]int, error)

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

func (*OAuthSigningKeyMutation) IsActive

func (m *OAuthSigningKeyMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*OAuthSigningKeyMutation) Kid

func (m *OAuthSigningKeyMutation) Kid() (r string, exists bool)

Kid returns the value of the "kid" field in the mutation.

func (*OAuthSigningKeyMutation) OldAlgorithm

func (m *OAuthSigningKeyMutation) OldAlgorithm(ctx context.Context) (v string, err error)

OldAlgorithm returns the old "algorithm" field's value of the OAuthSigningKey entity. If the OAuthSigningKey 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 (*OAuthSigningKeyMutation) OldExpiresAt

func (m *OAuthSigningKeyMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the OAuthSigningKey entity. If the OAuthSigningKey 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 (*OAuthSigningKeyMutation) OldField

func (m *OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) OldIsActive

func (m *OAuthSigningKeyMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the OAuthSigningKey entity. If the OAuthSigningKey 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 (*OAuthSigningKeyMutation) OldKid

func (m *OAuthSigningKeyMutation) OldKid(ctx context.Context) (v string, err error)

OldKid returns the old "kid" field's value of the OAuthSigningKey entity. If the OAuthSigningKey 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 (*OAuthSigningKeyMutation) OldPrivateKeyPem

func (m *OAuthSigningKeyMutation) OldPrivateKeyPem(ctx context.Context) (v string, err error)

OldPrivateKeyPem returns the old "private_key_pem" field's value of the OAuthSigningKey entity. If the OAuthSigningKey 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 (*OAuthSigningKeyMutation) OldPublicKeyPem

func (m *OAuthSigningKeyMutation) OldPublicKeyPem(ctx context.Context) (v string, err error)

OldPublicKeyPem returns the old "public_key_pem" field's value of the OAuthSigningKey entity. If the OAuthSigningKey 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 (*OAuthSigningKeyMutation) OldRetiredAt

func (m *OAuthSigningKeyMutation) OldRetiredAt(ctx context.Context) (v *time.Time, err error)

OldRetiredAt returns the old "retired_at" field's value of the OAuthSigningKey entity. If the OAuthSigningKey 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 (*OAuthSigningKeyMutation) Op

func (m *OAuthSigningKeyMutation) Op() Op

Op returns the operation name.

func (*OAuthSigningKeyMutation) PrivateKeyPem

func (m *OAuthSigningKeyMutation) PrivateKeyPem() (r string, exists bool)

PrivateKeyPem returns the value of the "private_key_pem" field in the mutation.

func (*OAuthSigningKeyMutation) PublicKeyPem

func (m *OAuthSigningKeyMutation) PublicKeyPem() (r string, exists bool)

PublicKeyPem returns the value of the "public_key_pem" field in the mutation.

func (*OAuthSigningKeyMutation) RemovedEdges

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

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

func (*OAuthSigningKeyMutation) RemovedIDs

func (m *OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) ResetAlgorithm

func (m *OAuthSigningKeyMutation) ResetAlgorithm()

ResetAlgorithm resets all changes to the "algorithm" field.

func (*OAuthSigningKeyMutation) ResetEdge

func (m *OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) ResetExpiresAt

func (m *OAuthSigningKeyMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*OAuthSigningKeyMutation) ResetField

func (m *OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) ResetIsActive

func (m *OAuthSigningKeyMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*OAuthSigningKeyMutation) ResetKid

func (m *OAuthSigningKeyMutation) ResetKid()

ResetKid resets all changes to the "kid" field.

func (*OAuthSigningKeyMutation) ResetPrivateKeyPem

func (m *OAuthSigningKeyMutation) ResetPrivateKeyPem()

ResetPrivateKeyPem resets all changes to the "private_key_pem" field.

func (*OAuthSigningKeyMutation) ResetPublicKeyPem

func (m *OAuthSigningKeyMutation) ResetPublicKeyPem()

ResetPublicKeyPem resets all changes to the "public_key_pem" field.

func (*OAuthSigningKeyMutation) ResetRetiredAt

func (m *OAuthSigningKeyMutation) ResetRetiredAt()

ResetRetiredAt resets all changes to the "retired_at" field.

func (*OAuthSigningKeyMutation) RetiredAt

func (m *OAuthSigningKeyMutation) RetiredAt() (r time.Time, exists bool)

RetiredAt returns the value of the "retired_at" field in the mutation.

func (*OAuthSigningKeyMutation) RetiredAtCleared

func (m *OAuthSigningKeyMutation) RetiredAtCleared() bool

RetiredAtCleared returns if the "retired_at" field was cleared in this mutation.

func (*OAuthSigningKeyMutation) SetAlgorithm

func (m *OAuthSigningKeyMutation) SetAlgorithm(s string)

SetAlgorithm sets the "algorithm" field.

func (*OAuthSigningKeyMutation) SetExpiresAt

func (m *OAuthSigningKeyMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*OAuthSigningKeyMutation) SetField

func (m *OAuthSigningKeyMutation) 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 (*OAuthSigningKeyMutation) SetIsActive

func (m *OAuthSigningKeyMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*OAuthSigningKeyMutation) SetKid

func (m *OAuthSigningKeyMutation) SetKid(s string)

SetKid sets the "kid" field.

func (*OAuthSigningKeyMutation) SetOp

func (m *OAuthSigningKeyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OAuthSigningKeyMutation) SetPrivateKeyPem

func (m *OAuthSigningKeyMutation) SetPrivateKeyPem(s string)

SetPrivateKeyPem sets the "private_key_pem" field.

func (*OAuthSigningKeyMutation) SetPublicKeyPem

func (m *OAuthSigningKeyMutation) SetPublicKeyPem(s string)

SetPublicKeyPem sets the "public_key_pem" field.

func (*OAuthSigningKeyMutation) SetRetiredAt

func (m *OAuthSigningKeyMutation) SetRetiredAt(t time.Time)

SetRetiredAt sets the "retired_at" field.

func (OAuthSigningKeyMutation) Tx

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

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

func (*OAuthSigningKeyMutation) Type

func (m *OAuthSigningKeyMutation) Type() string

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

func (*OAuthSigningKeyMutation) Where

Where appends a list predicates to the OAuthSigningKeyMutation builder.

func (*OAuthSigningKeyMutation) WhereP

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

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

type OAuthSigningKeyQuery

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

OAuthSigningKeyQuery is the builder for querying OAuthSigningKey entities.

func (*OAuthSigningKeyQuery) Aggregate

Aggregate returns a OAuthSigningKeySelect configured with the given aggregations.

func (*OAuthSigningKeyQuery) All

All executes the query and returns a list of OAuthSigningKeys.

func (*OAuthSigningKeyQuery) AllX

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

func (*OAuthSigningKeyQuery) Clone

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

func (*OAuthSigningKeyQuery) Count

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

Count returns the count of the given query.

func (*OAuthSigningKeyQuery) CountX

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

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

func (*OAuthSigningKeyQuery) Exist

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

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

func (*OAuthSigningKeyQuery) ExistX

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

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

func (*OAuthSigningKeyQuery) First

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

func (*OAuthSigningKeyQuery) FirstID

func (_q *OAuthSigningKeyQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OAuthSigningKeyQuery) FirstIDX

func (_q *OAuthSigningKeyQuery) FirstIDX(ctx context.Context) int

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

func (*OAuthSigningKeyQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*OAuthSigningKeyQuery) GroupBy

func (_q *OAuthSigningKeyQuery) GroupBy(field string, fields ...string) *OAuthSigningKeyGroupBy

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 {
	Kid string `json:"kid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.OAuthSigningKey.Query().
	GroupBy(oauthsigningkey.FieldKid).
	Aggregate(_test.Count()).
	Scan(ctx, &v)

func (*OAuthSigningKeyQuery) IDs

func (_q *OAuthSigningKeyQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of OAuthSigningKey IDs.

func (*OAuthSigningKeyQuery) IDsX

func (_q *OAuthSigningKeyQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*OAuthSigningKeyQuery) Limit

func (_q *OAuthSigningKeyQuery) Limit(limit int) *OAuthSigningKeyQuery

Limit the number of records to be returned by this query.

func (*OAuthSigningKeyQuery) Offset

func (_q *OAuthSigningKeyQuery) Offset(offset int) *OAuthSigningKeyQuery

Offset to start from.

func (*OAuthSigningKeyQuery) Only

Only returns a single OAuthSigningKey entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OAuthSigningKey entity is found. Returns a *NotFoundError when no OAuthSigningKey entities are found.

func (*OAuthSigningKeyQuery) OnlyID

func (_q *OAuthSigningKeyQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only OAuthSigningKey ID in the query. Returns a *NotSingularError when more than one OAuthSigningKey ID is found. Returns a *NotFoundError when no entities are found.

func (*OAuthSigningKeyQuery) OnlyIDX

func (_q *OAuthSigningKeyQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OAuthSigningKeyQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*OAuthSigningKeyQuery) Order

Order specifies how the records should be ordered.

func (*OAuthSigningKeyQuery) Select

func (_q *OAuthSigningKeyQuery) Select(fields ...string) *OAuthSigningKeySelect

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 {
	Kid string `json:"kid,omitempty"`
}

client.OAuthSigningKey.Query().
	Select(oauthsigningkey.FieldKid).
	Scan(ctx, &v)

func (*OAuthSigningKeyQuery) Unique

func (_q *OAuthSigningKeyQuery) Unique(unique bool) *OAuthSigningKeyQuery

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 (*OAuthSigningKeyQuery) Where

Where adds a new predicate for the OAuthSigningKeyQuery builder.

type OAuthSigningKeySelect

type OAuthSigningKeySelect struct {
	*OAuthSigningKeyQuery
	// contains filtered or unexported fields
}

OAuthSigningKeySelect is the builder for selecting fields of OAuthSigningKey entities.

func (*OAuthSigningKeySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*OAuthSigningKeySelect) Bool

func (s *OAuthSigningKeySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) BoolX

func (s *OAuthSigningKeySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OAuthSigningKeySelect) Bools

func (s *OAuthSigningKeySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) BoolsX

func (s *OAuthSigningKeySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OAuthSigningKeySelect) Float64

func (s *OAuthSigningKeySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) Float64X

func (s *OAuthSigningKeySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OAuthSigningKeySelect) Float64s

func (s *OAuthSigningKeySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) Float64sX

func (s *OAuthSigningKeySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OAuthSigningKeySelect) Int

func (s *OAuthSigningKeySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) IntX

func (s *OAuthSigningKeySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OAuthSigningKeySelect) Ints

func (s *OAuthSigningKeySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) IntsX

func (s *OAuthSigningKeySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OAuthSigningKeySelect) Scan

func (_s *OAuthSigningKeySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OAuthSigningKeySelect) ScanX

func (s *OAuthSigningKeySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OAuthSigningKeySelect) String

func (s *OAuthSigningKeySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) StringX

func (s *OAuthSigningKeySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OAuthSigningKeySelect) Strings

func (s *OAuthSigningKeySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OAuthSigningKeySelect) StringsX

func (s *OAuthSigningKeySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OAuthSigningKeyUpdate

type OAuthSigningKeyUpdate struct {
	// contains filtered or unexported fields
}

OAuthSigningKeyUpdate is the builder for updating OAuthSigningKey entities.

func (*OAuthSigningKeyUpdate) ClearExpiresAt

func (_u *OAuthSigningKeyUpdate) ClearExpiresAt() *OAuthSigningKeyUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthSigningKeyUpdate) ClearRetiredAt

func (_u *OAuthSigningKeyUpdate) ClearRetiredAt() *OAuthSigningKeyUpdate

ClearRetiredAt clears the value of the "retired_at" field.

func (*OAuthSigningKeyUpdate) Exec

Exec executes the query.

func (*OAuthSigningKeyUpdate) ExecX

func (_u *OAuthSigningKeyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuthSigningKeyUpdate) Mutation

Mutation returns the OAuthSigningKeyMutation object of the builder.

func (*OAuthSigningKeyUpdate) Save

func (_u *OAuthSigningKeyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OAuthSigningKeyUpdate) SaveX

func (_u *OAuthSigningKeyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OAuthSigningKeyUpdate) SetAlgorithm

func (_u *OAuthSigningKeyUpdate) SetAlgorithm(v string) *OAuthSigningKeyUpdate

SetAlgorithm sets the "algorithm" field.

func (*OAuthSigningKeyUpdate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthSigningKeyUpdate) SetIsActive

func (_u *OAuthSigningKeyUpdate) SetIsActive(v bool) *OAuthSigningKeyUpdate

SetIsActive sets the "is_active" field.

func (*OAuthSigningKeyUpdate) SetKid

SetKid sets the "kid" field.

func (*OAuthSigningKeyUpdate) SetNillableAlgorithm

func (_u *OAuthSigningKeyUpdate) SetNillableAlgorithm(v *string) *OAuthSigningKeyUpdate

SetNillableAlgorithm sets the "algorithm" field if the given value is not nil.

func (*OAuthSigningKeyUpdate) SetNillableExpiresAt

func (_u *OAuthSigningKeyUpdate) SetNillableExpiresAt(v *time.Time) *OAuthSigningKeyUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthSigningKeyUpdate) SetNillableIsActive

func (_u *OAuthSigningKeyUpdate) SetNillableIsActive(v *bool) *OAuthSigningKeyUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*OAuthSigningKeyUpdate) SetNillableKid

func (_u *OAuthSigningKeyUpdate) SetNillableKid(v *string) *OAuthSigningKeyUpdate

SetNillableKid sets the "kid" field if the given value is not nil.

func (*OAuthSigningKeyUpdate) SetNillablePrivateKeyPem

func (_u *OAuthSigningKeyUpdate) SetNillablePrivateKeyPem(v *string) *OAuthSigningKeyUpdate

SetNillablePrivateKeyPem sets the "private_key_pem" field if the given value is not nil.

func (*OAuthSigningKeyUpdate) SetNillablePublicKeyPem

func (_u *OAuthSigningKeyUpdate) SetNillablePublicKeyPem(v *string) *OAuthSigningKeyUpdate

SetNillablePublicKeyPem sets the "public_key_pem" field if the given value is not nil.

func (*OAuthSigningKeyUpdate) SetNillableRetiredAt

func (_u *OAuthSigningKeyUpdate) SetNillableRetiredAt(v *time.Time) *OAuthSigningKeyUpdate

SetNillableRetiredAt sets the "retired_at" field if the given value is not nil.

func (*OAuthSigningKeyUpdate) SetPrivateKeyPem

func (_u *OAuthSigningKeyUpdate) SetPrivateKeyPem(v string) *OAuthSigningKeyUpdate

SetPrivateKeyPem sets the "private_key_pem" field.

func (*OAuthSigningKeyUpdate) SetPublicKeyPem

func (_u *OAuthSigningKeyUpdate) SetPublicKeyPem(v string) *OAuthSigningKeyUpdate

SetPublicKeyPem sets the "public_key_pem" field.

func (*OAuthSigningKeyUpdate) SetRetiredAt

SetRetiredAt sets the "retired_at" field.

func (*OAuthSigningKeyUpdate) Where

Where appends a list predicates to the OAuthSigningKeyUpdate builder.

type OAuthSigningKeyUpdateOne

type OAuthSigningKeyUpdateOne struct {
	// contains filtered or unexported fields
}

OAuthSigningKeyUpdateOne is the builder for updating a single OAuthSigningKey entity.

func (*OAuthSigningKeyUpdateOne) ClearExpiresAt

func (_u *OAuthSigningKeyUpdateOne) ClearExpiresAt() *OAuthSigningKeyUpdateOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*OAuthSigningKeyUpdateOne) ClearRetiredAt

func (_u *OAuthSigningKeyUpdateOne) ClearRetiredAt() *OAuthSigningKeyUpdateOne

ClearRetiredAt clears the value of the "retired_at" field.

func (*OAuthSigningKeyUpdateOne) Exec

Exec executes the query on the entity.

func (*OAuthSigningKeyUpdateOne) ExecX

func (_u *OAuthSigningKeyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuthSigningKeyUpdateOne) Mutation

Mutation returns the OAuthSigningKeyMutation object of the builder.

func (*OAuthSigningKeyUpdateOne) Save

Save executes the query and returns the updated OAuthSigningKey entity.

func (*OAuthSigningKeyUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OAuthSigningKeyUpdateOne) Select

func (_u *OAuthSigningKeyUpdateOne) Select(field string, fields ...string) *OAuthSigningKeyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OAuthSigningKeyUpdateOne) SetAlgorithm

SetAlgorithm sets the "algorithm" field.

func (*OAuthSigningKeyUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*OAuthSigningKeyUpdateOne) SetIsActive

SetIsActive sets the "is_active" field.

func (*OAuthSigningKeyUpdateOne) SetKid

SetKid sets the "kid" field.

func (*OAuthSigningKeyUpdateOne) SetNillableAlgorithm

func (_u *OAuthSigningKeyUpdateOne) SetNillableAlgorithm(v *string) *OAuthSigningKeyUpdateOne

SetNillableAlgorithm sets the "algorithm" field if the given value is not nil.

func (*OAuthSigningKeyUpdateOne) SetNillableExpiresAt

func (_u *OAuthSigningKeyUpdateOne) SetNillableExpiresAt(v *time.Time) *OAuthSigningKeyUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuthSigningKeyUpdateOne) SetNillableIsActive

func (_u *OAuthSigningKeyUpdateOne) SetNillableIsActive(v *bool) *OAuthSigningKeyUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*OAuthSigningKeyUpdateOne) SetNillableKid

SetNillableKid sets the "kid" field if the given value is not nil.

func (*OAuthSigningKeyUpdateOne) SetNillablePrivateKeyPem

func (_u *OAuthSigningKeyUpdateOne) SetNillablePrivateKeyPem(v *string) *OAuthSigningKeyUpdateOne

SetNillablePrivateKeyPem sets the "private_key_pem" field if the given value is not nil.

func (*OAuthSigningKeyUpdateOne) SetNillablePublicKeyPem

func (_u *OAuthSigningKeyUpdateOne) SetNillablePublicKeyPem(v *string) *OAuthSigningKeyUpdateOne

SetNillablePublicKeyPem sets the "public_key_pem" field if the given value is not nil.

func (*OAuthSigningKeyUpdateOne) SetNillableRetiredAt

func (_u *OAuthSigningKeyUpdateOne) SetNillableRetiredAt(v *time.Time) *OAuthSigningKeyUpdateOne

SetNillableRetiredAt sets the "retired_at" field if the given value is not nil.

func (*OAuthSigningKeyUpdateOne) SetPrivateKeyPem

func (_u *OAuthSigningKeyUpdateOne) SetPrivateKeyPem(v string) *OAuthSigningKeyUpdateOne

SetPrivateKeyPem sets the "private_key_pem" field.

func (*OAuthSigningKeyUpdateOne) SetPublicKeyPem

SetPublicKeyPem sets the "public_key_pem" field.

func (*OAuthSigningKeyUpdateOne) SetRetiredAt

SetRetiredAt sets the "retired_at" field.

func (*OAuthSigningKeyUpdateOne) Where

Where appends a list predicates to the OAuthSigningKeyUpdate builder.

type OAuthSigningKeys

type OAuthSigningKeys []*OAuthSigningKey

OAuthSigningKeys is a parsable slice of OAuthSigningKey.

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 PersonalAccessToken

type PersonalAccessToken struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Consumer user ID that owns the token
	UserID int `json:"user_id,omitempty"`
	// Human-readable token name
	Name string `json:"name,omitempty"`
	// SHA-256 hash of the raw token
	TokenHash string `json:"token_hash,omitempty"`
	// Safe token prefix for display
	TokenPrefix string `json:"token_prefix,omitempty"`
	// Last time this token authenticated
	LastUsedAt *time.Time `json:"last_used_at,omitempty"`
	// Token expiry, nil means no expiry
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

PersonalAccessToken is the model entity for the PersonalAccessToken schema.

func (*PersonalAccessToken) String

func (_m *PersonalAccessToken) String() string

String implements the fmt.Stringer.

func (*PersonalAccessToken) Unwrap

Unwrap unwraps the PersonalAccessToken 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 (*PersonalAccessToken) Update

Update returns a builder for updating this PersonalAccessToken. Note that you need to call PersonalAccessToken.Unwrap() before calling this method if this PersonalAccessToken was returned from a transaction, and the transaction was committed or rolled back.

func (*PersonalAccessToken) Value

func (_m *PersonalAccessToken) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PersonalAccessToken. This includes values selected through modifiers, order, etc.

type PersonalAccessTokenClient

type PersonalAccessTokenClient struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenClient is a client for the PersonalAccessToken schema.

func NewPersonalAccessTokenClient

func NewPersonalAccessTokenClient(c config) *PersonalAccessTokenClient

NewPersonalAccessTokenClient returns a client for the PersonalAccessToken from the given config.

func (*PersonalAccessTokenClient) Create

Create returns a builder for creating a PersonalAccessToken entity.

func (*PersonalAccessTokenClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PersonalAccessToken entities.

func (*PersonalAccessTokenClient) Delete

Delete returns a delete builder for PersonalAccessToken.

func (*PersonalAccessTokenClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PersonalAccessTokenClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PersonalAccessTokenClient) Get

Get returns a PersonalAccessToken entity by its id.

func (*PersonalAccessTokenClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PersonalAccessTokenClient) Hooks

func (c *PersonalAccessTokenClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PersonalAccessTokenClient) Intercept

func (c *PersonalAccessTokenClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `personalaccesstoken.Intercept(f(g(h())))`.

func (*PersonalAccessTokenClient) Interceptors

func (c *PersonalAccessTokenClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PersonalAccessTokenClient) MapCreateBulk

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 (*PersonalAccessTokenClient) Query

Query returns a query builder for PersonalAccessToken.

func (*PersonalAccessTokenClient) Update

Update returns an update builder for PersonalAccessToken.

func (*PersonalAccessTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PersonalAccessTokenClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PersonalAccessTokenClient) Use

func (c *PersonalAccessTokenClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `personalaccesstoken.Hooks(f(g(h())))`.

type PersonalAccessTokenCreate

type PersonalAccessTokenCreate struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenCreate is the builder for creating a PersonalAccessToken entity.

func (*PersonalAccessTokenCreate) Exec

Exec executes the query.

func (*PersonalAccessTokenCreate) ExecX

func (_c *PersonalAccessTokenCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonalAccessTokenCreate) Mutation

Mutation returns the PersonalAccessTokenMutation object of the builder.

func (*PersonalAccessTokenCreate) Save

Save creates the PersonalAccessToken in the database.

func (*PersonalAccessTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PersonalAccessTokenCreate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*PersonalAccessTokenCreate) SetLastUsedAt

SetLastUsedAt sets the "last_used_at" field.

func (*PersonalAccessTokenCreate) SetName

SetName sets the "name" field.

func (*PersonalAccessTokenCreate) SetNillableExpiresAt

func (_c *PersonalAccessTokenCreate) SetNillableExpiresAt(v *time.Time) *PersonalAccessTokenCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*PersonalAccessTokenCreate) SetNillableLastUsedAt

func (_c *PersonalAccessTokenCreate) SetNillableLastUsedAt(v *time.Time) *PersonalAccessTokenCreate

SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.

func (*PersonalAccessTokenCreate) SetTokenHash

SetTokenHash sets the "token_hash" field.

func (*PersonalAccessTokenCreate) SetTokenPrefix

SetTokenPrefix sets the "token_prefix" field.

func (*PersonalAccessTokenCreate) SetUserID

SetUserID sets the "user_id" field.

type PersonalAccessTokenCreateBulk

type PersonalAccessTokenCreateBulk struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenCreateBulk is the builder for creating many PersonalAccessToken entities in bulk.

func (*PersonalAccessTokenCreateBulk) Exec

Exec executes the query.

func (*PersonalAccessTokenCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*PersonalAccessTokenCreateBulk) Save

Save creates the PersonalAccessToken entities in the database.

func (*PersonalAccessTokenCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PersonalAccessTokenDelete

type PersonalAccessTokenDelete struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenDelete is the builder for deleting a PersonalAccessToken entity.

func (*PersonalAccessTokenDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*PersonalAccessTokenDelete) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*PersonalAccessTokenDelete) Where

Where appends a list predicates to the PersonalAccessTokenDelete builder.

type PersonalAccessTokenDeleteOne

type PersonalAccessTokenDeleteOne struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenDeleteOne is the builder for deleting a single PersonalAccessToken entity.

func (*PersonalAccessTokenDeleteOne) Exec

Exec executes the deletion query.

func (*PersonalAccessTokenDeleteOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*PersonalAccessTokenDeleteOne) Where

Where appends a list predicates to the PersonalAccessTokenDelete builder.

type PersonalAccessTokenGroupBy

type PersonalAccessTokenGroupBy struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenGroupBy is the group-by builder for PersonalAccessToken entities.

func (*PersonalAccessTokenGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PersonalAccessTokenGroupBy) Bool

func (s *PersonalAccessTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) BoolX

func (s *PersonalAccessTokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) Bools

func (s *PersonalAccessTokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) BoolsX

func (s *PersonalAccessTokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) Float64

func (s *PersonalAccessTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) Float64X

func (s *PersonalAccessTokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) Float64s

func (s *PersonalAccessTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) Float64sX

func (s *PersonalAccessTokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) Int

func (s *PersonalAccessTokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) IntX

func (s *PersonalAccessTokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) Ints

func (s *PersonalAccessTokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) IntsX

func (s *PersonalAccessTokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) Scan

Scan applies the selector query and scans the result into the given value.

func (*PersonalAccessTokenGroupBy) ScanX

func (s *PersonalAccessTokenGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) String

func (s *PersonalAccessTokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) StringX

func (s *PersonalAccessTokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonalAccessTokenGroupBy) Strings

func (s *PersonalAccessTokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenGroupBy) StringsX

func (s *PersonalAccessTokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonalAccessTokenMutation

type PersonalAccessTokenMutation struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenMutation represents an operation that mutates the PersonalAccessToken nodes in the graph.

func (*PersonalAccessTokenMutation) AddField

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) AddUserID

func (m *PersonalAccessTokenMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*PersonalAccessTokenMutation) AddedEdges

func (m *PersonalAccessTokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PersonalAccessTokenMutation) AddedField

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) AddedFields

func (m *PersonalAccessTokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PersonalAccessTokenMutation) AddedIDs

func (m *PersonalAccessTokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PersonalAccessTokenMutation) AddedUserID

func (m *PersonalAccessTokenMutation) AddedUserID() (r int, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*PersonalAccessTokenMutation) ClearEdge

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) ClearExpiresAt

func (m *PersonalAccessTokenMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*PersonalAccessTokenMutation) ClearField

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) ClearLastUsedAt

func (m *PersonalAccessTokenMutation) ClearLastUsedAt()

ClearLastUsedAt clears the value of the "last_used_at" field.

func (*PersonalAccessTokenMutation) ClearedEdges

func (m *PersonalAccessTokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PersonalAccessTokenMutation) ClearedFields

func (m *PersonalAccessTokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PersonalAccessTokenMutation) Client

func (m PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) EdgeCleared

func (m *PersonalAccessTokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PersonalAccessTokenMutation) ExpiresAt

func (m *PersonalAccessTokenMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*PersonalAccessTokenMutation) ExpiresAtCleared

func (m *PersonalAccessTokenMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*PersonalAccessTokenMutation) Field

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) FieldCleared

func (m *PersonalAccessTokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PersonalAccessTokenMutation) Fields

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) ID

func (m *PersonalAccessTokenMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) LastUsedAt

func (m *PersonalAccessTokenMutation) LastUsedAt() (r time.Time, exists bool)

LastUsedAt returns the value of the "last_used_at" field in the mutation.

func (*PersonalAccessTokenMutation) LastUsedAtCleared

func (m *PersonalAccessTokenMutation) LastUsedAtCleared() bool

LastUsedAtCleared returns if the "last_used_at" field was cleared in this mutation.

func (*PersonalAccessTokenMutation) Name

func (m *PersonalAccessTokenMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PersonalAccessTokenMutation) OldExpiresAt

func (m *PersonalAccessTokenMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the PersonalAccessToken entity. If the PersonalAccessToken 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 (*PersonalAccessTokenMutation) OldField

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) OldLastUsedAt

func (m *PersonalAccessTokenMutation) OldLastUsedAt(ctx context.Context) (v *time.Time, err error)

OldLastUsedAt returns the old "last_used_at" field's value of the PersonalAccessToken entity. If the PersonalAccessToken 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 (*PersonalAccessTokenMutation) OldName

func (m *PersonalAccessTokenMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the PersonalAccessToken entity. If the PersonalAccessToken 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 (*PersonalAccessTokenMutation) OldTokenHash

func (m *PersonalAccessTokenMutation) OldTokenHash(ctx context.Context) (v string, err error)

OldTokenHash returns the old "token_hash" field's value of the PersonalAccessToken entity. If the PersonalAccessToken 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 (*PersonalAccessTokenMutation) OldTokenPrefix

func (m *PersonalAccessTokenMutation) OldTokenPrefix(ctx context.Context) (v string, err error)

OldTokenPrefix returns the old "token_prefix" field's value of the PersonalAccessToken entity. If the PersonalAccessToken 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 (*PersonalAccessTokenMutation) OldUserID

func (m *PersonalAccessTokenMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the PersonalAccessToken entity. If the PersonalAccessToken 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 (*PersonalAccessTokenMutation) Op

Op returns the operation name.

func (*PersonalAccessTokenMutation) RemovedEdges

func (m *PersonalAccessTokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PersonalAccessTokenMutation) RemovedIDs

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) ResetEdge

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) ResetExpiresAt

func (m *PersonalAccessTokenMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*PersonalAccessTokenMutation) ResetField

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) ResetLastUsedAt

func (m *PersonalAccessTokenMutation) ResetLastUsedAt()

ResetLastUsedAt resets all changes to the "last_used_at" field.

func (*PersonalAccessTokenMutation) ResetName

func (m *PersonalAccessTokenMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PersonalAccessTokenMutation) ResetTokenHash

func (m *PersonalAccessTokenMutation) ResetTokenHash()

ResetTokenHash resets all changes to the "token_hash" field.

func (*PersonalAccessTokenMutation) ResetTokenPrefix

func (m *PersonalAccessTokenMutation) ResetTokenPrefix()

ResetTokenPrefix resets all changes to the "token_prefix" field.

func (*PersonalAccessTokenMutation) ResetUserID

func (m *PersonalAccessTokenMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*PersonalAccessTokenMutation) SetExpiresAt

func (m *PersonalAccessTokenMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*PersonalAccessTokenMutation) SetField

func (m *PersonalAccessTokenMutation) 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 (*PersonalAccessTokenMutation) SetLastUsedAt

func (m *PersonalAccessTokenMutation) SetLastUsedAt(t time.Time)

SetLastUsedAt sets the "last_used_at" field.

func (*PersonalAccessTokenMutation) SetName

func (m *PersonalAccessTokenMutation) SetName(s string)

SetName sets the "name" field.

func (*PersonalAccessTokenMutation) SetOp

func (m *PersonalAccessTokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PersonalAccessTokenMutation) SetTokenHash

func (m *PersonalAccessTokenMutation) SetTokenHash(s string)

SetTokenHash sets the "token_hash" field.

func (*PersonalAccessTokenMutation) SetTokenPrefix

func (m *PersonalAccessTokenMutation) SetTokenPrefix(s string)

SetTokenPrefix sets the "token_prefix" field.

func (*PersonalAccessTokenMutation) SetUserID

func (m *PersonalAccessTokenMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*PersonalAccessTokenMutation) TokenHash

func (m *PersonalAccessTokenMutation) TokenHash() (r string, exists bool)

TokenHash returns the value of the "token_hash" field in the mutation.

func (*PersonalAccessTokenMutation) TokenPrefix

func (m *PersonalAccessTokenMutation) TokenPrefix() (r string, exists bool)

TokenPrefix returns the value of the "token_prefix" field in the mutation.

func (PersonalAccessTokenMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PersonalAccessTokenMutation) Type

Type returns the node type of this mutation (PersonalAccessToken).

func (*PersonalAccessTokenMutation) UserID

func (m *PersonalAccessTokenMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*PersonalAccessTokenMutation) Where

Where appends a list predicates to the PersonalAccessTokenMutation builder.

func (*PersonalAccessTokenMutation) WhereP

func (m *PersonalAccessTokenMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PersonalAccessTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PersonalAccessTokenQuery

type PersonalAccessTokenQuery struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenQuery is the builder for querying PersonalAccessToken entities.

func (*PersonalAccessTokenQuery) Aggregate

Aggregate returns a PersonalAccessTokenSelect configured with the given aggregations.

func (*PersonalAccessTokenQuery) All

All executes the query and returns a list of PersonalAccessTokens.

func (*PersonalAccessTokenQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PersonalAccessTokenQuery) Clone

Clone returns a duplicate of the PersonalAccessTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PersonalAccessTokenQuery) Count

func (_q *PersonalAccessTokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PersonalAccessTokenQuery) CountX

func (_q *PersonalAccessTokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PersonalAccessTokenQuery) Exist

Exist returns true if the query has elements in the graph.

func (*PersonalAccessTokenQuery) ExistX

func (_q *PersonalAccessTokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PersonalAccessTokenQuery) First

First returns the first PersonalAccessToken entity from the query. Returns a *NotFoundError when no PersonalAccessToken was found.

func (*PersonalAccessTokenQuery) FirstID

func (_q *PersonalAccessTokenQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PersonalAccessToken ID from the query. Returns a *NotFoundError when no PersonalAccessToken ID was found.

func (*PersonalAccessTokenQuery) FirstIDX

func (_q *PersonalAccessTokenQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PersonalAccessTokenQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PersonalAccessTokenQuery) GroupBy

func (_q *PersonalAccessTokenQuery) GroupBy(field string, fields ...string) *PersonalAccessTokenGroupBy

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 {
	UserID int `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PersonalAccessToken.Query().
	GroupBy(personalaccesstoken.FieldUserID).
	Aggregate(_test.Count()).
	Scan(ctx, &v)

func (*PersonalAccessTokenQuery) IDs

func (_q *PersonalAccessTokenQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PersonalAccessToken IDs.

func (*PersonalAccessTokenQuery) IDsX

func (_q *PersonalAccessTokenQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PersonalAccessTokenQuery) Limit

Limit the number of records to be returned by this query.

func (*PersonalAccessTokenQuery) Offset

Offset to start from.

func (*PersonalAccessTokenQuery) Only

Only returns a single PersonalAccessToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PersonalAccessToken entity is found. Returns a *NotFoundError when no PersonalAccessToken entities are found.

func (*PersonalAccessTokenQuery) OnlyID

func (_q *PersonalAccessTokenQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PersonalAccessToken ID in the query. Returns a *NotSingularError when more than one PersonalAccessToken ID is found. Returns a *NotFoundError when no entities are found.

func (*PersonalAccessTokenQuery) OnlyIDX

func (_q *PersonalAccessTokenQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PersonalAccessTokenQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PersonalAccessTokenQuery) Order

Order specifies how the records should be ordered.

func (*PersonalAccessTokenQuery) Select

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 {
	UserID int `json:"user_id,omitempty"`
}

client.PersonalAccessToken.Query().
	Select(personalaccesstoken.FieldUserID).
	Scan(ctx, &v)

func (*PersonalAccessTokenQuery) Unique

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 (*PersonalAccessTokenQuery) Where

Where adds a new predicate for the PersonalAccessTokenQuery builder.

type PersonalAccessTokenSelect

type PersonalAccessTokenSelect struct {
	*PersonalAccessTokenQuery
	// contains filtered or unexported fields
}

PersonalAccessTokenSelect is the builder for selecting fields of PersonalAccessToken entities.

func (*PersonalAccessTokenSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PersonalAccessTokenSelect) Bool

func (s *PersonalAccessTokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) BoolX

func (s *PersonalAccessTokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonalAccessTokenSelect) Bools

func (s *PersonalAccessTokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) BoolsX

func (s *PersonalAccessTokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonalAccessTokenSelect) Float64

func (s *PersonalAccessTokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) Float64X

func (s *PersonalAccessTokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonalAccessTokenSelect) Float64s

func (s *PersonalAccessTokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) Float64sX

func (s *PersonalAccessTokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonalAccessTokenSelect) Int

func (s *PersonalAccessTokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) IntX

func (s *PersonalAccessTokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonalAccessTokenSelect) Ints

func (s *PersonalAccessTokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) IntsX

func (s *PersonalAccessTokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonalAccessTokenSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*PersonalAccessTokenSelect) ScanX

func (s *PersonalAccessTokenSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonalAccessTokenSelect) String

func (s *PersonalAccessTokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) StringX

func (s *PersonalAccessTokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonalAccessTokenSelect) Strings

func (s *PersonalAccessTokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonalAccessTokenSelect) StringsX

func (s *PersonalAccessTokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonalAccessTokenUpdate

type PersonalAccessTokenUpdate struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenUpdate is the builder for updating PersonalAccessToken entities.

func (*PersonalAccessTokenUpdate) AddUserID

AddUserID adds value to the "user_id" field.

func (*PersonalAccessTokenUpdate) ClearExpiresAt

ClearExpiresAt clears the value of the "expires_at" field.

func (*PersonalAccessTokenUpdate) ClearLastUsedAt

ClearLastUsedAt clears the value of the "last_used_at" field.

func (*PersonalAccessTokenUpdate) Exec

Exec executes the query.

func (*PersonalAccessTokenUpdate) ExecX

func (_u *PersonalAccessTokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonalAccessTokenUpdate) Mutation

Mutation returns the PersonalAccessTokenMutation object of the builder.

func (*PersonalAccessTokenUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*PersonalAccessTokenUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PersonalAccessTokenUpdate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*PersonalAccessTokenUpdate) SetLastUsedAt

SetLastUsedAt sets the "last_used_at" field.

func (*PersonalAccessTokenUpdate) SetName

SetName sets the "name" field.

func (*PersonalAccessTokenUpdate) SetNillableExpiresAt

func (_u *PersonalAccessTokenUpdate) SetNillableExpiresAt(v *time.Time) *PersonalAccessTokenUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*PersonalAccessTokenUpdate) SetNillableLastUsedAt

func (_u *PersonalAccessTokenUpdate) SetNillableLastUsedAt(v *time.Time) *PersonalAccessTokenUpdate

SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.

func (*PersonalAccessTokenUpdate) SetNillableName

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonalAccessTokenUpdate) SetNillableTokenHash

func (_u *PersonalAccessTokenUpdate) SetNillableTokenHash(v *string) *PersonalAccessTokenUpdate

SetNillableTokenHash sets the "token_hash" field if the given value is not nil.

func (*PersonalAccessTokenUpdate) SetNillableTokenPrefix

func (_u *PersonalAccessTokenUpdate) SetNillableTokenPrefix(v *string) *PersonalAccessTokenUpdate

SetNillableTokenPrefix sets the "token_prefix" field if the given value is not nil.

func (*PersonalAccessTokenUpdate) SetNillableUserID

func (_u *PersonalAccessTokenUpdate) SetNillableUserID(v *int) *PersonalAccessTokenUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*PersonalAccessTokenUpdate) SetTokenHash

SetTokenHash sets the "token_hash" field.

func (*PersonalAccessTokenUpdate) SetTokenPrefix

SetTokenPrefix sets the "token_prefix" field.

func (*PersonalAccessTokenUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*PersonalAccessTokenUpdate) Where

Where appends a list predicates to the PersonalAccessTokenUpdate builder.

type PersonalAccessTokenUpdateOne

type PersonalAccessTokenUpdateOne struct {
	// contains filtered or unexported fields
}

PersonalAccessTokenUpdateOne is the builder for updating a single PersonalAccessToken entity.

func (*PersonalAccessTokenUpdateOne) AddUserID

AddUserID adds value to the "user_id" field.

func (*PersonalAccessTokenUpdateOne) ClearExpiresAt

ClearExpiresAt clears the value of the "expires_at" field.

func (*PersonalAccessTokenUpdateOne) ClearLastUsedAt

ClearLastUsedAt clears the value of the "last_used_at" field.

func (*PersonalAccessTokenUpdateOne) Exec

Exec executes the query on the entity.

func (*PersonalAccessTokenUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*PersonalAccessTokenUpdateOne) Mutation

Mutation returns the PersonalAccessTokenMutation object of the builder.

func (*PersonalAccessTokenUpdateOne) Save

Save executes the query and returns the updated PersonalAccessToken entity.

func (*PersonalAccessTokenUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PersonalAccessTokenUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PersonalAccessTokenUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*PersonalAccessTokenUpdateOne) SetLastUsedAt

SetLastUsedAt sets the "last_used_at" field.

func (*PersonalAccessTokenUpdateOne) SetName

SetName sets the "name" field.

func (*PersonalAccessTokenUpdateOne) SetNillableExpiresAt

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*PersonalAccessTokenUpdateOne) SetNillableLastUsedAt

func (_u *PersonalAccessTokenUpdateOne) SetNillableLastUsedAt(v *time.Time) *PersonalAccessTokenUpdateOne

SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.

func (*PersonalAccessTokenUpdateOne) SetNillableName

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonalAccessTokenUpdateOne) SetNillableTokenHash

SetNillableTokenHash sets the "token_hash" field if the given value is not nil.

func (*PersonalAccessTokenUpdateOne) SetNillableTokenPrefix

func (_u *PersonalAccessTokenUpdateOne) SetNillableTokenPrefix(v *string) *PersonalAccessTokenUpdateOne

SetNillableTokenPrefix sets the "token_prefix" field if the given value is not nil.

func (*PersonalAccessTokenUpdateOne) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*PersonalAccessTokenUpdateOne) SetTokenHash

SetTokenHash sets the "token_hash" field.

func (*PersonalAccessTokenUpdateOne) SetTokenPrefix

SetTokenPrefix sets the "token_prefix" field.

func (*PersonalAccessTokenUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*PersonalAccessTokenUpdateOne) Where

Where appends a list predicates to the PersonalAccessTokenUpdate builder.

type PersonalAccessTokens

type PersonalAccessTokens []*PersonalAccessToken

PersonalAccessTokens is a parsable slice of PersonalAccessToken.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type 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 {

	// OAuthAccessToken is the client for interacting with the OAuthAccessToken builders.
	OAuthAccessToken *OAuthAccessTokenClient
	// OAuthAuthorizationCode is the client for interacting with the OAuthAuthorizationCode builders.
	OAuthAuthorizationCode *OAuthAuthorizationCodeClient
	// OAuthClient is the client for interacting with the OAuthClient builders.
	OAuthClient *OAuthClientClient
	// OAuthRefreshToken is the client for interacting with the OAuthRefreshToken builders.
	OAuthRefreshToken *OAuthRefreshTokenClient
	// OAuthSigningKey is the client for interacting with the OAuthSigningKey builders.
	OAuthSigningKey *OAuthSigningKeyClient
	// PersonalAccessToken is the client for interacting with the PersonalAccessToken builders.
	PersonalAccessToken *PersonalAccessTokenClient
	// 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 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL