ent

package
v0.0.0-...-63c78a4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 20 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.
	TypeDownloadEvent  = "DownloadEvent"
	TypeDownloadIssuer = "DownloadIssuer"
	TypeDownloadShare  = "DownloadShare"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// DownloadEvent is the client for interacting with the DownloadEvent builders.
	DownloadEvent *DownloadEventClient
	// DownloadIssuer is the client for interacting with the DownloadIssuer builders.
	DownloadIssuer *DownloadIssuerClient
	// DownloadShare is the client for interacting with the DownloadShare builders.
	DownloadShare *DownloadShareClient
	// 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().
	DownloadEvent.
	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 DownloadEvent

type DownloadEvent struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// ShareID holds the value of the "share_id" field.
	ShareID *string `json:"share_id,omitempty"`
	// Phase holds the value of the "phase" field.
	Phase string `json:"phase,omitempty"`
	// Outcome holds the value of the "outcome" field.
	Outcome string `json:"outcome,omitempty"`
	// BytesTransferred holds the value of the "bytes_transferred" field.
	BytesTransferred int64 `json:"bytes_transferred,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

DownloadEvent is the model entity for the DownloadEvent schema.

func (*DownloadEvent) String

func (_m *DownloadEvent) String() string

String implements the fmt.Stringer.

func (*DownloadEvent) Unwrap

func (_m *DownloadEvent) Unwrap() *DownloadEvent

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

func (_m *DownloadEvent) Update() *DownloadEventUpdateOne

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

func (*DownloadEvent) Value

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

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

type DownloadEventClient

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

DownloadEventClient is a client for the DownloadEvent schema.

func NewDownloadEventClient

func NewDownloadEventClient(c config) *DownloadEventClient

NewDownloadEventClient returns a client for the DownloadEvent from the given config.

func (*DownloadEventClient) Create

Create returns a builder for creating a DownloadEvent entity.

func (*DownloadEventClient) CreateBulk

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

func (*DownloadEventClient) Delete

Delete returns a delete builder for DownloadEvent.

func (*DownloadEventClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DownloadEventClient) DeleteOneID

func (c *DownloadEventClient) DeleteOneID(id int64) *DownloadEventDeleteOne

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

func (*DownloadEventClient) Get

Get returns a DownloadEvent entity by its id.

func (*DownloadEventClient) GetX

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

func (*DownloadEventClient) Hooks

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

Hooks returns the client hooks.

func (*DownloadEventClient) Intercept

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

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

func (*DownloadEventClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DownloadEventClient) MapCreateBulk

func (c *DownloadEventClient) MapCreateBulk(slice any, setFunc func(*DownloadEventCreate, int)) *DownloadEventCreateBulk

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

Query returns a query builder for DownloadEvent.

func (*DownloadEventClient) Update

Update returns an update builder for DownloadEvent.

func (*DownloadEventClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DownloadEventClient) UpdateOneID

func (c *DownloadEventClient) UpdateOneID(id int64) *DownloadEventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DownloadEventClient) Use

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

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

type DownloadEventCreate

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

DownloadEventCreate is the builder for creating a DownloadEvent entity.

func (*DownloadEventCreate) Exec

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

Exec executes the query.

func (*DownloadEventCreate) ExecX

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

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

func (*DownloadEventCreate) Mutation

Mutation returns the DownloadEventMutation object of the builder.

func (*DownloadEventCreate) Save

Save creates the DownloadEvent in the database.

func (*DownloadEventCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DownloadEventCreate) SetBytesTransferred

func (_c *DownloadEventCreate) SetBytesTransferred(v int64) *DownloadEventCreate

SetBytesTransferred sets the "bytes_transferred" field.

func (*DownloadEventCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DownloadEventCreate) SetID

SetID sets the "id" field.

func (*DownloadEventCreate) SetNillableBytesTransferred

func (_c *DownloadEventCreate) SetNillableBytesTransferred(v *int64) *DownloadEventCreate

SetNillableBytesTransferred sets the "bytes_transferred" field if the given value is not nil.

func (*DownloadEventCreate) SetNillableCreatedAt

func (_c *DownloadEventCreate) SetNillableCreatedAt(v *time.Time) *DownloadEventCreate

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

func (*DownloadEventCreate) SetNillableShareID

func (_c *DownloadEventCreate) SetNillableShareID(v *string) *DownloadEventCreate

SetNillableShareID sets the "share_id" field if the given value is not nil.

func (*DownloadEventCreate) SetOutcome

func (_c *DownloadEventCreate) SetOutcome(v string) *DownloadEventCreate

SetOutcome sets the "outcome" field.

func (*DownloadEventCreate) SetPhase

SetPhase sets the "phase" field.

func (*DownloadEventCreate) SetShareID

func (_c *DownloadEventCreate) SetShareID(v string) *DownloadEventCreate

SetShareID sets the "share_id" field.

type DownloadEventCreateBulk

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

DownloadEventCreateBulk is the builder for creating many DownloadEvent entities in bulk.

func (*DownloadEventCreateBulk) Exec

Exec executes the query.

func (*DownloadEventCreateBulk) ExecX

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

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

func (*DownloadEventCreateBulk) Save

Save creates the DownloadEvent entities in the database.

func (*DownloadEventCreateBulk) SaveX

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

type DownloadEventDelete

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

DownloadEventDelete is the builder for deleting a DownloadEvent entity.

func (*DownloadEventDelete) Exec

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

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

func (*DownloadEventDelete) ExecX

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

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

func (*DownloadEventDelete) Where

Where appends a list predicates to the DownloadEventDelete builder.

type DownloadEventDeleteOne

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

DownloadEventDeleteOne is the builder for deleting a single DownloadEvent entity.

func (*DownloadEventDeleteOne) Exec

Exec executes the deletion query.

func (*DownloadEventDeleteOne) ExecX

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

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

func (*DownloadEventDeleteOne) Where

Where appends a list predicates to the DownloadEventDelete builder.

type DownloadEventGroupBy

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

DownloadEventGroupBy is the group-by builder for DownloadEvent entities.

func (*DownloadEventGroupBy) Aggregate

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

func (*DownloadEventGroupBy) Bool

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

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

func (*DownloadEventGroupBy) BoolX

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

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

func (*DownloadEventGroupBy) Bools

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

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

func (*DownloadEventGroupBy) BoolsX

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

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

func (*DownloadEventGroupBy) Float64

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

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

func (*DownloadEventGroupBy) Float64X

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

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

func (*DownloadEventGroupBy) Float64s

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

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

func (*DownloadEventGroupBy) Float64sX

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

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

func (*DownloadEventGroupBy) Int

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

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

func (*DownloadEventGroupBy) IntX

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

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

func (*DownloadEventGroupBy) Ints

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

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

func (*DownloadEventGroupBy) IntsX

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

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

func (*DownloadEventGroupBy) Scan

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

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

func (*DownloadEventGroupBy) ScanX

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

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

func (*DownloadEventGroupBy) String

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

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

func (*DownloadEventGroupBy) StringX

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

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

func (*DownloadEventGroupBy) Strings

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

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

func (*DownloadEventGroupBy) StringsX

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

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

type DownloadEventMutation

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

DownloadEventMutation represents an operation that mutates the DownloadEvent nodes in the graph.

func (*DownloadEventMutation) AddBytesTransferred

func (m *DownloadEventMutation) AddBytesTransferred(i int64)

AddBytesTransferred adds i to the "bytes_transferred" field.

func (*DownloadEventMutation) AddField

func (m *DownloadEventMutation) 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 (*DownloadEventMutation) AddedBytesTransferred

func (m *DownloadEventMutation) AddedBytesTransferred() (r int64, exists bool)

AddedBytesTransferred returns the value that was added to the "bytes_transferred" field in this mutation.

func (*DownloadEventMutation) AddedEdges

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

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

func (*DownloadEventMutation) AddedField

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

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

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

func (*DownloadEventMutation) AddedIDs

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

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

func (*DownloadEventMutation) BytesTransferred

func (m *DownloadEventMutation) BytesTransferred() (r int64, exists bool)

BytesTransferred returns the value of the "bytes_transferred" field in the mutation.

func (*DownloadEventMutation) ClearEdge

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

func (m *DownloadEventMutation) 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 (*DownloadEventMutation) ClearShareID

func (m *DownloadEventMutation) ClearShareID()

ClearShareID clears the value of the "share_id" field.

func (*DownloadEventMutation) ClearedEdges

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

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

func (*DownloadEventMutation) ClearedFields

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

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

func (DownloadEventMutation) Client

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

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

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

func (*DownloadEventMutation) EdgeCleared

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

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

func (*DownloadEventMutation) Field

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

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

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

func (*DownloadEventMutation) Fields

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

func (m *DownloadEventMutation) ID() (id int64, 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 (*DownloadEventMutation) IDs

func (m *DownloadEventMutation) IDs(ctx context.Context) ([]int64, 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 (*DownloadEventMutation) OldBytesTransferred

func (m *DownloadEventMutation) OldBytesTransferred(ctx context.Context) (v int64, err error)

OldBytesTransferred returns the old "bytes_transferred" field's value of the DownloadEvent entity. If the DownloadEvent 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 (*DownloadEventMutation) OldCreatedAt

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

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

func (m *DownloadEventMutation) 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 (*DownloadEventMutation) OldOutcome

func (m *DownloadEventMutation) OldOutcome(ctx context.Context) (v string, err error)

OldOutcome returns the old "outcome" field's value of the DownloadEvent entity. If the DownloadEvent 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 (*DownloadEventMutation) OldPhase

func (m *DownloadEventMutation) OldPhase(ctx context.Context) (v string, err error)

OldPhase returns the old "phase" field's value of the DownloadEvent entity. If the DownloadEvent 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 (*DownloadEventMutation) OldShareID

func (m *DownloadEventMutation) OldShareID(ctx context.Context) (v *string, err error)

OldShareID returns the old "share_id" field's value of the DownloadEvent entity. If the DownloadEvent 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 (*DownloadEventMutation) Op

func (m *DownloadEventMutation) Op() Op

Op returns the operation name.

func (*DownloadEventMutation) Outcome

func (m *DownloadEventMutation) Outcome() (r string, exists bool)

Outcome returns the value of the "outcome" field in the mutation.

func (*DownloadEventMutation) Phase

func (m *DownloadEventMutation) Phase() (r string, exists bool)

Phase returns the value of the "phase" field in the mutation.

func (*DownloadEventMutation) RemovedEdges

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

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

func (*DownloadEventMutation) RemovedIDs

func (m *DownloadEventMutation) 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 (*DownloadEventMutation) ResetBytesTransferred

func (m *DownloadEventMutation) ResetBytesTransferred()

ResetBytesTransferred resets all changes to the "bytes_transferred" field.

func (*DownloadEventMutation) ResetCreatedAt

func (m *DownloadEventMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DownloadEventMutation) ResetEdge

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

func (m *DownloadEventMutation) 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 (*DownloadEventMutation) ResetOutcome

func (m *DownloadEventMutation) ResetOutcome()

ResetOutcome resets all changes to the "outcome" field.

func (*DownloadEventMutation) ResetPhase

func (m *DownloadEventMutation) ResetPhase()

ResetPhase resets all changes to the "phase" field.

func (*DownloadEventMutation) ResetShareID

func (m *DownloadEventMutation) ResetShareID()

ResetShareID resets all changes to the "share_id" field.

func (*DownloadEventMutation) SetBytesTransferred

func (m *DownloadEventMutation) SetBytesTransferred(i int64)

SetBytesTransferred sets the "bytes_transferred" field.

func (*DownloadEventMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DownloadEventMutation) SetField

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

func (m *DownloadEventMutation) SetID(id int64)

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

func (*DownloadEventMutation) SetOp

func (m *DownloadEventMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DownloadEventMutation) SetOutcome

func (m *DownloadEventMutation) SetOutcome(s string)

SetOutcome sets the "outcome" field.

func (*DownloadEventMutation) SetPhase

func (m *DownloadEventMutation) SetPhase(s string)

SetPhase sets the "phase" field.

func (*DownloadEventMutation) SetShareID

func (m *DownloadEventMutation) SetShareID(s string)

SetShareID sets the "share_id" field.

func (*DownloadEventMutation) ShareID

func (m *DownloadEventMutation) ShareID() (r string, exists bool)

ShareID returns the value of the "share_id" field in the mutation.

func (*DownloadEventMutation) ShareIDCleared

func (m *DownloadEventMutation) ShareIDCleared() bool

ShareIDCleared returns if the "share_id" field was cleared in this mutation.

func (DownloadEventMutation) Tx

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

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

func (*DownloadEventMutation) Type

func (m *DownloadEventMutation) Type() string

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

func (*DownloadEventMutation) Where

Where appends a list predicates to the DownloadEventMutation builder.

func (*DownloadEventMutation) WhereP

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

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

type DownloadEventQuery

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

DownloadEventQuery is the builder for querying DownloadEvent entities.

func (*DownloadEventQuery) Aggregate

func (_q *DownloadEventQuery) Aggregate(fns ...AggregateFunc) *DownloadEventSelect

Aggregate returns a DownloadEventSelect configured with the given aggregations.

func (*DownloadEventQuery) All

All executes the query and returns a list of DownloadEvents.

func (*DownloadEventQuery) AllX

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

func (*DownloadEventQuery) Clone

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

func (*DownloadEventQuery) Count

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

Count returns the count of the given query.

func (*DownloadEventQuery) CountX

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

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

func (*DownloadEventQuery) Exist

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

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

func (*DownloadEventQuery) ExistX

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

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

func (*DownloadEventQuery) First

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

func (*DownloadEventQuery) FirstID

func (_q *DownloadEventQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*DownloadEventQuery) FirstIDX

func (_q *DownloadEventQuery) FirstIDX(ctx context.Context) int64

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

func (*DownloadEventQuery) FirstX

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

func (*DownloadEventQuery) GroupBy

func (_q *DownloadEventQuery) GroupBy(field string, fields ...string) *DownloadEventGroupBy

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

client.DownloadEvent.Query().
	GroupBy(downloadevent.FieldShareID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DownloadEventQuery) IDs

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

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

func (*DownloadEventQuery) IDsX

func (_q *DownloadEventQuery) IDsX(ctx context.Context) []int64

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

func (*DownloadEventQuery) Limit

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

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

func (*DownloadEventQuery) Offset

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

Offset to start from.

func (*DownloadEventQuery) Only

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

func (*DownloadEventQuery) OnlyID

func (_q *DownloadEventQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*DownloadEventQuery) OnlyIDX

func (_q *DownloadEventQuery) OnlyIDX(ctx context.Context) int64

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

func (*DownloadEventQuery) OnlyX

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

func (*DownloadEventQuery) Order

Order specifies how the records should be ordered.

func (*DownloadEventQuery) Select

func (_q *DownloadEventQuery) Select(fields ...string) *DownloadEventSelect

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

client.DownloadEvent.Query().
	Select(downloadevent.FieldShareID).
	Scan(ctx, &v)

func (*DownloadEventQuery) Unique

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

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

Where adds a new predicate for the DownloadEventQuery builder.

type DownloadEventSelect

type DownloadEventSelect struct {
	*DownloadEventQuery
	// contains filtered or unexported fields
}

DownloadEventSelect is the builder for selecting fields of DownloadEvent entities.

func (*DownloadEventSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*DownloadEventSelect) Bool

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

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

func (*DownloadEventSelect) BoolX

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

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

func (*DownloadEventSelect) Bools

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

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

func (*DownloadEventSelect) BoolsX

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

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

func (*DownloadEventSelect) Float64

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

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

func (*DownloadEventSelect) Float64X

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

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

func (*DownloadEventSelect) Float64s

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

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

func (*DownloadEventSelect) Float64sX

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

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

func (*DownloadEventSelect) Int

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

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

func (*DownloadEventSelect) IntX

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

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

func (*DownloadEventSelect) Ints

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

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

func (*DownloadEventSelect) IntsX

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

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

func (*DownloadEventSelect) Scan

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

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

func (*DownloadEventSelect) ScanX

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

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

func (*DownloadEventSelect) String

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

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

func (*DownloadEventSelect) StringX

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

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

func (*DownloadEventSelect) Strings

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

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

func (*DownloadEventSelect) StringsX

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

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

type DownloadEventUpdate

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

DownloadEventUpdate is the builder for updating DownloadEvent entities.

func (*DownloadEventUpdate) AddBytesTransferred

func (_u *DownloadEventUpdate) AddBytesTransferred(v int64) *DownloadEventUpdate

AddBytesTransferred adds value to the "bytes_transferred" field.

func (*DownloadEventUpdate) ClearShareID

func (_u *DownloadEventUpdate) ClearShareID() *DownloadEventUpdate

ClearShareID clears the value of the "share_id" field.

func (*DownloadEventUpdate) Exec

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

Exec executes the query.

func (*DownloadEventUpdate) ExecX

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

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

func (*DownloadEventUpdate) Mutation

Mutation returns the DownloadEventMutation object of the builder.

func (*DownloadEventUpdate) Save

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

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

func (*DownloadEventUpdate) SaveX

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

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

func (*DownloadEventUpdate) SetBytesTransferred

func (_u *DownloadEventUpdate) SetBytesTransferred(v int64) *DownloadEventUpdate

SetBytesTransferred sets the "bytes_transferred" field.

func (*DownloadEventUpdate) SetNillableBytesTransferred

func (_u *DownloadEventUpdate) SetNillableBytesTransferred(v *int64) *DownloadEventUpdate

SetNillableBytesTransferred sets the "bytes_transferred" field if the given value is not nil.

func (*DownloadEventUpdate) SetNillableOutcome

func (_u *DownloadEventUpdate) SetNillableOutcome(v *string) *DownloadEventUpdate

SetNillableOutcome sets the "outcome" field if the given value is not nil.

func (*DownloadEventUpdate) SetNillablePhase

func (_u *DownloadEventUpdate) SetNillablePhase(v *string) *DownloadEventUpdate

SetNillablePhase sets the "phase" field if the given value is not nil.

func (*DownloadEventUpdate) SetNillableShareID

func (_u *DownloadEventUpdate) SetNillableShareID(v *string) *DownloadEventUpdate

SetNillableShareID sets the "share_id" field if the given value is not nil.

func (*DownloadEventUpdate) SetOutcome

func (_u *DownloadEventUpdate) SetOutcome(v string) *DownloadEventUpdate

SetOutcome sets the "outcome" field.

func (*DownloadEventUpdate) SetPhase

SetPhase sets the "phase" field.

func (*DownloadEventUpdate) SetShareID

func (_u *DownloadEventUpdate) SetShareID(v string) *DownloadEventUpdate

SetShareID sets the "share_id" field.

func (*DownloadEventUpdate) Where

Where appends a list predicates to the DownloadEventUpdate builder.

type DownloadEventUpdateOne

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

DownloadEventUpdateOne is the builder for updating a single DownloadEvent entity.

func (*DownloadEventUpdateOne) AddBytesTransferred

func (_u *DownloadEventUpdateOne) AddBytesTransferred(v int64) *DownloadEventUpdateOne

AddBytesTransferred adds value to the "bytes_transferred" field.

func (*DownloadEventUpdateOne) ClearShareID

func (_u *DownloadEventUpdateOne) ClearShareID() *DownloadEventUpdateOne

ClearShareID clears the value of the "share_id" field.

func (*DownloadEventUpdateOne) Exec

Exec executes the query on the entity.

func (*DownloadEventUpdateOne) ExecX

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

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

func (*DownloadEventUpdateOne) Mutation

Mutation returns the DownloadEventMutation object of the builder.

func (*DownloadEventUpdateOne) Save

Save executes the query and returns the updated DownloadEvent entity.

func (*DownloadEventUpdateOne) SaveX

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

func (*DownloadEventUpdateOne) Select

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

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

func (*DownloadEventUpdateOne) SetBytesTransferred

func (_u *DownloadEventUpdateOne) SetBytesTransferred(v int64) *DownloadEventUpdateOne

SetBytesTransferred sets the "bytes_transferred" field.

func (*DownloadEventUpdateOne) SetNillableBytesTransferred

func (_u *DownloadEventUpdateOne) SetNillableBytesTransferred(v *int64) *DownloadEventUpdateOne

SetNillableBytesTransferred sets the "bytes_transferred" field if the given value is not nil.

func (*DownloadEventUpdateOne) SetNillableOutcome

func (_u *DownloadEventUpdateOne) SetNillableOutcome(v *string) *DownloadEventUpdateOne

SetNillableOutcome sets the "outcome" field if the given value is not nil.

func (*DownloadEventUpdateOne) SetNillablePhase

func (_u *DownloadEventUpdateOne) SetNillablePhase(v *string) *DownloadEventUpdateOne

SetNillablePhase sets the "phase" field if the given value is not nil.

func (*DownloadEventUpdateOne) SetNillableShareID

func (_u *DownloadEventUpdateOne) SetNillableShareID(v *string) *DownloadEventUpdateOne

SetNillableShareID sets the "share_id" field if the given value is not nil.

func (*DownloadEventUpdateOne) SetOutcome

SetOutcome sets the "outcome" field.

func (*DownloadEventUpdateOne) SetPhase

SetPhase sets the "phase" field.

func (*DownloadEventUpdateOne) SetShareID

SetShareID sets the "share_id" field.

func (*DownloadEventUpdateOne) Where

Where appends a list predicates to the DownloadEventUpdate builder.

type DownloadEvents

type DownloadEvents []*DownloadEvent

DownloadEvents is a parsable slice of DownloadEvent.

type DownloadIssuer

type DownloadIssuer struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// contains filtered or unexported fields
}

DownloadIssuer is the model entity for the DownloadIssuer schema.

func (*DownloadIssuer) String

func (_m *DownloadIssuer) String() string

String implements the fmt.Stringer.

func (*DownloadIssuer) Unwrap

func (_m *DownloadIssuer) Unwrap() *DownloadIssuer

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

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

func (*DownloadIssuer) Value

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

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

type DownloadIssuerClient

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

DownloadIssuerClient is a client for the DownloadIssuer schema.

func NewDownloadIssuerClient

func NewDownloadIssuerClient(c config) *DownloadIssuerClient

NewDownloadIssuerClient returns a client for the DownloadIssuer from the given config.

func (*DownloadIssuerClient) Create

Create returns a builder for creating a DownloadIssuer entity.

func (*DownloadIssuerClient) CreateBulk

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

func (*DownloadIssuerClient) Delete

Delete returns a delete builder for DownloadIssuer.

func (*DownloadIssuerClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DownloadIssuerClient) DeleteOneID

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

func (*DownloadIssuerClient) Get

Get returns a DownloadIssuer entity by its id.

func (*DownloadIssuerClient) GetX

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

func (*DownloadIssuerClient) Hooks

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

Hooks returns the client hooks.

func (*DownloadIssuerClient) Intercept

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

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

func (*DownloadIssuerClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DownloadIssuerClient) MapCreateBulk

func (c *DownloadIssuerClient) MapCreateBulk(slice any, setFunc func(*DownloadIssuerCreate, int)) *DownloadIssuerCreateBulk

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

Query returns a query builder for DownloadIssuer.

func (*DownloadIssuerClient) Update

Update returns an update builder for DownloadIssuer.

func (*DownloadIssuerClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DownloadIssuerClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DownloadIssuerClient) Use

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

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

type DownloadIssuerCreate

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

DownloadIssuerCreate is the builder for creating a DownloadIssuer entity.

func (*DownloadIssuerCreate) Exec

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

Exec executes the query.

func (*DownloadIssuerCreate) ExecX

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

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

func (*DownloadIssuerCreate) Mutation

Mutation returns the DownloadIssuerMutation object of the builder.

func (*DownloadIssuerCreate) Save

Save creates the DownloadIssuer in the database.

func (*DownloadIssuerCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DownloadIssuerCreate) SetEnabled

func (_c *DownloadIssuerCreate) SetEnabled(v bool) *DownloadIssuerCreate

SetEnabled sets the "enabled" field.

func (*DownloadIssuerCreate) SetID

SetID sets the "id" field.

func (*DownloadIssuerCreate) SetNillableEnabled

func (_c *DownloadIssuerCreate) SetNillableEnabled(v *bool) *DownloadIssuerCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

type DownloadIssuerCreateBulk

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

DownloadIssuerCreateBulk is the builder for creating many DownloadIssuer entities in bulk.

func (*DownloadIssuerCreateBulk) Exec

Exec executes the query.

func (*DownloadIssuerCreateBulk) ExecX

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

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

func (*DownloadIssuerCreateBulk) Save

Save creates the DownloadIssuer entities in the database.

func (*DownloadIssuerCreateBulk) SaveX

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

type DownloadIssuerDelete

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

DownloadIssuerDelete is the builder for deleting a DownloadIssuer entity.

func (*DownloadIssuerDelete) Exec

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

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

func (*DownloadIssuerDelete) ExecX

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

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

func (*DownloadIssuerDelete) Where

Where appends a list predicates to the DownloadIssuerDelete builder.

type DownloadIssuerDeleteOne

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

DownloadIssuerDeleteOne is the builder for deleting a single DownloadIssuer entity.

func (*DownloadIssuerDeleteOne) Exec

Exec executes the deletion query.

func (*DownloadIssuerDeleteOne) ExecX

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

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

func (*DownloadIssuerDeleteOne) Where

Where appends a list predicates to the DownloadIssuerDelete builder.

type DownloadIssuerGroupBy

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

DownloadIssuerGroupBy is the group-by builder for DownloadIssuer entities.

func (*DownloadIssuerGroupBy) Aggregate

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

func (*DownloadIssuerGroupBy) Bool

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

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

func (*DownloadIssuerGroupBy) BoolX

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

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

func (*DownloadIssuerGroupBy) Bools

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

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

func (*DownloadIssuerGroupBy) BoolsX

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

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

func (*DownloadIssuerGroupBy) Float64

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

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

func (*DownloadIssuerGroupBy) Float64X

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

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

func (*DownloadIssuerGroupBy) Float64s

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

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

func (*DownloadIssuerGroupBy) Float64sX

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

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

func (*DownloadIssuerGroupBy) Int

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

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

func (*DownloadIssuerGroupBy) IntX

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

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

func (*DownloadIssuerGroupBy) Ints

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

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

func (*DownloadIssuerGroupBy) IntsX

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

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

func (*DownloadIssuerGroupBy) Scan

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

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

func (*DownloadIssuerGroupBy) ScanX

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

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

func (*DownloadIssuerGroupBy) String

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

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

func (*DownloadIssuerGroupBy) StringX

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

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

func (*DownloadIssuerGroupBy) Strings

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

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

func (*DownloadIssuerGroupBy) StringsX

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

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

type DownloadIssuerMutation

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

DownloadIssuerMutation represents an operation that mutates the DownloadIssuer nodes in the graph.

func (*DownloadIssuerMutation) AddField

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

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

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

func (*DownloadIssuerMutation) AddedField

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

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

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

func (*DownloadIssuerMutation) AddedIDs

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

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

func (*DownloadIssuerMutation) ClearEdge

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

func (m *DownloadIssuerMutation) 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 (*DownloadIssuerMutation) ClearedEdges

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

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

func (*DownloadIssuerMutation) ClearedFields

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

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

func (DownloadIssuerMutation) Client

func (m DownloadIssuerMutation) 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 (*DownloadIssuerMutation) EdgeCleared

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

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

func (*DownloadIssuerMutation) Enabled

func (m *DownloadIssuerMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*DownloadIssuerMutation) Field

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

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

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

func (*DownloadIssuerMutation) Fields

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

func (m *DownloadIssuerMutation) ID() (id string, 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 (*DownloadIssuerMutation) 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 (*DownloadIssuerMutation) OldEnabled

func (m *DownloadIssuerMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the DownloadIssuer entity. If the DownloadIssuer 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 (*DownloadIssuerMutation) OldField

func (m *DownloadIssuerMutation) 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 (*DownloadIssuerMutation) Op

func (m *DownloadIssuerMutation) Op() Op

Op returns the operation name.

func (*DownloadIssuerMutation) RemovedEdges

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

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

func (*DownloadIssuerMutation) RemovedIDs

func (m *DownloadIssuerMutation) 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 (*DownloadIssuerMutation) ResetEdge

func (m *DownloadIssuerMutation) 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 (*DownloadIssuerMutation) ResetEnabled

func (m *DownloadIssuerMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*DownloadIssuerMutation) ResetField

func (m *DownloadIssuerMutation) 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 (*DownloadIssuerMutation) SetEnabled

func (m *DownloadIssuerMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*DownloadIssuerMutation) SetField

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

func (m *DownloadIssuerMutation) SetID(id string)

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

func (*DownloadIssuerMutation) SetOp

func (m *DownloadIssuerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (DownloadIssuerMutation) Tx

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

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

func (*DownloadIssuerMutation) Type

func (m *DownloadIssuerMutation) Type() string

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

func (*DownloadIssuerMutation) Where

Where appends a list predicates to the DownloadIssuerMutation builder.

func (*DownloadIssuerMutation) WhereP

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

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

type DownloadIssuerQuery

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

DownloadIssuerQuery is the builder for querying DownloadIssuer entities.

func (*DownloadIssuerQuery) Aggregate

Aggregate returns a DownloadIssuerSelect configured with the given aggregations.

func (*DownloadIssuerQuery) All

All executes the query and returns a list of DownloadIssuers.

func (*DownloadIssuerQuery) AllX

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

func (*DownloadIssuerQuery) Clone

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

func (*DownloadIssuerQuery) Count

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

Count returns the count of the given query.

func (*DownloadIssuerQuery) CountX

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

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

func (*DownloadIssuerQuery) Exist

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

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

func (*DownloadIssuerQuery) ExistX

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

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

func (*DownloadIssuerQuery) First

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

func (*DownloadIssuerQuery) FirstID

func (_q *DownloadIssuerQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DownloadIssuerQuery) FirstIDX

func (_q *DownloadIssuerQuery) FirstIDX(ctx context.Context) string

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

func (*DownloadIssuerQuery) FirstX

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

func (*DownloadIssuerQuery) GroupBy

func (_q *DownloadIssuerQuery) GroupBy(field string, fields ...string) *DownloadIssuerGroupBy

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 {
	Enabled bool `json:"enabled,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DownloadIssuer.Query().
	GroupBy(downloadissuer.FieldEnabled).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DownloadIssuerQuery) IDs

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

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

func (*DownloadIssuerQuery) IDsX

func (_q *DownloadIssuerQuery) IDsX(ctx context.Context) []string

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

func (*DownloadIssuerQuery) Limit

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

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

func (*DownloadIssuerQuery) Offset

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

Offset to start from.

func (*DownloadIssuerQuery) Only

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

func (*DownloadIssuerQuery) OnlyID

func (_q *DownloadIssuerQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DownloadIssuerQuery) OnlyIDX

func (_q *DownloadIssuerQuery) OnlyIDX(ctx context.Context) string

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

func (*DownloadIssuerQuery) OnlyX

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

func (*DownloadIssuerQuery) Order

Order specifies how the records should be ordered.

func (*DownloadIssuerQuery) Select

func (_q *DownloadIssuerQuery) Select(fields ...string) *DownloadIssuerSelect

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 {
	Enabled bool `json:"enabled,omitempty"`
}

client.DownloadIssuer.Query().
	Select(downloadissuer.FieldEnabled).
	Scan(ctx, &v)

func (*DownloadIssuerQuery) Unique

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

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

Where adds a new predicate for the DownloadIssuerQuery builder.

type DownloadIssuerSelect

type DownloadIssuerSelect struct {
	*DownloadIssuerQuery
	// contains filtered or unexported fields
}

DownloadIssuerSelect is the builder for selecting fields of DownloadIssuer entities.

func (*DownloadIssuerSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*DownloadIssuerSelect) Bool

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

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

func (*DownloadIssuerSelect) BoolX

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

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

func (*DownloadIssuerSelect) Bools

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

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

func (*DownloadIssuerSelect) BoolsX

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

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

func (*DownloadIssuerSelect) Float64

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

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

func (*DownloadIssuerSelect) Float64X

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

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

func (*DownloadIssuerSelect) Float64s

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

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

func (*DownloadIssuerSelect) Float64sX

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

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

func (*DownloadIssuerSelect) Int

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

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

func (*DownloadIssuerSelect) IntX

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

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

func (*DownloadIssuerSelect) Ints

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

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

func (*DownloadIssuerSelect) IntsX

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

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

func (*DownloadIssuerSelect) Scan

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

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

func (*DownloadIssuerSelect) ScanX

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

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

func (*DownloadIssuerSelect) String

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

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

func (*DownloadIssuerSelect) StringX

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

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

func (*DownloadIssuerSelect) Strings

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

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

func (*DownloadIssuerSelect) StringsX

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

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

type DownloadIssuerUpdate

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

DownloadIssuerUpdate is the builder for updating DownloadIssuer entities.

func (*DownloadIssuerUpdate) Exec

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

Exec executes the query.

func (*DownloadIssuerUpdate) ExecX

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

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

func (*DownloadIssuerUpdate) Mutation

Mutation returns the DownloadIssuerMutation object of the builder.

func (*DownloadIssuerUpdate) Save

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

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

func (*DownloadIssuerUpdate) SaveX

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

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

func (*DownloadIssuerUpdate) SetEnabled

func (_u *DownloadIssuerUpdate) SetEnabled(v bool) *DownloadIssuerUpdate

SetEnabled sets the "enabled" field.

func (*DownloadIssuerUpdate) SetNillableEnabled

func (_u *DownloadIssuerUpdate) SetNillableEnabled(v *bool) *DownloadIssuerUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*DownloadIssuerUpdate) Where

Where appends a list predicates to the DownloadIssuerUpdate builder.

type DownloadIssuerUpdateOne

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

DownloadIssuerUpdateOne is the builder for updating a single DownloadIssuer entity.

func (*DownloadIssuerUpdateOne) Exec

Exec executes the query on the entity.

func (*DownloadIssuerUpdateOne) ExecX

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

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

func (*DownloadIssuerUpdateOne) Mutation

Mutation returns the DownloadIssuerMutation object of the builder.

func (*DownloadIssuerUpdateOne) Save

Save executes the query and returns the updated DownloadIssuer entity.

func (*DownloadIssuerUpdateOne) SaveX

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

func (*DownloadIssuerUpdateOne) Select

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

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

func (*DownloadIssuerUpdateOne) SetEnabled

SetEnabled sets the "enabled" field.

func (*DownloadIssuerUpdateOne) SetNillableEnabled

func (_u *DownloadIssuerUpdateOne) SetNillableEnabled(v *bool) *DownloadIssuerUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*DownloadIssuerUpdateOne) Where

Where appends a list predicates to the DownloadIssuerUpdate builder.

type DownloadIssuers

type DownloadIssuers []*DownloadIssuer

DownloadIssuers is a parsable slice of DownloadIssuer.

type DownloadShare

type DownloadShare struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// TokenHash holds the value of the "token_hash" field.
	TokenHash []byte `json:"token_hash,omitempty"`
	// Repository holds the value of the "repository" field.
	Repository string `json:"repository,omitempty"`
	// SourceTag holds the value of the "source_tag" field.
	SourceTag string `json:"source_tag,omitempty"`
	// ManifestDigest holds the value of the "manifest_digest" field.
	ManifestDigest string `json:"manifest_digest,omitempty"`
	// BlobDigest holds the value of the "blob_digest" field.
	BlobDigest string `json:"blob_digest,omitempty"`
	// BlobSize holds the value of the "blob_size" field.
	BlobSize int64 `json:"blob_size,omitempty"`
	// MediaType holds the value of the "media_type" field.
	MediaType string `json:"media_type,omitempty"`
	// Filename holds the value of the "filename" field.
	Filename string `json:"filename,omitempty"`
	// CustomerID holds the value of the "customer_id" field.
	CustomerID string `json:"customer_id,omitempty"`
	// Purpose holds the value of the "purpose" field.
	Purpose string `json:"purpose,omitempty"`
	// IssuedBy holds the value of the "issued_by" field.
	IssuedBy string `json:"issued_by,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// RevokedAt holds the value of the "revoked_at" field.
	RevokedAt *time.Time `json:"revoked_at,omitempty"`
	// MaxSessions holds the value of the "max_sessions" field.
	MaxSessions *int `json:"max_sessions,omitempty"`
	// SessionsStarted holds the value of the "sessions_started" field.
	SessionsStarted int64 `json:"sessions_started,omitempty"`
	// contains filtered or unexported fields
}

DownloadShare is the model entity for the DownloadShare schema.

func (*DownloadShare) String

func (_m *DownloadShare) String() string

String implements the fmt.Stringer.

func (*DownloadShare) Unwrap

func (_m *DownloadShare) Unwrap() *DownloadShare

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

func (_m *DownloadShare) Update() *DownloadShareUpdateOne

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

func (*DownloadShare) Value

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

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

type DownloadShareClient

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

DownloadShareClient is a client for the DownloadShare schema.

func NewDownloadShareClient

func NewDownloadShareClient(c config) *DownloadShareClient

NewDownloadShareClient returns a client for the DownloadShare from the given config.

func (*DownloadShareClient) Create

Create returns a builder for creating a DownloadShare entity.

func (*DownloadShareClient) CreateBulk

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

func (*DownloadShareClient) Delete

Delete returns a delete builder for DownloadShare.

func (*DownloadShareClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DownloadShareClient) DeleteOneID

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

func (*DownloadShareClient) Get

Get returns a DownloadShare entity by its id.

func (*DownloadShareClient) GetX

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

func (*DownloadShareClient) Hooks

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

Hooks returns the client hooks.

func (*DownloadShareClient) Intercept

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

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

func (*DownloadShareClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DownloadShareClient) MapCreateBulk

func (c *DownloadShareClient) MapCreateBulk(slice any, setFunc func(*DownloadShareCreate, int)) *DownloadShareCreateBulk

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

Query returns a query builder for DownloadShare.

func (*DownloadShareClient) Update

Update returns an update builder for DownloadShare.

func (*DownloadShareClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DownloadShareClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DownloadShareClient) Use

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

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

type DownloadShareCreate

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

DownloadShareCreate is the builder for creating a DownloadShare entity.

func (*DownloadShareCreate) Exec

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

Exec executes the query.

func (*DownloadShareCreate) ExecX

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

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

func (*DownloadShareCreate) Mutation

Mutation returns the DownloadShareMutation object of the builder.

func (*DownloadShareCreate) Save

Save creates the DownloadShare in the database.

func (*DownloadShareCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DownloadShareCreate) SetBlobDigest

func (_c *DownloadShareCreate) SetBlobDigest(v string) *DownloadShareCreate

SetBlobDigest sets the "blob_digest" field.

func (*DownloadShareCreate) SetBlobSize

func (_c *DownloadShareCreate) SetBlobSize(v int64) *DownloadShareCreate

SetBlobSize sets the "blob_size" field.

func (*DownloadShareCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DownloadShareCreate) SetCustomerID

func (_c *DownloadShareCreate) SetCustomerID(v string) *DownloadShareCreate

SetCustomerID sets the "customer_id" field.

func (*DownloadShareCreate) SetExpiresAt

func (_c *DownloadShareCreate) SetExpiresAt(v time.Time) *DownloadShareCreate

SetExpiresAt sets the "expires_at" field.

func (*DownloadShareCreate) SetFilename

func (_c *DownloadShareCreate) SetFilename(v string) *DownloadShareCreate

SetFilename sets the "filename" field.

func (*DownloadShareCreate) SetID

SetID sets the "id" field.

func (*DownloadShareCreate) SetIssuedBy

func (_c *DownloadShareCreate) SetIssuedBy(v string) *DownloadShareCreate

SetIssuedBy sets the "issued_by" field.

func (*DownloadShareCreate) SetManifestDigest

func (_c *DownloadShareCreate) SetManifestDigest(v string) *DownloadShareCreate

SetManifestDigest sets the "manifest_digest" field.

func (*DownloadShareCreate) SetMaxSessions

func (_c *DownloadShareCreate) SetMaxSessions(v int) *DownloadShareCreate

SetMaxSessions sets the "max_sessions" field.

func (*DownloadShareCreate) SetMediaType

func (_c *DownloadShareCreate) SetMediaType(v string) *DownloadShareCreate

SetMediaType sets the "media_type" field.

func (*DownloadShareCreate) SetNillableMaxSessions

func (_c *DownloadShareCreate) SetNillableMaxSessions(v *int) *DownloadShareCreate

SetNillableMaxSessions sets the "max_sessions" field if the given value is not nil.

func (*DownloadShareCreate) SetNillableRevokedAt

func (_c *DownloadShareCreate) SetNillableRevokedAt(v *time.Time) *DownloadShareCreate

SetNillableRevokedAt sets the "revoked_at" field if the given value is not nil.

func (*DownloadShareCreate) SetNillableSessionsStarted

func (_c *DownloadShareCreate) SetNillableSessionsStarted(v *int64) *DownloadShareCreate

SetNillableSessionsStarted sets the "sessions_started" field if the given value is not nil.

func (*DownloadShareCreate) SetPurpose

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

SetPurpose sets the "purpose" field.

func (*DownloadShareCreate) SetRepository

func (_c *DownloadShareCreate) SetRepository(v string) *DownloadShareCreate

SetRepository sets the "repository" field.

func (*DownloadShareCreate) SetRevokedAt

func (_c *DownloadShareCreate) SetRevokedAt(v time.Time) *DownloadShareCreate

SetRevokedAt sets the "revoked_at" field.

func (*DownloadShareCreate) SetSessionsStarted

func (_c *DownloadShareCreate) SetSessionsStarted(v int64) *DownloadShareCreate

SetSessionsStarted sets the "sessions_started" field.

func (*DownloadShareCreate) SetSourceTag

func (_c *DownloadShareCreate) SetSourceTag(v string) *DownloadShareCreate

SetSourceTag sets the "source_tag" field.

func (*DownloadShareCreate) SetTokenHash

func (_c *DownloadShareCreate) SetTokenHash(v []byte) *DownloadShareCreate

SetTokenHash sets the "token_hash" field.

type DownloadShareCreateBulk

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

DownloadShareCreateBulk is the builder for creating many DownloadShare entities in bulk.

func (*DownloadShareCreateBulk) Exec

Exec executes the query.

func (*DownloadShareCreateBulk) ExecX

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

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

func (*DownloadShareCreateBulk) Save

Save creates the DownloadShare entities in the database.

func (*DownloadShareCreateBulk) SaveX

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

type DownloadShareDelete

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

DownloadShareDelete is the builder for deleting a DownloadShare entity.

func (*DownloadShareDelete) Exec

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

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

func (*DownloadShareDelete) ExecX

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

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

func (*DownloadShareDelete) Where

Where appends a list predicates to the DownloadShareDelete builder.

type DownloadShareDeleteOne

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

DownloadShareDeleteOne is the builder for deleting a single DownloadShare entity.

func (*DownloadShareDeleteOne) Exec

Exec executes the deletion query.

func (*DownloadShareDeleteOne) ExecX

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

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

func (*DownloadShareDeleteOne) Where

Where appends a list predicates to the DownloadShareDelete builder.

type DownloadShareGroupBy

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

DownloadShareGroupBy is the group-by builder for DownloadShare entities.

func (*DownloadShareGroupBy) Aggregate

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

func (*DownloadShareGroupBy) Bool

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

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

func (*DownloadShareGroupBy) BoolX

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

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

func (*DownloadShareGroupBy) Bools

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

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

func (*DownloadShareGroupBy) BoolsX

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

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

func (*DownloadShareGroupBy) Float64

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

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

func (*DownloadShareGroupBy) Float64X

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

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

func (*DownloadShareGroupBy) Float64s

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

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

func (*DownloadShareGroupBy) Float64sX

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

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

func (*DownloadShareGroupBy) Int

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

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

func (*DownloadShareGroupBy) IntX

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

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

func (*DownloadShareGroupBy) Ints

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

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

func (*DownloadShareGroupBy) IntsX

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

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

func (*DownloadShareGroupBy) Scan

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

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

func (*DownloadShareGroupBy) ScanX

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

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

func (*DownloadShareGroupBy) String

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

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

func (*DownloadShareGroupBy) StringX

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

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

func (*DownloadShareGroupBy) Strings

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

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

func (*DownloadShareGroupBy) StringsX

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

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

type DownloadShareMutation

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

DownloadShareMutation represents an operation that mutates the DownloadShare nodes in the graph.

func (*DownloadShareMutation) AddBlobSize

func (m *DownloadShareMutation) AddBlobSize(i int64)

AddBlobSize adds i to the "blob_size" field.

func (*DownloadShareMutation) AddField

func (m *DownloadShareMutation) 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 (*DownloadShareMutation) AddMaxSessions

func (m *DownloadShareMutation) AddMaxSessions(i int)

AddMaxSessions adds i to the "max_sessions" field.

func (*DownloadShareMutation) AddSessionsStarted

func (m *DownloadShareMutation) AddSessionsStarted(i int64)

AddSessionsStarted adds i to the "sessions_started" field.

func (*DownloadShareMutation) AddedBlobSize

func (m *DownloadShareMutation) AddedBlobSize() (r int64, exists bool)

AddedBlobSize returns the value that was added to the "blob_size" field in this mutation.

func (*DownloadShareMutation) AddedEdges

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

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

func (*DownloadShareMutation) AddedField

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

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

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

func (*DownloadShareMutation) AddedIDs

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

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

func (*DownloadShareMutation) AddedMaxSessions

func (m *DownloadShareMutation) AddedMaxSessions() (r int, exists bool)

AddedMaxSessions returns the value that was added to the "max_sessions" field in this mutation.

func (*DownloadShareMutation) AddedSessionsStarted

func (m *DownloadShareMutation) AddedSessionsStarted() (r int64, exists bool)

AddedSessionsStarted returns the value that was added to the "sessions_started" field in this mutation.

func (*DownloadShareMutation) BlobDigest

func (m *DownloadShareMutation) BlobDigest() (r string, exists bool)

BlobDigest returns the value of the "blob_digest" field in the mutation.

func (*DownloadShareMutation) BlobSize

func (m *DownloadShareMutation) BlobSize() (r int64, exists bool)

BlobSize returns the value of the "blob_size" field in the mutation.

func (*DownloadShareMutation) ClearEdge

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

func (m *DownloadShareMutation) 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 (*DownloadShareMutation) ClearMaxSessions

func (m *DownloadShareMutation) ClearMaxSessions()

ClearMaxSessions clears the value of the "max_sessions" field.

func (*DownloadShareMutation) ClearRevokedAt

func (m *DownloadShareMutation) ClearRevokedAt()

ClearRevokedAt clears the value of the "revoked_at" field.

func (*DownloadShareMutation) ClearedEdges

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

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

func (*DownloadShareMutation) ClearedFields

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

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

func (DownloadShareMutation) Client

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

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

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

func (*DownloadShareMutation) CustomerID

func (m *DownloadShareMutation) CustomerID() (r string, exists bool)

CustomerID returns the value of the "customer_id" field in the mutation.

func (*DownloadShareMutation) EdgeCleared

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

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

func (*DownloadShareMutation) ExpiresAt

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

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

func (*DownloadShareMutation) Field

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

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

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

func (*DownloadShareMutation) Fields

func (m *DownloadShareMutation) 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 (*DownloadShareMutation) Filename

func (m *DownloadShareMutation) Filename() (r string, exists bool)

Filename returns the value of the "filename" field in the mutation.

func (*DownloadShareMutation) ID

func (m *DownloadShareMutation) ID() (id string, 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 (*DownloadShareMutation) 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 (*DownloadShareMutation) IssuedBy

func (m *DownloadShareMutation) IssuedBy() (r string, exists bool)

IssuedBy returns the value of the "issued_by" field in the mutation.

func (*DownloadShareMutation) ManifestDigest

func (m *DownloadShareMutation) ManifestDigest() (r string, exists bool)

ManifestDigest returns the value of the "manifest_digest" field in the mutation.

func (*DownloadShareMutation) MaxSessions

func (m *DownloadShareMutation) MaxSessions() (r int, exists bool)

MaxSessions returns the value of the "max_sessions" field in the mutation.

func (*DownloadShareMutation) MaxSessionsCleared

func (m *DownloadShareMutation) MaxSessionsCleared() bool

MaxSessionsCleared returns if the "max_sessions" field was cleared in this mutation.

func (*DownloadShareMutation) MediaType

func (m *DownloadShareMutation) MediaType() (r string, exists bool)

MediaType returns the value of the "media_type" field in the mutation.

func (*DownloadShareMutation) OldBlobDigest

func (m *DownloadShareMutation) OldBlobDigest(ctx context.Context) (v string, err error)

OldBlobDigest returns the old "blob_digest" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldBlobSize

func (m *DownloadShareMutation) OldBlobSize(ctx context.Context) (v int64, err error)

OldBlobSize returns the old "blob_size" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldCreatedAt

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

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

func (m *DownloadShareMutation) OldCustomerID(ctx context.Context) (v string, err error)

OldCustomerID returns the old "customer_id" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldExpiresAt

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

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

func (m *DownloadShareMutation) 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 (*DownloadShareMutation) OldFilename

func (m *DownloadShareMutation) OldFilename(ctx context.Context) (v string, err error)

OldFilename returns the old "filename" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldIssuedBy

func (m *DownloadShareMutation) OldIssuedBy(ctx context.Context) (v string, err error)

OldIssuedBy returns the old "issued_by" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldManifestDigest

func (m *DownloadShareMutation) OldManifestDigest(ctx context.Context) (v string, err error)

OldManifestDigest returns the old "manifest_digest" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldMaxSessions

func (m *DownloadShareMutation) OldMaxSessions(ctx context.Context) (v *int, err error)

OldMaxSessions returns the old "max_sessions" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldMediaType

func (m *DownloadShareMutation) OldMediaType(ctx context.Context) (v string, err error)

OldMediaType returns the old "media_type" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldPurpose

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

OldPurpose returns the old "purpose" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldRepository

func (m *DownloadShareMutation) OldRepository(ctx context.Context) (v string, err error)

OldRepository returns the old "repository" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldRevokedAt

func (m *DownloadShareMutation) OldRevokedAt(ctx context.Context) (v *time.Time, err error)

OldRevokedAt returns the old "revoked_at" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldSessionsStarted

func (m *DownloadShareMutation) OldSessionsStarted(ctx context.Context) (v int64, err error)

OldSessionsStarted returns the old "sessions_started" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldSourceTag

func (m *DownloadShareMutation) OldSourceTag(ctx context.Context) (v string, err error)

OldSourceTag returns the old "source_tag" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) OldTokenHash

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

OldTokenHash returns the old "token_hash" field's value of the DownloadShare entity. If the DownloadShare 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 (*DownloadShareMutation) Op

func (m *DownloadShareMutation) Op() Op

Op returns the operation name.

func (*DownloadShareMutation) Purpose

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

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

func (*DownloadShareMutation) RemovedEdges

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

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

func (*DownloadShareMutation) RemovedIDs

func (m *DownloadShareMutation) 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 (*DownloadShareMutation) Repository

func (m *DownloadShareMutation) Repository() (r string, exists bool)

Repository returns the value of the "repository" field in the mutation.

func (*DownloadShareMutation) ResetBlobDigest

func (m *DownloadShareMutation) ResetBlobDigest()

ResetBlobDigest resets all changes to the "blob_digest" field.

func (*DownloadShareMutation) ResetBlobSize

func (m *DownloadShareMutation) ResetBlobSize()

ResetBlobSize resets all changes to the "blob_size" field.

func (*DownloadShareMutation) ResetCreatedAt

func (m *DownloadShareMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DownloadShareMutation) ResetCustomerID

func (m *DownloadShareMutation) ResetCustomerID()

ResetCustomerID resets all changes to the "customer_id" field.

func (*DownloadShareMutation) ResetEdge

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

func (m *DownloadShareMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*DownloadShareMutation) ResetField

func (m *DownloadShareMutation) 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 (*DownloadShareMutation) ResetFilename

func (m *DownloadShareMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*DownloadShareMutation) ResetIssuedBy

func (m *DownloadShareMutation) ResetIssuedBy()

ResetIssuedBy resets all changes to the "issued_by" field.

func (*DownloadShareMutation) ResetManifestDigest

func (m *DownloadShareMutation) ResetManifestDigest()

ResetManifestDigest resets all changes to the "manifest_digest" field.

func (*DownloadShareMutation) ResetMaxSessions

func (m *DownloadShareMutation) ResetMaxSessions()

ResetMaxSessions resets all changes to the "max_sessions" field.

func (*DownloadShareMutation) ResetMediaType

func (m *DownloadShareMutation) ResetMediaType()

ResetMediaType resets all changes to the "media_type" field.

func (*DownloadShareMutation) ResetPurpose

func (m *DownloadShareMutation) ResetPurpose()

ResetPurpose resets all changes to the "purpose" field.

func (*DownloadShareMutation) ResetRepository

func (m *DownloadShareMutation) ResetRepository()

ResetRepository resets all changes to the "repository" field.

func (*DownloadShareMutation) ResetRevokedAt

func (m *DownloadShareMutation) ResetRevokedAt()

ResetRevokedAt resets all changes to the "revoked_at" field.

func (*DownloadShareMutation) ResetSessionsStarted

func (m *DownloadShareMutation) ResetSessionsStarted()

ResetSessionsStarted resets all changes to the "sessions_started" field.

func (*DownloadShareMutation) ResetSourceTag

func (m *DownloadShareMutation) ResetSourceTag()

ResetSourceTag resets all changes to the "source_tag" field.

func (*DownloadShareMutation) ResetTokenHash

func (m *DownloadShareMutation) ResetTokenHash()

ResetTokenHash resets all changes to the "token_hash" field.

func (*DownloadShareMutation) RevokedAt

func (m *DownloadShareMutation) RevokedAt() (r time.Time, exists bool)

RevokedAt returns the value of the "revoked_at" field in the mutation.

func (*DownloadShareMutation) RevokedAtCleared

func (m *DownloadShareMutation) RevokedAtCleared() bool

RevokedAtCleared returns if the "revoked_at" field was cleared in this mutation.

func (*DownloadShareMutation) SessionsStarted

func (m *DownloadShareMutation) SessionsStarted() (r int64, exists bool)

SessionsStarted returns the value of the "sessions_started" field in the mutation.

func (*DownloadShareMutation) SetBlobDigest

func (m *DownloadShareMutation) SetBlobDigest(s string)

SetBlobDigest sets the "blob_digest" field.

func (*DownloadShareMutation) SetBlobSize

func (m *DownloadShareMutation) SetBlobSize(i int64)

SetBlobSize sets the "blob_size" field.

func (*DownloadShareMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DownloadShareMutation) SetCustomerID

func (m *DownloadShareMutation) SetCustomerID(s string)

SetCustomerID sets the "customer_id" field.

func (*DownloadShareMutation) SetExpiresAt

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

SetExpiresAt sets the "expires_at" field.

func (*DownloadShareMutation) SetField

func (m *DownloadShareMutation) 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 (*DownloadShareMutation) SetFilename

func (m *DownloadShareMutation) SetFilename(s string)

SetFilename sets the "filename" field.

func (*DownloadShareMutation) SetID

func (m *DownloadShareMutation) SetID(id string)

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

func (*DownloadShareMutation) SetIssuedBy

func (m *DownloadShareMutation) SetIssuedBy(s string)

SetIssuedBy sets the "issued_by" field.

func (*DownloadShareMutation) SetManifestDigest

func (m *DownloadShareMutation) SetManifestDigest(s string)

SetManifestDigest sets the "manifest_digest" field.

func (*DownloadShareMutation) SetMaxSessions

func (m *DownloadShareMutation) SetMaxSessions(i int)

SetMaxSessions sets the "max_sessions" field.

func (*DownloadShareMutation) SetMediaType

func (m *DownloadShareMutation) SetMediaType(s string)

SetMediaType sets the "media_type" field.

func (*DownloadShareMutation) SetOp

func (m *DownloadShareMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DownloadShareMutation) SetPurpose

func (m *DownloadShareMutation) SetPurpose(s string)

SetPurpose sets the "purpose" field.

func (*DownloadShareMutation) SetRepository

func (m *DownloadShareMutation) SetRepository(s string)

SetRepository sets the "repository" field.

func (*DownloadShareMutation) SetRevokedAt

func (m *DownloadShareMutation) SetRevokedAt(t time.Time)

SetRevokedAt sets the "revoked_at" field.

func (*DownloadShareMutation) SetSessionsStarted

func (m *DownloadShareMutation) SetSessionsStarted(i int64)

SetSessionsStarted sets the "sessions_started" field.

func (*DownloadShareMutation) SetSourceTag

func (m *DownloadShareMutation) SetSourceTag(s string)

SetSourceTag sets the "source_tag" field.

func (*DownloadShareMutation) SetTokenHash

func (m *DownloadShareMutation) SetTokenHash(b []byte)

SetTokenHash sets the "token_hash" field.

func (*DownloadShareMutation) SourceTag

func (m *DownloadShareMutation) SourceTag() (r string, exists bool)

SourceTag returns the value of the "source_tag" field in the mutation.

func (*DownloadShareMutation) TokenHash

func (m *DownloadShareMutation) TokenHash() (r []byte, exists bool)

TokenHash returns the value of the "token_hash" field in the mutation.

func (DownloadShareMutation) Tx

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

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

func (*DownloadShareMutation) Type

func (m *DownloadShareMutation) Type() string

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

func (*DownloadShareMutation) Where

Where appends a list predicates to the DownloadShareMutation builder.

func (*DownloadShareMutation) WhereP

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

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

type DownloadShareQuery

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

DownloadShareQuery is the builder for querying DownloadShare entities.

func (*DownloadShareQuery) Aggregate

func (_q *DownloadShareQuery) Aggregate(fns ...AggregateFunc) *DownloadShareSelect

Aggregate returns a DownloadShareSelect configured with the given aggregations.

func (*DownloadShareQuery) All

All executes the query and returns a list of DownloadShares.

func (*DownloadShareQuery) AllX

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

func (*DownloadShareQuery) Clone

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

func (*DownloadShareQuery) Count

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

Count returns the count of the given query.

func (*DownloadShareQuery) CountX

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

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

func (*DownloadShareQuery) Exist

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

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

func (*DownloadShareQuery) ExistX

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

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

func (*DownloadShareQuery) First

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

func (*DownloadShareQuery) FirstID

func (_q *DownloadShareQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DownloadShareQuery) FirstIDX

func (_q *DownloadShareQuery) FirstIDX(ctx context.Context) string

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

func (*DownloadShareQuery) FirstX

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

func (*DownloadShareQuery) GroupBy

func (_q *DownloadShareQuery) GroupBy(field string, fields ...string) *DownloadShareGroupBy

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 {
	TokenHash []byte `json:"token_hash,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DownloadShare.Query().
	GroupBy(downloadshare.FieldTokenHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DownloadShareQuery) IDs

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

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

func (*DownloadShareQuery) IDsX

func (_q *DownloadShareQuery) IDsX(ctx context.Context) []string

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

func (*DownloadShareQuery) Limit

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

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

func (*DownloadShareQuery) Offset

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

Offset to start from.

func (*DownloadShareQuery) Only

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

func (*DownloadShareQuery) OnlyID

func (_q *DownloadShareQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DownloadShareQuery) OnlyIDX

func (_q *DownloadShareQuery) OnlyIDX(ctx context.Context) string

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

func (*DownloadShareQuery) OnlyX

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

func (*DownloadShareQuery) Order

Order specifies how the records should be ordered.

func (*DownloadShareQuery) Select

func (_q *DownloadShareQuery) Select(fields ...string) *DownloadShareSelect

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 {
	TokenHash []byte `json:"token_hash,omitempty"`
}

client.DownloadShare.Query().
	Select(downloadshare.FieldTokenHash).
	Scan(ctx, &v)

func (*DownloadShareQuery) Unique

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

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

Where adds a new predicate for the DownloadShareQuery builder.

type DownloadShareSelect

type DownloadShareSelect struct {
	*DownloadShareQuery
	// contains filtered or unexported fields
}

DownloadShareSelect is the builder for selecting fields of DownloadShare entities.

func (*DownloadShareSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*DownloadShareSelect) Bool

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

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

func (*DownloadShareSelect) BoolX

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

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

func (*DownloadShareSelect) Bools

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

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

func (*DownloadShareSelect) BoolsX

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

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

func (*DownloadShareSelect) Float64

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

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

func (*DownloadShareSelect) Float64X

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

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

func (*DownloadShareSelect) Float64s

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

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

func (*DownloadShareSelect) Float64sX

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

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

func (*DownloadShareSelect) Int

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

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

func (*DownloadShareSelect) IntX

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

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

func (*DownloadShareSelect) Ints

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

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

func (*DownloadShareSelect) IntsX

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

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

func (*DownloadShareSelect) Scan

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

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

func (*DownloadShareSelect) ScanX

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

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

func (*DownloadShareSelect) String

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

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

func (*DownloadShareSelect) StringX

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

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

func (*DownloadShareSelect) Strings

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

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

func (*DownloadShareSelect) StringsX

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

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

type DownloadShareUpdate

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

DownloadShareUpdate is the builder for updating DownloadShare entities.

func (*DownloadShareUpdate) AddSessionsStarted

func (_u *DownloadShareUpdate) AddSessionsStarted(v int64) *DownloadShareUpdate

AddSessionsStarted adds value to the "sessions_started" field.

func (*DownloadShareUpdate) ClearRevokedAt

func (_u *DownloadShareUpdate) ClearRevokedAt() *DownloadShareUpdate

ClearRevokedAt clears the value of the "revoked_at" field.

func (*DownloadShareUpdate) Exec

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

Exec executes the query.

func (*DownloadShareUpdate) ExecX

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

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

func (*DownloadShareUpdate) Mutation

Mutation returns the DownloadShareMutation object of the builder.

func (*DownloadShareUpdate) Save

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

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

func (*DownloadShareUpdate) SaveX

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

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

func (*DownloadShareUpdate) SetNillableRevokedAt

func (_u *DownloadShareUpdate) SetNillableRevokedAt(v *time.Time) *DownloadShareUpdate

SetNillableRevokedAt sets the "revoked_at" field if the given value is not nil.

func (*DownloadShareUpdate) SetNillableSessionsStarted

func (_u *DownloadShareUpdate) SetNillableSessionsStarted(v *int64) *DownloadShareUpdate

SetNillableSessionsStarted sets the "sessions_started" field if the given value is not nil.

func (*DownloadShareUpdate) SetRevokedAt

func (_u *DownloadShareUpdate) SetRevokedAt(v time.Time) *DownloadShareUpdate

SetRevokedAt sets the "revoked_at" field.

func (*DownloadShareUpdate) SetSessionsStarted

func (_u *DownloadShareUpdate) SetSessionsStarted(v int64) *DownloadShareUpdate

SetSessionsStarted sets the "sessions_started" field.

func (*DownloadShareUpdate) Where

Where appends a list predicates to the DownloadShareUpdate builder.

type DownloadShareUpdateOne

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

DownloadShareUpdateOne is the builder for updating a single DownloadShare entity.

func (*DownloadShareUpdateOne) AddSessionsStarted

func (_u *DownloadShareUpdateOne) AddSessionsStarted(v int64) *DownloadShareUpdateOne

AddSessionsStarted adds value to the "sessions_started" field.

func (*DownloadShareUpdateOne) ClearRevokedAt

func (_u *DownloadShareUpdateOne) ClearRevokedAt() *DownloadShareUpdateOne

ClearRevokedAt clears the value of the "revoked_at" field.

func (*DownloadShareUpdateOne) Exec

Exec executes the query on the entity.

func (*DownloadShareUpdateOne) ExecX

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

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

func (*DownloadShareUpdateOne) Mutation

Mutation returns the DownloadShareMutation object of the builder.

func (*DownloadShareUpdateOne) Save

Save executes the query and returns the updated DownloadShare entity.

func (*DownloadShareUpdateOne) SaveX

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

func (*DownloadShareUpdateOne) Select

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

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

func (*DownloadShareUpdateOne) SetNillableRevokedAt

func (_u *DownloadShareUpdateOne) SetNillableRevokedAt(v *time.Time) *DownloadShareUpdateOne

SetNillableRevokedAt sets the "revoked_at" field if the given value is not nil.

func (*DownloadShareUpdateOne) SetNillableSessionsStarted

func (_u *DownloadShareUpdateOne) SetNillableSessionsStarted(v *int64) *DownloadShareUpdateOne

SetNillableSessionsStarted sets the "sessions_started" field if the given value is not nil.

func (*DownloadShareUpdateOne) SetRevokedAt

SetRevokedAt sets the "revoked_at" field.

func (*DownloadShareUpdateOne) SetSessionsStarted

func (_u *DownloadShareUpdateOne) SetSessionsStarted(v int64) *DownloadShareUpdateOne

SetSessionsStarted sets the "sessions_started" field.

func (*DownloadShareUpdateOne) Where

Where appends a list predicates to the DownloadShareUpdate builder.

type DownloadShares

type DownloadShares []*DownloadShare

DownloadShares is a parsable slice of DownloadShare.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type 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 {

	// DownloadEvent is the client for interacting with the DownloadEvent builders.
	DownloadEvent *DownloadEventClient
	// DownloadIssuer is the client for interacting with the DownloadIssuer builders.
	DownloadIssuer *DownloadIssuerClient
	// DownloadShare is the client for interacting with the DownloadShare builders.
	DownloadShare *DownloadShareClient
	// 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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