ent

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 41 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.
	TypeAuditLog        = "AuditLog"
	TypeConfigProfile   = "ConfigProfile"
	TypeCronJob         = "CronJob"
	TypeCronJobHistory  = "CronJobHistory"
	TypeEscrowDeal      = "EscrowDeal"
	TypeExternalRef     = "ExternalRef"
	TypeInquiry         = "Inquiry"
	TypeKey             = "Key"
	TypeKnowledge       = "Knowledge"
	TypeLearning        = "Learning"
	TypeMessage         = "Message"
	TypeObservation     = "Observation"
	TypePaymentTx       = "PaymentTx"
	TypePeerReputation  = "PeerReputation"
	TypeReflection      = "Reflection"
	TypeSecret          = "Secret"
	TypeSession         = "Session"
	TypeTokenUsage      = "TokenUsage"
	TypeWorkflowRun     = "WorkflowRun"
	TypeWorkflowStepRun = "WorkflowStepRun"
)

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 AuditLog

type AuditLog struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SessionKey holds the value of the "session_key" field.
	SessionKey string `json:"session_key,omitempty"`
	// Action holds the value of the "action" field.
	Action auditlog.Action `json:"action,omitempty"`
	// Actor holds the value of the "actor" field.
	Actor string `json:"actor,omitempty"`
	// Target holds the value of the "target" field.
	Target string `json:"target,omitempty"`
	// Details holds the value of the "details" field.
	Details map[string]interface{} `json:"details,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

AuditLog is the model entity for the AuditLog schema.

func (*AuditLog) String

func (_m *AuditLog) String() string

String implements the fmt.Stringer.

func (*AuditLog) Unwrap

func (_m *AuditLog) Unwrap() *AuditLog

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

func (_m *AuditLog) Update() *AuditLogUpdateOne

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

func (*AuditLog) Value

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

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

type AuditLogClient

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

AuditLogClient is a client for the AuditLog schema.

func NewAuditLogClient

func NewAuditLogClient(c config) *AuditLogClient

NewAuditLogClient returns a client for the AuditLog from the given config.

func (*AuditLogClient) Create

func (c *AuditLogClient) Create() *AuditLogCreate

Create returns a builder for creating a AuditLog entity.

func (*AuditLogClient) CreateBulk

func (c *AuditLogClient) CreateBulk(builders ...*AuditLogCreate) *AuditLogCreateBulk

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

func (*AuditLogClient) Delete

func (c *AuditLogClient) Delete() *AuditLogDelete

Delete returns a delete builder for AuditLog.

func (*AuditLogClient) DeleteOne

func (c *AuditLogClient) DeleteOne(_m *AuditLog) *AuditLogDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuditLogClient) DeleteOneID

func (c *AuditLogClient) DeleteOneID(id uuid.UUID) *AuditLogDeleteOne

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

func (*AuditLogClient) Get

func (c *AuditLogClient) Get(ctx context.Context, id uuid.UUID) (*AuditLog, error)

Get returns a AuditLog entity by its id.

func (*AuditLogClient) GetX

func (c *AuditLogClient) GetX(ctx context.Context, id uuid.UUID) *AuditLog

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

func (*AuditLogClient) Hooks

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

Hooks returns the client hooks.

func (*AuditLogClient) Intercept

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

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

func (*AuditLogClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuditLogClient) MapCreateBulk

func (c *AuditLogClient) MapCreateBulk(slice any, setFunc func(*AuditLogCreate, int)) *AuditLogCreateBulk

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

func (c *AuditLogClient) Query() *AuditLogQuery

Query returns a query builder for AuditLog.

func (*AuditLogClient) Update

func (c *AuditLogClient) Update() *AuditLogUpdate

Update returns an update builder for AuditLog.

func (*AuditLogClient) UpdateOne

func (c *AuditLogClient) UpdateOne(_m *AuditLog) *AuditLogUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuditLogClient) UpdateOneID

func (c *AuditLogClient) UpdateOneID(id uuid.UUID) *AuditLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuditLogClient) Use

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

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

type AuditLogCreate

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

AuditLogCreate is the builder for creating a AuditLog entity.

func (*AuditLogCreate) Exec

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

Exec executes the query.

func (*AuditLogCreate) ExecX

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

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

func (*AuditLogCreate) Mutation

func (_c *AuditLogCreate) Mutation() *AuditLogMutation

Mutation returns the AuditLogMutation object of the builder.

func (*AuditLogCreate) Save

func (_c *AuditLogCreate) Save(ctx context.Context) (*AuditLog, error)

Save creates the AuditLog in the database.

func (*AuditLogCreate) SaveX

func (_c *AuditLogCreate) SaveX(ctx context.Context) *AuditLog

SaveX calls Save and panics if Save returns an error.

func (*AuditLogCreate) SetAction

func (_c *AuditLogCreate) SetAction(v auditlog.Action) *AuditLogCreate

SetAction sets the "action" field.

func (*AuditLogCreate) SetActor

func (_c *AuditLogCreate) SetActor(v string) *AuditLogCreate

SetActor sets the "actor" field.

func (*AuditLogCreate) SetDetails

func (_c *AuditLogCreate) SetDetails(v map[string]interface{}) *AuditLogCreate

SetDetails sets the "details" field.

func (*AuditLogCreate) SetID

func (_c *AuditLogCreate) SetID(v uuid.UUID) *AuditLogCreate

SetID sets the "id" field.

func (*AuditLogCreate) SetNillableID

func (_c *AuditLogCreate) SetNillableID(v *uuid.UUID) *AuditLogCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AuditLogCreate) SetNillableSessionKey

func (_c *AuditLogCreate) SetNillableSessionKey(v *string) *AuditLogCreate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*AuditLogCreate) SetNillableTarget

func (_c *AuditLogCreate) SetNillableTarget(v *string) *AuditLogCreate

SetNillableTarget sets the "target" field if the given value is not nil.

func (*AuditLogCreate) SetNillableTimestamp

func (_c *AuditLogCreate) SetNillableTimestamp(v *time.Time) *AuditLogCreate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*AuditLogCreate) SetSessionKey

func (_c *AuditLogCreate) SetSessionKey(v string) *AuditLogCreate

SetSessionKey sets the "session_key" field.

func (*AuditLogCreate) SetTarget

func (_c *AuditLogCreate) SetTarget(v string) *AuditLogCreate

SetTarget sets the "target" field.

func (*AuditLogCreate) SetTimestamp

func (_c *AuditLogCreate) SetTimestamp(v time.Time) *AuditLogCreate

SetTimestamp sets the "timestamp" field.

type AuditLogCreateBulk

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

AuditLogCreateBulk is the builder for creating many AuditLog entities in bulk.

func (*AuditLogCreateBulk) Exec

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

Exec executes the query.

func (*AuditLogCreateBulk) ExecX

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

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

func (*AuditLogCreateBulk) Save

func (_c *AuditLogCreateBulk) Save(ctx context.Context) ([]*AuditLog, error)

Save creates the AuditLog entities in the database.

func (*AuditLogCreateBulk) SaveX

func (_c *AuditLogCreateBulk) SaveX(ctx context.Context) []*AuditLog

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

type AuditLogDelete

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

AuditLogDelete is the builder for deleting a AuditLog entity.

func (*AuditLogDelete) Exec

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

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

func (*AuditLogDelete) ExecX

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

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

func (*AuditLogDelete) Where

func (_d *AuditLogDelete) Where(ps ...predicate.AuditLog) *AuditLogDelete

Where appends a list predicates to the AuditLogDelete builder.

type AuditLogDeleteOne

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

AuditLogDeleteOne is the builder for deleting a single AuditLog entity.

func (*AuditLogDeleteOne) Exec

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

Exec executes the deletion query.

func (*AuditLogDeleteOne) ExecX

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

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

func (*AuditLogDeleteOne) Where

Where appends a list predicates to the AuditLogDelete builder.

type AuditLogGroupBy

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

AuditLogGroupBy is the group-by builder for AuditLog entities.

func (*AuditLogGroupBy) Aggregate

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

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

func (*AuditLogGroupBy) Bool

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

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

func (*AuditLogGroupBy) BoolX

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

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

func (*AuditLogGroupBy) Bools

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

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

func (*AuditLogGroupBy) BoolsX

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

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

func (*AuditLogGroupBy) Float64

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

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

func (*AuditLogGroupBy) Float64X

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

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

func (*AuditLogGroupBy) Float64s

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

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

func (*AuditLogGroupBy) Float64sX

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

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

func (*AuditLogGroupBy) Int

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

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

func (*AuditLogGroupBy) IntX

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

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

func (*AuditLogGroupBy) Ints

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

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

func (*AuditLogGroupBy) IntsX

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

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

func (*AuditLogGroupBy) Scan

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

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

func (*AuditLogGroupBy) ScanX

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

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

func (*AuditLogGroupBy) String

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

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

func (*AuditLogGroupBy) StringX

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

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

func (*AuditLogGroupBy) Strings

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

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

func (*AuditLogGroupBy) StringsX

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

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

type AuditLogMutation

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

AuditLogMutation represents an operation that mutates the AuditLog nodes in the graph.

func (*AuditLogMutation) Action

func (m *AuditLogMutation) Action() (r auditlog.Action, exists bool)

Action returns the value of the "action" field in the mutation.

func (*AuditLogMutation) Actor

func (m *AuditLogMutation) Actor() (r string, exists bool)

Actor returns the value of the "actor" field in the mutation.

func (*AuditLogMutation) AddField

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

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

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

func (*AuditLogMutation) AddedField

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

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

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

func (*AuditLogMutation) AddedIDs

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

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

func (*AuditLogMutation) ClearDetails

func (m *AuditLogMutation) ClearDetails()

ClearDetails clears the value of the "details" field.

func (*AuditLogMutation) ClearEdge

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

func (m *AuditLogMutation) 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 (*AuditLogMutation) ClearSessionKey

func (m *AuditLogMutation) ClearSessionKey()

ClearSessionKey clears the value of the "session_key" field.

func (*AuditLogMutation) ClearTarget

func (m *AuditLogMutation) ClearTarget()

ClearTarget clears the value of the "target" field.

func (*AuditLogMutation) ClearedEdges

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

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

func (*AuditLogMutation) ClearedFields

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

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

func (AuditLogMutation) Client

func (m AuditLogMutation) 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 (*AuditLogMutation) Details

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

Details returns the value of the "details" field in the mutation.

func (*AuditLogMutation) DetailsCleared

func (m *AuditLogMutation) DetailsCleared() bool

DetailsCleared returns if the "details" field was cleared in this mutation.

func (*AuditLogMutation) EdgeCleared

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

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

func (*AuditLogMutation) Field

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

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

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

func (*AuditLogMutation) Fields

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

func (m *AuditLogMutation) ID() (id uuid.UUID, 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 (*AuditLogMutation) IDs

func (m *AuditLogMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*AuditLogMutation) OldAction

func (m *AuditLogMutation) OldAction(ctx context.Context) (v auditlog.Action, err error)

OldAction returns the old "action" field's value of the AuditLog entity. If the AuditLog 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 (*AuditLogMutation) OldActor

func (m *AuditLogMutation) OldActor(ctx context.Context) (v string, err error)

OldActor returns the old "actor" field's value of the AuditLog entity. If the AuditLog 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 (*AuditLogMutation) OldDetails

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

OldDetails returns the old "details" field's value of the AuditLog entity. If the AuditLog 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 (*AuditLogMutation) OldField

func (m *AuditLogMutation) 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 (*AuditLogMutation) OldSessionKey

func (m *AuditLogMutation) OldSessionKey(ctx context.Context) (v string, err error)

OldSessionKey returns the old "session_key" field's value of the AuditLog entity. If the AuditLog 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 (*AuditLogMutation) OldTarget

func (m *AuditLogMutation) OldTarget(ctx context.Context) (v string, err error)

OldTarget returns the old "target" field's value of the AuditLog entity. If the AuditLog 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 (*AuditLogMutation) OldTimestamp

func (m *AuditLogMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the AuditLog entity. If the AuditLog 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 (*AuditLogMutation) Op

func (m *AuditLogMutation) Op() Op

Op returns the operation name.

func (*AuditLogMutation) RemovedEdges

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

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

func (*AuditLogMutation) RemovedIDs

func (m *AuditLogMutation) 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 (*AuditLogMutation) ResetAction

func (m *AuditLogMutation) ResetAction()

ResetAction resets all changes to the "action" field.

func (*AuditLogMutation) ResetActor

func (m *AuditLogMutation) ResetActor()

ResetActor resets all changes to the "actor" field.

func (*AuditLogMutation) ResetDetails

func (m *AuditLogMutation) ResetDetails()

ResetDetails resets all changes to the "details" field.

func (*AuditLogMutation) ResetEdge

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

func (m *AuditLogMutation) 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 (*AuditLogMutation) ResetSessionKey

func (m *AuditLogMutation) ResetSessionKey()

ResetSessionKey resets all changes to the "session_key" field.

func (*AuditLogMutation) ResetTarget

func (m *AuditLogMutation) ResetTarget()

ResetTarget resets all changes to the "target" field.

func (*AuditLogMutation) ResetTimestamp

func (m *AuditLogMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*AuditLogMutation) SessionKey

func (m *AuditLogMutation) SessionKey() (r string, exists bool)

SessionKey returns the value of the "session_key" field in the mutation.

func (*AuditLogMutation) SessionKeyCleared

func (m *AuditLogMutation) SessionKeyCleared() bool

SessionKeyCleared returns if the "session_key" field was cleared in this mutation.

func (*AuditLogMutation) SetAction

func (m *AuditLogMutation) SetAction(a auditlog.Action)

SetAction sets the "action" field.

func (*AuditLogMutation) SetActor

func (m *AuditLogMutation) SetActor(s string)

SetActor sets the "actor" field.

func (*AuditLogMutation) SetDetails

func (m *AuditLogMutation) SetDetails(value map[string]interface{})

SetDetails sets the "details" field.

func (*AuditLogMutation) SetField

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

func (m *AuditLogMutation) SetID(id uuid.UUID)

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

func (*AuditLogMutation) SetOp

func (m *AuditLogMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuditLogMutation) SetSessionKey

func (m *AuditLogMutation) SetSessionKey(s string)

SetSessionKey sets the "session_key" field.

func (*AuditLogMutation) SetTarget

func (m *AuditLogMutation) SetTarget(s string)

SetTarget sets the "target" field.

func (*AuditLogMutation) SetTimestamp

func (m *AuditLogMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*AuditLogMutation) Target

func (m *AuditLogMutation) Target() (r string, exists bool)

Target returns the value of the "target" field in the mutation.

func (*AuditLogMutation) TargetCleared

func (m *AuditLogMutation) TargetCleared() bool

TargetCleared returns if the "target" field was cleared in this mutation.

func (*AuditLogMutation) Timestamp

func (m *AuditLogMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (AuditLogMutation) Tx

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

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

func (*AuditLogMutation) Type

func (m *AuditLogMutation) Type() string

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

func (*AuditLogMutation) Where

func (m *AuditLogMutation) Where(ps ...predicate.AuditLog)

Where appends a list predicates to the AuditLogMutation builder.

func (*AuditLogMutation) WhereP

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

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

type AuditLogQuery

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

AuditLogQuery is the builder for querying AuditLog entities.

func (*AuditLogQuery) Aggregate

func (_q *AuditLogQuery) Aggregate(fns ...AggregateFunc) *AuditLogSelect

Aggregate returns a AuditLogSelect configured with the given aggregations.

func (*AuditLogQuery) All

func (_q *AuditLogQuery) All(ctx context.Context) ([]*AuditLog, error)

All executes the query and returns a list of AuditLogs.

func (*AuditLogQuery) AllX

func (_q *AuditLogQuery) AllX(ctx context.Context) []*AuditLog

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

func (*AuditLogQuery) Clone

func (_q *AuditLogQuery) Clone() *AuditLogQuery

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

func (*AuditLogQuery) Count

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

Count returns the count of the given query.

func (*AuditLogQuery) CountX

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

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

func (*AuditLogQuery) Exist

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

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

func (*AuditLogQuery) ExistX

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

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

func (*AuditLogQuery) First

func (_q *AuditLogQuery) First(ctx context.Context) (*AuditLog, error)

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

func (*AuditLogQuery) FirstID

func (_q *AuditLogQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuditLogQuery) FirstIDX

func (_q *AuditLogQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AuditLogQuery) FirstX

func (_q *AuditLogQuery) FirstX(ctx context.Context) *AuditLog

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

func (*AuditLogQuery) GroupBy

func (_q *AuditLogQuery) GroupBy(field string, fields ...string) *AuditLogGroupBy

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

client.AuditLog.Query().
	GroupBy(auditlog.FieldSessionKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuditLogQuery) IDs

func (_q *AuditLogQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AuditLogQuery) IDsX

func (_q *AuditLogQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AuditLogQuery) Limit

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

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

func (*AuditLogQuery) Offset

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

Offset to start from.

func (*AuditLogQuery) Only

func (_q *AuditLogQuery) Only(ctx context.Context) (*AuditLog, error)

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

func (*AuditLogQuery) OnlyID

func (_q *AuditLogQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuditLogQuery) OnlyIDX

func (_q *AuditLogQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AuditLogQuery) OnlyX

func (_q *AuditLogQuery) OnlyX(ctx context.Context) *AuditLog

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

func (*AuditLogQuery) Order

Order specifies how the records should be ordered.

func (*AuditLogQuery) Select

func (_q *AuditLogQuery) Select(fields ...string) *AuditLogSelect

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

client.AuditLog.Query().
	Select(auditlog.FieldSessionKey).
	Scan(ctx, &v)

func (*AuditLogQuery) Unique

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

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

func (_q *AuditLogQuery) Where(ps ...predicate.AuditLog) *AuditLogQuery

Where adds a new predicate for the AuditLogQuery builder.

type AuditLogSelect

type AuditLogSelect struct {
	*AuditLogQuery
	// contains filtered or unexported fields
}

AuditLogSelect is the builder for selecting fields of AuditLog entities.

func (*AuditLogSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AuditLogSelect) Bool

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

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

func (*AuditLogSelect) BoolX

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

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

func (*AuditLogSelect) Bools

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

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

func (*AuditLogSelect) BoolsX

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

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

func (*AuditLogSelect) Float64

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

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

func (*AuditLogSelect) Float64X

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

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

func (*AuditLogSelect) Float64s

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

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

func (*AuditLogSelect) Float64sX

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

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

func (*AuditLogSelect) Int

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

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

func (*AuditLogSelect) IntX

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

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

func (*AuditLogSelect) Ints

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

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

func (*AuditLogSelect) IntsX

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

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

func (*AuditLogSelect) Scan

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

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

func (*AuditLogSelect) ScanX

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

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

func (*AuditLogSelect) String

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

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

func (*AuditLogSelect) StringX

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

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

func (*AuditLogSelect) Strings

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

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

func (*AuditLogSelect) StringsX

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

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

type AuditLogUpdate

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

AuditLogUpdate is the builder for updating AuditLog entities.

func (*AuditLogUpdate) ClearDetails

func (_u *AuditLogUpdate) ClearDetails() *AuditLogUpdate

ClearDetails clears the value of the "details" field.

func (*AuditLogUpdate) ClearSessionKey

func (_u *AuditLogUpdate) ClearSessionKey() *AuditLogUpdate

ClearSessionKey clears the value of the "session_key" field.

func (*AuditLogUpdate) ClearTarget

func (_u *AuditLogUpdate) ClearTarget() *AuditLogUpdate

ClearTarget clears the value of the "target" field.

func (*AuditLogUpdate) Exec

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

Exec executes the query.

func (*AuditLogUpdate) ExecX

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

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

func (*AuditLogUpdate) Mutation

func (_u *AuditLogUpdate) Mutation() *AuditLogMutation

Mutation returns the AuditLogMutation object of the builder.

func (*AuditLogUpdate) Save

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

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

func (*AuditLogUpdate) SaveX

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

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

func (*AuditLogUpdate) SetAction

func (_u *AuditLogUpdate) SetAction(v auditlog.Action) *AuditLogUpdate

SetAction sets the "action" field.

func (*AuditLogUpdate) SetActor

func (_u *AuditLogUpdate) SetActor(v string) *AuditLogUpdate

SetActor sets the "actor" field.

func (*AuditLogUpdate) SetDetails

func (_u *AuditLogUpdate) SetDetails(v map[string]interface{}) *AuditLogUpdate

SetDetails sets the "details" field.

func (*AuditLogUpdate) SetNillableAction

func (_u *AuditLogUpdate) SetNillableAction(v *auditlog.Action) *AuditLogUpdate

SetNillableAction sets the "action" field if the given value is not nil.

func (*AuditLogUpdate) SetNillableActor

func (_u *AuditLogUpdate) SetNillableActor(v *string) *AuditLogUpdate

SetNillableActor sets the "actor" field if the given value is not nil.

func (*AuditLogUpdate) SetNillableSessionKey

func (_u *AuditLogUpdate) SetNillableSessionKey(v *string) *AuditLogUpdate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*AuditLogUpdate) SetNillableTarget

func (_u *AuditLogUpdate) SetNillableTarget(v *string) *AuditLogUpdate

SetNillableTarget sets the "target" field if the given value is not nil.

func (*AuditLogUpdate) SetSessionKey

func (_u *AuditLogUpdate) SetSessionKey(v string) *AuditLogUpdate

SetSessionKey sets the "session_key" field.

func (*AuditLogUpdate) SetTarget

func (_u *AuditLogUpdate) SetTarget(v string) *AuditLogUpdate

SetTarget sets the "target" field.

func (*AuditLogUpdate) Where

func (_u *AuditLogUpdate) Where(ps ...predicate.AuditLog) *AuditLogUpdate

Where appends a list predicates to the AuditLogUpdate builder.

type AuditLogUpdateOne

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

AuditLogUpdateOne is the builder for updating a single AuditLog entity.

func (*AuditLogUpdateOne) ClearDetails

func (_u *AuditLogUpdateOne) ClearDetails() *AuditLogUpdateOne

ClearDetails clears the value of the "details" field.

func (*AuditLogUpdateOne) ClearSessionKey

func (_u *AuditLogUpdateOne) ClearSessionKey() *AuditLogUpdateOne

ClearSessionKey clears the value of the "session_key" field.

func (*AuditLogUpdateOne) ClearTarget

func (_u *AuditLogUpdateOne) ClearTarget() *AuditLogUpdateOne

ClearTarget clears the value of the "target" field.

func (*AuditLogUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AuditLogUpdateOne) ExecX

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

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

func (*AuditLogUpdateOne) Mutation

func (_u *AuditLogUpdateOne) Mutation() *AuditLogMutation

Mutation returns the AuditLogMutation object of the builder.

func (*AuditLogUpdateOne) Save

func (_u *AuditLogUpdateOne) Save(ctx context.Context) (*AuditLog, error)

Save executes the query and returns the updated AuditLog entity.

func (*AuditLogUpdateOne) SaveX

func (_u *AuditLogUpdateOne) SaveX(ctx context.Context) *AuditLog

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

func (*AuditLogUpdateOne) Select

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

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

func (*AuditLogUpdateOne) SetAction

SetAction sets the "action" field.

func (*AuditLogUpdateOne) SetActor

func (_u *AuditLogUpdateOne) SetActor(v string) *AuditLogUpdateOne

SetActor sets the "actor" field.

func (*AuditLogUpdateOne) SetDetails

func (_u *AuditLogUpdateOne) SetDetails(v map[string]interface{}) *AuditLogUpdateOne

SetDetails sets the "details" field.

func (*AuditLogUpdateOne) SetNillableAction

func (_u *AuditLogUpdateOne) SetNillableAction(v *auditlog.Action) *AuditLogUpdateOne

SetNillableAction sets the "action" field if the given value is not nil.

func (*AuditLogUpdateOne) SetNillableActor

func (_u *AuditLogUpdateOne) SetNillableActor(v *string) *AuditLogUpdateOne

SetNillableActor sets the "actor" field if the given value is not nil.

func (*AuditLogUpdateOne) SetNillableSessionKey

func (_u *AuditLogUpdateOne) SetNillableSessionKey(v *string) *AuditLogUpdateOne

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*AuditLogUpdateOne) SetNillableTarget

func (_u *AuditLogUpdateOne) SetNillableTarget(v *string) *AuditLogUpdateOne

SetNillableTarget sets the "target" field if the given value is not nil.

func (*AuditLogUpdateOne) SetSessionKey

func (_u *AuditLogUpdateOne) SetSessionKey(v string) *AuditLogUpdateOne

SetSessionKey sets the "session_key" field.

func (*AuditLogUpdateOne) SetTarget

func (_u *AuditLogUpdateOne) SetTarget(v string) *AuditLogUpdateOne

SetTarget sets the "target" field.

func (*AuditLogUpdateOne) Where

Where appends a list predicates to the AuditLogUpdate builder.

type AuditLogs

type AuditLogs []*AuditLog

AuditLogs is a parsable slice of AuditLog.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AuditLog is the client for interacting with the AuditLog builders.
	AuditLog *AuditLogClient
	// ConfigProfile is the client for interacting with the ConfigProfile builders.
	ConfigProfile *ConfigProfileClient
	// CronJob is the client for interacting with the CronJob builders.
	CronJob *CronJobClient
	// CronJobHistory is the client for interacting with the CronJobHistory builders.
	CronJobHistory *CronJobHistoryClient
	// EscrowDeal is the client for interacting with the EscrowDeal builders.
	EscrowDeal *EscrowDealClient
	// ExternalRef is the client for interacting with the ExternalRef builders.
	ExternalRef *ExternalRefClient
	// Inquiry is the client for interacting with the Inquiry builders.
	Inquiry *InquiryClient
	// Key is the client for interacting with the Key builders.
	Key *KeyClient
	// Knowledge is the client for interacting with the Knowledge builders.
	Knowledge *KnowledgeClient
	// Learning is the client for interacting with the Learning builders.
	Learning *LearningClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Observation is the client for interacting with the Observation builders.
	Observation *ObservationClient
	// PaymentTx is the client for interacting with the PaymentTx builders.
	PaymentTx *PaymentTxClient
	// PeerReputation is the client for interacting with the PeerReputation builders.
	PeerReputation *PeerReputationClient
	// Reflection is the client for interacting with the Reflection builders.
	Reflection *ReflectionClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// TokenUsage is the client for interacting with the TokenUsage builders.
	TokenUsage *TokenUsageClient
	// WorkflowRun is the client for interacting with the WorkflowRun builders.
	WorkflowRun *WorkflowRunClient
	// WorkflowStepRun is the client for interacting with the WorkflowStepRun builders.
	WorkflowStepRun *WorkflowStepRunClient
	// 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().
	AuditLog.
	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 ConfigProfile

type ConfigProfile struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Profile identifier (e.g., default, staging, production)
	Name string `json:"name,omitempty"`
	// AES-256-GCM encrypted JSON configuration blob
	EncryptedData []byte `json:"encrypted_data,omitempty"`
	// Whether this profile is the currently active one
	Active bool `json:"active,omitempty"`
	// Schema version for forward compatibility
	Version int `json:"version,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

ConfigProfile is the model entity for the ConfigProfile schema.

func (*ConfigProfile) String

func (_m *ConfigProfile) String() string

String implements the fmt.Stringer.

func (*ConfigProfile) Unwrap

func (_m *ConfigProfile) Unwrap() *ConfigProfile

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

func (_m *ConfigProfile) Update() *ConfigProfileUpdateOne

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

func (*ConfigProfile) Value

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

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

type ConfigProfileClient

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

ConfigProfileClient is a client for the ConfigProfile schema.

func NewConfigProfileClient

func NewConfigProfileClient(c config) *ConfigProfileClient

NewConfigProfileClient returns a client for the ConfigProfile from the given config.

func (*ConfigProfileClient) Create

Create returns a builder for creating a ConfigProfile entity.

func (*ConfigProfileClient) CreateBulk

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

func (*ConfigProfileClient) Delete

Delete returns a delete builder for ConfigProfile.

func (*ConfigProfileClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ConfigProfileClient) DeleteOneID

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

func (*ConfigProfileClient) Get

Get returns a ConfigProfile entity by its id.

func (*ConfigProfileClient) GetX

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

func (*ConfigProfileClient) Hooks

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

Hooks returns the client hooks.

func (*ConfigProfileClient) Intercept

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

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

func (*ConfigProfileClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ConfigProfileClient) MapCreateBulk

func (c *ConfigProfileClient) MapCreateBulk(slice any, setFunc func(*ConfigProfileCreate, int)) *ConfigProfileCreateBulk

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

Query returns a query builder for ConfigProfile.

func (*ConfigProfileClient) Update

Update returns an update builder for ConfigProfile.

func (*ConfigProfileClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ConfigProfileClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ConfigProfileClient) Use

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

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

type ConfigProfileCreate

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

ConfigProfileCreate is the builder for creating a ConfigProfile entity.

func (*ConfigProfileCreate) Exec

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

Exec executes the query.

func (*ConfigProfileCreate) ExecX

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

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

func (*ConfigProfileCreate) Mutation

Mutation returns the ConfigProfileMutation object of the builder.

func (*ConfigProfileCreate) Save

Save creates the ConfigProfile in the database.

func (*ConfigProfileCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ConfigProfileCreate) SetActive

func (_c *ConfigProfileCreate) SetActive(v bool) *ConfigProfileCreate

SetActive sets the "active" field.

func (*ConfigProfileCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ConfigProfileCreate) SetEncryptedData

func (_c *ConfigProfileCreate) SetEncryptedData(v []byte) *ConfigProfileCreate

SetEncryptedData sets the "encrypted_data" field.

func (*ConfigProfileCreate) SetID

SetID sets the "id" field.

func (*ConfigProfileCreate) SetName

SetName sets the "name" field.

func (*ConfigProfileCreate) SetNillableActive

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

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

func (*ConfigProfileCreate) SetNillableCreatedAt

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

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

func (*ConfigProfileCreate) SetNillableID

func (_c *ConfigProfileCreate) SetNillableID(v *uuid.UUID) *ConfigProfileCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ConfigProfileCreate) SetNillableUpdatedAt

func (_c *ConfigProfileCreate) SetNillableUpdatedAt(v *time.Time) *ConfigProfileCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ConfigProfileCreate) SetNillableVersion

func (_c *ConfigProfileCreate) SetNillableVersion(v *int) *ConfigProfileCreate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ConfigProfileCreate) SetUpdatedAt

func (_c *ConfigProfileCreate) SetUpdatedAt(v time.Time) *ConfigProfileCreate

SetUpdatedAt sets the "updated_at" field.

func (*ConfigProfileCreate) SetVersion

func (_c *ConfigProfileCreate) SetVersion(v int) *ConfigProfileCreate

SetVersion sets the "version" field.

type ConfigProfileCreateBulk

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

ConfigProfileCreateBulk is the builder for creating many ConfigProfile entities in bulk.

func (*ConfigProfileCreateBulk) Exec

Exec executes the query.

func (*ConfigProfileCreateBulk) ExecX

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

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

func (*ConfigProfileCreateBulk) Save

Save creates the ConfigProfile entities in the database.

func (*ConfigProfileCreateBulk) SaveX

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

type ConfigProfileDelete

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

ConfigProfileDelete is the builder for deleting a ConfigProfile entity.

func (*ConfigProfileDelete) Exec

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

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

func (*ConfigProfileDelete) ExecX

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

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

func (*ConfigProfileDelete) Where

Where appends a list predicates to the ConfigProfileDelete builder.

type ConfigProfileDeleteOne

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

ConfigProfileDeleteOne is the builder for deleting a single ConfigProfile entity.

func (*ConfigProfileDeleteOne) Exec

Exec executes the deletion query.

func (*ConfigProfileDeleteOne) ExecX

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

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

func (*ConfigProfileDeleteOne) Where

Where appends a list predicates to the ConfigProfileDelete builder.

type ConfigProfileGroupBy

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

ConfigProfileGroupBy is the group-by builder for ConfigProfile entities.

func (*ConfigProfileGroupBy) Aggregate

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

func (*ConfigProfileGroupBy) Bool

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

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

func (*ConfigProfileGroupBy) BoolX

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

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

func (*ConfigProfileGroupBy) Bools

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

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

func (*ConfigProfileGroupBy) BoolsX

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

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

func (*ConfigProfileGroupBy) Float64

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

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

func (*ConfigProfileGroupBy) Float64X

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

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

func (*ConfigProfileGroupBy) Float64s

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

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

func (*ConfigProfileGroupBy) Float64sX

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

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

func (*ConfigProfileGroupBy) Int

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

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

func (*ConfigProfileGroupBy) IntX

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

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

func (*ConfigProfileGroupBy) Ints

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

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

func (*ConfigProfileGroupBy) IntsX

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

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

func (*ConfigProfileGroupBy) Scan

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

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

func (*ConfigProfileGroupBy) ScanX

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

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

func (*ConfigProfileGroupBy) String

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

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

func (*ConfigProfileGroupBy) StringX

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

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

func (*ConfigProfileGroupBy) Strings

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

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

func (*ConfigProfileGroupBy) StringsX

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

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

type ConfigProfileMutation

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

ConfigProfileMutation represents an operation that mutates the ConfigProfile nodes in the graph.

func (*ConfigProfileMutation) Active

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

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

func (*ConfigProfileMutation) AddField

func (m *ConfigProfileMutation) 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 (*ConfigProfileMutation) AddVersion

func (m *ConfigProfileMutation) AddVersion(i int)

AddVersion adds i to the "version" field.

func (*ConfigProfileMutation) AddedEdges

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

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

func (*ConfigProfileMutation) AddedField

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

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

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

func (*ConfigProfileMutation) AddedIDs

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

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

func (*ConfigProfileMutation) AddedVersion

func (m *ConfigProfileMutation) AddedVersion() (r int, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*ConfigProfileMutation) ClearEdge

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

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

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

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

func (*ConfigProfileMutation) ClearedFields

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

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

func (ConfigProfileMutation) Client

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

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

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

func (*ConfigProfileMutation) EdgeCleared

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

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

func (*ConfigProfileMutation) EncryptedData

func (m *ConfigProfileMutation) EncryptedData() (r []byte, exists bool)

EncryptedData returns the value of the "encrypted_data" field in the mutation.

func (*ConfigProfileMutation) Field

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

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

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

func (*ConfigProfileMutation) Fields

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

func (m *ConfigProfileMutation) ID() (id uuid.UUID, 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 (*ConfigProfileMutation) 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 (*ConfigProfileMutation) Name

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

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

func (*ConfigProfileMutation) OldActive

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

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

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

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

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

OldEncryptedData returns the old "encrypted_data" field's value of the ConfigProfile entity. If the ConfigProfile 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 (*ConfigProfileMutation) OldField

func (m *ConfigProfileMutation) 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 (*ConfigProfileMutation) OldName

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

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

func (m *ConfigProfileMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ConfigProfile entity. If the ConfigProfile 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 (*ConfigProfileMutation) OldVersion

func (m *ConfigProfileMutation) OldVersion(ctx context.Context) (v int, err error)

OldVersion returns the old "version" field's value of the ConfigProfile entity. If the ConfigProfile 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 (*ConfigProfileMutation) Op

func (m *ConfigProfileMutation) Op() Op

Op returns the operation name.

func (*ConfigProfileMutation) RemovedEdges

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

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

func (*ConfigProfileMutation) RemovedIDs

func (m *ConfigProfileMutation) 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 (*ConfigProfileMutation) ResetActive

func (m *ConfigProfileMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*ConfigProfileMutation) ResetCreatedAt

func (m *ConfigProfileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ConfigProfileMutation) ResetEdge

func (m *ConfigProfileMutation) 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 (*ConfigProfileMutation) ResetEncryptedData

func (m *ConfigProfileMutation) ResetEncryptedData()

ResetEncryptedData resets all changes to the "encrypted_data" field.

func (*ConfigProfileMutation) ResetField

func (m *ConfigProfileMutation) 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 (*ConfigProfileMutation) ResetName

func (m *ConfigProfileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ConfigProfileMutation) ResetUpdatedAt

func (m *ConfigProfileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ConfigProfileMutation) ResetVersion

func (m *ConfigProfileMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*ConfigProfileMutation) SetActive

func (m *ConfigProfileMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*ConfigProfileMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ConfigProfileMutation) SetEncryptedData

func (m *ConfigProfileMutation) SetEncryptedData(b []byte)

SetEncryptedData sets the "encrypted_data" field.

func (*ConfigProfileMutation) SetField

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

func (m *ConfigProfileMutation) SetID(id uuid.UUID)

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

func (*ConfigProfileMutation) SetName

func (m *ConfigProfileMutation) SetName(s string)

SetName sets the "name" field.

func (*ConfigProfileMutation) SetOp

func (m *ConfigProfileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ConfigProfileMutation) SetUpdatedAt

func (m *ConfigProfileMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ConfigProfileMutation) SetVersion

func (m *ConfigProfileMutation) SetVersion(i int)

SetVersion sets the "version" field.

func (ConfigProfileMutation) Tx

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

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

func (*ConfigProfileMutation) Type

func (m *ConfigProfileMutation) Type() string

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

func (*ConfigProfileMutation) UpdatedAt

func (m *ConfigProfileMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ConfigProfileMutation) Version

func (m *ConfigProfileMutation) Version() (r int, exists bool)

Version returns the value of the "version" field in the mutation.

func (*ConfigProfileMutation) Where

Where appends a list predicates to the ConfigProfileMutation builder.

func (*ConfigProfileMutation) WhereP

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

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

type ConfigProfileQuery

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

ConfigProfileQuery is the builder for querying ConfigProfile entities.

func (*ConfigProfileQuery) Aggregate

func (_q *ConfigProfileQuery) Aggregate(fns ...AggregateFunc) *ConfigProfileSelect

Aggregate returns a ConfigProfileSelect configured with the given aggregations.

func (*ConfigProfileQuery) All

All executes the query and returns a list of ConfigProfiles.

func (*ConfigProfileQuery) AllX

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

func (*ConfigProfileQuery) Clone

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

func (*ConfigProfileQuery) Count

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

Count returns the count of the given query.

func (*ConfigProfileQuery) CountX

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

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

func (*ConfigProfileQuery) Exist

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

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

func (*ConfigProfileQuery) ExistX

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

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

func (*ConfigProfileQuery) First

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

func (*ConfigProfileQuery) FirstID

func (_q *ConfigProfileQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ConfigProfileQuery) FirstIDX

func (_q *ConfigProfileQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ConfigProfileQuery) FirstX

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

func (*ConfigProfileQuery) GroupBy

func (_q *ConfigProfileQuery) GroupBy(field string, fields ...string) *ConfigProfileGroupBy

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

Example:

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

client.ConfigProfile.Query().
	GroupBy(configprofile.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ConfigProfileQuery) IDs

func (_q *ConfigProfileQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*ConfigProfileQuery) IDsX

func (_q *ConfigProfileQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ConfigProfileQuery) Limit

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

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

func (*ConfigProfileQuery) Offset

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

Offset to start from.

func (*ConfigProfileQuery) Only

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

func (*ConfigProfileQuery) OnlyID

func (_q *ConfigProfileQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ConfigProfileQuery) OnlyIDX

func (_q *ConfigProfileQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ConfigProfileQuery) OnlyX

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

func (*ConfigProfileQuery) Order

Order specifies how the records should be ordered.

func (*ConfigProfileQuery) Select

func (_q *ConfigProfileQuery) Select(fields ...string) *ConfigProfileSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.ConfigProfile.Query().
	Select(configprofile.FieldName).
	Scan(ctx, &v)

func (*ConfigProfileQuery) Unique

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

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

Where adds a new predicate for the ConfigProfileQuery builder.

type ConfigProfileSelect

type ConfigProfileSelect struct {
	*ConfigProfileQuery
	// contains filtered or unexported fields
}

ConfigProfileSelect is the builder for selecting fields of ConfigProfile entities.

func (*ConfigProfileSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ConfigProfileSelect) Bool

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

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

func (*ConfigProfileSelect) BoolX

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

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

func (*ConfigProfileSelect) Bools

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

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

func (*ConfigProfileSelect) BoolsX

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

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

func (*ConfigProfileSelect) Float64

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

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

func (*ConfigProfileSelect) Float64X

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

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

func (*ConfigProfileSelect) Float64s

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

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

func (*ConfigProfileSelect) Float64sX

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

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

func (*ConfigProfileSelect) Int

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

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

func (*ConfigProfileSelect) IntX

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

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

func (*ConfigProfileSelect) Ints

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

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

func (*ConfigProfileSelect) IntsX

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

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

func (*ConfigProfileSelect) Scan

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

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

func (*ConfigProfileSelect) ScanX

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

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

func (*ConfigProfileSelect) String

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

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

func (*ConfigProfileSelect) StringX

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

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

func (*ConfigProfileSelect) Strings

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

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

func (*ConfigProfileSelect) StringsX

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

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

type ConfigProfileUpdate

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

ConfigProfileUpdate is the builder for updating ConfigProfile entities.

func (*ConfigProfileUpdate) AddVersion

func (_u *ConfigProfileUpdate) AddVersion(v int) *ConfigProfileUpdate

AddVersion adds value to the "version" field.

func (*ConfigProfileUpdate) Exec

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

Exec executes the query.

func (*ConfigProfileUpdate) ExecX

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

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

func (*ConfigProfileUpdate) Mutation

Mutation returns the ConfigProfileMutation object of the builder.

func (*ConfigProfileUpdate) Save

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

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

func (*ConfigProfileUpdate) SaveX

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

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

func (*ConfigProfileUpdate) SetActive

func (_u *ConfigProfileUpdate) SetActive(v bool) *ConfigProfileUpdate

SetActive sets the "active" field.

func (*ConfigProfileUpdate) SetEncryptedData

func (_u *ConfigProfileUpdate) SetEncryptedData(v []byte) *ConfigProfileUpdate

SetEncryptedData sets the "encrypted_data" field.

func (*ConfigProfileUpdate) SetName

SetName sets the "name" field.

func (*ConfigProfileUpdate) SetNillableActive

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

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

func (*ConfigProfileUpdate) SetNillableName

func (_u *ConfigProfileUpdate) SetNillableName(v *string) *ConfigProfileUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ConfigProfileUpdate) SetNillableVersion

func (_u *ConfigProfileUpdate) SetNillableVersion(v *int) *ConfigProfileUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ConfigProfileUpdate) SetUpdatedAt

func (_u *ConfigProfileUpdate) SetUpdatedAt(v time.Time) *ConfigProfileUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ConfigProfileUpdate) SetVersion

func (_u *ConfigProfileUpdate) SetVersion(v int) *ConfigProfileUpdate

SetVersion sets the "version" field.

func (*ConfigProfileUpdate) Where

Where appends a list predicates to the ConfigProfileUpdate builder.

type ConfigProfileUpdateOne

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

ConfigProfileUpdateOne is the builder for updating a single ConfigProfile entity.

func (*ConfigProfileUpdateOne) AddVersion

AddVersion adds value to the "version" field.

func (*ConfigProfileUpdateOne) Exec

Exec executes the query on the entity.

func (*ConfigProfileUpdateOne) ExecX

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

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

func (*ConfigProfileUpdateOne) Mutation

Mutation returns the ConfigProfileMutation object of the builder.

func (*ConfigProfileUpdateOne) Save

Save executes the query and returns the updated ConfigProfile entity.

func (*ConfigProfileUpdateOne) SaveX

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

func (*ConfigProfileUpdateOne) Select

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

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

func (*ConfigProfileUpdateOne) SetActive

SetActive sets the "active" field.

func (*ConfigProfileUpdateOne) SetEncryptedData

func (_u *ConfigProfileUpdateOne) SetEncryptedData(v []byte) *ConfigProfileUpdateOne

SetEncryptedData sets the "encrypted_data" field.

func (*ConfigProfileUpdateOne) SetName

SetName sets the "name" field.

func (*ConfigProfileUpdateOne) SetNillableActive

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

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

func (*ConfigProfileUpdateOne) SetNillableName

func (_u *ConfigProfileUpdateOne) SetNillableName(v *string) *ConfigProfileUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ConfigProfileUpdateOne) SetNillableVersion

func (_u *ConfigProfileUpdateOne) SetNillableVersion(v *int) *ConfigProfileUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ConfigProfileUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ConfigProfileUpdateOne) SetVersion

SetVersion sets the "version" field.

func (*ConfigProfileUpdateOne) Where

Where appends a list predicates to the ConfigProfileUpdate builder.

type ConfigProfiles

type ConfigProfiles []*ConfigProfile

ConfigProfiles is a parsable slice of ConfigProfile.

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 CronJob

type CronJob struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Human-readable job name
	Name string `json:"name,omitempty"`
	// Schedule type: one-time, interval, or cron expression
	ScheduleType cronjob.ScheduleType `json:"schedule_type,omitempty"`
	// Schedule value: ISO8601 datetime, duration, or cron expression
	Schedule string `json:"schedule,omitempty"`
	// Prompt to execute when the job fires
	Prompt string `json:"prompt,omitempty"`
	// Session mode: isolated or main
	SessionMode string `json:"session_mode,omitempty"`
	// Channels to deliver results to (e.g. slack, telegram)
	DeliverTo []string `json:"deliver_to,omitempty"`
	// Timezone for schedule evaluation
	Timezone string `json:"timezone,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// When the job last executed
	LastRunAt *time.Time `json:"last_run_at,omitempty"`
	// When the job will next execute
	NextRunAt *time.Time `json:"next_run_at,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

CronJob is the model entity for the CronJob schema.

func (*CronJob) String

func (_m *CronJob) String() string

String implements the fmt.Stringer.

func (*CronJob) Unwrap

func (_m *CronJob) Unwrap() *CronJob

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

func (_m *CronJob) Update() *CronJobUpdateOne

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

func (*CronJob) Value

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

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

type CronJobClient

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

CronJobClient is a client for the CronJob schema.

func NewCronJobClient

func NewCronJobClient(c config) *CronJobClient

NewCronJobClient returns a client for the CronJob from the given config.

func (*CronJobClient) Create

func (c *CronJobClient) Create() *CronJobCreate

Create returns a builder for creating a CronJob entity.

func (*CronJobClient) CreateBulk

func (c *CronJobClient) CreateBulk(builders ...*CronJobCreate) *CronJobCreateBulk

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

func (*CronJobClient) Delete

func (c *CronJobClient) Delete() *CronJobDelete

Delete returns a delete builder for CronJob.

func (*CronJobClient) DeleteOne

func (c *CronJobClient) DeleteOne(_m *CronJob) *CronJobDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CronJobClient) DeleteOneID

func (c *CronJobClient) DeleteOneID(id uuid.UUID) *CronJobDeleteOne

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

func (*CronJobClient) Get

func (c *CronJobClient) Get(ctx context.Context, id uuid.UUID) (*CronJob, error)

Get returns a CronJob entity by its id.

func (*CronJobClient) GetX

func (c *CronJobClient) GetX(ctx context.Context, id uuid.UUID) *CronJob

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

func (*CronJobClient) Hooks

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

Hooks returns the client hooks.

func (*CronJobClient) Intercept

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

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

func (*CronJobClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CronJobClient) MapCreateBulk

func (c *CronJobClient) MapCreateBulk(slice any, setFunc func(*CronJobCreate, int)) *CronJobCreateBulk

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

func (c *CronJobClient) Query() *CronJobQuery

Query returns a query builder for CronJob.

func (*CronJobClient) Update

func (c *CronJobClient) Update() *CronJobUpdate

Update returns an update builder for CronJob.

func (*CronJobClient) UpdateOne

func (c *CronJobClient) UpdateOne(_m *CronJob) *CronJobUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CronJobClient) UpdateOneID

func (c *CronJobClient) UpdateOneID(id uuid.UUID) *CronJobUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CronJobClient) Use

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

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

type CronJobCreate

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

CronJobCreate is the builder for creating a CronJob entity.

func (*CronJobCreate) Exec

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

Exec executes the query.

func (*CronJobCreate) ExecX

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

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

func (*CronJobCreate) Mutation

func (_c *CronJobCreate) Mutation() *CronJobMutation

Mutation returns the CronJobMutation object of the builder.

func (*CronJobCreate) Save

func (_c *CronJobCreate) Save(ctx context.Context) (*CronJob, error)

Save creates the CronJob in the database.

func (*CronJobCreate) SaveX

func (_c *CronJobCreate) SaveX(ctx context.Context) *CronJob

SaveX calls Save and panics if Save returns an error.

func (*CronJobCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CronJobCreate) SetDeliverTo

func (_c *CronJobCreate) SetDeliverTo(v []string) *CronJobCreate

SetDeliverTo sets the "deliver_to" field.

func (*CronJobCreate) SetEnabled

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

SetEnabled sets the "enabled" field.

func (*CronJobCreate) SetID

func (_c *CronJobCreate) SetID(v uuid.UUID) *CronJobCreate

SetID sets the "id" field.

func (*CronJobCreate) SetLastRunAt

func (_c *CronJobCreate) SetLastRunAt(v time.Time) *CronJobCreate

SetLastRunAt sets the "last_run_at" field.

func (*CronJobCreate) SetName

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

SetName sets the "name" field.

func (*CronJobCreate) SetNextRunAt

func (_c *CronJobCreate) SetNextRunAt(v time.Time) *CronJobCreate

SetNextRunAt sets the "next_run_at" field.

func (*CronJobCreate) SetNillableCreatedAt

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

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

func (*CronJobCreate) SetNillableEnabled

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

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

func (*CronJobCreate) SetNillableID

func (_c *CronJobCreate) SetNillableID(v *uuid.UUID) *CronJobCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CronJobCreate) SetNillableLastRunAt

func (_c *CronJobCreate) SetNillableLastRunAt(v *time.Time) *CronJobCreate

SetNillableLastRunAt sets the "last_run_at" field if the given value is not nil.

func (*CronJobCreate) SetNillableNextRunAt

func (_c *CronJobCreate) SetNillableNextRunAt(v *time.Time) *CronJobCreate

SetNillableNextRunAt sets the "next_run_at" field if the given value is not nil.

func (*CronJobCreate) SetNillableSessionMode

func (_c *CronJobCreate) SetNillableSessionMode(v *string) *CronJobCreate

SetNillableSessionMode sets the "session_mode" field if the given value is not nil.

func (*CronJobCreate) SetNillableTimezone

func (_c *CronJobCreate) SetNillableTimezone(v *string) *CronJobCreate

SetNillableTimezone sets the "timezone" field if the given value is not nil.

func (*CronJobCreate) SetNillableUpdatedAt

func (_c *CronJobCreate) SetNillableUpdatedAt(v *time.Time) *CronJobCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*CronJobCreate) SetPrompt

func (_c *CronJobCreate) SetPrompt(v string) *CronJobCreate

SetPrompt sets the "prompt" field.

func (*CronJobCreate) SetSchedule

func (_c *CronJobCreate) SetSchedule(v string) *CronJobCreate

SetSchedule sets the "schedule" field.

func (*CronJobCreate) SetScheduleType

func (_c *CronJobCreate) SetScheduleType(v cronjob.ScheduleType) *CronJobCreate

SetScheduleType sets the "schedule_type" field.

func (*CronJobCreate) SetSessionMode

func (_c *CronJobCreate) SetSessionMode(v string) *CronJobCreate

SetSessionMode sets the "session_mode" field.

func (*CronJobCreate) SetTimezone

func (_c *CronJobCreate) SetTimezone(v string) *CronJobCreate

SetTimezone sets the "timezone" field.

func (*CronJobCreate) SetUpdatedAt

func (_c *CronJobCreate) SetUpdatedAt(v time.Time) *CronJobCreate

SetUpdatedAt sets the "updated_at" field.

type CronJobCreateBulk

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

CronJobCreateBulk is the builder for creating many CronJob entities in bulk.

func (*CronJobCreateBulk) Exec

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

Exec executes the query.

func (*CronJobCreateBulk) ExecX

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

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

func (*CronJobCreateBulk) Save

func (_c *CronJobCreateBulk) Save(ctx context.Context) ([]*CronJob, error)

Save creates the CronJob entities in the database.

func (*CronJobCreateBulk) SaveX

func (_c *CronJobCreateBulk) SaveX(ctx context.Context) []*CronJob

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

type CronJobDelete

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

CronJobDelete is the builder for deleting a CronJob entity.

func (*CronJobDelete) Exec

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

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

func (*CronJobDelete) ExecX

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

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

func (*CronJobDelete) Where

func (_d *CronJobDelete) Where(ps ...predicate.CronJob) *CronJobDelete

Where appends a list predicates to the CronJobDelete builder.

type CronJobDeleteOne

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

CronJobDeleteOne is the builder for deleting a single CronJob entity.

func (*CronJobDeleteOne) Exec

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

Exec executes the deletion query.

func (*CronJobDeleteOne) ExecX

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

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

func (*CronJobDeleteOne) Where

Where appends a list predicates to the CronJobDelete builder.

type CronJobGroupBy

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

CronJobGroupBy is the group-by builder for CronJob entities.

func (*CronJobGroupBy) Aggregate

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

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

func (*CronJobGroupBy) Bool

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

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

func (*CronJobGroupBy) BoolX

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

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

func (*CronJobGroupBy) Bools

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

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

func (*CronJobGroupBy) BoolsX

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

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

func (*CronJobGroupBy) Float64

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

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

func (*CronJobGroupBy) Float64X

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

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

func (*CronJobGroupBy) Float64s

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

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

func (*CronJobGroupBy) Float64sX

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

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

func (*CronJobGroupBy) Int

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

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

func (*CronJobGroupBy) IntX

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

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

func (*CronJobGroupBy) Ints

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

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

func (*CronJobGroupBy) IntsX

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

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

func (*CronJobGroupBy) Scan

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

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

func (*CronJobGroupBy) ScanX

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

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

func (*CronJobGroupBy) String

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

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

func (*CronJobGroupBy) StringX

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

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

func (*CronJobGroupBy) Strings

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

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

func (*CronJobGroupBy) StringsX

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

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

type CronJobHistories

type CronJobHistories []*CronJobHistory

CronJobHistories is a parsable slice of CronJobHistory.

type CronJobHistory

type CronJobHistory struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Reference to the CronJob that was executed
	JobID uuid.UUID `json:"job_id,omitempty"`
	// Snapshot of job name at execution time
	JobName string `json:"job_name,omitempty"`
	// Status holds the value of the "status" field.
	Status cronjobhistory.Status `json:"status,omitempty"`
	// Prompt that was executed
	Prompt string `json:"prompt,omitempty"`
	// Agent response
	Result string `json:"result,omitempty"`
	// Error details if execution failed
	ErrorMessage string `json:"error_message,omitempty"`
	// TokensUsed holds the value of the "tokens_used" field.
	TokensUsed int `json:"tokens_used,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// CompletedAt holds the value of the "completed_at" field.
	CompletedAt *time.Time `json:"completed_at,omitempty"`
	// contains filtered or unexported fields
}

CronJobHistory is the model entity for the CronJobHistory schema.

func (*CronJobHistory) String

func (_m *CronJobHistory) String() string

String implements the fmt.Stringer.

func (*CronJobHistory) Unwrap

func (_m *CronJobHistory) Unwrap() *CronJobHistory

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

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

func (*CronJobHistory) Value

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

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

type CronJobHistoryClient

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

CronJobHistoryClient is a client for the CronJobHistory schema.

func NewCronJobHistoryClient

func NewCronJobHistoryClient(c config) *CronJobHistoryClient

NewCronJobHistoryClient returns a client for the CronJobHistory from the given config.

func (*CronJobHistoryClient) Create

Create returns a builder for creating a CronJobHistory entity.

func (*CronJobHistoryClient) CreateBulk

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

func (*CronJobHistoryClient) Delete

Delete returns a delete builder for CronJobHistory.

func (*CronJobHistoryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CronJobHistoryClient) DeleteOneID

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

func (*CronJobHistoryClient) Get

Get returns a CronJobHistory entity by its id.

func (*CronJobHistoryClient) GetX

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

func (*CronJobHistoryClient) Hooks

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

Hooks returns the client hooks.

func (*CronJobHistoryClient) Intercept

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

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

func (*CronJobHistoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CronJobHistoryClient) MapCreateBulk

func (c *CronJobHistoryClient) MapCreateBulk(slice any, setFunc func(*CronJobHistoryCreate, int)) *CronJobHistoryCreateBulk

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

Query returns a query builder for CronJobHistory.

func (*CronJobHistoryClient) Update

Update returns an update builder for CronJobHistory.

func (*CronJobHistoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CronJobHistoryClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*CronJobHistoryClient) Use

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

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

type CronJobHistoryCreate

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

CronJobHistoryCreate is the builder for creating a CronJobHistory entity.

func (*CronJobHistoryCreate) Exec

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

Exec executes the query.

func (*CronJobHistoryCreate) ExecX

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

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

func (*CronJobHistoryCreate) Mutation

Mutation returns the CronJobHistoryMutation object of the builder.

func (*CronJobHistoryCreate) Save

Save creates the CronJobHistory in the database.

func (*CronJobHistoryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CronJobHistoryCreate) SetCompletedAt

func (_c *CronJobHistoryCreate) SetCompletedAt(v time.Time) *CronJobHistoryCreate

SetCompletedAt sets the "completed_at" field.

func (*CronJobHistoryCreate) SetErrorMessage

func (_c *CronJobHistoryCreate) SetErrorMessage(v string) *CronJobHistoryCreate

SetErrorMessage sets the "error_message" field.

func (*CronJobHistoryCreate) SetID

SetID sets the "id" field.

func (*CronJobHistoryCreate) SetJobID

SetJobID sets the "job_id" field.

func (*CronJobHistoryCreate) SetJobName

SetJobName sets the "job_name" field.

func (*CronJobHistoryCreate) SetNillableCompletedAt

func (_c *CronJobHistoryCreate) SetNillableCompletedAt(v *time.Time) *CronJobHistoryCreate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*CronJobHistoryCreate) SetNillableErrorMessage

func (_c *CronJobHistoryCreate) SetNillableErrorMessage(v *string) *CronJobHistoryCreate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*CronJobHistoryCreate) SetNillableID

func (_c *CronJobHistoryCreate) SetNillableID(v *uuid.UUID) *CronJobHistoryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CronJobHistoryCreate) SetNillableResult

func (_c *CronJobHistoryCreate) SetNillableResult(v *string) *CronJobHistoryCreate

SetNillableResult sets the "result" field if the given value is not nil.

func (*CronJobHistoryCreate) SetNillableStartedAt

func (_c *CronJobHistoryCreate) SetNillableStartedAt(v *time.Time) *CronJobHistoryCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*CronJobHistoryCreate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CronJobHistoryCreate) SetNillableTokensUsed

func (_c *CronJobHistoryCreate) SetNillableTokensUsed(v *int) *CronJobHistoryCreate

SetNillableTokensUsed sets the "tokens_used" field if the given value is not nil.

func (*CronJobHistoryCreate) SetPrompt

SetPrompt sets the "prompt" field.

func (*CronJobHistoryCreate) SetResult

SetResult sets the "result" field.

func (*CronJobHistoryCreate) SetStartedAt

func (_c *CronJobHistoryCreate) SetStartedAt(v time.Time) *CronJobHistoryCreate

SetStartedAt sets the "started_at" field.

func (*CronJobHistoryCreate) SetStatus

SetStatus sets the "status" field.

func (*CronJobHistoryCreate) SetTokensUsed

func (_c *CronJobHistoryCreate) SetTokensUsed(v int) *CronJobHistoryCreate

SetTokensUsed sets the "tokens_used" field.

type CronJobHistoryCreateBulk

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

CronJobHistoryCreateBulk is the builder for creating many CronJobHistory entities in bulk.

func (*CronJobHistoryCreateBulk) Exec

Exec executes the query.

func (*CronJobHistoryCreateBulk) ExecX

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

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

func (*CronJobHistoryCreateBulk) Save

Save creates the CronJobHistory entities in the database.

func (*CronJobHistoryCreateBulk) SaveX

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

type CronJobHistoryDelete

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

CronJobHistoryDelete is the builder for deleting a CronJobHistory entity.

func (*CronJobHistoryDelete) Exec

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

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

func (*CronJobHistoryDelete) ExecX

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

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

func (*CronJobHistoryDelete) Where

Where appends a list predicates to the CronJobHistoryDelete builder.

type CronJobHistoryDeleteOne

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

CronJobHistoryDeleteOne is the builder for deleting a single CronJobHistory entity.

func (*CronJobHistoryDeleteOne) Exec

Exec executes the deletion query.

func (*CronJobHistoryDeleteOne) ExecX

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

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

func (*CronJobHistoryDeleteOne) Where

Where appends a list predicates to the CronJobHistoryDelete builder.

type CronJobHistoryGroupBy

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

CronJobHistoryGroupBy is the group-by builder for CronJobHistory entities.

func (*CronJobHistoryGroupBy) Aggregate

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

func (*CronJobHistoryGroupBy) Bool

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

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

func (*CronJobHistoryGroupBy) BoolX

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

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

func (*CronJobHistoryGroupBy) Bools

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

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

func (*CronJobHistoryGroupBy) BoolsX

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

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

func (*CronJobHistoryGroupBy) Float64

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

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

func (*CronJobHistoryGroupBy) Float64X

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

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

func (*CronJobHistoryGroupBy) Float64s

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

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

func (*CronJobHistoryGroupBy) Float64sX

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

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

func (*CronJobHistoryGroupBy) Int

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

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

func (*CronJobHistoryGroupBy) IntX

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

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

func (*CronJobHistoryGroupBy) Ints

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

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

func (*CronJobHistoryGroupBy) IntsX

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

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

func (*CronJobHistoryGroupBy) Scan

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

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

func (*CronJobHistoryGroupBy) ScanX

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

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

func (*CronJobHistoryGroupBy) String

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

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

func (*CronJobHistoryGroupBy) StringX

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

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

func (*CronJobHistoryGroupBy) Strings

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

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

func (*CronJobHistoryGroupBy) StringsX

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

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

type CronJobHistoryMutation

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

CronJobHistoryMutation represents an operation that mutates the CronJobHistory nodes in the graph.

func (*CronJobHistoryMutation) AddField

func (m *CronJobHistoryMutation) 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 (*CronJobHistoryMutation) AddTokensUsed

func (m *CronJobHistoryMutation) AddTokensUsed(i int)

AddTokensUsed adds i to the "tokens_used" field.

func (*CronJobHistoryMutation) AddedEdges

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

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

func (*CronJobHistoryMutation) AddedField

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

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

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

func (*CronJobHistoryMutation) AddedIDs

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

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

func (*CronJobHistoryMutation) AddedTokensUsed

func (m *CronJobHistoryMutation) AddedTokensUsed() (r int, exists bool)

AddedTokensUsed returns the value that was added to the "tokens_used" field in this mutation.

func (*CronJobHistoryMutation) ClearCompletedAt

func (m *CronJobHistoryMutation) ClearCompletedAt()

ClearCompletedAt clears the value of the "completed_at" field.

func (*CronJobHistoryMutation) ClearEdge

func (m *CronJobHistoryMutation) 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 (*CronJobHistoryMutation) ClearErrorMessage

func (m *CronJobHistoryMutation) ClearErrorMessage()

ClearErrorMessage clears the value of the "error_message" field.

func (*CronJobHistoryMutation) ClearField

func (m *CronJobHistoryMutation) 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 (*CronJobHistoryMutation) ClearResult

func (m *CronJobHistoryMutation) ClearResult()

ClearResult clears the value of the "result" field.

func (*CronJobHistoryMutation) ClearedEdges

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

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

func (*CronJobHistoryMutation) ClearedFields

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

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

func (CronJobHistoryMutation) Client

func (m CronJobHistoryMutation) 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 (*CronJobHistoryMutation) CompletedAt

func (m *CronJobHistoryMutation) CompletedAt() (r time.Time, exists bool)

CompletedAt returns the value of the "completed_at" field in the mutation.

func (*CronJobHistoryMutation) CompletedAtCleared

func (m *CronJobHistoryMutation) CompletedAtCleared() bool

CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.

func (*CronJobHistoryMutation) EdgeCleared

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

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

func (*CronJobHistoryMutation) ErrorMessage

func (m *CronJobHistoryMutation) ErrorMessage() (r string, exists bool)

ErrorMessage returns the value of the "error_message" field in the mutation.

func (*CronJobHistoryMutation) ErrorMessageCleared

func (m *CronJobHistoryMutation) ErrorMessageCleared() bool

ErrorMessageCleared returns if the "error_message" field was cleared in this mutation.

func (*CronJobHistoryMutation) Field

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

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

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

func (*CronJobHistoryMutation) Fields

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

func (m *CronJobHistoryMutation) ID() (id uuid.UUID, 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 (*CronJobHistoryMutation) 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 (*CronJobHistoryMutation) JobID

func (m *CronJobHistoryMutation) JobID() (r uuid.UUID, exists bool)

JobID returns the value of the "job_id" field in the mutation.

func (*CronJobHistoryMutation) JobName

func (m *CronJobHistoryMutation) JobName() (r string, exists bool)

JobName returns the value of the "job_name" field in the mutation.

func (*CronJobHistoryMutation) OldCompletedAt

func (m *CronJobHistoryMutation) OldCompletedAt(ctx context.Context) (v *time.Time, err error)

OldCompletedAt returns the old "completed_at" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldErrorMessage

func (m *CronJobHistoryMutation) OldErrorMessage(ctx context.Context) (v string, err error)

OldErrorMessage returns the old "error_message" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldField

func (m *CronJobHistoryMutation) 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 (*CronJobHistoryMutation) OldJobID

func (m *CronJobHistoryMutation) OldJobID(ctx context.Context) (v uuid.UUID, err error)

OldJobID returns the old "job_id" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldJobName

func (m *CronJobHistoryMutation) OldJobName(ctx context.Context) (v string, err error)

OldJobName returns the old "job_name" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldPrompt

func (m *CronJobHistoryMutation) OldPrompt(ctx context.Context) (v string, err error)

OldPrompt returns the old "prompt" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldResult

func (m *CronJobHistoryMutation) OldResult(ctx context.Context) (v string, err error)

OldResult returns the old "result" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldStartedAt

func (m *CronJobHistoryMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldStatus

func (m *CronJobHistoryMutation) OldStatus(ctx context.Context) (v cronjobhistory.Status, err error)

OldStatus returns the old "status" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) OldTokensUsed

func (m *CronJobHistoryMutation) OldTokensUsed(ctx context.Context) (v int, err error)

OldTokensUsed returns the old "tokens_used" field's value of the CronJobHistory entity. If the CronJobHistory 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 (*CronJobHistoryMutation) Op

func (m *CronJobHistoryMutation) Op() Op

Op returns the operation name.

func (*CronJobHistoryMutation) Prompt

func (m *CronJobHistoryMutation) Prompt() (r string, exists bool)

Prompt returns the value of the "prompt" field in the mutation.

func (*CronJobHistoryMutation) RemovedEdges

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

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

func (*CronJobHistoryMutation) RemovedIDs

func (m *CronJobHistoryMutation) 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 (*CronJobHistoryMutation) ResetCompletedAt

func (m *CronJobHistoryMutation) ResetCompletedAt()

ResetCompletedAt resets all changes to the "completed_at" field.

func (*CronJobHistoryMutation) ResetEdge

func (m *CronJobHistoryMutation) 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 (*CronJobHistoryMutation) ResetErrorMessage

func (m *CronJobHistoryMutation) ResetErrorMessage()

ResetErrorMessage resets all changes to the "error_message" field.

func (*CronJobHistoryMutation) ResetField

func (m *CronJobHistoryMutation) 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 (*CronJobHistoryMutation) ResetJobID

func (m *CronJobHistoryMutation) ResetJobID()

ResetJobID resets all changes to the "job_id" field.

func (*CronJobHistoryMutation) ResetJobName

func (m *CronJobHistoryMutation) ResetJobName()

ResetJobName resets all changes to the "job_name" field.

func (*CronJobHistoryMutation) ResetPrompt

func (m *CronJobHistoryMutation) ResetPrompt()

ResetPrompt resets all changes to the "prompt" field.

func (*CronJobHistoryMutation) ResetResult

func (m *CronJobHistoryMutation) ResetResult()

ResetResult resets all changes to the "result" field.

func (*CronJobHistoryMutation) ResetStartedAt

func (m *CronJobHistoryMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*CronJobHistoryMutation) ResetStatus

func (m *CronJobHistoryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*CronJobHistoryMutation) ResetTokensUsed

func (m *CronJobHistoryMutation) ResetTokensUsed()

ResetTokensUsed resets all changes to the "tokens_used" field.

func (*CronJobHistoryMutation) Result

func (m *CronJobHistoryMutation) Result() (r string, exists bool)

Result returns the value of the "result" field in the mutation.

func (*CronJobHistoryMutation) ResultCleared

func (m *CronJobHistoryMutation) ResultCleared() bool

ResultCleared returns if the "result" field was cleared in this mutation.

func (*CronJobHistoryMutation) SetCompletedAt

func (m *CronJobHistoryMutation) SetCompletedAt(t time.Time)

SetCompletedAt sets the "completed_at" field.

func (*CronJobHistoryMutation) SetErrorMessage

func (m *CronJobHistoryMutation) SetErrorMessage(s string)

SetErrorMessage sets the "error_message" field.

func (*CronJobHistoryMutation) SetField

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

func (m *CronJobHistoryMutation) SetID(id uuid.UUID)

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

func (*CronJobHistoryMutation) SetJobID

func (m *CronJobHistoryMutation) SetJobID(u uuid.UUID)

SetJobID sets the "job_id" field.

func (*CronJobHistoryMutation) SetJobName

func (m *CronJobHistoryMutation) SetJobName(s string)

SetJobName sets the "job_name" field.

func (*CronJobHistoryMutation) SetOp

func (m *CronJobHistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CronJobHistoryMutation) SetPrompt

func (m *CronJobHistoryMutation) SetPrompt(s string)

SetPrompt sets the "prompt" field.

func (*CronJobHistoryMutation) SetResult

func (m *CronJobHistoryMutation) SetResult(s string)

SetResult sets the "result" field.

func (*CronJobHistoryMutation) SetStartedAt

func (m *CronJobHistoryMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*CronJobHistoryMutation) SetStatus

SetStatus sets the "status" field.

func (*CronJobHistoryMutation) SetTokensUsed

func (m *CronJobHistoryMutation) SetTokensUsed(i int)

SetTokensUsed sets the "tokens_used" field.

func (*CronJobHistoryMutation) StartedAt

func (m *CronJobHistoryMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*CronJobHistoryMutation) Status

func (m *CronJobHistoryMutation) Status() (r cronjobhistory.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*CronJobHistoryMutation) TokensUsed

func (m *CronJobHistoryMutation) TokensUsed() (r int, exists bool)

TokensUsed returns the value of the "tokens_used" field in the mutation.

func (CronJobHistoryMutation) Tx

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

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

func (*CronJobHistoryMutation) Type

func (m *CronJobHistoryMutation) Type() string

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

func (*CronJobHistoryMutation) Where

Where appends a list predicates to the CronJobHistoryMutation builder.

func (*CronJobHistoryMutation) WhereP

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

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

type CronJobHistoryQuery

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

CronJobHistoryQuery is the builder for querying CronJobHistory entities.

func (*CronJobHistoryQuery) Aggregate

Aggregate returns a CronJobHistorySelect configured with the given aggregations.

func (*CronJobHistoryQuery) All

All executes the query and returns a list of CronJobHistories.

func (*CronJobHistoryQuery) AllX

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

func (*CronJobHistoryQuery) Clone

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

func (*CronJobHistoryQuery) Count

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

Count returns the count of the given query.

func (*CronJobHistoryQuery) CountX

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

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

func (*CronJobHistoryQuery) Exist

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

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

func (*CronJobHistoryQuery) ExistX

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

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

func (*CronJobHistoryQuery) First

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

func (*CronJobHistoryQuery) FirstID

func (_q *CronJobHistoryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CronJobHistoryQuery) FirstIDX

func (_q *CronJobHistoryQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CronJobHistoryQuery) FirstX

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

func (*CronJobHistoryQuery) GroupBy

func (_q *CronJobHistoryQuery) GroupBy(field string, fields ...string) *CronJobHistoryGroupBy

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 {
	JobID uuid.UUID `json:"job_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CronJobHistory.Query().
	GroupBy(cronjobhistory.FieldJobID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CronJobHistoryQuery) IDs

func (_q *CronJobHistoryQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*CronJobHistoryQuery) IDsX

func (_q *CronJobHistoryQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CronJobHistoryQuery) Limit

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

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

func (*CronJobHistoryQuery) Offset

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

Offset to start from.

func (*CronJobHistoryQuery) Only

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

func (*CronJobHistoryQuery) OnlyID

func (_q *CronJobHistoryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CronJobHistoryQuery) OnlyIDX

func (_q *CronJobHistoryQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CronJobHistoryQuery) OnlyX

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

func (*CronJobHistoryQuery) Order

Order specifies how the records should be ordered.

func (*CronJobHistoryQuery) Select

func (_q *CronJobHistoryQuery) Select(fields ...string) *CronJobHistorySelect

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 {
	JobID uuid.UUID `json:"job_id,omitempty"`
}

client.CronJobHistory.Query().
	Select(cronjobhistory.FieldJobID).
	Scan(ctx, &v)

func (*CronJobHistoryQuery) Unique

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

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

Where adds a new predicate for the CronJobHistoryQuery builder.

type CronJobHistorySelect

type CronJobHistorySelect struct {
	*CronJobHistoryQuery
	// contains filtered or unexported fields
}

CronJobHistorySelect is the builder for selecting fields of CronJobHistory entities.

func (*CronJobHistorySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*CronJobHistorySelect) Bool

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

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

func (*CronJobHistorySelect) BoolX

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

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

func (*CronJobHistorySelect) Bools

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

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

func (*CronJobHistorySelect) BoolsX

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

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

func (*CronJobHistorySelect) Float64

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

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

func (*CronJobHistorySelect) Float64X

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

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

func (*CronJobHistorySelect) Float64s

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

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

func (*CronJobHistorySelect) Float64sX

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

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

func (*CronJobHistorySelect) Int

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

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

func (*CronJobHistorySelect) IntX

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

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

func (*CronJobHistorySelect) Ints

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

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

func (*CronJobHistorySelect) IntsX

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

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

func (*CronJobHistorySelect) Scan

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

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

func (*CronJobHistorySelect) ScanX

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

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

func (*CronJobHistorySelect) String

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

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

func (*CronJobHistorySelect) StringX

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

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

func (*CronJobHistorySelect) Strings

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

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

func (*CronJobHistorySelect) StringsX

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

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

type CronJobHistoryUpdate

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

CronJobHistoryUpdate is the builder for updating CronJobHistory entities.

func (*CronJobHistoryUpdate) AddTokensUsed

func (_u *CronJobHistoryUpdate) AddTokensUsed(v int) *CronJobHistoryUpdate

AddTokensUsed adds value to the "tokens_used" field.

func (*CronJobHistoryUpdate) ClearCompletedAt

func (_u *CronJobHistoryUpdate) ClearCompletedAt() *CronJobHistoryUpdate

ClearCompletedAt clears the value of the "completed_at" field.

func (*CronJobHistoryUpdate) ClearErrorMessage

func (_u *CronJobHistoryUpdate) ClearErrorMessage() *CronJobHistoryUpdate

ClearErrorMessage clears the value of the "error_message" field.

func (*CronJobHistoryUpdate) ClearResult

func (_u *CronJobHistoryUpdate) ClearResult() *CronJobHistoryUpdate

ClearResult clears the value of the "result" field.

func (*CronJobHistoryUpdate) Exec

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

Exec executes the query.

func (*CronJobHistoryUpdate) ExecX

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

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

func (*CronJobHistoryUpdate) Mutation

Mutation returns the CronJobHistoryMutation object of the builder.

func (*CronJobHistoryUpdate) Save

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

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

func (*CronJobHistoryUpdate) SaveX

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

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

func (*CronJobHistoryUpdate) SetCompletedAt

func (_u *CronJobHistoryUpdate) SetCompletedAt(v time.Time) *CronJobHistoryUpdate

SetCompletedAt sets the "completed_at" field.

func (*CronJobHistoryUpdate) SetErrorMessage

func (_u *CronJobHistoryUpdate) SetErrorMessage(v string) *CronJobHistoryUpdate

SetErrorMessage sets the "error_message" field.

func (*CronJobHistoryUpdate) SetJobID

SetJobID sets the "job_id" field.

func (*CronJobHistoryUpdate) SetJobName

SetJobName sets the "job_name" field.

func (*CronJobHistoryUpdate) SetNillableCompletedAt

func (_u *CronJobHistoryUpdate) SetNillableCompletedAt(v *time.Time) *CronJobHistoryUpdate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetNillableErrorMessage

func (_u *CronJobHistoryUpdate) SetNillableErrorMessage(v *string) *CronJobHistoryUpdate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetNillableJobID

func (_u *CronJobHistoryUpdate) SetNillableJobID(v *uuid.UUID) *CronJobHistoryUpdate

SetNillableJobID sets the "job_id" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetNillableJobName

func (_u *CronJobHistoryUpdate) SetNillableJobName(v *string) *CronJobHistoryUpdate

SetNillableJobName sets the "job_name" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetNillablePrompt

func (_u *CronJobHistoryUpdate) SetNillablePrompt(v *string) *CronJobHistoryUpdate

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetNillableResult

func (_u *CronJobHistoryUpdate) SetNillableResult(v *string) *CronJobHistoryUpdate

SetNillableResult sets the "result" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetNillableTokensUsed

func (_u *CronJobHistoryUpdate) SetNillableTokensUsed(v *int) *CronJobHistoryUpdate

SetNillableTokensUsed sets the "tokens_used" field if the given value is not nil.

func (*CronJobHistoryUpdate) SetPrompt

SetPrompt sets the "prompt" field.

func (*CronJobHistoryUpdate) SetResult

SetResult sets the "result" field.

func (*CronJobHistoryUpdate) SetStatus

SetStatus sets the "status" field.

func (*CronJobHistoryUpdate) SetTokensUsed

func (_u *CronJobHistoryUpdate) SetTokensUsed(v int) *CronJobHistoryUpdate

SetTokensUsed sets the "tokens_used" field.

func (*CronJobHistoryUpdate) Where

Where appends a list predicates to the CronJobHistoryUpdate builder.

type CronJobHistoryUpdateOne

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

CronJobHistoryUpdateOne is the builder for updating a single CronJobHistory entity.

func (*CronJobHistoryUpdateOne) AddTokensUsed

func (_u *CronJobHistoryUpdateOne) AddTokensUsed(v int) *CronJobHistoryUpdateOne

AddTokensUsed adds value to the "tokens_used" field.

func (*CronJobHistoryUpdateOne) ClearCompletedAt

func (_u *CronJobHistoryUpdateOne) ClearCompletedAt() *CronJobHistoryUpdateOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*CronJobHistoryUpdateOne) ClearErrorMessage

func (_u *CronJobHistoryUpdateOne) ClearErrorMessage() *CronJobHistoryUpdateOne

ClearErrorMessage clears the value of the "error_message" field.

func (*CronJobHistoryUpdateOne) ClearResult

ClearResult clears the value of the "result" field.

func (*CronJobHistoryUpdateOne) Exec

Exec executes the query on the entity.

func (*CronJobHistoryUpdateOne) ExecX

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

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

func (*CronJobHistoryUpdateOne) Mutation

Mutation returns the CronJobHistoryMutation object of the builder.

func (*CronJobHistoryUpdateOne) Save

Save executes the query and returns the updated CronJobHistory entity.

func (*CronJobHistoryUpdateOne) SaveX

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

func (*CronJobHistoryUpdateOne) Select

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

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

func (*CronJobHistoryUpdateOne) SetCompletedAt

SetCompletedAt sets the "completed_at" field.

func (*CronJobHistoryUpdateOne) SetErrorMessage

func (_u *CronJobHistoryUpdateOne) SetErrorMessage(v string) *CronJobHistoryUpdateOne

SetErrorMessage sets the "error_message" field.

func (*CronJobHistoryUpdateOne) SetJobID

SetJobID sets the "job_id" field.

func (*CronJobHistoryUpdateOne) SetJobName

SetJobName sets the "job_name" field.

func (*CronJobHistoryUpdateOne) SetNillableCompletedAt

func (_u *CronJobHistoryUpdateOne) SetNillableCompletedAt(v *time.Time) *CronJobHistoryUpdateOne

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetNillableErrorMessage

func (_u *CronJobHistoryUpdateOne) SetNillableErrorMessage(v *string) *CronJobHistoryUpdateOne

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetNillableJobID

func (_u *CronJobHistoryUpdateOne) SetNillableJobID(v *uuid.UUID) *CronJobHistoryUpdateOne

SetNillableJobID sets the "job_id" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetNillableJobName

func (_u *CronJobHistoryUpdateOne) SetNillableJobName(v *string) *CronJobHistoryUpdateOne

SetNillableJobName sets the "job_name" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetNillablePrompt

func (_u *CronJobHistoryUpdateOne) SetNillablePrompt(v *string) *CronJobHistoryUpdateOne

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetNillableResult

func (_u *CronJobHistoryUpdateOne) SetNillableResult(v *string) *CronJobHistoryUpdateOne

SetNillableResult sets the "result" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetNillableTokensUsed

func (_u *CronJobHistoryUpdateOne) SetNillableTokensUsed(v *int) *CronJobHistoryUpdateOne

SetNillableTokensUsed sets the "tokens_used" field if the given value is not nil.

func (*CronJobHistoryUpdateOne) SetPrompt

SetPrompt sets the "prompt" field.

func (*CronJobHistoryUpdateOne) SetResult

SetResult sets the "result" field.

func (*CronJobHistoryUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*CronJobHistoryUpdateOne) SetTokensUsed

func (_u *CronJobHistoryUpdateOne) SetTokensUsed(v int) *CronJobHistoryUpdateOne

SetTokensUsed sets the "tokens_used" field.

func (*CronJobHistoryUpdateOne) Where

Where appends a list predicates to the CronJobHistoryUpdate builder.

type CronJobMutation

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

CronJobMutation represents an operation that mutates the CronJob nodes in the graph.

func (*CronJobMutation) AddField

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

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

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

func (*CronJobMutation) AddedField

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

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

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

func (*CronJobMutation) AddedIDs

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

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

func (*CronJobMutation) AppendDeliverTo

func (m *CronJobMutation) AppendDeliverTo(s []string)

AppendDeliverTo adds s to the "deliver_to" field.

func (*CronJobMutation) AppendedDeliverTo

func (m *CronJobMutation) AppendedDeliverTo() ([]string, bool)

AppendedDeliverTo returns the list of values that were appended to the "deliver_to" field in this mutation.

func (*CronJobMutation) ClearDeliverTo

func (m *CronJobMutation) ClearDeliverTo()

ClearDeliverTo clears the value of the "deliver_to" field.

func (*CronJobMutation) ClearEdge

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

func (m *CronJobMutation) 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 (*CronJobMutation) ClearLastRunAt

func (m *CronJobMutation) ClearLastRunAt()

ClearLastRunAt clears the value of the "last_run_at" field.

func (*CronJobMutation) ClearNextRunAt

func (m *CronJobMutation) ClearNextRunAt()

ClearNextRunAt clears the value of the "next_run_at" field.

func (*CronJobMutation) ClearedEdges

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

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

func (*CronJobMutation) ClearedFields

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

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

func (CronJobMutation) Client

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

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

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

func (*CronJobMutation) DeliverTo

func (m *CronJobMutation) DeliverTo() (r []string, exists bool)

DeliverTo returns the value of the "deliver_to" field in the mutation.

func (*CronJobMutation) DeliverToCleared

func (m *CronJobMutation) DeliverToCleared() bool

DeliverToCleared returns if the "deliver_to" field was cleared in this mutation.

func (*CronJobMutation) EdgeCleared

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

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

func (*CronJobMutation) Enabled

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

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

func (*CronJobMutation) Field

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

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

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

func (*CronJobMutation) Fields

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

func (m *CronJobMutation) ID() (id uuid.UUID, 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 (*CronJobMutation) IDs

func (m *CronJobMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*CronJobMutation) LastRunAt

func (m *CronJobMutation) LastRunAt() (r time.Time, exists bool)

LastRunAt returns the value of the "last_run_at" field in the mutation.

func (*CronJobMutation) LastRunAtCleared

func (m *CronJobMutation) LastRunAtCleared() bool

LastRunAtCleared returns if the "last_run_at" field was cleared in this mutation.

func (*CronJobMutation) Name

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

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

func (*CronJobMutation) NextRunAt

func (m *CronJobMutation) NextRunAt() (r time.Time, exists bool)

NextRunAt returns the value of the "next_run_at" field in the mutation.

func (*CronJobMutation) NextRunAtCleared

func (m *CronJobMutation) NextRunAtCleared() bool

NextRunAtCleared returns if the "next_run_at" field was cleared in this mutation.

func (*CronJobMutation) OldCreatedAt

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

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

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

OldDeliverTo returns the old "deliver_to" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldEnabled

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

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

func (m *CronJobMutation) 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 (*CronJobMutation) OldLastRunAt

func (m *CronJobMutation) OldLastRunAt(ctx context.Context) (v *time.Time, err error)

OldLastRunAt returns the old "last_run_at" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldName

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

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

func (m *CronJobMutation) OldNextRunAt(ctx context.Context) (v *time.Time, err error)

OldNextRunAt returns the old "next_run_at" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldPrompt

func (m *CronJobMutation) OldPrompt(ctx context.Context) (v string, err error)

OldPrompt returns the old "prompt" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldSchedule

func (m *CronJobMutation) OldSchedule(ctx context.Context) (v string, err error)

OldSchedule returns the old "schedule" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldScheduleType

func (m *CronJobMutation) OldScheduleType(ctx context.Context) (v cronjob.ScheduleType, err error)

OldScheduleType returns the old "schedule_type" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldSessionMode

func (m *CronJobMutation) OldSessionMode(ctx context.Context) (v string, err error)

OldSessionMode returns the old "session_mode" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldTimezone

func (m *CronJobMutation) OldTimezone(ctx context.Context) (v string, err error)

OldTimezone returns the old "timezone" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) OldUpdatedAt

func (m *CronJobMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the CronJob entity. If the CronJob 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 (*CronJobMutation) Op

func (m *CronJobMutation) Op() Op

Op returns the operation name.

func (*CronJobMutation) Prompt

func (m *CronJobMutation) Prompt() (r string, exists bool)

Prompt returns the value of the "prompt" field in the mutation.

func (*CronJobMutation) RemovedEdges

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

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

func (*CronJobMutation) RemovedIDs

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

func (m *CronJobMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CronJobMutation) ResetDeliverTo

func (m *CronJobMutation) ResetDeliverTo()

ResetDeliverTo resets all changes to the "deliver_to" field.

func (*CronJobMutation) ResetEdge

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

func (m *CronJobMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*CronJobMutation) ResetField

func (m *CronJobMutation) 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 (*CronJobMutation) ResetLastRunAt

func (m *CronJobMutation) ResetLastRunAt()

ResetLastRunAt resets all changes to the "last_run_at" field.

func (*CronJobMutation) ResetName

func (m *CronJobMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CronJobMutation) ResetNextRunAt

func (m *CronJobMutation) ResetNextRunAt()

ResetNextRunAt resets all changes to the "next_run_at" field.

func (*CronJobMutation) ResetPrompt

func (m *CronJobMutation) ResetPrompt()

ResetPrompt resets all changes to the "prompt" field.

func (*CronJobMutation) ResetSchedule

func (m *CronJobMutation) ResetSchedule()

ResetSchedule resets all changes to the "schedule" field.

func (*CronJobMutation) ResetScheduleType

func (m *CronJobMutation) ResetScheduleType()

ResetScheduleType resets all changes to the "schedule_type" field.

func (*CronJobMutation) ResetSessionMode

func (m *CronJobMutation) ResetSessionMode()

ResetSessionMode resets all changes to the "session_mode" field.

func (*CronJobMutation) ResetTimezone

func (m *CronJobMutation) ResetTimezone()

ResetTimezone resets all changes to the "timezone" field.

func (*CronJobMutation) ResetUpdatedAt

func (m *CronJobMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CronJobMutation) Schedule

func (m *CronJobMutation) Schedule() (r string, exists bool)

Schedule returns the value of the "schedule" field in the mutation.

func (*CronJobMutation) ScheduleType

func (m *CronJobMutation) ScheduleType() (r cronjob.ScheduleType, exists bool)

ScheduleType returns the value of the "schedule_type" field in the mutation.

func (*CronJobMutation) SessionMode

func (m *CronJobMutation) SessionMode() (r string, exists bool)

SessionMode returns the value of the "session_mode" field in the mutation.

func (*CronJobMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CronJobMutation) SetDeliverTo

func (m *CronJobMutation) SetDeliverTo(s []string)

SetDeliverTo sets the "deliver_to" field.

func (*CronJobMutation) SetEnabled

func (m *CronJobMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*CronJobMutation) SetField

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

func (m *CronJobMutation) SetID(id uuid.UUID)

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

func (*CronJobMutation) SetLastRunAt

func (m *CronJobMutation) SetLastRunAt(t time.Time)

SetLastRunAt sets the "last_run_at" field.

func (*CronJobMutation) SetName

func (m *CronJobMutation) SetName(s string)

SetName sets the "name" field.

func (*CronJobMutation) SetNextRunAt

func (m *CronJobMutation) SetNextRunAt(t time.Time)

SetNextRunAt sets the "next_run_at" field.

func (*CronJobMutation) SetOp

func (m *CronJobMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CronJobMutation) SetPrompt

func (m *CronJobMutation) SetPrompt(s string)

SetPrompt sets the "prompt" field.

func (*CronJobMutation) SetSchedule

func (m *CronJobMutation) SetSchedule(s string)

SetSchedule sets the "schedule" field.

func (*CronJobMutation) SetScheduleType

func (m *CronJobMutation) SetScheduleType(ct cronjob.ScheduleType)

SetScheduleType sets the "schedule_type" field.

func (*CronJobMutation) SetSessionMode

func (m *CronJobMutation) SetSessionMode(s string)

SetSessionMode sets the "session_mode" field.

func (*CronJobMutation) SetTimezone

func (m *CronJobMutation) SetTimezone(s string)

SetTimezone sets the "timezone" field.

func (*CronJobMutation) SetUpdatedAt

func (m *CronJobMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*CronJobMutation) Timezone

func (m *CronJobMutation) Timezone() (r string, exists bool)

Timezone returns the value of the "timezone" field in the mutation.

func (CronJobMutation) Tx

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

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

func (*CronJobMutation) Type

func (m *CronJobMutation) Type() string

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

func (*CronJobMutation) UpdatedAt

func (m *CronJobMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*CronJobMutation) Where

func (m *CronJobMutation) Where(ps ...predicate.CronJob)

Where appends a list predicates to the CronJobMutation builder.

func (*CronJobMutation) WhereP

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

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

type CronJobQuery

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

CronJobQuery is the builder for querying CronJob entities.

func (*CronJobQuery) Aggregate

func (_q *CronJobQuery) Aggregate(fns ...AggregateFunc) *CronJobSelect

Aggregate returns a CronJobSelect configured with the given aggregations.

func (*CronJobQuery) All

func (_q *CronJobQuery) All(ctx context.Context) ([]*CronJob, error)

All executes the query and returns a list of CronJobs.

func (*CronJobQuery) AllX

func (_q *CronJobQuery) AllX(ctx context.Context) []*CronJob

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

func (*CronJobQuery) Clone

func (_q *CronJobQuery) Clone() *CronJobQuery

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

func (*CronJobQuery) Count

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

Count returns the count of the given query.

func (*CronJobQuery) CountX

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

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

func (*CronJobQuery) Exist

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

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

func (*CronJobQuery) ExistX

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

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

func (*CronJobQuery) First

func (_q *CronJobQuery) First(ctx context.Context) (*CronJob, error)

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

func (*CronJobQuery) FirstID

func (_q *CronJobQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CronJobQuery) FirstIDX

func (_q *CronJobQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CronJobQuery) FirstX

func (_q *CronJobQuery) FirstX(ctx context.Context) *CronJob

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

func (*CronJobQuery) GroupBy

func (_q *CronJobQuery) GroupBy(field string, fields ...string) *CronJobGroupBy

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

Example:

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

client.CronJob.Query().
	GroupBy(cronjob.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CronJobQuery) IDs

func (_q *CronJobQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*CronJobQuery) IDsX

func (_q *CronJobQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CronJobQuery) Limit

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

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

func (*CronJobQuery) Offset

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

Offset to start from.

func (*CronJobQuery) Only

func (_q *CronJobQuery) Only(ctx context.Context) (*CronJob, error)

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

func (*CronJobQuery) OnlyID

func (_q *CronJobQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CronJobQuery) OnlyIDX

func (_q *CronJobQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CronJobQuery) OnlyX

func (_q *CronJobQuery) OnlyX(ctx context.Context) *CronJob

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

func (*CronJobQuery) Order

func (_q *CronJobQuery) Order(o ...cronjob.OrderOption) *CronJobQuery

Order specifies how the records should be ordered.

func (*CronJobQuery) Select

func (_q *CronJobQuery) Select(fields ...string) *CronJobSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.CronJob.Query().
	Select(cronjob.FieldName).
	Scan(ctx, &v)

func (*CronJobQuery) Unique

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

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

func (_q *CronJobQuery) Where(ps ...predicate.CronJob) *CronJobQuery

Where adds a new predicate for the CronJobQuery builder.

type CronJobSelect

type CronJobSelect struct {
	*CronJobQuery
	// contains filtered or unexported fields
}

CronJobSelect is the builder for selecting fields of CronJob entities.

func (*CronJobSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CronJobSelect) Bool

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

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

func (*CronJobSelect) BoolX

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

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

func (*CronJobSelect) Bools

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

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

func (*CronJobSelect) BoolsX

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

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

func (*CronJobSelect) Float64

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

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

func (*CronJobSelect) Float64X

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

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

func (*CronJobSelect) Float64s

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

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

func (*CronJobSelect) Float64sX

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

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

func (*CronJobSelect) Int

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

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

func (*CronJobSelect) IntX

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

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

func (*CronJobSelect) Ints

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

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

func (*CronJobSelect) IntsX

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

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

func (*CronJobSelect) Scan

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

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

func (*CronJobSelect) ScanX

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

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

func (*CronJobSelect) String

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

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

func (*CronJobSelect) StringX

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

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

func (*CronJobSelect) Strings

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

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

func (*CronJobSelect) StringsX

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

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

type CronJobUpdate

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

CronJobUpdate is the builder for updating CronJob entities.

func (*CronJobUpdate) AppendDeliverTo

func (_u *CronJobUpdate) AppendDeliverTo(v []string) *CronJobUpdate

AppendDeliverTo appends value to the "deliver_to" field.

func (*CronJobUpdate) ClearDeliverTo

func (_u *CronJobUpdate) ClearDeliverTo() *CronJobUpdate

ClearDeliverTo clears the value of the "deliver_to" field.

func (*CronJobUpdate) ClearLastRunAt

func (_u *CronJobUpdate) ClearLastRunAt() *CronJobUpdate

ClearLastRunAt clears the value of the "last_run_at" field.

func (*CronJobUpdate) ClearNextRunAt

func (_u *CronJobUpdate) ClearNextRunAt() *CronJobUpdate

ClearNextRunAt clears the value of the "next_run_at" field.

func (*CronJobUpdate) Exec

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

Exec executes the query.

func (*CronJobUpdate) ExecX

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

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

func (*CronJobUpdate) Mutation

func (_u *CronJobUpdate) Mutation() *CronJobMutation

Mutation returns the CronJobMutation object of the builder.

func (*CronJobUpdate) Save

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

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

func (*CronJobUpdate) SaveX

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

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

func (*CronJobUpdate) SetDeliverTo

func (_u *CronJobUpdate) SetDeliverTo(v []string) *CronJobUpdate

SetDeliverTo sets the "deliver_to" field.

func (*CronJobUpdate) SetEnabled

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

SetEnabled sets the "enabled" field.

func (*CronJobUpdate) SetLastRunAt

func (_u *CronJobUpdate) SetLastRunAt(v time.Time) *CronJobUpdate

SetLastRunAt sets the "last_run_at" field.

func (*CronJobUpdate) SetName

func (_u *CronJobUpdate) SetName(v string) *CronJobUpdate

SetName sets the "name" field.

func (*CronJobUpdate) SetNextRunAt

func (_u *CronJobUpdate) SetNextRunAt(v time.Time) *CronJobUpdate

SetNextRunAt sets the "next_run_at" field.

func (*CronJobUpdate) SetNillableEnabled

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

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

func (*CronJobUpdate) SetNillableLastRunAt

func (_u *CronJobUpdate) SetNillableLastRunAt(v *time.Time) *CronJobUpdate

SetNillableLastRunAt sets the "last_run_at" field if the given value is not nil.

func (*CronJobUpdate) SetNillableName

func (_u *CronJobUpdate) SetNillableName(v *string) *CronJobUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*CronJobUpdate) SetNillableNextRunAt

func (_u *CronJobUpdate) SetNillableNextRunAt(v *time.Time) *CronJobUpdate

SetNillableNextRunAt sets the "next_run_at" field if the given value is not nil.

func (*CronJobUpdate) SetNillablePrompt

func (_u *CronJobUpdate) SetNillablePrompt(v *string) *CronJobUpdate

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*CronJobUpdate) SetNillableSchedule

func (_u *CronJobUpdate) SetNillableSchedule(v *string) *CronJobUpdate

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*CronJobUpdate) SetNillableScheduleType

func (_u *CronJobUpdate) SetNillableScheduleType(v *cronjob.ScheduleType) *CronJobUpdate

SetNillableScheduleType sets the "schedule_type" field if the given value is not nil.

func (*CronJobUpdate) SetNillableSessionMode

func (_u *CronJobUpdate) SetNillableSessionMode(v *string) *CronJobUpdate

SetNillableSessionMode sets the "session_mode" field if the given value is not nil.

func (*CronJobUpdate) SetNillableTimezone

func (_u *CronJobUpdate) SetNillableTimezone(v *string) *CronJobUpdate

SetNillableTimezone sets the "timezone" field if the given value is not nil.

func (*CronJobUpdate) SetPrompt

func (_u *CronJobUpdate) SetPrompt(v string) *CronJobUpdate

SetPrompt sets the "prompt" field.

func (*CronJobUpdate) SetSchedule

func (_u *CronJobUpdate) SetSchedule(v string) *CronJobUpdate

SetSchedule sets the "schedule" field.

func (*CronJobUpdate) SetScheduleType

func (_u *CronJobUpdate) SetScheduleType(v cronjob.ScheduleType) *CronJobUpdate

SetScheduleType sets the "schedule_type" field.

func (*CronJobUpdate) SetSessionMode

func (_u *CronJobUpdate) SetSessionMode(v string) *CronJobUpdate

SetSessionMode sets the "session_mode" field.

func (*CronJobUpdate) SetTimezone

func (_u *CronJobUpdate) SetTimezone(v string) *CronJobUpdate

SetTimezone sets the "timezone" field.

func (*CronJobUpdate) SetUpdatedAt

func (_u *CronJobUpdate) SetUpdatedAt(v time.Time) *CronJobUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CronJobUpdate) Where

func (_u *CronJobUpdate) Where(ps ...predicate.CronJob) *CronJobUpdate

Where appends a list predicates to the CronJobUpdate builder.

type CronJobUpdateOne

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

CronJobUpdateOne is the builder for updating a single CronJob entity.

func (*CronJobUpdateOne) AppendDeliverTo

func (_u *CronJobUpdateOne) AppendDeliverTo(v []string) *CronJobUpdateOne

AppendDeliverTo appends value to the "deliver_to" field.

func (*CronJobUpdateOne) ClearDeliverTo

func (_u *CronJobUpdateOne) ClearDeliverTo() *CronJobUpdateOne

ClearDeliverTo clears the value of the "deliver_to" field.

func (*CronJobUpdateOne) ClearLastRunAt

func (_u *CronJobUpdateOne) ClearLastRunAt() *CronJobUpdateOne

ClearLastRunAt clears the value of the "last_run_at" field.

func (*CronJobUpdateOne) ClearNextRunAt

func (_u *CronJobUpdateOne) ClearNextRunAt() *CronJobUpdateOne

ClearNextRunAt clears the value of the "next_run_at" field.

func (*CronJobUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CronJobUpdateOne) ExecX

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

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

func (*CronJobUpdateOne) Mutation

func (_u *CronJobUpdateOne) Mutation() *CronJobMutation

Mutation returns the CronJobMutation object of the builder.

func (*CronJobUpdateOne) Save

func (_u *CronJobUpdateOne) Save(ctx context.Context) (*CronJob, error)

Save executes the query and returns the updated CronJob entity.

func (*CronJobUpdateOne) SaveX

func (_u *CronJobUpdateOne) SaveX(ctx context.Context) *CronJob

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

func (*CronJobUpdateOne) Select

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

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

func (*CronJobUpdateOne) SetDeliverTo

func (_u *CronJobUpdateOne) SetDeliverTo(v []string) *CronJobUpdateOne

SetDeliverTo sets the "deliver_to" field.

func (*CronJobUpdateOne) SetEnabled

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

SetEnabled sets the "enabled" field.

func (*CronJobUpdateOne) SetLastRunAt

func (_u *CronJobUpdateOne) SetLastRunAt(v time.Time) *CronJobUpdateOne

SetLastRunAt sets the "last_run_at" field.

func (*CronJobUpdateOne) SetName

func (_u *CronJobUpdateOne) SetName(v string) *CronJobUpdateOne

SetName sets the "name" field.

func (*CronJobUpdateOne) SetNextRunAt

func (_u *CronJobUpdateOne) SetNextRunAt(v time.Time) *CronJobUpdateOne

SetNextRunAt sets the "next_run_at" field.

func (*CronJobUpdateOne) SetNillableEnabled

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

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

func (*CronJobUpdateOne) SetNillableLastRunAt

func (_u *CronJobUpdateOne) SetNillableLastRunAt(v *time.Time) *CronJobUpdateOne

SetNillableLastRunAt sets the "last_run_at" field if the given value is not nil.

func (*CronJobUpdateOne) SetNillableName

func (_u *CronJobUpdateOne) SetNillableName(v *string) *CronJobUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*CronJobUpdateOne) SetNillableNextRunAt

func (_u *CronJobUpdateOne) SetNillableNextRunAt(v *time.Time) *CronJobUpdateOne

SetNillableNextRunAt sets the "next_run_at" field if the given value is not nil.

func (*CronJobUpdateOne) SetNillablePrompt

func (_u *CronJobUpdateOne) SetNillablePrompt(v *string) *CronJobUpdateOne

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*CronJobUpdateOne) SetNillableSchedule

func (_u *CronJobUpdateOne) SetNillableSchedule(v *string) *CronJobUpdateOne

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*CronJobUpdateOne) SetNillableScheduleType

func (_u *CronJobUpdateOne) SetNillableScheduleType(v *cronjob.ScheduleType) *CronJobUpdateOne

SetNillableScheduleType sets the "schedule_type" field if the given value is not nil.

func (*CronJobUpdateOne) SetNillableSessionMode

func (_u *CronJobUpdateOne) SetNillableSessionMode(v *string) *CronJobUpdateOne

SetNillableSessionMode sets the "session_mode" field if the given value is not nil.

func (*CronJobUpdateOne) SetNillableTimezone

func (_u *CronJobUpdateOne) SetNillableTimezone(v *string) *CronJobUpdateOne

SetNillableTimezone sets the "timezone" field if the given value is not nil.

func (*CronJobUpdateOne) SetPrompt

func (_u *CronJobUpdateOne) SetPrompt(v string) *CronJobUpdateOne

SetPrompt sets the "prompt" field.

func (*CronJobUpdateOne) SetSchedule

func (_u *CronJobUpdateOne) SetSchedule(v string) *CronJobUpdateOne

SetSchedule sets the "schedule" field.

func (*CronJobUpdateOne) SetScheduleType

func (_u *CronJobUpdateOne) SetScheduleType(v cronjob.ScheduleType) *CronJobUpdateOne

SetScheduleType sets the "schedule_type" field.

func (*CronJobUpdateOne) SetSessionMode

func (_u *CronJobUpdateOne) SetSessionMode(v string) *CronJobUpdateOne

SetSessionMode sets the "session_mode" field.

func (*CronJobUpdateOne) SetTimezone

func (_u *CronJobUpdateOne) SetTimezone(v string) *CronJobUpdateOne

SetTimezone sets the "timezone" field.

func (*CronJobUpdateOne) SetUpdatedAt

func (_u *CronJobUpdateOne) SetUpdatedAt(v time.Time) *CronJobUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CronJobUpdateOne) Where

Where appends a list predicates to the CronJobUpdate builder.

type CronJobs

type CronJobs []*CronJob

CronJobs is a parsable slice of CronJob.

type EscrowDeal added in v0.5.0

type EscrowDeal struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Unique escrow identifier
	EscrowID string `json:"escrow_id,omitempty"`
	// Buyer DID
	BuyerDid string `json:"buyer_did,omitempty"`
	// Seller DID
	SellerDid string `json:"seller_did,omitempty"`
	// Total escrow amount as decimal string (big.Int)
	TotalAmount string `json:"total_amount,omitempty"`
	// Escrow lifecycle status
	Status string `json:"status,omitempty"`
	// JSON-serialized milestone data
	Milestones []byte `json:"milestones,omitempty"`
	// Associated task identifier
	TaskID string `json:"task_id,omitempty"`
	// Reason for the escrow
	Reason string `json:"reason,omitempty"`
	// Dispute description if disputed
	DisputeNote string `json:"dispute_note,omitempty"`
	// EVM chain ID for on-chain tracking
	ChainID int64 `json:"chain_id,omitempty"`
	// On-chain escrow hub contract address
	HubAddress string `json:"hub_address,omitempty"`
	// Deal ID on the escrow contract
	OnChainDealID string `json:"on_chain_deal_id,omitempty"`
	// Deposit transaction hash
	DepositTxHash string `json:"deposit_tx_hash,omitempty"`
	// Release transaction hash
	ReleaseTxHash string `json:"release_tx_hash,omitempty"`
	// Refund transaction hash
	RefundTxHash string `json:"refund_tx_hash,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Escrow expiration time
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

EscrowDeal is the model entity for the EscrowDeal schema.

func (*EscrowDeal) String added in v0.5.0

func (_m *EscrowDeal) String() string

String implements the fmt.Stringer.

func (*EscrowDeal) Unwrap added in v0.5.0

func (_m *EscrowDeal) Unwrap() *EscrowDeal

Unwrap unwraps the EscrowDeal 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 (*EscrowDeal) Update added in v0.5.0

func (_m *EscrowDeal) Update() *EscrowDealUpdateOne

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

func (*EscrowDeal) Value added in v0.5.0

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

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

type EscrowDealClient added in v0.5.0

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

EscrowDealClient is a client for the EscrowDeal schema.

func NewEscrowDealClient added in v0.5.0

func NewEscrowDealClient(c config) *EscrowDealClient

NewEscrowDealClient returns a client for the EscrowDeal from the given config.

func (*EscrowDealClient) Create added in v0.5.0

func (c *EscrowDealClient) Create() *EscrowDealCreate

Create returns a builder for creating a EscrowDeal entity.

func (*EscrowDealClient) CreateBulk added in v0.5.0

func (c *EscrowDealClient) CreateBulk(builders ...*EscrowDealCreate) *EscrowDealCreateBulk

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

func (*EscrowDealClient) Delete added in v0.5.0

func (c *EscrowDealClient) Delete() *EscrowDealDelete

Delete returns a delete builder for EscrowDeal.

func (*EscrowDealClient) DeleteOne added in v0.5.0

func (c *EscrowDealClient) DeleteOne(_m *EscrowDeal) *EscrowDealDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EscrowDealClient) DeleteOneID added in v0.5.0

func (c *EscrowDealClient) DeleteOneID(id int) *EscrowDealDeleteOne

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

func (*EscrowDealClient) Get added in v0.5.0

func (c *EscrowDealClient) Get(ctx context.Context, id int) (*EscrowDeal, error)

Get returns a EscrowDeal entity by its id.

func (*EscrowDealClient) GetX added in v0.5.0

func (c *EscrowDealClient) GetX(ctx context.Context, id int) *EscrowDeal

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

func (*EscrowDealClient) Hooks added in v0.5.0

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

Hooks returns the client hooks.

func (*EscrowDealClient) Intercept added in v0.5.0

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

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

func (*EscrowDealClient) Interceptors added in v0.5.0

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

Interceptors returns the client interceptors.

func (*EscrowDealClient) MapCreateBulk added in v0.5.0

func (c *EscrowDealClient) MapCreateBulk(slice any, setFunc func(*EscrowDealCreate, int)) *EscrowDealCreateBulk

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 (*EscrowDealClient) Query added in v0.5.0

func (c *EscrowDealClient) Query() *EscrowDealQuery

Query returns a query builder for EscrowDeal.

func (*EscrowDealClient) Update added in v0.5.0

func (c *EscrowDealClient) Update() *EscrowDealUpdate

Update returns an update builder for EscrowDeal.

func (*EscrowDealClient) UpdateOne added in v0.5.0

func (c *EscrowDealClient) UpdateOne(_m *EscrowDeal) *EscrowDealUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EscrowDealClient) UpdateOneID added in v0.5.0

func (c *EscrowDealClient) UpdateOneID(id int) *EscrowDealUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EscrowDealClient) Use added in v0.5.0

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

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

type EscrowDealCreate added in v0.5.0

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

EscrowDealCreate is the builder for creating a EscrowDeal entity.

func (*EscrowDealCreate) Exec added in v0.5.0

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

Exec executes the query.

func (*EscrowDealCreate) ExecX added in v0.5.0

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

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

func (*EscrowDealCreate) Mutation added in v0.5.0

func (_c *EscrowDealCreate) Mutation() *EscrowDealMutation

Mutation returns the EscrowDealMutation object of the builder.

func (*EscrowDealCreate) Save added in v0.5.0

func (_c *EscrowDealCreate) Save(ctx context.Context) (*EscrowDeal, error)

Save creates the EscrowDeal in the database.

func (*EscrowDealCreate) SaveX added in v0.5.0

func (_c *EscrowDealCreate) SaveX(ctx context.Context) *EscrowDeal

SaveX calls Save and panics if Save returns an error.

func (*EscrowDealCreate) SetBuyerDid added in v0.5.0

func (_c *EscrowDealCreate) SetBuyerDid(v string) *EscrowDealCreate

SetBuyerDid sets the "buyer_did" field.

func (*EscrowDealCreate) SetChainID added in v0.5.0

func (_c *EscrowDealCreate) SetChainID(v int64) *EscrowDealCreate

SetChainID sets the "chain_id" field.

func (*EscrowDealCreate) SetCreatedAt added in v0.5.0

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

SetCreatedAt sets the "created_at" field.

func (*EscrowDealCreate) SetDepositTxHash added in v0.5.0

func (_c *EscrowDealCreate) SetDepositTxHash(v string) *EscrowDealCreate

SetDepositTxHash sets the "deposit_tx_hash" field.

func (*EscrowDealCreate) SetDisputeNote added in v0.5.0

func (_c *EscrowDealCreate) SetDisputeNote(v string) *EscrowDealCreate

SetDisputeNote sets the "dispute_note" field.

func (*EscrowDealCreate) SetEscrowID added in v0.5.0

func (_c *EscrowDealCreate) SetEscrowID(v string) *EscrowDealCreate

SetEscrowID sets the "escrow_id" field.

func (*EscrowDealCreate) SetExpiresAt added in v0.5.0

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

SetExpiresAt sets the "expires_at" field.

func (*EscrowDealCreate) SetHubAddress added in v0.5.0

func (_c *EscrowDealCreate) SetHubAddress(v string) *EscrowDealCreate

SetHubAddress sets the "hub_address" field.

func (*EscrowDealCreate) SetMilestones added in v0.5.0

func (_c *EscrowDealCreate) SetMilestones(v []byte) *EscrowDealCreate

SetMilestones sets the "milestones" field.

func (*EscrowDealCreate) SetNillableChainID added in v0.5.0

func (_c *EscrowDealCreate) SetNillableChainID(v *int64) *EscrowDealCreate

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableCreatedAt added in v0.5.0

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

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

func (*EscrowDealCreate) SetNillableDepositTxHash added in v0.5.0

func (_c *EscrowDealCreate) SetNillableDepositTxHash(v *string) *EscrowDealCreate

SetNillableDepositTxHash sets the "deposit_tx_hash" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableDisputeNote added in v0.5.0

func (_c *EscrowDealCreate) SetNillableDisputeNote(v *string) *EscrowDealCreate

SetNillableDisputeNote sets the "dispute_note" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableHubAddress added in v0.5.0

func (_c *EscrowDealCreate) SetNillableHubAddress(v *string) *EscrowDealCreate

SetNillableHubAddress sets the "hub_address" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableOnChainDealID added in v0.5.0

func (_c *EscrowDealCreate) SetNillableOnChainDealID(v *string) *EscrowDealCreate

SetNillableOnChainDealID sets the "on_chain_deal_id" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableReason added in v0.5.0

func (_c *EscrowDealCreate) SetNillableReason(v *string) *EscrowDealCreate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableRefundTxHash added in v0.5.0

func (_c *EscrowDealCreate) SetNillableRefundTxHash(v *string) *EscrowDealCreate

SetNillableRefundTxHash sets the "refund_tx_hash" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableReleaseTxHash added in v0.5.0

func (_c *EscrowDealCreate) SetNillableReleaseTxHash(v *string) *EscrowDealCreate

SetNillableReleaseTxHash sets the "release_tx_hash" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableStatus added in v0.5.0

func (_c *EscrowDealCreate) SetNillableStatus(v *string) *EscrowDealCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableTaskID added in v0.5.0

func (_c *EscrowDealCreate) SetNillableTaskID(v *string) *EscrowDealCreate

SetNillableTaskID sets the "task_id" field if the given value is not nil.

func (*EscrowDealCreate) SetNillableUpdatedAt added in v0.5.0

func (_c *EscrowDealCreate) SetNillableUpdatedAt(v *time.Time) *EscrowDealCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*EscrowDealCreate) SetOnChainDealID added in v0.5.0

func (_c *EscrowDealCreate) SetOnChainDealID(v string) *EscrowDealCreate

SetOnChainDealID sets the "on_chain_deal_id" field.

func (*EscrowDealCreate) SetReason added in v0.5.0

func (_c *EscrowDealCreate) SetReason(v string) *EscrowDealCreate

SetReason sets the "reason" field.

func (*EscrowDealCreate) SetRefundTxHash added in v0.5.0

func (_c *EscrowDealCreate) SetRefundTxHash(v string) *EscrowDealCreate

SetRefundTxHash sets the "refund_tx_hash" field.

func (*EscrowDealCreate) SetReleaseTxHash added in v0.5.0

func (_c *EscrowDealCreate) SetReleaseTxHash(v string) *EscrowDealCreate

SetReleaseTxHash sets the "release_tx_hash" field.

func (*EscrowDealCreate) SetSellerDid added in v0.5.0

func (_c *EscrowDealCreate) SetSellerDid(v string) *EscrowDealCreate

SetSellerDid sets the "seller_did" field.

func (*EscrowDealCreate) SetStatus added in v0.5.0

func (_c *EscrowDealCreate) SetStatus(v string) *EscrowDealCreate

SetStatus sets the "status" field.

func (*EscrowDealCreate) SetTaskID added in v0.5.0

func (_c *EscrowDealCreate) SetTaskID(v string) *EscrowDealCreate

SetTaskID sets the "task_id" field.

func (*EscrowDealCreate) SetTotalAmount added in v0.5.0

func (_c *EscrowDealCreate) SetTotalAmount(v string) *EscrowDealCreate

SetTotalAmount sets the "total_amount" field.

func (*EscrowDealCreate) SetUpdatedAt added in v0.5.0

func (_c *EscrowDealCreate) SetUpdatedAt(v time.Time) *EscrowDealCreate

SetUpdatedAt sets the "updated_at" field.

type EscrowDealCreateBulk added in v0.5.0

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

EscrowDealCreateBulk is the builder for creating many EscrowDeal entities in bulk.

func (*EscrowDealCreateBulk) Exec added in v0.5.0

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

Exec executes the query.

func (*EscrowDealCreateBulk) ExecX added in v0.5.0

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

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

func (*EscrowDealCreateBulk) Save added in v0.5.0

func (_c *EscrowDealCreateBulk) Save(ctx context.Context) ([]*EscrowDeal, error)

Save creates the EscrowDeal entities in the database.

func (*EscrowDealCreateBulk) SaveX added in v0.5.0

func (_c *EscrowDealCreateBulk) SaveX(ctx context.Context) []*EscrowDeal

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

type EscrowDealDelete added in v0.5.0

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

EscrowDealDelete is the builder for deleting a EscrowDeal entity.

func (*EscrowDealDelete) Exec added in v0.5.0

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

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

func (*EscrowDealDelete) ExecX added in v0.5.0

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

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

func (*EscrowDealDelete) Where added in v0.5.0

Where appends a list predicates to the EscrowDealDelete builder.

type EscrowDealDeleteOne added in v0.5.0

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

EscrowDealDeleteOne is the builder for deleting a single EscrowDeal entity.

func (*EscrowDealDeleteOne) Exec added in v0.5.0

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

Exec executes the deletion query.

func (*EscrowDealDeleteOne) ExecX added in v0.5.0

func (_d *EscrowDealDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EscrowDealDeleteOne) Where added in v0.5.0

Where appends a list predicates to the EscrowDealDelete builder.

type EscrowDealGroupBy added in v0.5.0

type EscrowDealGroupBy struct {
	// contains filtered or unexported fields
}

EscrowDealGroupBy is the group-by builder for EscrowDeal entities.

func (*EscrowDealGroupBy) Aggregate added in v0.5.0

func (_g *EscrowDealGroupBy) Aggregate(fns ...AggregateFunc) *EscrowDealGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*EscrowDealGroupBy) Bool added in v0.5.0

func (s *EscrowDealGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) BoolX added in v0.5.0

func (s *EscrowDealGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EscrowDealGroupBy) Bools added in v0.5.0

func (s *EscrowDealGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) BoolsX added in v0.5.0

func (s *EscrowDealGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EscrowDealGroupBy) Float64 added in v0.5.0

func (s *EscrowDealGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) Float64X added in v0.5.0

func (s *EscrowDealGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EscrowDealGroupBy) Float64s added in v0.5.0

func (s *EscrowDealGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) Float64sX added in v0.5.0

func (s *EscrowDealGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EscrowDealGroupBy) Int added in v0.5.0

func (s *EscrowDealGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) IntX added in v0.5.0

func (s *EscrowDealGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EscrowDealGroupBy) Ints added in v0.5.0

func (s *EscrowDealGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) IntsX added in v0.5.0

func (s *EscrowDealGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EscrowDealGroupBy) Scan added in v0.5.0

func (_g *EscrowDealGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EscrowDealGroupBy) ScanX added in v0.5.0

func (s *EscrowDealGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EscrowDealGroupBy) String added in v0.5.0

func (s *EscrowDealGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) StringX added in v0.5.0

func (s *EscrowDealGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EscrowDealGroupBy) Strings added in v0.5.0

func (s *EscrowDealGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EscrowDealGroupBy) StringsX added in v0.5.0

func (s *EscrowDealGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EscrowDealMutation added in v0.5.0

type EscrowDealMutation struct {
	// contains filtered or unexported fields
}

EscrowDealMutation represents an operation that mutates the EscrowDeal nodes in the graph.

func (*EscrowDealMutation) AddChainID added in v0.5.0

func (m *EscrowDealMutation) AddChainID(i int64)

AddChainID adds i to the "chain_id" field.

func (*EscrowDealMutation) AddField added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) AddedChainID added in v0.5.0

func (m *EscrowDealMutation) AddedChainID() (r int64, exists bool)

AddedChainID returns the value that was added to the "chain_id" field in this mutation.

func (*EscrowDealMutation) AddedEdges added in v0.5.0

func (m *EscrowDealMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EscrowDealMutation) AddedField added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) AddedFields added in v0.5.0

func (m *EscrowDealMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EscrowDealMutation) AddedIDs added in v0.5.0

func (m *EscrowDealMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EscrowDealMutation) BuyerDid added in v0.5.0

func (m *EscrowDealMutation) BuyerDid() (r string, exists bool)

BuyerDid returns the value of the "buyer_did" field in the mutation.

func (*EscrowDealMutation) ChainID added in v0.5.0

func (m *EscrowDealMutation) ChainID() (r int64, exists bool)

ChainID returns the value of the "chain_id" field in the mutation.

func (*EscrowDealMutation) ChainIDCleared added in v0.5.0

func (m *EscrowDealMutation) ChainIDCleared() bool

ChainIDCleared returns if the "chain_id" field was cleared in this mutation.

func (*EscrowDealMutation) ClearChainID added in v0.5.0

func (m *EscrowDealMutation) ClearChainID()

ClearChainID clears the value of the "chain_id" field.

func (*EscrowDealMutation) ClearDepositTxHash added in v0.5.0

func (m *EscrowDealMutation) ClearDepositTxHash()

ClearDepositTxHash clears the value of the "deposit_tx_hash" field.

func (*EscrowDealMutation) ClearDisputeNote added in v0.5.0

func (m *EscrowDealMutation) ClearDisputeNote()

ClearDisputeNote clears the value of the "dispute_note" field.

func (*EscrowDealMutation) ClearEdge added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) ClearField added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) ClearHubAddress added in v0.5.0

func (m *EscrowDealMutation) ClearHubAddress()

ClearHubAddress clears the value of the "hub_address" field.

func (*EscrowDealMutation) ClearMilestones added in v0.5.0

func (m *EscrowDealMutation) ClearMilestones()

ClearMilestones clears the value of the "milestones" field.

func (*EscrowDealMutation) ClearOnChainDealID added in v0.5.0

func (m *EscrowDealMutation) ClearOnChainDealID()

ClearOnChainDealID clears the value of the "on_chain_deal_id" field.

func (*EscrowDealMutation) ClearReason added in v0.5.0

func (m *EscrowDealMutation) ClearReason()

ClearReason clears the value of the "reason" field.

func (*EscrowDealMutation) ClearRefundTxHash added in v0.5.0

func (m *EscrowDealMutation) ClearRefundTxHash()

ClearRefundTxHash clears the value of the "refund_tx_hash" field.

func (*EscrowDealMutation) ClearReleaseTxHash added in v0.5.0

func (m *EscrowDealMutation) ClearReleaseTxHash()

ClearReleaseTxHash clears the value of the "release_tx_hash" field.

func (*EscrowDealMutation) ClearTaskID added in v0.5.0

func (m *EscrowDealMutation) ClearTaskID()

ClearTaskID clears the value of the "task_id" field.

func (*EscrowDealMutation) ClearedEdges added in v0.5.0

func (m *EscrowDealMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EscrowDealMutation) ClearedFields added in v0.5.0

func (m *EscrowDealMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EscrowDealMutation) Client added in v0.5.0

func (m EscrowDealMutation) 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 (*EscrowDealMutation) CreatedAt added in v0.5.0

func (m *EscrowDealMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*EscrowDealMutation) DepositTxHash added in v0.5.0

func (m *EscrowDealMutation) DepositTxHash() (r string, exists bool)

DepositTxHash returns the value of the "deposit_tx_hash" field in the mutation.

func (*EscrowDealMutation) DepositTxHashCleared added in v0.5.0

func (m *EscrowDealMutation) DepositTxHashCleared() bool

DepositTxHashCleared returns if the "deposit_tx_hash" field was cleared in this mutation.

func (*EscrowDealMutation) DisputeNote added in v0.5.0

func (m *EscrowDealMutation) DisputeNote() (r string, exists bool)

DisputeNote returns the value of the "dispute_note" field in the mutation.

func (*EscrowDealMutation) DisputeNoteCleared added in v0.5.0

func (m *EscrowDealMutation) DisputeNoteCleared() bool

DisputeNoteCleared returns if the "dispute_note" field was cleared in this mutation.

func (*EscrowDealMutation) EdgeCleared added in v0.5.0

func (m *EscrowDealMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EscrowDealMutation) EscrowID added in v0.5.0

func (m *EscrowDealMutation) EscrowID() (r string, exists bool)

EscrowID returns the value of the "escrow_id" field in the mutation.

func (*EscrowDealMutation) ExpiresAt added in v0.5.0

func (m *EscrowDealMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*EscrowDealMutation) Field added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) FieldCleared added in v0.5.0

func (m *EscrowDealMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EscrowDealMutation) Fields added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) HubAddress added in v0.5.0

func (m *EscrowDealMutation) HubAddress() (r string, exists bool)

HubAddress returns the value of the "hub_address" field in the mutation.

func (*EscrowDealMutation) HubAddressCleared added in v0.5.0

func (m *EscrowDealMutation) HubAddressCleared() bool

HubAddressCleared returns if the "hub_address" field was cleared in this mutation.

func (*EscrowDealMutation) ID added in v0.5.0

func (m *EscrowDealMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*EscrowDealMutation) IDs added in v0.5.0

func (m *EscrowDealMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*EscrowDealMutation) Milestones added in v0.5.0

func (m *EscrowDealMutation) Milestones() (r []byte, exists bool)

Milestones returns the value of the "milestones" field in the mutation.

func (*EscrowDealMutation) MilestonesCleared added in v0.5.0

func (m *EscrowDealMutation) MilestonesCleared() bool

MilestonesCleared returns if the "milestones" field was cleared in this mutation.

func (*EscrowDealMutation) OldBuyerDid added in v0.5.0

func (m *EscrowDealMutation) OldBuyerDid(ctx context.Context) (v string, err error)

OldBuyerDid returns the old "buyer_did" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldChainID added in v0.5.0

func (m *EscrowDealMutation) OldChainID(ctx context.Context) (v int64, err error)

OldChainID returns the old "chain_id" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldCreatedAt added in v0.5.0

func (m *EscrowDealMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldDepositTxHash added in v0.5.0

func (m *EscrowDealMutation) OldDepositTxHash(ctx context.Context) (v string, err error)

OldDepositTxHash returns the old "deposit_tx_hash" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldDisputeNote added in v0.5.0

func (m *EscrowDealMutation) OldDisputeNote(ctx context.Context) (v string, err error)

OldDisputeNote returns the old "dispute_note" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldEscrowID added in v0.5.0

func (m *EscrowDealMutation) OldEscrowID(ctx context.Context) (v string, err error)

OldEscrowID returns the old "escrow_id" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldExpiresAt added in v0.5.0

func (m *EscrowDealMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldField added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) OldHubAddress added in v0.5.0

func (m *EscrowDealMutation) OldHubAddress(ctx context.Context) (v string, err error)

OldHubAddress returns the old "hub_address" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldMilestones added in v0.5.0

func (m *EscrowDealMutation) OldMilestones(ctx context.Context) (v []byte, err error)

OldMilestones returns the old "milestones" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldOnChainDealID added in v0.5.0

func (m *EscrowDealMutation) OldOnChainDealID(ctx context.Context) (v string, err error)

OldOnChainDealID returns the old "on_chain_deal_id" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldReason added in v0.5.0

func (m *EscrowDealMutation) OldReason(ctx context.Context) (v string, err error)

OldReason returns the old "reason" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldRefundTxHash added in v0.5.0

func (m *EscrowDealMutation) OldRefundTxHash(ctx context.Context) (v string, err error)

OldRefundTxHash returns the old "refund_tx_hash" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldReleaseTxHash added in v0.5.0

func (m *EscrowDealMutation) OldReleaseTxHash(ctx context.Context) (v string, err error)

OldReleaseTxHash returns the old "release_tx_hash" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldSellerDid added in v0.5.0

func (m *EscrowDealMutation) OldSellerDid(ctx context.Context) (v string, err error)

OldSellerDid returns the old "seller_did" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldStatus added in v0.5.0

func (m *EscrowDealMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old "status" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldTaskID added in v0.5.0

func (m *EscrowDealMutation) OldTaskID(ctx context.Context) (v string, err error)

OldTaskID returns the old "task_id" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldTotalAmount added in v0.5.0

func (m *EscrowDealMutation) OldTotalAmount(ctx context.Context) (v string, err error)

OldTotalAmount returns the old "total_amount" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OldUpdatedAt added in v0.5.0

func (m *EscrowDealMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the EscrowDeal entity. If the EscrowDeal 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 (*EscrowDealMutation) OnChainDealID added in v0.5.0

func (m *EscrowDealMutation) OnChainDealID() (r string, exists bool)

OnChainDealID returns the value of the "on_chain_deal_id" field in the mutation.

func (*EscrowDealMutation) OnChainDealIDCleared added in v0.5.0

func (m *EscrowDealMutation) OnChainDealIDCleared() bool

OnChainDealIDCleared returns if the "on_chain_deal_id" field was cleared in this mutation.

func (*EscrowDealMutation) Op added in v0.5.0

func (m *EscrowDealMutation) Op() Op

Op returns the operation name.

func (*EscrowDealMutation) Reason added in v0.5.0

func (m *EscrowDealMutation) Reason() (r string, exists bool)

Reason returns the value of the "reason" field in the mutation.

func (*EscrowDealMutation) ReasonCleared added in v0.5.0

func (m *EscrowDealMutation) ReasonCleared() bool

ReasonCleared returns if the "reason" field was cleared in this mutation.

func (*EscrowDealMutation) RefundTxHash added in v0.5.0

func (m *EscrowDealMutation) RefundTxHash() (r string, exists bool)

RefundTxHash returns the value of the "refund_tx_hash" field in the mutation.

func (*EscrowDealMutation) RefundTxHashCleared added in v0.5.0

func (m *EscrowDealMutation) RefundTxHashCleared() bool

RefundTxHashCleared returns if the "refund_tx_hash" field was cleared in this mutation.

func (*EscrowDealMutation) ReleaseTxHash added in v0.5.0

func (m *EscrowDealMutation) ReleaseTxHash() (r string, exists bool)

ReleaseTxHash returns the value of the "release_tx_hash" field in the mutation.

func (*EscrowDealMutation) ReleaseTxHashCleared added in v0.5.0

func (m *EscrowDealMutation) ReleaseTxHashCleared() bool

ReleaseTxHashCleared returns if the "release_tx_hash" field was cleared in this mutation.

func (*EscrowDealMutation) RemovedEdges added in v0.5.0

func (m *EscrowDealMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EscrowDealMutation) RemovedIDs added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) ResetBuyerDid added in v0.5.0

func (m *EscrowDealMutation) ResetBuyerDid()

ResetBuyerDid resets all changes to the "buyer_did" field.

func (*EscrowDealMutation) ResetChainID added in v0.5.0

func (m *EscrowDealMutation) ResetChainID()

ResetChainID resets all changes to the "chain_id" field.

func (*EscrowDealMutation) ResetCreatedAt added in v0.5.0

func (m *EscrowDealMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*EscrowDealMutation) ResetDepositTxHash added in v0.5.0

func (m *EscrowDealMutation) ResetDepositTxHash()

ResetDepositTxHash resets all changes to the "deposit_tx_hash" field.

func (*EscrowDealMutation) ResetDisputeNote added in v0.5.0

func (m *EscrowDealMutation) ResetDisputeNote()

ResetDisputeNote resets all changes to the "dispute_note" field.

func (*EscrowDealMutation) ResetEdge added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) ResetEscrowID added in v0.5.0

func (m *EscrowDealMutation) ResetEscrowID()

ResetEscrowID resets all changes to the "escrow_id" field.

func (*EscrowDealMutation) ResetExpiresAt added in v0.5.0

func (m *EscrowDealMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*EscrowDealMutation) ResetField added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) ResetHubAddress added in v0.5.0

func (m *EscrowDealMutation) ResetHubAddress()

ResetHubAddress resets all changes to the "hub_address" field.

func (*EscrowDealMutation) ResetMilestones added in v0.5.0

func (m *EscrowDealMutation) ResetMilestones()

ResetMilestones resets all changes to the "milestones" field.

func (*EscrowDealMutation) ResetOnChainDealID added in v0.5.0

func (m *EscrowDealMutation) ResetOnChainDealID()

ResetOnChainDealID resets all changes to the "on_chain_deal_id" field.

func (*EscrowDealMutation) ResetReason added in v0.5.0

func (m *EscrowDealMutation) ResetReason()

ResetReason resets all changes to the "reason" field.

func (*EscrowDealMutation) ResetRefundTxHash added in v0.5.0

func (m *EscrowDealMutation) ResetRefundTxHash()

ResetRefundTxHash resets all changes to the "refund_tx_hash" field.

func (*EscrowDealMutation) ResetReleaseTxHash added in v0.5.0

func (m *EscrowDealMutation) ResetReleaseTxHash()

ResetReleaseTxHash resets all changes to the "release_tx_hash" field.

func (*EscrowDealMutation) ResetSellerDid added in v0.5.0

func (m *EscrowDealMutation) ResetSellerDid()

ResetSellerDid resets all changes to the "seller_did" field.

func (*EscrowDealMutation) ResetStatus added in v0.5.0

func (m *EscrowDealMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*EscrowDealMutation) ResetTaskID added in v0.5.0

func (m *EscrowDealMutation) ResetTaskID()

ResetTaskID resets all changes to the "task_id" field.

func (*EscrowDealMutation) ResetTotalAmount added in v0.5.0

func (m *EscrowDealMutation) ResetTotalAmount()

ResetTotalAmount resets all changes to the "total_amount" field.

func (*EscrowDealMutation) ResetUpdatedAt added in v0.5.0

func (m *EscrowDealMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*EscrowDealMutation) SellerDid added in v0.5.0

func (m *EscrowDealMutation) SellerDid() (r string, exists bool)

SellerDid returns the value of the "seller_did" field in the mutation.

func (*EscrowDealMutation) SetBuyerDid added in v0.5.0

func (m *EscrowDealMutation) SetBuyerDid(s string)

SetBuyerDid sets the "buyer_did" field.

func (*EscrowDealMutation) SetChainID added in v0.5.0

func (m *EscrowDealMutation) SetChainID(i int64)

SetChainID sets the "chain_id" field.

func (*EscrowDealMutation) SetCreatedAt added in v0.5.0

func (m *EscrowDealMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*EscrowDealMutation) SetDepositTxHash added in v0.5.0

func (m *EscrowDealMutation) SetDepositTxHash(s string)

SetDepositTxHash sets the "deposit_tx_hash" field.

func (*EscrowDealMutation) SetDisputeNote added in v0.5.0

func (m *EscrowDealMutation) SetDisputeNote(s string)

SetDisputeNote sets the "dispute_note" field.

func (*EscrowDealMutation) SetEscrowID added in v0.5.0

func (m *EscrowDealMutation) SetEscrowID(s string)

SetEscrowID sets the "escrow_id" field.

func (*EscrowDealMutation) SetExpiresAt added in v0.5.0

func (m *EscrowDealMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*EscrowDealMutation) SetField added in v0.5.0

func (m *EscrowDealMutation) 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 (*EscrowDealMutation) SetHubAddress added in v0.5.0

func (m *EscrowDealMutation) SetHubAddress(s string)

SetHubAddress sets the "hub_address" field.

func (*EscrowDealMutation) SetMilestones added in v0.5.0

func (m *EscrowDealMutation) SetMilestones(b []byte)

SetMilestones sets the "milestones" field.

func (*EscrowDealMutation) SetOnChainDealID added in v0.5.0

func (m *EscrowDealMutation) SetOnChainDealID(s string)

SetOnChainDealID sets the "on_chain_deal_id" field.

func (*EscrowDealMutation) SetOp added in v0.5.0

func (m *EscrowDealMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EscrowDealMutation) SetReason added in v0.5.0

func (m *EscrowDealMutation) SetReason(s string)

SetReason sets the "reason" field.

func (*EscrowDealMutation) SetRefundTxHash added in v0.5.0

func (m *EscrowDealMutation) SetRefundTxHash(s string)

SetRefundTxHash sets the "refund_tx_hash" field.

func (*EscrowDealMutation) SetReleaseTxHash added in v0.5.0

func (m *EscrowDealMutation) SetReleaseTxHash(s string)

SetReleaseTxHash sets the "release_tx_hash" field.

func (*EscrowDealMutation) SetSellerDid added in v0.5.0

func (m *EscrowDealMutation) SetSellerDid(s string)

SetSellerDid sets the "seller_did" field.

func (*EscrowDealMutation) SetStatus added in v0.5.0

func (m *EscrowDealMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*EscrowDealMutation) SetTaskID added in v0.5.0

func (m *EscrowDealMutation) SetTaskID(s string)

SetTaskID sets the "task_id" field.

func (*EscrowDealMutation) SetTotalAmount added in v0.5.0

func (m *EscrowDealMutation) SetTotalAmount(s string)

SetTotalAmount sets the "total_amount" field.

func (*EscrowDealMutation) SetUpdatedAt added in v0.5.0

func (m *EscrowDealMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*EscrowDealMutation) Status added in v0.5.0

func (m *EscrowDealMutation) Status() (r string, exists bool)

Status returns the value of the "status" field in the mutation.

func (*EscrowDealMutation) TaskID added in v0.5.0

func (m *EscrowDealMutation) TaskID() (r string, exists bool)

TaskID returns the value of the "task_id" field in the mutation.

func (*EscrowDealMutation) TaskIDCleared added in v0.5.0

func (m *EscrowDealMutation) TaskIDCleared() bool

TaskIDCleared returns if the "task_id" field was cleared in this mutation.

func (*EscrowDealMutation) TotalAmount added in v0.5.0

func (m *EscrowDealMutation) TotalAmount() (r string, exists bool)

TotalAmount returns the value of the "total_amount" field in the mutation.

func (EscrowDealMutation) Tx added in v0.5.0

func (m EscrowDealMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EscrowDealMutation) Type added in v0.5.0

func (m *EscrowDealMutation) Type() string

Type returns the node type of this mutation (EscrowDeal).

func (*EscrowDealMutation) UpdatedAt added in v0.5.0

func (m *EscrowDealMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*EscrowDealMutation) Where added in v0.5.0

func (m *EscrowDealMutation) Where(ps ...predicate.EscrowDeal)

Where appends a list predicates to the EscrowDealMutation builder.

func (*EscrowDealMutation) WhereP added in v0.5.0

func (m *EscrowDealMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EscrowDealMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EscrowDealQuery added in v0.5.0

type EscrowDealQuery struct {
	// contains filtered or unexported fields
}

EscrowDealQuery is the builder for querying EscrowDeal entities.

func (*EscrowDealQuery) Aggregate added in v0.5.0

func (_q *EscrowDealQuery) Aggregate(fns ...AggregateFunc) *EscrowDealSelect

Aggregate returns a EscrowDealSelect configured with the given aggregations.

func (*EscrowDealQuery) All added in v0.5.0

func (_q *EscrowDealQuery) All(ctx context.Context) ([]*EscrowDeal, error)

All executes the query and returns a list of EscrowDeals.

func (*EscrowDealQuery) AllX added in v0.5.0

func (_q *EscrowDealQuery) AllX(ctx context.Context) []*EscrowDeal

AllX is like All, but panics if an error occurs.

func (*EscrowDealQuery) Clone added in v0.5.0

func (_q *EscrowDealQuery) Clone() *EscrowDealQuery

Clone returns a duplicate of the EscrowDealQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EscrowDealQuery) Count added in v0.5.0

func (_q *EscrowDealQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EscrowDealQuery) CountX added in v0.5.0

func (_q *EscrowDealQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EscrowDealQuery) Exist added in v0.5.0

func (_q *EscrowDealQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EscrowDealQuery) ExistX added in v0.5.0

func (_q *EscrowDealQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EscrowDealQuery) First added in v0.5.0

func (_q *EscrowDealQuery) First(ctx context.Context) (*EscrowDeal, error)

First returns the first EscrowDeal entity from the query. Returns a *NotFoundError when no EscrowDeal was found.

func (*EscrowDealQuery) FirstID added in v0.5.0

func (_q *EscrowDealQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first EscrowDeal ID from the query. Returns a *NotFoundError when no EscrowDeal ID was found.

func (*EscrowDealQuery) FirstIDX added in v0.5.0

func (_q *EscrowDealQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EscrowDealQuery) FirstX added in v0.5.0

func (_q *EscrowDealQuery) FirstX(ctx context.Context) *EscrowDeal

FirstX is like First, but panics if an error occurs.

func (*EscrowDealQuery) GroupBy added in v0.5.0

func (_q *EscrowDealQuery) GroupBy(field string, fields ...string) *EscrowDealGroupBy

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 {
	EscrowID string `json:"escrow_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.EscrowDeal.Query().
	GroupBy(escrowdeal.FieldEscrowID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EscrowDealQuery) IDs added in v0.5.0

func (_q *EscrowDealQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of EscrowDeal IDs.

func (*EscrowDealQuery) IDsX added in v0.5.0

func (_q *EscrowDealQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EscrowDealQuery) Limit added in v0.5.0

func (_q *EscrowDealQuery) Limit(limit int) *EscrowDealQuery

Limit the number of records to be returned by this query.

func (*EscrowDealQuery) Offset added in v0.5.0

func (_q *EscrowDealQuery) Offset(offset int) *EscrowDealQuery

Offset to start from.

func (*EscrowDealQuery) Only added in v0.5.0

func (_q *EscrowDealQuery) Only(ctx context.Context) (*EscrowDeal, error)

Only returns a single EscrowDeal entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one EscrowDeal entity is found. Returns a *NotFoundError when no EscrowDeal entities are found.

func (*EscrowDealQuery) OnlyID added in v0.5.0

func (_q *EscrowDealQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only EscrowDeal ID in the query. Returns a *NotSingularError when more than one EscrowDeal ID is found. Returns a *NotFoundError when no entities are found.

func (*EscrowDealQuery) OnlyIDX added in v0.5.0

func (_q *EscrowDealQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EscrowDealQuery) OnlyX added in v0.5.0

func (_q *EscrowDealQuery) OnlyX(ctx context.Context) *EscrowDeal

OnlyX is like Only, but panics if an error occurs.

func (*EscrowDealQuery) Order added in v0.5.0

Order specifies how the records should be ordered.

func (*EscrowDealQuery) Select added in v0.5.0

func (_q *EscrowDealQuery) Select(fields ...string) *EscrowDealSelect

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 {
	EscrowID string `json:"escrow_id,omitempty"`
}

client.EscrowDeal.Query().
	Select(escrowdeal.FieldEscrowID).
	Scan(ctx, &v)

func (*EscrowDealQuery) Unique added in v0.5.0

func (_q *EscrowDealQuery) Unique(unique bool) *EscrowDealQuery

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 (*EscrowDealQuery) Where added in v0.5.0

Where adds a new predicate for the EscrowDealQuery builder.

type EscrowDealSelect added in v0.5.0

type EscrowDealSelect struct {
	*EscrowDealQuery
	// contains filtered or unexported fields
}

EscrowDealSelect is the builder for selecting fields of EscrowDeal entities.

func (*EscrowDealSelect) Aggregate added in v0.5.0

func (_s *EscrowDealSelect) Aggregate(fns ...AggregateFunc) *EscrowDealSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EscrowDealSelect) Bool added in v0.5.0

func (s *EscrowDealSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) BoolX added in v0.5.0

func (s *EscrowDealSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EscrowDealSelect) Bools added in v0.5.0

func (s *EscrowDealSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) BoolsX added in v0.5.0

func (s *EscrowDealSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EscrowDealSelect) Float64 added in v0.5.0

func (s *EscrowDealSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) Float64X added in v0.5.0

func (s *EscrowDealSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EscrowDealSelect) Float64s added in v0.5.0

func (s *EscrowDealSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) Float64sX added in v0.5.0

func (s *EscrowDealSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EscrowDealSelect) Int added in v0.5.0

func (s *EscrowDealSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) IntX added in v0.5.0

func (s *EscrowDealSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EscrowDealSelect) Ints added in v0.5.0

func (s *EscrowDealSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) IntsX added in v0.5.0

func (s *EscrowDealSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EscrowDealSelect) Scan added in v0.5.0

func (_s *EscrowDealSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EscrowDealSelect) ScanX added in v0.5.0

func (s *EscrowDealSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EscrowDealSelect) String added in v0.5.0

func (s *EscrowDealSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) StringX added in v0.5.0

func (s *EscrowDealSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EscrowDealSelect) Strings added in v0.5.0

func (s *EscrowDealSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EscrowDealSelect) StringsX added in v0.5.0

func (s *EscrowDealSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EscrowDealUpdate added in v0.5.0

type EscrowDealUpdate struct {
	// contains filtered or unexported fields
}

EscrowDealUpdate is the builder for updating EscrowDeal entities.

func (*EscrowDealUpdate) AddChainID added in v0.5.0

func (_u *EscrowDealUpdate) AddChainID(v int64) *EscrowDealUpdate

AddChainID adds value to the "chain_id" field.

func (*EscrowDealUpdate) ClearChainID added in v0.5.0

func (_u *EscrowDealUpdate) ClearChainID() *EscrowDealUpdate

ClearChainID clears the value of the "chain_id" field.

func (*EscrowDealUpdate) ClearDepositTxHash added in v0.5.0

func (_u *EscrowDealUpdate) ClearDepositTxHash() *EscrowDealUpdate

ClearDepositTxHash clears the value of the "deposit_tx_hash" field.

func (*EscrowDealUpdate) ClearDisputeNote added in v0.5.0

func (_u *EscrowDealUpdate) ClearDisputeNote() *EscrowDealUpdate

ClearDisputeNote clears the value of the "dispute_note" field.

func (*EscrowDealUpdate) ClearHubAddress added in v0.5.0

func (_u *EscrowDealUpdate) ClearHubAddress() *EscrowDealUpdate

ClearHubAddress clears the value of the "hub_address" field.

func (*EscrowDealUpdate) ClearMilestones added in v0.5.0

func (_u *EscrowDealUpdate) ClearMilestones() *EscrowDealUpdate

ClearMilestones clears the value of the "milestones" field.

func (*EscrowDealUpdate) ClearOnChainDealID added in v0.5.0

func (_u *EscrowDealUpdate) ClearOnChainDealID() *EscrowDealUpdate

ClearOnChainDealID clears the value of the "on_chain_deal_id" field.

func (*EscrowDealUpdate) ClearReason added in v0.5.0

func (_u *EscrowDealUpdate) ClearReason() *EscrowDealUpdate

ClearReason clears the value of the "reason" field.

func (*EscrowDealUpdate) ClearRefundTxHash added in v0.5.0

func (_u *EscrowDealUpdate) ClearRefundTxHash() *EscrowDealUpdate

ClearRefundTxHash clears the value of the "refund_tx_hash" field.

func (*EscrowDealUpdate) ClearReleaseTxHash added in v0.5.0

func (_u *EscrowDealUpdate) ClearReleaseTxHash() *EscrowDealUpdate

ClearReleaseTxHash clears the value of the "release_tx_hash" field.

func (*EscrowDealUpdate) ClearTaskID added in v0.5.0

func (_u *EscrowDealUpdate) ClearTaskID() *EscrowDealUpdate

ClearTaskID clears the value of the "task_id" field.

func (*EscrowDealUpdate) Exec added in v0.5.0

func (_u *EscrowDealUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EscrowDealUpdate) ExecX added in v0.5.0

func (_u *EscrowDealUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EscrowDealUpdate) Mutation added in v0.5.0

func (_u *EscrowDealUpdate) Mutation() *EscrowDealMutation

Mutation returns the EscrowDealMutation object of the builder.

func (*EscrowDealUpdate) Save added in v0.5.0

func (_u *EscrowDealUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EscrowDealUpdate) SaveX added in v0.5.0

func (_u *EscrowDealUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EscrowDealUpdate) SetBuyerDid added in v0.5.0

func (_u *EscrowDealUpdate) SetBuyerDid(v string) *EscrowDealUpdate

SetBuyerDid sets the "buyer_did" field.

func (*EscrowDealUpdate) SetChainID added in v0.5.0

func (_u *EscrowDealUpdate) SetChainID(v int64) *EscrowDealUpdate

SetChainID sets the "chain_id" field.

func (*EscrowDealUpdate) SetDepositTxHash added in v0.5.0

func (_u *EscrowDealUpdate) SetDepositTxHash(v string) *EscrowDealUpdate

SetDepositTxHash sets the "deposit_tx_hash" field.

func (*EscrowDealUpdate) SetDisputeNote added in v0.5.0

func (_u *EscrowDealUpdate) SetDisputeNote(v string) *EscrowDealUpdate

SetDisputeNote sets the "dispute_note" field.

func (*EscrowDealUpdate) SetEscrowID added in v0.5.0

func (_u *EscrowDealUpdate) SetEscrowID(v string) *EscrowDealUpdate

SetEscrowID sets the "escrow_id" field.

func (*EscrowDealUpdate) SetExpiresAt added in v0.5.0

func (_u *EscrowDealUpdate) SetExpiresAt(v time.Time) *EscrowDealUpdate

SetExpiresAt sets the "expires_at" field.

func (*EscrowDealUpdate) SetHubAddress added in v0.5.0

func (_u *EscrowDealUpdate) SetHubAddress(v string) *EscrowDealUpdate

SetHubAddress sets the "hub_address" field.

func (*EscrowDealUpdate) SetMilestones added in v0.5.0

func (_u *EscrowDealUpdate) SetMilestones(v []byte) *EscrowDealUpdate

SetMilestones sets the "milestones" field.

func (*EscrowDealUpdate) SetNillableBuyerDid added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableBuyerDid(v *string) *EscrowDealUpdate

SetNillableBuyerDid sets the "buyer_did" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableChainID added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableChainID(v *int64) *EscrowDealUpdate

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableDepositTxHash added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableDepositTxHash(v *string) *EscrowDealUpdate

SetNillableDepositTxHash sets the "deposit_tx_hash" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableDisputeNote added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableDisputeNote(v *string) *EscrowDealUpdate

SetNillableDisputeNote sets the "dispute_note" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableEscrowID added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableEscrowID(v *string) *EscrowDealUpdate

SetNillableEscrowID sets the "escrow_id" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableExpiresAt added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableExpiresAt(v *time.Time) *EscrowDealUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableHubAddress added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableHubAddress(v *string) *EscrowDealUpdate

SetNillableHubAddress sets the "hub_address" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableOnChainDealID added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableOnChainDealID(v *string) *EscrowDealUpdate

SetNillableOnChainDealID sets the "on_chain_deal_id" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableReason added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableReason(v *string) *EscrowDealUpdate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableRefundTxHash added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableRefundTxHash(v *string) *EscrowDealUpdate

SetNillableRefundTxHash sets the "refund_tx_hash" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableReleaseTxHash added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableReleaseTxHash(v *string) *EscrowDealUpdate

SetNillableReleaseTxHash sets the "release_tx_hash" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableSellerDid added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableSellerDid(v *string) *EscrowDealUpdate

SetNillableSellerDid sets the "seller_did" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableStatus added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableStatus(v *string) *EscrowDealUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableTaskID added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableTaskID(v *string) *EscrowDealUpdate

SetNillableTaskID sets the "task_id" field if the given value is not nil.

func (*EscrowDealUpdate) SetNillableTotalAmount added in v0.5.0

func (_u *EscrowDealUpdate) SetNillableTotalAmount(v *string) *EscrowDealUpdate

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*EscrowDealUpdate) SetOnChainDealID added in v0.5.0

func (_u *EscrowDealUpdate) SetOnChainDealID(v string) *EscrowDealUpdate

SetOnChainDealID sets the "on_chain_deal_id" field.

func (*EscrowDealUpdate) SetReason added in v0.5.0

func (_u *EscrowDealUpdate) SetReason(v string) *EscrowDealUpdate

SetReason sets the "reason" field.

func (*EscrowDealUpdate) SetRefundTxHash added in v0.5.0

func (_u *EscrowDealUpdate) SetRefundTxHash(v string) *EscrowDealUpdate

SetRefundTxHash sets the "refund_tx_hash" field.

func (*EscrowDealUpdate) SetReleaseTxHash added in v0.5.0

func (_u *EscrowDealUpdate) SetReleaseTxHash(v string) *EscrowDealUpdate

SetReleaseTxHash sets the "release_tx_hash" field.

func (*EscrowDealUpdate) SetSellerDid added in v0.5.0

func (_u *EscrowDealUpdate) SetSellerDid(v string) *EscrowDealUpdate

SetSellerDid sets the "seller_did" field.

func (*EscrowDealUpdate) SetStatus added in v0.5.0

func (_u *EscrowDealUpdate) SetStatus(v string) *EscrowDealUpdate

SetStatus sets the "status" field.

func (*EscrowDealUpdate) SetTaskID added in v0.5.0

func (_u *EscrowDealUpdate) SetTaskID(v string) *EscrowDealUpdate

SetTaskID sets the "task_id" field.

func (*EscrowDealUpdate) SetTotalAmount added in v0.5.0

func (_u *EscrowDealUpdate) SetTotalAmount(v string) *EscrowDealUpdate

SetTotalAmount sets the "total_amount" field.

func (*EscrowDealUpdate) SetUpdatedAt added in v0.5.0

func (_u *EscrowDealUpdate) SetUpdatedAt(v time.Time) *EscrowDealUpdate

SetUpdatedAt sets the "updated_at" field.

func (*EscrowDealUpdate) Where added in v0.5.0

Where appends a list predicates to the EscrowDealUpdate builder.

type EscrowDealUpdateOne added in v0.5.0

type EscrowDealUpdateOne struct {
	// contains filtered or unexported fields
}

EscrowDealUpdateOne is the builder for updating a single EscrowDeal entity.

func (*EscrowDealUpdateOne) AddChainID added in v0.5.0

func (_u *EscrowDealUpdateOne) AddChainID(v int64) *EscrowDealUpdateOne

AddChainID adds value to the "chain_id" field.

func (*EscrowDealUpdateOne) ClearChainID added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearChainID() *EscrowDealUpdateOne

ClearChainID clears the value of the "chain_id" field.

func (*EscrowDealUpdateOne) ClearDepositTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearDepositTxHash() *EscrowDealUpdateOne

ClearDepositTxHash clears the value of the "deposit_tx_hash" field.

func (*EscrowDealUpdateOne) ClearDisputeNote added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearDisputeNote() *EscrowDealUpdateOne

ClearDisputeNote clears the value of the "dispute_note" field.

func (*EscrowDealUpdateOne) ClearHubAddress added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearHubAddress() *EscrowDealUpdateOne

ClearHubAddress clears the value of the "hub_address" field.

func (*EscrowDealUpdateOne) ClearMilestones added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearMilestones() *EscrowDealUpdateOne

ClearMilestones clears the value of the "milestones" field.

func (*EscrowDealUpdateOne) ClearOnChainDealID added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearOnChainDealID() *EscrowDealUpdateOne

ClearOnChainDealID clears the value of the "on_chain_deal_id" field.

func (*EscrowDealUpdateOne) ClearReason added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearReason() *EscrowDealUpdateOne

ClearReason clears the value of the "reason" field.

func (*EscrowDealUpdateOne) ClearRefundTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearRefundTxHash() *EscrowDealUpdateOne

ClearRefundTxHash clears the value of the "refund_tx_hash" field.

func (*EscrowDealUpdateOne) ClearReleaseTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearReleaseTxHash() *EscrowDealUpdateOne

ClearReleaseTxHash clears the value of the "release_tx_hash" field.

func (*EscrowDealUpdateOne) ClearTaskID added in v0.5.0

func (_u *EscrowDealUpdateOne) ClearTaskID() *EscrowDealUpdateOne

ClearTaskID clears the value of the "task_id" field.

func (*EscrowDealUpdateOne) Exec added in v0.5.0

func (_u *EscrowDealUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EscrowDealUpdateOne) ExecX added in v0.5.0

func (_u *EscrowDealUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EscrowDealUpdateOne) Mutation added in v0.5.0

func (_u *EscrowDealUpdateOne) Mutation() *EscrowDealMutation

Mutation returns the EscrowDealMutation object of the builder.

func (*EscrowDealUpdateOne) Save added in v0.5.0

Save executes the query and returns the updated EscrowDeal entity.

func (*EscrowDealUpdateOne) SaveX added in v0.5.0

SaveX is like Save, but panics if an error occurs.

func (*EscrowDealUpdateOne) Select added in v0.5.0

func (_u *EscrowDealUpdateOne) Select(field string, fields ...string) *EscrowDealUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EscrowDealUpdateOne) SetBuyerDid added in v0.5.0

func (_u *EscrowDealUpdateOne) SetBuyerDid(v string) *EscrowDealUpdateOne

SetBuyerDid sets the "buyer_did" field.

func (*EscrowDealUpdateOne) SetChainID added in v0.5.0

func (_u *EscrowDealUpdateOne) SetChainID(v int64) *EscrowDealUpdateOne

SetChainID sets the "chain_id" field.

func (*EscrowDealUpdateOne) SetDepositTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) SetDepositTxHash(v string) *EscrowDealUpdateOne

SetDepositTxHash sets the "deposit_tx_hash" field.

func (*EscrowDealUpdateOne) SetDisputeNote added in v0.5.0

func (_u *EscrowDealUpdateOne) SetDisputeNote(v string) *EscrowDealUpdateOne

SetDisputeNote sets the "dispute_note" field.

func (*EscrowDealUpdateOne) SetEscrowID added in v0.5.0

func (_u *EscrowDealUpdateOne) SetEscrowID(v string) *EscrowDealUpdateOne

SetEscrowID sets the "escrow_id" field.

func (*EscrowDealUpdateOne) SetExpiresAt added in v0.5.0

func (_u *EscrowDealUpdateOne) SetExpiresAt(v time.Time) *EscrowDealUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*EscrowDealUpdateOne) SetHubAddress added in v0.5.0

func (_u *EscrowDealUpdateOne) SetHubAddress(v string) *EscrowDealUpdateOne

SetHubAddress sets the "hub_address" field.

func (*EscrowDealUpdateOne) SetMilestones added in v0.5.0

func (_u *EscrowDealUpdateOne) SetMilestones(v []byte) *EscrowDealUpdateOne

SetMilestones sets the "milestones" field.

func (*EscrowDealUpdateOne) SetNillableBuyerDid added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableBuyerDid(v *string) *EscrowDealUpdateOne

SetNillableBuyerDid sets the "buyer_did" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableChainID added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableChainID(v *int64) *EscrowDealUpdateOne

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableDepositTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableDepositTxHash(v *string) *EscrowDealUpdateOne

SetNillableDepositTxHash sets the "deposit_tx_hash" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableDisputeNote added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableDisputeNote(v *string) *EscrowDealUpdateOne

SetNillableDisputeNote sets the "dispute_note" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableEscrowID added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableEscrowID(v *string) *EscrowDealUpdateOne

SetNillableEscrowID sets the "escrow_id" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableExpiresAt added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableExpiresAt(v *time.Time) *EscrowDealUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableHubAddress added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableHubAddress(v *string) *EscrowDealUpdateOne

SetNillableHubAddress sets the "hub_address" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableOnChainDealID added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableOnChainDealID(v *string) *EscrowDealUpdateOne

SetNillableOnChainDealID sets the "on_chain_deal_id" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableReason added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableReason(v *string) *EscrowDealUpdateOne

SetNillableReason sets the "reason" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableRefundTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableRefundTxHash(v *string) *EscrowDealUpdateOne

SetNillableRefundTxHash sets the "refund_tx_hash" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableReleaseTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableReleaseTxHash(v *string) *EscrowDealUpdateOne

SetNillableReleaseTxHash sets the "release_tx_hash" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableSellerDid added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableSellerDid(v *string) *EscrowDealUpdateOne

SetNillableSellerDid sets the "seller_did" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableStatus added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableStatus(v *string) *EscrowDealUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableTaskID added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableTaskID(v *string) *EscrowDealUpdateOne

SetNillableTaskID sets the "task_id" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetNillableTotalAmount added in v0.5.0

func (_u *EscrowDealUpdateOne) SetNillableTotalAmount(v *string) *EscrowDealUpdateOne

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*EscrowDealUpdateOne) SetOnChainDealID added in v0.5.0

func (_u *EscrowDealUpdateOne) SetOnChainDealID(v string) *EscrowDealUpdateOne

SetOnChainDealID sets the "on_chain_deal_id" field.

func (*EscrowDealUpdateOne) SetReason added in v0.5.0

SetReason sets the "reason" field.

func (*EscrowDealUpdateOne) SetRefundTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) SetRefundTxHash(v string) *EscrowDealUpdateOne

SetRefundTxHash sets the "refund_tx_hash" field.

func (*EscrowDealUpdateOne) SetReleaseTxHash added in v0.5.0

func (_u *EscrowDealUpdateOne) SetReleaseTxHash(v string) *EscrowDealUpdateOne

SetReleaseTxHash sets the "release_tx_hash" field.

func (*EscrowDealUpdateOne) SetSellerDid added in v0.5.0

func (_u *EscrowDealUpdateOne) SetSellerDid(v string) *EscrowDealUpdateOne

SetSellerDid sets the "seller_did" field.

func (*EscrowDealUpdateOne) SetStatus added in v0.5.0

SetStatus sets the "status" field.

func (*EscrowDealUpdateOne) SetTaskID added in v0.5.0

SetTaskID sets the "task_id" field.

func (*EscrowDealUpdateOne) SetTotalAmount added in v0.5.0

func (_u *EscrowDealUpdateOne) SetTotalAmount(v string) *EscrowDealUpdateOne

SetTotalAmount sets the "total_amount" field.

func (*EscrowDealUpdateOne) SetUpdatedAt added in v0.5.0

func (_u *EscrowDealUpdateOne) SetUpdatedAt(v time.Time) *EscrowDealUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*EscrowDealUpdateOne) Where added in v0.5.0

Where appends a list predicates to the EscrowDealUpdate builder.

type EscrowDeals added in v0.5.0

type EscrowDeals []*EscrowDeal

EscrowDeals is a parsable slice of EscrowDeal.

type ExternalRef

type ExternalRef struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// RefType holds the value of the "ref_type" field.
	RefType externalref.RefType `json:"ref_type,omitempty"`
	// Location holds the value of the "location" field.
	Location string `json:"location,omitempty"`
	// Summary holds the value of the "summary" field.
	Summary string `json:"summary,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

ExternalRef is the model entity for the ExternalRef schema.

func (*ExternalRef) String

func (_m *ExternalRef) String() string

String implements the fmt.Stringer.

func (*ExternalRef) Unwrap

func (_m *ExternalRef) Unwrap() *ExternalRef

Unwrap unwraps the ExternalRef 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 (*ExternalRef) Update

func (_m *ExternalRef) Update() *ExternalRefUpdateOne

Update returns a builder for updating this ExternalRef. Note that you need to call ExternalRef.Unwrap() before calling this method if this ExternalRef was returned from a transaction, and the transaction was committed or rolled back.

func (*ExternalRef) Value

func (_m *ExternalRef) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ExternalRef. This includes values selected through modifiers, order, etc.

type ExternalRefClient

type ExternalRefClient struct {
	// contains filtered or unexported fields
}

ExternalRefClient is a client for the ExternalRef schema.

func NewExternalRefClient

func NewExternalRefClient(c config) *ExternalRefClient

NewExternalRefClient returns a client for the ExternalRef from the given config.

func (*ExternalRefClient) Create

func (c *ExternalRefClient) Create() *ExternalRefCreate

Create returns a builder for creating a ExternalRef entity.

func (*ExternalRefClient) CreateBulk

func (c *ExternalRefClient) CreateBulk(builders ...*ExternalRefCreate) *ExternalRefCreateBulk

CreateBulk returns a builder for creating a bulk of ExternalRef entities.

func (*ExternalRefClient) Delete

func (c *ExternalRefClient) Delete() *ExternalRefDelete

Delete returns a delete builder for ExternalRef.

func (*ExternalRefClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ExternalRefClient) DeleteOneID

func (c *ExternalRefClient) DeleteOneID(id uuid.UUID) *ExternalRefDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ExternalRefClient) Get

Get returns a ExternalRef entity by its id.

func (*ExternalRefClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ExternalRefClient) Hooks

func (c *ExternalRefClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ExternalRefClient) Intercept

func (c *ExternalRefClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `externalref.Intercept(f(g(h())))`.

func (*ExternalRefClient) Interceptors

func (c *ExternalRefClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ExternalRefClient) MapCreateBulk

func (c *ExternalRefClient) MapCreateBulk(slice any, setFunc func(*ExternalRefCreate, int)) *ExternalRefCreateBulk

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 (*ExternalRefClient) Query

func (c *ExternalRefClient) Query() *ExternalRefQuery

Query returns a query builder for ExternalRef.

func (*ExternalRefClient) Update

func (c *ExternalRefClient) Update() *ExternalRefUpdate

Update returns an update builder for ExternalRef.

func (*ExternalRefClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ExternalRefClient) UpdateOneID

func (c *ExternalRefClient) UpdateOneID(id uuid.UUID) *ExternalRefUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ExternalRefClient) Use

func (c *ExternalRefClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `externalref.Hooks(f(g(h())))`.

type ExternalRefCreate

type ExternalRefCreate struct {
	// contains filtered or unexported fields
}

ExternalRefCreate is the builder for creating a ExternalRef entity.

func (*ExternalRefCreate) Exec

func (_c *ExternalRefCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ExternalRefCreate) ExecX

func (_c *ExternalRefCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExternalRefCreate) Mutation

func (_c *ExternalRefCreate) Mutation() *ExternalRefMutation

Mutation returns the ExternalRefMutation object of the builder.

func (*ExternalRefCreate) Save

Save creates the ExternalRef in the database.

func (*ExternalRefCreate) SaveX

func (_c *ExternalRefCreate) SaveX(ctx context.Context) *ExternalRef

SaveX calls Save and panics if Save returns an error.

func (*ExternalRefCreate) SetCreatedAt

func (_c *ExternalRefCreate) SetCreatedAt(v time.Time) *ExternalRefCreate

SetCreatedAt sets the "created_at" field.

func (*ExternalRefCreate) SetID

SetID sets the "id" field.

func (*ExternalRefCreate) SetLocation

func (_c *ExternalRefCreate) SetLocation(v string) *ExternalRefCreate

SetLocation sets the "location" field.

func (*ExternalRefCreate) SetMetadata

func (_c *ExternalRefCreate) SetMetadata(v map[string]interface{}) *ExternalRefCreate

SetMetadata sets the "metadata" field.

func (*ExternalRefCreate) SetName

func (_c *ExternalRefCreate) SetName(v string) *ExternalRefCreate

SetName sets the "name" field.

func (*ExternalRefCreate) SetNillableCreatedAt

func (_c *ExternalRefCreate) SetNillableCreatedAt(v *time.Time) *ExternalRefCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ExternalRefCreate) SetNillableID

func (_c *ExternalRefCreate) SetNillableID(v *uuid.UUID) *ExternalRefCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ExternalRefCreate) SetNillableSummary

func (_c *ExternalRefCreate) SetNillableSummary(v *string) *ExternalRefCreate

SetNillableSummary sets the "summary" field if the given value is not nil.

func (*ExternalRefCreate) SetNillableUpdatedAt

func (_c *ExternalRefCreate) SetNillableUpdatedAt(v *time.Time) *ExternalRefCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ExternalRefCreate) SetRefType

SetRefType sets the "ref_type" field.

func (*ExternalRefCreate) SetSummary

func (_c *ExternalRefCreate) SetSummary(v string) *ExternalRefCreate

SetSummary sets the "summary" field.

func (*ExternalRefCreate) SetUpdatedAt

func (_c *ExternalRefCreate) SetUpdatedAt(v time.Time) *ExternalRefCreate

SetUpdatedAt sets the "updated_at" field.

type ExternalRefCreateBulk

type ExternalRefCreateBulk struct {
	// contains filtered or unexported fields
}

ExternalRefCreateBulk is the builder for creating many ExternalRef entities in bulk.

func (*ExternalRefCreateBulk) Exec

Exec executes the query.

func (*ExternalRefCreateBulk) ExecX

func (_c *ExternalRefCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExternalRefCreateBulk) Save

Save creates the ExternalRef entities in the database.

func (*ExternalRefCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ExternalRefDelete

type ExternalRefDelete struct {
	// contains filtered or unexported fields
}

ExternalRefDelete is the builder for deleting a ExternalRef entity.

func (*ExternalRefDelete) Exec

func (_d *ExternalRefDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ExternalRefDelete) ExecX

func (_d *ExternalRefDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ExternalRefDelete) Where

Where appends a list predicates to the ExternalRefDelete builder.

type ExternalRefDeleteOne

type ExternalRefDeleteOne struct {
	// contains filtered or unexported fields
}

ExternalRefDeleteOne is the builder for deleting a single ExternalRef entity.

func (*ExternalRefDeleteOne) Exec

func (_d *ExternalRefDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ExternalRefDeleteOne) ExecX

func (_d *ExternalRefDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExternalRefDeleteOne) Where

Where appends a list predicates to the ExternalRefDelete builder.

type ExternalRefGroupBy

type ExternalRefGroupBy struct {
	// contains filtered or unexported fields
}

ExternalRefGroupBy is the group-by builder for ExternalRef entities.

func (*ExternalRefGroupBy) Aggregate

func (_g *ExternalRefGroupBy) Aggregate(fns ...AggregateFunc) *ExternalRefGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ExternalRefGroupBy) Bool

func (s *ExternalRefGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) BoolX

func (s *ExternalRefGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ExternalRefGroupBy) Bools

func (s *ExternalRefGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) BoolsX

func (s *ExternalRefGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ExternalRefGroupBy) Float64

func (s *ExternalRefGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) Float64X

func (s *ExternalRefGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ExternalRefGroupBy) Float64s

func (s *ExternalRefGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) Float64sX

func (s *ExternalRefGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ExternalRefGroupBy) Int

func (s *ExternalRefGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) IntX

func (s *ExternalRefGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ExternalRefGroupBy) Ints

func (s *ExternalRefGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) IntsX

func (s *ExternalRefGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ExternalRefGroupBy) Scan

func (_g *ExternalRefGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ExternalRefGroupBy) ScanX

func (s *ExternalRefGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ExternalRefGroupBy) String

func (s *ExternalRefGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) StringX

func (s *ExternalRefGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ExternalRefGroupBy) Strings

func (s *ExternalRefGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ExternalRefGroupBy) StringsX

func (s *ExternalRefGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ExternalRefMutation

type ExternalRefMutation struct {
	// contains filtered or unexported fields
}

ExternalRefMutation represents an operation that mutates the ExternalRef nodes in the graph.

func (*ExternalRefMutation) AddField

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) AddedEdges

func (m *ExternalRefMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ExternalRefMutation) AddedField

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) AddedFields

func (m *ExternalRefMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ExternalRefMutation) AddedIDs

func (m *ExternalRefMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ExternalRefMutation) ClearEdge

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) ClearField

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) ClearMetadata

func (m *ExternalRefMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*ExternalRefMutation) ClearSummary

func (m *ExternalRefMutation) ClearSummary()

ClearSummary clears the value of the "summary" field.

func (*ExternalRefMutation) ClearedEdges

func (m *ExternalRefMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ExternalRefMutation) ClearedFields

func (m *ExternalRefMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ExternalRefMutation) Client

func (m ExternalRefMutation) 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 (*ExternalRefMutation) CreatedAt

func (m *ExternalRefMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ExternalRefMutation) EdgeCleared

func (m *ExternalRefMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ExternalRefMutation) Field

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) FieldCleared

func (m *ExternalRefMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ExternalRefMutation) Fields

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) ID

func (m *ExternalRefMutation) ID() (id uuid.UUID, 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 (*ExternalRefMutation) IDs

func (m *ExternalRefMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ExternalRefMutation) Location

func (m *ExternalRefMutation) Location() (r string, exists bool)

Location returns the value of the "location" field in the mutation.

func (*ExternalRefMutation) Metadata

func (m *ExternalRefMutation) Metadata() (r map[string]interface{}, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*ExternalRefMutation) MetadataCleared

func (m *ExternalRefMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*ExternalRefMutation) Name

func (m *ExternalRefMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ExternalRefMutation) OldCreatedAt

func (m *ExternalRefMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ExternalRef entity. If the ExternalRef 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 (*ExternalRefMutation) OldField

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) OldLocation

func (m *ExternalRefMutation) OldLocation(ctx context.Context) (v string, err error)

OldLocation returns the old "location" field's value of the ExternalRef entity. If the ExternalRef 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 (*ExternalRefMutation) OldMetadata

func (m *ExternalRefMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error)

OldMetadata returns the old "metadata" field's value of the ExternalRef entity. If the ExternalRef 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 (*ExternalRefMutation) OldName

func (m *ExternalRefMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the ExternalRef entity. If the ExternalRef 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 (*ExternalRefMutation) OldRefType

func (m *ExternalRefMutation) OldRefType(ctx context.Context) (v externalref.RefType, err error)

OldRefType returns the old "ref_type" field's value of the ExternalRef entity. If the ExternalRef 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 (*ExternalRefMutation) OldSummary

func (m *ExternalRefMutation) OldSummary(ctx context.Context) (v string, err error)

OldSummary returns the old "summary" field's value of the ExternalRef entity. If the ExternalRef 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 (*ExternalRefMutation) OldUpdatedAt

func (m *ExternalRefMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ExternalRef entity. If the ExternalRef 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 (*ExternalRefMutation) Op

func (m *ExternalRefMutation) Op() Op

Op returns the operation name.

func (*ExternalRefMutation) RefType

func (m *ExternalRefMutation) RefType() (r externalref.RefType, exists bool)

RefType returns the value of the "ref_type" field in the mutation.

func (*ExternalRefMutation) RemovedEdges

func (m *ExternalRefMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ExternalRefMutation) RemovedIDs

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) ResetCreatedAt

func (m *ExternalRefMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ExternalRefMutation) ResetEdge

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) ResetField

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) ResetLocation

func (m *ExternalRefMutation) ResetLocation()

ResetLocation resets all changes to the "location" field.

func (*ExternalRefMutation) ResetMetadata

func (m *ExternalRefMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*ExternalRefMutation) ResetName

func (m *ExternalRefMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ExternalRefMutation) ResetRefType

func (m *ExternalRefMutation) ResetRefType()

ResetRefType resets all changes to the "ref_type" field.

func (*ExternalRefMutation) ResetSummary

func (m *ExternalRefMutation) ResetSummary()

ResetSummary resets all changes to the "summary" field.

func (*ExternalRefMutation) ResetUpdatedAt

func (m *ExternalRefMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ExternalRefMutation) SetCreatedAt

func (m *ExternalRefMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ExternalRefMutation) SetField

func (m *ExternalRefMutation) 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 (*ExternalRefMutation) SetID

func (m *ExternalRefMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ExternalRef entities.

func (*ExternalRefMutation) SetLocation

func (m *ExternalRefMutation) SetLocation(s string)

SetLocation sets the "location" field.

func (*ExternalRefMutation) SetMetadata

func (m *ExternalRefMutation) SetMetadata(value map[string]interface{})

SetMetadata sets the "metadata" field.

func (*ExternalRefMutation) SetName

func (m *ExternalRefMutation) SetName(s string)

SetName sets the "name" field.

func (*ExternalRefMutation) SetOp

func (m *ExternalRefMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ExternalRefMutation) SetRefType

func (m *ExternalRefMutation) SetRefType(et externalref.RefType)

SetRefType sets the "ref_type" field.

func (*ExternalRefMutation) SetSummary

func (m *ExternalRefMutation) SetSummary(s string)

SetSummary sets the "summary" field.

func (*ExternalRefMutation) SetUpdatedAt

func (m *ExternalRefMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ExternalRefMutation) Summary

func (m *ExternalRefMutation) Summary() (r string, exists bool)

Summary returns the value of the "summary" field in the mutation.

func (*ExternalRefMutation) SummaryCleared

func (m *ExternalRefMutation) SummaryCleared() bool

SummaryCleared returns if the "summary" field was cleared in this mutation.

func (ExternalRefMutation) Tx

func (m ExternalRefMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ExternalRefMutation) Type

func (m *ExternalRefMutation) Type() string

Type returns the node type of this mutation (ExternalRef).

func (*ExternalRefMutation) UpdatedAt

func (m *ExternalRefMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ExternalRefMutation) Where

func (m *ExternalRefMutation) Where(ps ...predicate.ExternalRef)

Where appends a list predicates to the ExternalRefMutation builder.

func (*ExternalRefMutation) WhereP

func (m *ExternalRefMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ExternalRefMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ExternalRefQuery

type ExternalRefQuery struct {
	// contains filtered or unexported fields
}

ExternalRefQuery is the builder for querying ExternalRef entities.

func (*ExternalRefQuery) Aggregate

func (_q *ExternalRefQuery) Aggregate(fns ...AggregateFunc) *ExternalRefSelect

Aggregate returns a ExternalRefSelect configured with the given aggregations.

func (*ExternalRefQuery) All

func (_q *ExternalRefQuery) All(ctx context.Context) ([]*ExternalRef, error)

All executes the query and returns a list of ExternalRefs.

func (*ExternalRefQuery) AllX

func (_q *ExternalRefQuery) AllX(ctx context.Context) []*ExternalRef

AllX is like All, but panics if an error occurs.

func (*ExternalRefQuery) Clone

func (_q *ExternalRefQuery) Clone() *ExternalRefQuery

Clone returns a duplicate of the ExternalRefQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ExternalRefQuery) Count

func (_q *ExternalRefQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ExternalRefQuery) CountX

func (_q *ExternalRefQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ExternalRefQuery) Exist

func (_q *ExternalRefQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ExternalRefQuery) ExistX

func (_q *ExternalRefQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ExternalRefQuery) First

func (_q *ExternalRefQuery) First(ctx context.Context) (*ExternalRef, error)

First returns the first ExternalRef entity from the query. Returns a *NotFoundError when no ExternalRef was found.

func (*ExternalRefQuery) FirstID

func (_q *ExternalRefQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ExternalRef ID from the query. Returns a *NotFoundError when no ExternalRef ID was found.

func (*ExternalRefQuery) FirstIDX

func (_q *ExternalRefQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ExternalRefQuery) FirstX

func (_q *ExternalRefQuery) FirstX(ctx context.Context) *ExternalRef

FirstX is like First, but panics if an error occurs.

func (*ExternalRefQuery) GroupBy

func (_q *ExternalRefQuery) GroupBy(field string, fields ...string) *ExternalRefGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ExternalRef.Query().
	GroupBy(externalref.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ExternalRefQuery) IDs

func (_q *ExternalRefQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ExternalRef IDs.

func (*ExternalRefQuery) IDsX

func (_q *ExternalRefQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ExternalRefQuery) Limit

func (_q *ExternalRefQuery) Limit(limit int) *ExternalRefQuery

Limit the number of records to be returned by this query.

func (*ExternalRefQuery) Offset

func (_q *ExternalRefQuery) Offset(offset int) *ExternalRefQuery

Offset to start from.

func (*ExternalRefQuery) Only

func (_q *ExternalRefQuery) Only(ctx context.Context) (*ExternalRef, error)

Only returns a single ExternalRef entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ExternalRef entity is found. Returns a *NotFoundError when no ExternalRef entities are found.

func (*ExternalRefQuery) OnlyID

func (_q *ExternalRefQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ExternalRef ID in the query. Returns a *NotSingularError when more than one ExternalRef ID is found. Returns a *NotFoundError when no entities are found.

func (*ExternalRefQuery) OnlyIDX

func (_q *ExternalRefQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ExternalRefQuery) OnlyX

func (_q *ExternalRefQuery) OnlyX(ctx context.Context) *ExternalRef

OnlyX is like Only, but panics if an error occurs.

func (*ExternalRefQuery) Order

Order specifies how the records should be ordered.

func (*ExternalRefQuery) Select

func (_q *ExternalRefQuery) Select(fields ...string) *ExternalRefSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.ExternalRef.Query().
	Select(externalref.FieldName).
	Scan(ctx, &v)

func (*ExternalRefQuery) Unique

func (_q *ExternalRefQuery) Unique(unique bool) *ExternalRefQuery

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 (*ExternalRefQuery) Where

Where adds a new predicate for the ExternalRefQuery builder.

type ExternalRefSelect

type ExternalRefSelect struct {
	*ExternalRefQuery
	// contains filtered or unexported fields
}

ExternalRefSelect is the builder for selecting fields of ExternalRef entities.

func (*ExternalRefSelect) Aggregate

func (_s *ExternalRefSelect) Aggregate(fns ...AggregateFunc) *ExternalRefSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ExternalRefSelect) Bool

func (s *ExternalRefSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) BoolX

func (s *ExternalRefSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ExternalRefSelect) Bools

func (s *ExternalRefSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) BoolsX

func (s *ExternalRefSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ExternalRefSelect) Float64

func (s *ExternalRefSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) Float64X

func (s *ExternalRefSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ExternalRefSelect) Float64s

func (s *ExternalRefSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) Float64sX

func (s *ExternalRefSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ExternalRefSelect) Int

func (s *ExternalRefSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) IntX

func (s *ExternalRefSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ExternalRefSelect) Ints

func (s *ExternalRefSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) IntsX

func (s *ExternalRefSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ExternalRefSelect) Scan

func (_s *ExternalRefSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ExternalRefSelect) ScanX

func (s *ExternalRefSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ExternalRefSelect) String

func (s *ExternalRefSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) StringX

func (s *ExternalRefSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ExternalRefSelect) Strings

func (s *ExternalRefSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ExternalRefSelect) StringsX

func (s *ExternalRefSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ExternalRefUpdate

type ExternalRefUpdate struct {
	// contains filtered or unexported fields
}

ExternalRefUpdate is the builder for updating ExternalRef entities.

func (*ExternalRefUpdate) ClearMetadata

func (_u *ExternalRefUpdate) ClearMetadata() *ExternalRefUpdate

ClearMetadata clears the value of the "metadata" field.

func (*ExternalRefUpdate) ClearSummary

func (_u *ExternalRefUpdate) ClearSummary() *ExternalRefUpdate

ClearSummary clears the value of the "summary" field.

func (*ExternalRefUpdate) Exec

func (_u *ExternalRefUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ExternalRefUpdate) ExecX

func (_u *ExternalRefUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExternalRefUpdate) Mutation

func (_u *ExternalRefUpdate) Mutation() *ExternalRefMutation

Mutation returns the ExternalRefMutation object of the builder.

func (*ExternalRefUpdate) Save

func (_u *ExternalRefUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ExternalRefUpdate) SaveX

func (_u *ExternalRefUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ExternalRefUpdate) SetLocation

func (_u *ExternalRefUpdate) SetLocation(v string) *ExternalRefUpdate

SetLocation sets the "location" field.

func (*ExternalRefUpdate) SetMetadata

func (_u *ExternalRefUpdate) SetMetadata(v map[string]interface{}) *ExternalRefUpdate

SetMetadata sets the "metadata" field.

func (*ExternalRefUpdate) SetName

func (_u *ExternalRefUpdate) SetName(v string) *ExternalRefUpdate

SetName sets the "name" field.

func (*ExternalRefUpdate) SetNillableLocation

func (_u *ExternalRefUpdate) SetNillableLocation(v *string) *ExternalRefUpdate

SetNillableLocation sets the "location" field if the given value is not nil.

func (*ExternalRefUpdate) SetNillableName

func (_u *ExternalRefUpdate) SetNillableName(v *string) *ExternalRefUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ExternalRefUpdate) SetNillableRefType

func (_u *ExternalRefUpdate) SetNillableRefType(v *externalref.RefType) *ExternalRefUpdate

SetNillableRefType sets the "ref_type" field if the given value is not nil.

func (*ExternalRefUpdate) SetNillableSummary

func (_u *ExternalRefUpdate) SetNillableSummary(v *string) *ExternalRefUpdate

SetNillableSummary sets the "summary" field if the given value is not nil.

func (*ExternalRefUpdate) SetRefType

SetRefType sets the "ref_type" field.

func (*ExternalRefUpdate) SetSummary

func (_u *ExternalRefUpdate) SetSummary(v string) *ExternalRefUpdate

SetSummary sets the "summary" field.

func (*ExternalRefUpdate) SetUpdatedAt

func (_u *ExternalRefUpdate) SetUpdatedAt(v time.Time) *ExternalRefUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ExternalRefUpdate) Where

Where appends a list predicates to the ExternalRefUpdate builder.

type ExternalRefUpdateOne

type ExternalRefUpdateOne struct {
	// contains filtered or unexported fields
}

ExternalRefUpdateOne is the builder for updating a single ExternalRef entity.

func (*ExternalRefUpdateOne) ClearMetadata

func (_u *ExternalRefUpdateOne) ClearMetadata() *ExternalRefUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*ExternalRefUpdateOne) ClearSummary

func (_u *ExternalRefUpdateOne) ClearSummary() *ExternalRefUpdateOne

ClearSummary clears the value of the "summary" field.

func (*ExternalRefUpdateOne) Exec

func (_u *ExternalRefUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ExternalRefUpdateOne) ExecX

func (_u *ExternalRefUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExternalRefUpdateOne) Mutation

func (_u *ExternalRefUpdateOne) Mutation() *ExternalRefMutation

Mutation returns the ExternalRefMutation object of the builder.

func (*ExternalRefUpdateOne) Save

Save executes the query and returns the updated ExternalRef entity.

func (*ExternalRefUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ExternalRefUpdateOne) Select

func (_u *ExternalRefUpdateOne) Select(field string, fields ...string) *ExternalRefUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ExternalRefUpdateOne) SetLocation

func (_u *ExternalRefUpdateOne) SetLocation(v string) *ExternalRefUpdateOne

SetLocation sets the "location" field.

func (*ExternalRefUpdateOne) SetMetadata

func (_u *ExternalRefUpdateOne) SetMetadata(v map[string]interface{}) *ExternalRefUpdateOne

SetMetadata sets the "metadata" field.

func (*ExternalRefUpdateOne) SetName

SetName sets the "name" field.

func (*ExternalRefUpdateOne) SetNillableLocation

func (_u *ExternalRefUpdateOne) SetNillableLocation(v *string) *ExternalRefUpdateOne

SetNillableLocation sets the "location" field if the given value is not nil.

func (*ExternalRefUpdateOne) SetNillableName

func (_u *ExternalRefUpdateOne) SetNillableName(v *string) *ExternalRefUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ExternalRefUpdateOne) SetNillableRefType

func (_u *ExternalRefUpdateOne) SetNillableRefType(v *externalref.RefType) *ExternalRefUpdateOne

SetNillableRefType sets the "ref_type" field if the given value is not nil.

func (*ExternalRefUpdateOne) SetNillableSummary

func (_u *ExternalRefUpdateOne) SetNillableSummary(v *string) *ExternalRefUpdateOne

SetNillableSummary sets the "summary" field if the given value is not nil.

func (*ExternalRefUpdateOne) SetRefType

SetRefType sets the "ref_type" field.

func (*ExternalRefUpdateOne) SetSummary

SetSummary sets the "summary" field.

func (*ExternalRefUpdateOne) SetUpdatedAt

func (_u *ExternalRefUpdateOne) SetUpdatedAt(v time.Time) *ExternalRefUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ExternalRefUpdateOne) Where

Where appends a list predicates to the ExternalRefUpdate builder.

type ExternalRefs

type ExternalRefs []*ExternalRef

ExternalRefs is a parsable slice of ExternalRef.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Inquiries

type Inquiries []*Inquiry

Inquiries is a parsable slice of Inquiry.

type Inquiry

type Inquiry struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SessionKey holds the value of the "session_key" field.
	SessionKey string `json:"session_key,omitempty"`
	// Topic holds the value of the "topic" field.
	Topic string `json:"topic,omitempty"`
	// Question holds the value of the "question" field.
	Question string `json:"question,omitempty"`
	// Context holds the value of the "context" field.
	Context *string `json:"context,omitempty"`
	// Priority holds the value of the "priority" field.
	Priority inquiry.Priority `json:"priority,omitempty"`
	// Status holds the value of the "status" field.
	Status inquiry.Status `json:"status,omitempty"`
	// Answer holds the value of the "answer" field.
	Answer *string `json:"answer,omitempty"`
	// KnowledgeKey holds the value of the "knowledge_key" field.
	KnowledgeKey *string `json:"knowledge_key,omitempty"`
	// SourceObservationID holds the value of the "source_observation_id" field.
	SourceObservationID *string `json:"source_observation_id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ResolvedAt holds the value of the "resolved_at" field.
	ResolvedAt *time.Time `json:"resolved_at,omitempty"`
	// contains filtered or unexported fields
}

Inquiry is the model entity for the Inquiry schema.

func (*Inquiry) String

func (_m *Inquiry) String() string

String implements the fmt.Stringer.

func (*Inquiry) Unwrap

func (_m *Inquiry) Unwrap() *Inquiry

Unwrap unwraps the Inquiry 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 (*Inquiry) Update

func (_m *Inquiry) Update() *InquiryUpdateOne

Update returns a builder for updating this Inquiry. Note that you need to call Inquiry.Unwrap() before calling this method if this Inquiry was returned from a transaction, and the transaction was committed or rolled back.

func (*Inquiry) Value

func (_m *Inquiry) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Inquiry. This includes values selected through modifiers, order, etc.

type InquiryClient

type InquiryClient struct {
	// contains filtered or unexported fields
}

InquiryClient is a client for the Inquiry schema.

func NewInquiryClient

func NewInquiryClient(c config) *InquiryClient

NewInquiryClient returns a client for the Inquiry from the given config.

func (*InquiryClient) Create

func (c *InquiryClient) Create() *InquiryCreate

Create returns a builder for creating a Inquiry entity.

func (*InquiryClient) CreateBulk

func (c *InquiryClient) CreateBulk(builders ...*InquiryCreate) *InquiryCreateBulk

CreateBulk returns a builder for creating a bulk of Inquiry entities.

func (*InquiryClient) Delete

func (c *InquiryClient) Delete() *InquiryDelete

Delete returns a delete builder for Inquiry.

func (*InquiryClient) DeleteOne

func (c *InquiryClient) DeleteOne(_m *Inquiry) *InquiryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InquiryClient) DeleteOneID

func (c *InquiryClient) DeleteOneID(id uuid.UUID) *InquiryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*InquiryClient) Get

func (c *InquiryClient) Get(ctx context.Context, id uuid.UUID) (*Inquiry, error)

Get returns a Inquiry entity by its id.

func (*InquiryClient) GetX

func (c *InquiryClient) GetX(ctx context.Context, id uuid.UUID) *Inquiry

GetX is like Get, but panics if an error occurs.

func (*InquiryClient) Hooks

func (c *InquiryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*InquiryClient) Intercept

func (c *InquiryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `inquiry.Intercept(f(g(h())))`.

func (*InquiryClient) Interceptors

func (c *InquiryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*InquiryClient) MapCreateBulk

func (c *InquiryClient) MapCreateBulk(slice any, setFunc func(*InquiryCreate, int)) *InquiryCreateBulk

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 (*InquiryClient) Query

func (c *InquiryClient) Query() *InquiryQuery

Query returns a query builder for Inquiry.

func (*InquiryClient) Update

func (c *InquiryClient) Update() *InquiryUpdate

Update returns an update builder for Inquiry.

func (*InquiryClient) UpdateOne

func (c *InquiryClient) UpdateOne(_m *Inquiry) *InquiryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*InquiryClient) UpdateOneID

func (c *InquiryClient) UpdateOneID(id uuid.UUID) *InquiryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InquiryClient) Use

func (c *InquiryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `inquiry.Hooks(f(g(h())))`.

type InquiryCreate

type InquiryCreate struct {
	// contains filtered or unexported fields
}

InquiryCreate is the builder for creating a Inquiry entity.

func (*InquiryCreate) Exec

func (_c *InquiryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InquiryCreate) ExecX

func (_c *InquiryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InquiryCreate) Mutation

func (_c *InquiryCreate) Mutation() *InquiryMutation

Mutation returns the InquiryMutation object of the builder.

func (*InquiryCreate) Save

func (_c *InquiryCreate) Save(ctx context.Context) (*Inquiry, error)

Save creates the Inquiry in the database.

func (*InquiryCreate) SaveX

func (_c *InquiryCreate) SaveX(ctx context.Context) *Inquiry

SaveX calls Save and panics if Save returns an error.

func (*InquiryCreate) SetAnswer

func (_c *InquiryCreate) SetAnswer(v string) *InquiryCreate

SetAnswer sets the "answer" field.

func (*InquiryCreate) SetContext

func (_c *InquiryCreate) SetContext(v string) *InquiryCreate

SetContext sets the "context" field.

func (*InquiryCreate) SetCreatedAt

func (_c *InquiryCreate) SetCreatedAt(v time.Time) *InquiryCreate

SetCreatedAt sets the "created_at" field.

func (*InquiryCreate) SetID

func (_c *InquiryCreate) SetID(v uuid.UUID) *InquiryCreate

SetID sets the "id" field.

func (*InquiryCreate) SetKnowledgeKey

func (_c *InquiryCreate) SetKnowledgeKey(v string) *InquiryCreate

SetKnowledgeKey sets the "knowledge_key" field.

func (*InquiryCreate) SetNillableAnswer

func (_c *InquiryCreate) SetNillableAnswer(v *string) *InquiryCreate

SetNillableAnswer sets the "answer" field if the given value is not nil.

func (*InquiryCreate) SetNillableContext

func (_c *InquiryCreate) SetNillableContext(v *string) *InquiryCreate

SetNillableContext sets the "context" field if the given value is not nil.

func (*InquiryCreate) SetNillableCreatedAt

func (_c *InquiryCreate) SetNillableCreatedAt(v *time.Time) *InquiryCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*InquiryCreate) SetNillableID

func (_c *InquiryCreate) SetNillableID(v *uuid.UUID) *InquiryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*InquiryCreate) SetNillableKnowledgeKey

func (_c *InquiryCreate) SetNillableKnowledgeKey(v *string) *InquiryCreate

SetNillableKnowledgeKey sets the "knowledge_key" field if the given value is not nil.

func (*InquiryCreate) SetNillablePriority

func (_c *InquiryCreate) SetNillablePriority(v *inquiry.Priority) *InquiryCreate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*InquiryCreate) SetNillableResolvedAt

func (_c *InquiryCreate) SetNillableResolvedAt(v *time.Time) *InquiryCreate

SetNillableResolvedAt sets the "resolved_at" field if the given value is not nil.

func (*InquiryCreate) SetNillableSourceObservationID

func (_c *InquiryCreate) SetNillableSourceObservationID(v *string) *InquiryCreate

SetNillableSourceObservationID sets the "source_observation_id" field if the given value is not nil.

func (*InquiryCreate) SetNillableStatus

func (_c *InquiryCreate) SetNillableStatus(v *inquiry.Status) *InquiryCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InquiryCreate) SetPriority

func (_c *InquiryCreate) SetPriority(v inquiry.Priority) *InquiryCreate

SetPriority sets the "priority" field.

func (*InquiryCreate) SetQuestion

func (_c *InquiryCreate) SetQuestion(v string) *InquiryCreate

SetQuestion sets the "question" field.

func (*InquiryCreate) SetResolvedAt

func (_c *InquiryCreate) SetResolvedAt(v time.Time) *InquiryCreate

SetResolvedAt sets the "resolved_at" field.

func (*InquiryCreate) SetSessionKey

func (_c *InquiryCreate) SetSessionKey(v string) *InquiryCreate

SetSessionKey sets the "session_key" field.

func (*InquiryCreate) SetSourceObservationID

func (_c *InquiryCreate) SetSourceObservationID(v string) *InquiryCreate

SetSourceObservationID sets the "source_observation_id" field.

func (*InquiryCreate) SetStatus

func (_c *InquiryCreate) SetStatus(v inquiry.Status) *InquiryCreate

SetStatus sets the "status" field.

func (*InquiryCreate) SetTopic

func (_c *InquiryCreate) SetTopic(v string) *InquiryCreate

SetTopic sets the "topic" field.

type InquiryCreateBulk

type InquiryCreateBulk struct {
	// contains filtered or unexported fields
}

InquiryCreateBulk is the builder for creating many Inquiry entities in bulk.

func (*InquiryCreateBulk) Exec

func (_c *InquiryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*InquiryCreateBulk) ExecX

func (_c *InquiryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InquiryCreateBulk) Save

func (_c *InquiryCreateBulk) Save(ctx context.Context) ([]*Inquiry, error)

Save creates the Inquiry entities in the database.

func (*InquiryCreateBulk) SaveX

func (_c *InquiryCreateBulk) SaveX(ctx context.Context) []*Inquiry

SaveX is like Save, but panics if an error occurs.

type InquiryDelete

type InquiryDelete struct {
	// contains filtered or unexported fields
}

InquiryDelete is the builder for deleting a Inquiry entity.

func (*InquiryDelete) Exec

func (_d *InquiryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*InquiryDelete) ExecX

func (_d *InquiryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*InquiryDelete) Where

func (_d *InquiryDelete) Where(ps ...predicate.Inquiry) *InquiryDelete

Where appends a list predicates to the InquiryDelete builder.

type InquiryDeleteOne

type InquiryDeleteOne struct {
	// contains filtered or unexported fields
}

InquiryDeleteOne is the builder for deleting a single Inquiry entity.

func (*InquiryDeleteOne) Exec

func (_d *InquiryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*InquiryDeleteOne) ExecX

func (_d *InquiryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InquiryDeleteOne) Where

Where appends a list predicates to the InquiryDelete builder.

type InquiryGroupBy

type InquiryGroupBy struct {
	// contains filtered or unexported fields
}

InquiryGroupBy is the group-by builder for Inquiry entities.

func (*InquiryGroupBy) Aggregate

func (_g *InquiryGroupBy) Aggregate(fns ...AggregateFunc) *InquiryGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*InquiryGroupBy) Bool

func (s *InquiryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) BoolX

func (s *InquiryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InquiryGroupBy) Bools

func (s *InquiryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) BoolsX

func (s *InquiryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InquiryGroupBy) Float64

func (s *InquiryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) Float64X

func (s *InquiryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InquiryGroupBy) Float64s

func (s *InquiryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) Float64sX

func (s *InquiryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InquiryGroupBy) Int

func (s *InquiryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) IntX

func (s *InquiryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InquiryGroupBy) Ints

func (s *InquiryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) IntsX

func (s *InquiryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InquiryGroupBy) Scan

func (_g *InquiryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*InquiryGroupBy) ScanX

func (s *InquiryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InquiryGroupBy) String

func (s *InquiryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) StringX

func (s *InquiryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InquiryGroupBy) Strings

func (s *InquiryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InquiryGroupBy) StringsX

func (s *InquiryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InquiryMutation

type InquiryMutation struct {
	// contains filtered or unexported fields
}

InquiryMutation represents an operation that mutates the Inquiry nodes in the graph.

func (*InquiryMutation) AddField

func (m *InquiryMutation) 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 (*InquiryMutation) AddedEdges

func (m *InquiryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*InquiryMutation) AddedField

func (m *InquiryMutation) 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 (*InquiryMutation) AddedFields

func (m *InquiryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*InquiryMutation) AddedIDs

func (m *InquiryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*InquiryMutation) Answer

func (m *InquiryMutation) Answer() (r string, exists bool)

Answer returns the value of the "answer" field in the mutation.

func (*InquiryMutation) AnswerCleared

func (m *InquiryMutation) AnswerCleared() bool

AnswerCleared returns if the "answer" field was cleared in this mutation.

func (*InquiryMutation) ClearAnswer

func (m *InquiryMutation) ClearAnswer()

ClearAnswer clears the value of the "answer" field.

func (*InquiryMutation) ClearContext

func (m *InquiryMutation) ClearContext()

ClearContext clears the value of the "context" field.

func (*InquiryMutation) ClearEdge

func (m *InquiryMutation) 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 (*InquiryMutation) ClearField

func (m *InquiryMutation) 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 (*InquiryMutation) ClearKnowledgeKey

func (m *InquiryMutation) ClearKnowledgeKey()

ClearKnowledgeKey clears the value of the "knowledge_key" field.

func (*InquiryMutation) ClearResolvedAt

func (m *InquiryMutation) ClearResolvedAt()

ClearResolvedAt clears the value of the "resolved_at" field.

func (*InquiryMutation) ClearSourceObservationID

func (m *InquiryMutation) ClearSourceObservationID()

ClearSourceObservationID clears the value of the "source_observation_id" field.

func (*InquiryMutation) ClearedEdges

func (m *InquiryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*InquiryMutation) ClearedFields

func (m *InquiryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (InquiryMutation) Client

func (m InquiryMutation) 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 (*InquiryMutation) Context

func (m *InquiryMutation) Context() (r string, exists bool)

Context returns the value of the "context" field in the mutation.

func (*InquiryMutation) ContextCleared

func (m *InquiryMutation) ContextCleared() bool

ContextCleared returns if the "context" field was cleared in this mutation.

func (*InquiryMutation) CreatedAt

func (m *InquiryMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*InquiryMutation) EdgeCleared

func (m *InquiryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*InquiryMutation) Field

func (m *InquiryMutation) 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 (*InquiryMutation) FieldCleared

func (m *InquiryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*InquiryMutation) Fields

func (m *InquiryMutation) 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 (*InquiryMutation) ID

func (m *InquiryMutation) ID() (id uuid.UUID, 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 (*InquiryMutation) IDs

func (m *InquiryMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*InquiryMutation) KnowledgeKey

func (m *InquiryMutation) KnowledgeKey() (r string, exists bool)

KnowledgeKey returns the value of the "knowledge_key" field in the mutation.

func (*InquiryMutation) KnowledgeKeyCleared

func (m *InquiryMutation) KnowledgeKeyCleared() bool

KnowledgeKeyCleared returns if the "knowledge_key" field was cleared in this mutation.

func (*InquiryMutation) OldAnswer

func (m *InquiryMutation) OldAnswer(ctx context.Context) (v *string, err error)

OldAnswer returns the old "answer" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldContext

func (m *InquiryMutation) OldContext(ctx context.Context) (v *string, err error)

OldContext returns the old "context" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldCreatedAt

func (m *InquiryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldField

func (m *InquiryMutation) 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 (*InquiryMutation) OldKnowledgeKey

func (m *InquiryMutation) OldKnowledgeKey(ctx context.Context) (v *string, err error)

OldKnowledgeKey returns the old "knowledge_key" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldPriority

func (m *InquiryMutation) OldPriority(ctx context.Context) (v inquiry.Priority, err error)

OldPriority returns the old "priority" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldQuestion

func (m *InquiryMutation) OldQuestion(ctx context.Context) (v string, err error)

OldQuestion returns the old "question" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldResolvedAt

func (m *InquiryMutation) OldResolvedAt(ctx context.Context) (v *time.Time, err error)

OldResolvedAt returns the old "resolved_at" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldSessionKey

func (m *InquiryMutation) OldSessionKey(ctx context.Context) (v string, err error)

OldSessionKey returns the old "session_key" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldSourceObservationID

func (m *InquiryMutation) OldSourceObservationID(ctx context.Context) (v *string, err error)

OldSourceObservationID returns the old "source_observation_id" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldStatus

func (m *InquiryMutation) OldStatus(ctx context.Context) (v inquiry.Status, err error)

OldStatus returns the old "status" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) OldTopic

func (m *InquiryMutation) OldTopic(ctx context.Context) (v string, err error)

OldTopic returns the old "topic" field's value of the Inquiry entity. If the Inquiry 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 (*InquiryMutation) Op

func (m *InquiryMutation) Op() Op

Op returns the operation name.

func (*InquiryMutation) Priority

func (m *InquiryMutation) Priority() (r inquiry.Priority, exists bool)

Priority returns the value of the "priority" field in the mutation.

func (*InquiryMutation) Question

func (m *InquiryMutation) Question() (r string, exists bool)

Question returns the value of the "question" field in the mutation.

func (*InquiryMutation) RemovedEdges

func (m *InquiryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*InquiryMutation) RemovedIDs

func (m *InquiryMutation) 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 (*InquiryMutation) ResetAnswer

func (m *InquiryMutation) ResetAnswer()

ResetAnswer resets all changes to the "answer" field.

func (*InquiryMutation) ResetContext

func (m *InquiryMutation) ResetContext()

ResetContext resets all changes to the "context" field.

func (*InquiryMutation) ResetCreatedAt

func (m *InquiryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*InquiryMutation) ResetEdge

func (m *InquiryMutation) 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 (*InquiryMutation) ResetField

func (m *InquiryMutation) 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 (*InquiryMutation) ResetKnowledgeKey

func (m *InquiryMutation) ResetKnowledgeKey()

ResetKnowledgeKey resets all changes to the "knowledge_key" field.

func (*InquiryMutation) ResetPriority

func (m *InquiryMutation) ResetPriority()

ResetPriority resets all changes to the "priority" field.

func (*InquiryMutation) ResetQuestion

func (m *InquiryMutation) ResetQuestion()

ResetQuestion resets all changes to the "question" field.

func (*InquiryMutation) ResetResolvedAt

func (m *InquiryMutation) ResetResolvedAt()

ResetResolvedAt resets all changes to the "resolved_at" field.

func (*InquiryMutation) ResetSessionKey

func (m *InquiryMutation) ResetSessionKey()

ResetSessionKey resets all changes to the "session_key" field.

func (*InquiryMutation) ResetSourceObservationID

func (m *InquiryMutation) ResetSourceObservationID()

ResetSourceObservationID resets all changes to the "source_observation_id" field.

func (*InquiryMutation) ResetStatus

func (m *InquiryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*InquiryMutation) ResetTopic

func (m *InquiryMutation) ResetTopic()

ResetTopic resets all changes to the "topic" field.

func (*InquiryMutation) ResolvedAt

func (m *InquiryMutation) ResolvedAt() (r time.Time, exists bool)

ResolvedAt returns the value of the "resolved_at" field in the mutation.

func (*InquiryMutation) ResolvedAtCleared

func (m *InquiryMutation) ResolvedAtCleared() bool

ResolvedAtCleared returns if the "resolved_at" field was cleared in this mutation.

func (*InquiryMutation) SessionKey

func (m *InquiryMutation) SessionKey() (r string, exists bool)

SessionKey returns the value of the "session_key" field in the mutation.

func (*InquiryMutation) SetAnswer

func (m *InquiryMutation) SetAnswer(s string)

SetAnswer sets the "answer" field.

func (*InquiryMutation) SetContext

func (m *InquiryMutation) SetContext(s string)

SetContext sets the "context" field.

func (*InquiryMutation) SetCreatedAt

func (m *InquiryMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*InquiryMutation) SetField

func (m *InquiryMutation) 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 (*InquiryMutation) SetID

func (m *InquiryMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Inquiry entities.

func (*InquiryMutation) SetKnowledgeKey

func (m *InquiryMutation) SetKnowledgeKey(s string)

SetKnowledgeKey sets the "knowledge_key" field.

func (*InquiryMutation) SetOp

func (m *InquiryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InquiryMutation) SetPriority

func (m *InquiryMutation) SetPriority(i inquiry.Priority)

SetPriority sets the "priority" field.

func (*InquiryMutation) SetQuestion

func (m *InquiryMutation) SetQuestion(s string)

SetQuestion sets the "question" field.

func (*InquiryMutation) SetResolvedAt

func (m *InquiryMutation) SetResolvedAt(t time.Time)

SetResolvedAt sets the "resolved_at" field.

func (*InquiryMutation) SetSessionKey

func (m *InquiryMutation) SetSessionKey(s string)

SetSessionKey sets the "session_key" field.

func (*InquiryMutation) SetSourceObservationID

func (m *InquiryMutation) SetSourceObservationID(s string)

SetSourceObservationID sets the "source_observation_id" field.

func (*InquiryMutation) SetStatus

func (m *InquiryMutation) SetStatus(i inquiry.Status)

SetStatus sets the "status" field.

func (*InquiryMutation) SetTopic

func (m *InquiryMutation) SetTopic(s string)

SetTopic sets the "topic" field.

func (*InquiryMutation) SourceObservationID

func (m *InquiryMutation) SourceObservationID() (r string, exists bool)

SourceObservationID returns the value of the "source_observation_id" field in the mutation.

func (*InquiryMutation) SourceObservationIDCleared

func (m *InquiryMutation) SourceObservationIDCleared() bool

SourceObservationIDCleared returns if the "source_observation_id" field was cleared in this mutation.

func (*InquiryMutation) Status

func (m *InquiryMutation) Status() (r inquiry.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*InquiryMutation) Topic

func (m *InquiryMutation) Topic() (r string, exists bool)

Topic returns the value of the "topic" field in the mutation.

func (InquiryMutation) Tx

func (m InquiryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*InquiryMutation) Type

func (m *InquiryMutation) Type() string

Type returns the node type of this mutation (Inquiry).

func (*InquiryMutation) Where

func (m *InquiryMutation) Where(ps ...predicate.Inquiry)

Where appends a list predicates to the InquiryMutation builder.

func (*InquiryMutation) WhereP

func (m *InquiryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the InquiryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type InquiryQuery

type InquiryQuery struct {
	// contains filtered or unexported fields
}

InquiryQuery is the builder for querying Inquiry entities.

func (*InquiryQuery) Aggregate

func (_q *InquiryQuery) Aggregate(fns ...AggregateFunc) *InquirySelect

Aggregate returns a InquirySelect configured with the given aggregations.

func (*InquiryQuery) All

func (_q *InquiryQuery) All(ctx context.Context) ([]*Inquiry, error)

All executes the query and returns a list of Inquiries.

func (*InquiryQuery) AllX

func (_q *InquiryQuery) AllX(ctx context.Context) []*Inquiry

AllX is like All, but panics if an error occurs.

func (*InquiryQuery) Clone

func (_q *InquiryQuery) Clone() *InquiryQuery

Clone returns a duplicate of the InquiryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*InquiryQuery) Count

func (_q *InquiryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InquiryQuery) CountX

func (_q *InquiryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*InquiryQuery) Exist

func (_q *InquiryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*InquiryQuery) ExistX

func (_q *InquiryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*InquiryQuery) First

func (_q *InquiryQuery) First(ctx context.Context) (*Inquiry, error)

First returns the first Inquiry entity from the query. Returns a *NotFoundError when no Inquiry was found.

func (*InquiryQuery) FirstID

func (_q *InquiryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Inquiry ID from the query. Returns a *NotFoundError when no Inquiry ID was found.

func (*InquiryQuery) FirstIDX

func (_q *InquiryQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*InquiryQuery) FirstX

func (_q *InquiryQuery) FirstX(ctx context.Context) *Inquiry

FirstX is like First, but panics if an error occurs.

func (*InquiryQuery) GroupBy

func (_q *InquiryQuery) GroupBy(field string, fields ...string) *InquiryGroupBy

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 {
	SessionKey string `json:"session_key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Inquiry.Query().
	GroupBy(inquiry.FieldSessionKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InquiryQuery) IDs

func (_q *InquiryQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Inquiry IDs.

func (*InquiryQuery) IDsX

func (_q *InquiryQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*InquiryQuery) Limit

func (_q *InquiryQuery) Limit(limit int) *InquiryQuery

Limit the number of records to be returned by this query.

func (*InquiryQuery) Offset

func (_q *InquiryQuery) Offset(offset int) *InquiryQuery

Offset to start from.

func (*InquiryQuery) Only

func (_q *InquiryQuery) Only(ctx context.Context) (*Inquiry, error)

Only returns a single Inquiry entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Inquiry entity is found. Returns a *NotFoundError when no Inquiry entities are found.

func (*InquiryQuery) OnlyID

func (_q *InquiryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Inquiry ID in the query. Returns a *NotSingularError when more than one Inquiry ID is found. Returns a *NotFoundError when no entities are found.

func (*InquiryQuery) OnlyIDX

func (_q *InquiryQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*InquiryQuery) OnlyX

func (_q *InquiryQuery) OnlyX(ctx context.Context) *Inquiry

OnlyX is like Only, but panics if an error occurs.

func (*InquiryQuery) Order

func (_q *InquiryQuery) Order(o ...inquiry.OrderOption) *InquiryQuery

Order specifies how the records should be ordered.

func (*InquiryQuery) Select

func (_q *InquiryQuery) Select(fields ...string) *InquirySelect

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 {
	SessionKey string `json:"session_key,omitempty"`
}

client.Inquiry.Query().
	Select(inquiry.FieldSessionKey).
	Scan(ctx, &v)

func (*InquiryQuery) Unique

func (_q *InquiryQuery) Unique(unique bool) *InquiryQuery

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 (*InquiryQuery) Where

func (_q *InquiryQuery) Where(ps ...predicate.Inquiry) *InquiryQuery

Where adds a new predicate for the InquiryQuery builder.

type InquirySelect

type InquirySelect struct {
	*InquiryQuery
	// contains filtered or unexported fields
}

InquirySelect is the builder for selecting fields of Inquiry entities.

func (*InquirySelect) Aggregate

func (_s *InquirySelect) Aggregate(fns ...AggregateFunc) *InquirySelect

Aggregate adds the given aggregation functions to the selector query.

func (*InquirySelect) Bool

func (s *InquirySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InquirySelect) BoolX

func (s *InquirySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InquirySelect) Bools

func (s *InquirySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InquirySelect) BoolsX

func (s *InquirySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InquirySelect) Float64

func (s *InquirySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InquirySelect) Float64X

func (s *InquirySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InquirySelect) Float64s

func (s *InquirySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InquirySelect) Float64sX

func (s *InquirySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InquirySelect) Int

func (s *InquirySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InquirySelect) IntX

func (s *InquirySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InquirySelect) Ints

func (s *InquirySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InquirySelect) IntsX

func (s *InquirySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InquirySelect) Scan

func (_s *InquirySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*InquirySelect) ScanX

func (s *InquirySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InquirySelect) String

func (s *InquirySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InquirySelect) StringX

func (s *InquirySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InquirySelect) Strings

func (s *InquirySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InquirySelect) StringsX

func (s *InquirySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InquiryUpdate

type InquiryUpdate struct {
	// contains filtered or unexported fields
}

InquiryUpdate is the builder for updating Inquiry entities.

func (*InquiryUpdate) ClearAnswer

func (_u *InquiryUpdate) ClearAnswer() *InquiryUpdate

ClearAnswer clears the value of the "answer" field.

func (*InquiryUpdate) ClearContext

func (_u *InquiryUpdate) ClearContext() *InquiryUpdate

ClearContext clears the value of the "context" field.

func (*InquiryUpdate) ClearKnowledgeKey

func (_u *InquiryUpdate) ClearKnowledgeKey() *InquiryUpdate

ClearKnowledgeKey clears the value of the "knowledge_key" field.

func (*InquiryUpdate) ClearResolvedAt

func (_u *InquiryUpdate) ClearResolvedAt() *InquiryUpdate

ClearResolvedAt clears the value of the "resolved_at" field.

func (*InquiryUpdate) ClearSourceObservationID

func (_u *InquiryUpdate) ClearSourceObservationID() *InquiryUpdate

ClearSourceObservationID clears the value of the "source_observation_id" field.

func (*InquiryUpdate) Exec

func (_u *InquiryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InquiryUpdate) ExecX

func (_u *InquiryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InquiryUpdate) Mutation

func (_u *InquiryUpdate) Mutation() *InquiryMutation

Mutation returns the InquiryMutation object of the builder.

func (*InquiryUpdate) Save

func (_u *InquiryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*InquiryUpdate) SaveX

func (_u *InquiryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*InquiryUpdate) SetAnswer

func (_u *InquiryUpdate) SetAnswer(v string) *InquiryUpdate

SetAnswer sets the "answer" field.

func (*InquiryUpdate) SetContext

func (_u *InquiryUpdate) SetContext(v string) *InquiryUpdate

SetContext sets the "context" field.

func (*InquiryUpdate) SetKnowledgeKey

func (_u *InquiryUpdate) SetKnowledgeKey(v string) *InquiryUpdate

SetKnowledgeKey sets the "knowledge_key" field.

func (*InquiryUpdate) SetNillableAnswer

func (_u *InquiryUpdate) SetNillableAnswer(v *string) *InquiryUpdate

SetNillableAnswer sets the "answer" field if the given value is not nil.

func (*InquiryUpdate) SetNillableContext

func (_u *InquiryUpdate) SetNillableContext(v *string) *InquiryUpdate

SetNillableContext sets the "context" field if the given value is not nil.

func (*InquiryUpdate) SetNillableKnowledgeKey

func (_u *InquiryUpdate) SetNillableKnowledgeKey(v *string) *InquiryUpdate

SetNillableKnowledgeKey sets the "knowledge_key" field if the given value is not nil.

func (*InquiryUpdate) SetNillablePriority

func (_u *InquiryUpdate) SetNillablePriority(v *inquiry.Priority) *InquiryUpdate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*InquiryUpdate) SetNillableQuestion

func (_u *InquiryUpdate) SetNillableQuestion(v *string) *InquiryUpdate

SetNillableQuestion sets the "question" field if the given value is not nil.

func (*InquiryUpdate) SetNillableResolvedAt

func (_u *InquiryUpdate) SetNillableResolvedAt(v *time.Time) *InquiryUpdate

SetNillableResolvedAt sets the "resolved_at" field if the given value is not nil.

func (*InquiryUpdate) SetNillableSessionKey

func (_u *InquiryUpdate) SetNillableSessionKey(v *string) *InquiryUpdate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*InquiryUpdate) SetNillableSourceObservationID

func (_u *InquiryUpdate) SetNillableSourceObservationID(v *string) *InquiryUpdate

SetNillableSourceObservationID sets the "source_observation_id" field if the given value is not nil.

func (*InquiryUpdate) SetNillableStatus

func (_u *InquiryUpdate) SetNillableStatus(v *inquiry.Status) *InquiryUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InquiryUpdate) SetNillableTopic

func (_u *InquiryUpdate) SetNillableTopic(v *string) *InquiryUpdate

SetNillableTopic sets the "topic" field if the given value is not nil.

func (*InquiryUpdate) SetPriority

func (_u *InquiryUpdate) SetPriority(v inquiry.Priority) *InquiryUpdate

SetPriority sets the "priority" field.

func (*InquiryUpdate) SetQuestion

func (_u *InquiryUpdate) SetQuestion(v string) *InquiryUpdate

SetQuestion sets the "question" field.

func (*InquiryUpdate) SetResolvedAt

func (_u *InquiryUpdate) SetResolvedAt(v time.Time) *InquiryUpdate

SetResolvedAt sets the "resolved_at" field.

func (*InquiryUpdate) SetSessionKey

func (_u *InquiryUpdate) SetSessionKey(v string) *InquiryUpdate

SetSessionKey sets the "session_key" field.

func (*InquiryUpdate) SetSourceObservationID

func (_u *InquiryUpdate) SetSourceObservationID(v string) *InquiryUpdate

SetSourceObservationID sets the "source_observation_id" field.

func (*InquiryUpdate) SetStatus

func (_u *InquiryUpdate) SetStatus(v inquiry.Status) *InquiryUpdate

SetStatus sets the "status" field.

func (*InquiryUpdate) SetTopic

func (_u *InquiryUpdate) SetTopic(v string) *InquiryUpdate

SetTopic sets the "topic" field.

func (*InquiryUpdate) Where

func (_u *InquiryUpdate) Where(ps ...predicate.Inquiry) *InquiryUpdate

Where appends a list predicates to the InquiryUpdate builder.

type InquiryUpdateOne

type InquiryUpdateOne struct {
	// contains filtered or unexported fields
}

InquiryUpdateOne is the builder for updating a single Inquiry entity.

func (*InquiryUpdateOne) ClearAnswer

func (_u *InquiryUpdateOne) ClearAnswer() *InquiryUpdateOne

ClearAnswer clears the value of the "answer" field.

func (*InquiryUpdateOne) ClearContext

func (_u *InquiryUpdateOne) ClearContext() *InquiryUpdateOne

ClearContext clears the value of the "context" field.

func (*InquiryUpdateOne) ClearKnowledgeKey

func (_u *InquiryUpdateOne) ClearKnowledgeKey() *InquiryUpdateOne

ClearKnowledgeKey clears the value of the "knowledge_key" field.

func (*InquiryUpdateOne) ClearResolvedAt

func (_u *InquiryUpdateOne) ClearResolvedAt() *InquiryUpdateOne

ClearResolvedAt clears the value of the "resolved_at" field.

func (*InquiryUpdateOne) ClearSourceObservationID

func (_u *InquiryUpdateOne) ClearSourceObservationID() *InquiryUpdateOne

ClearSourceObservationID clears the value of the "source_observation_id" field.

func (*InquiryUpdateOne) Exec

func (_u *InquiryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InquiryUpdateOne) ExecX

func (_u *InquiryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InquiryUpdateOne) Mutation

func (_u *InquiryUpdateOne) Mutation() *InquiryMutation

Mutation returns the InquiryMutation object of the builder.

func (*InquiryUpdateOne) Save

func (_u *InquiryUpdateOne) Save(ctx context.Context) (*Inquiry, error)

Save executes the query and returns the updated Inquiry entity.

func (*InquiryUpdateOne) SaveX

func (_u *InquiryUpdateOne) SaveX(ctx context.Context) *Inquiry

SaveX is like Save, but panics if an error occurs.

func (*InquiryUpdateOne) Select

func (_u *InquiryUpdateOne) Select(field string, fields ...string) *InquiryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*InquiryUpdateOne) SetAnswer

func (_u *InquiryUpdateOne) SetAnswer(v string) *InquiryUpdateOne

SetAnswer sets the "answer" field.

func (*InquiryUpdateOne) SetContext

func (_u *InquiryUpdateOne) SetContext(v string) *InquiryUpdateOne

SetContext sets the "context" field.

func (*InquiryUpdateOne) SetKnowledgeKey

func (_u *InquiryUpdateOne) SetKnowledgeKey(v string) *InquiryUpdateOne

SetKnowledgeKey sets the "knowledge_key" field.

func (*InquiryUpdateOne) SetNillableAnswer

func (_u *InquiryUpdateOne) SetNillableAnswer(v *string) *InquiryUpdateOne

SetNillableAnswer sets the "answer" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableContext

func (_u *InquiryUpdateOne) SetNillableContext(v *string) *InquiryUpdateOne

SetNillableContext sets the "context" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableKnowledgeKey

func (_u *InquiryUpdateOne) SetNillableKnowledgeKey(v *string) *InquiryUpdateOne

SetNillableKnowledgeKey sets the "knowledge_key" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillablePriority

func (_u *InquiryUpdateOne) SetNillablePriority(v *inquiry.Priority) *InquiryUpdateOne

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableQuestion

func (_u *InquiryUpdateOne) SetNillableQuestion(v *string) *InquiryUpdateOne

SetNillableQuestion sets the "question" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableResolvedAt

func (_u *InquiryUpdateOne) SetNillableResolvedAt(v *time.Time) *InquiryUpdateOne

SetNillableResolvedAt sets the "resolved_at" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableSessionKey

func (_u *InquiryUpdateOne) SetNillableSessionKey(v *string) *InquiryUpdateOne

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableSourceObservationID

func (_u *InquiryUpdateOne) SetNillableSourceObservationID(v *string) *InquiryUpdateOne

SetNillableSourceObservationID sets the "source_observation_id" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableStatus

func (_u *InquiryUpdateOne) SetNillableStatus(v *inquiry.Status) *InquiryUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InquiryUpdateOne) SetNillableTopic

func (_u *InquiryUpdateOne) SetNillableTopic(v *string) *InquiryUpdateOne

SetNillableTopic sets the "topic" field if the given value is not nil.

func (*InquiryUpdateOne) SetPriority

func (_u *InquiryUpdateOne) SetPriority(v inquiry.Priority) *InquiryUpdateOne

SetPriority sets the "priority" field.

func (*InquiryUpdateOne) SetQuestion

func (_u *InquiryUpdateOne) SetQuestion(v string) *InquiryUpdateOne

SetQuestion sets the "question" field.

func (*InquiryUpdateOne) SetResolvedAt

func (_u *InquiryUpdateOne) SetResolvedAt(v time.Time) *InquiryUpdateOne

SetResolvedAt sets the "resolved_at" field.

func (*InquiryUpdateOne) SetSessionKey

func (_u *InquiryUpdateOne) SetSessionKey(v string) *InquiryUpdateOne

SetSessionKey sets the "session_key" field.

func (*InquiryUpdateOne) SetSourceObservationID

func (_u *InquiryUpdateOne) SetSourceObservationID(v string) *InquiryUpdateOne

SetSourceObservationID sets the "source_observation_id" field.

func (*InquiryUpdateOne) SetStatus

func (_u *InquiryUpdateOne) SetStatus(v inquiry.Status) *InquiryUpdateOne

SetStatus sets the "status" field.

func (*InquiryUpdateOne) SetTopic

func (_u *InquiryUpdateOne) SetTopic(v string) *InquiryUpdateOne

SetTopic sets the "topic" field.

func (*InquiryUpdateOne) Where

Where appends a list predicates to the InquiryUpdate builder.

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 Key

type Key struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Display name for the key
	Name string `json:"name,omitempty"`
	// Reference to key in external provider (companion) or 'local'
	RemoteKeyID string `json:"remote_key_id,omitempty"`
	// Key purpose
	Type key.Type `json:"type,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Last time this key was used for an operation
	LastUsedAt *time.Time `json:"last_used_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the KeyQuery when eager-loading is set.
	Edges KeyEdges `json:"edges"`
	// contains filtered or unexported fields
}

Key is the model entity for the Key schema.

func (*Key) QuerySecrets

func (_m *Key) QuerySecrets() *SecretQuery

QuerySecrets queries the "secrets" edge of the Key entity.

func (*Key) String

func (_m *Key) String() string

String implements the fmt.Stringer.

func (*Key) Unwrap

func (_m *Key) Unwrap() *Key

Unwrap unwraps the Key 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 (*Key) Update

func (_m *Key) Update() *KeyUpdateOne

Update returns a builder for updating this Key. Note that you need to call Key.Unwrap() before calling this method if this Key was returned from a transaction, and the transaction was committed or rolled back.

func (*Key) Value

func (_m *Key) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Key. This includes values selected through modifiers, order, etc.

type KeyClient

type KeyClient struct {
	// contains filtered or unexported fields
}

KeyClient is a client for the Key schema.

func NewKeyClient

func NewKeyClient(c config) *KeyClient

NewKeyClient returns a client for the Key from the given config.

func (*KeyClient) Create

func (c *KeyClient) Create() *KeyCreate

Create returns a builder for creating a Key entity.

func (*KeyClient) CreateBulk

func (c *KeyClient) CreateBulk(builders ...*KeyCreate) *KeyCreateBulk

CreateBulk returns a builder for creating a bulk of Key entities.

func (*KeyClient) Delete

func (c *KeyClient) Delete() *KeyDelete

Delete returns a delete builder for Key.

func (*KeyClient) DeleteOne

func (c *KeyClient) DeleteOne(_m *Key) *KeyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*KeyClient) DeleteOneID

func (c *KeyClient) DeleteOneID(id uuid.UUID) *KeyDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*KeyClient) Get

func (c *KeyClient) Get(ctx context.Context, id uuid.UUID) (*Key, error)

Get returns a Key entity by its id.

func (*KeyClient) GetX

func (c *KeyClient) GetX(ctx context.Context, id uuid.UUID) *Key

GetX is like Get, but panics if an error occurs.

func (*KeyClient) Hooks

func (c *KeyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*KeyClient) Intercept

func (c *KeyClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `key.Intercept(f(g(h())))`.

func (*KeyClient) Interceptors

func (c *KeyClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*KeyClient) MapCreateBulk

func (c *KeyClient) MapCreateBulk(slice any, setFunc func(*KeyCreate, int)) *KeyCreateBulk

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 (*KeyClient) Query

func (c *KeyClient) Query() *KeyQuery

Query returns a query builder for Key.

func (*KeyClient) QuerySecrets

func (c *KeyClient) QuerySecrets(_m *Key) *SecretQuery

QuerySecrets queries the secrets edge of a Key.

func (*KeyClient) Update

func (c *KeyClient) Update() *KeyUpdate

Update returns an update builder for Key.

func (*KeyClient) UpdateOne

func (c *KeyClient) UpdateOne(_m *Key) *KeyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*KeyClient) UpdateOneID

func (c *KeyClient) UpdateOneID(id uuid.UUID) *KeyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*KeyClient) Use

func (c *KeyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `key.Hooks(f(g(h())))`.

type KeyCreate

type KeyCreate struct {
	// contains filtered or unexported fields
}

KeyCreate is the builder for creating a Key entity.

func (*KeyCreate) AddSecretIDs

func (_c *KeyCreate) AddSecretIDs(ids ...uuid.UUID) *KeyCreate

AddSecretIDs adds the "secrets" edge to the Secret entity by IDs.

func (*KeyCreate) AddSecrets

func (_c *KeyCreate) AddSecrets(v ...*Secret) *KeyCreate

AddSecrets adds the "secrets" edges to the Secret entity.

func (*KeyCreate) Exec

func (_c *KeyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*KeyCreate) ExecX

func (_c *KeyCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KeyCreate) Mutation

func (_c *KeyCreate) Mutation() *KeyMutation

Mutation returns the KeyMutation object of the builder.

func (*KeyCreate) Save

func (_c *KeyCreate) Save(ctx context.Context) (*Key, error)

Save creates the Key in the database.

func (*KeyCreate) SaveX

func (_c *KeyCreate) SaveX(ctx context.Context) *Key

SaveX calls Save and panics if Save returns an error.

func (*KeyCreate) SetCreatedAt

func (_c *KeyCreate) SetCreatedAt(v time.Time) *KeyCreate

SetCreatedAt sets the "created_at" field.

func (*KeyCreate) SetID

func (_c *KeyCreate) SetID(v uuid.UUID) *KeyCreate

SetID sets the "id" field.

func (*KeyCreate) SetLastUsedAt

func (_c *KeyCreate) SetLastUsedAt(v time.Time) *KeyCreate

SetLastUsedAt sets the "last_used_at" field.

func (*KeyCreate) SetName

func (_c *KeyCreate) SetName(v string) *KeyCreate

SetName sets the "name" field.

func (*KeyCreate) SetNillableCreatedAt

func (_c *KeyCreate) SetNillableCreatedAt(v *time.Time) *KeyCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*KeyCreate) SetNillableID

func (_c *KeyCreate) SetNillableID(v *uuid.UUID) *KeyCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*KeyCreate) SetNillableLastUsedAt

func (_c *KeyCreate) SetNillableLastUsedAt(v *time.Time) *KeyCreate

SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.

func (*KeyCreate) SetNillableType

func (_c *KeyCreate) SetNillableType(v *key.Type) *KeyCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*KeyCreate) SetRemoteKeyID

func (_c *KeyCreate) SetRemoteKeyID(v string) *KeyCreate

SetRemoteKeyID sets the "remote_key_id" field.

func (*KeyCreate) SetType

func (_c *KeyCreate) SetType(v key.Type) *KeyCreate

SetType sets the "type" field.

type KeyCreateBulk

type KeyCreateBulk struct {
	// contains filtered or unexported fields
}

KeyCreateBulk is the builder for creating many Key entities in bulk.

func (*KeyCreateBulk) Exec

func (_c *KeyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*KeyCreateBulk) ExecX

func (_c *KeyCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KeyCreateBulk) Save

func (_c *KeyCreateBulk) Save(ctx context.Context) ([]*Key, error)

Save creates the Key entities in the database.

func (*KeyCreateBulk) SaveX

func (_c *KeyCreateBulk) SaveX(ctx context.Context) []*Key

SaveX is like Save, but panics if an error occurs.

type KeyDelete

type KeyDelete struct {
	// contains filtered or unexported fields
}

KeyDelete is the builder for deleting a Key entity.

func (*KeyDelete) Exec

func (_d *KeyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*KeyDelete) ExecX

func (_d *KeyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*KeyDelete) Where

func (_d *KeyDelete) Where(ps ...predicate.Key) *KeyDelete

Where appends a list predicates to the KeyDelete builder.

type KeyDeleteOne

type KeyDeleteOne struct {
	// contains filtered or unexported fields
}

KeyDeleteOne is the builder for deleting a single Key entity.

func (*KeyDeleteOne) Exec

func (_d *KeyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*KeyDeleteOne) ExecX

func (_d *KeyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KeyDeleteOne) Where

func (_d *KeyDeleteOne) Where(ps ...predicate.Key) *KeyDeleteOne

Where appends a list predicates to the KeyDelete builder.

type KeyEdges

type KeyEdges struct {
	// Secrets encrypted with this key
	Secrets []*Secret `json:"secrets,omitempty"`
	// contains filtered or unexported fields
}

KeyEdges holds the relations/edges for other nodes in the graph.

func (KeyEdges) SecretsOrErr

func (e KeyEdges) SecretsOrErr() ([]*Secret, error)

SecretsOrErr returns the Secrets value or an error if the edge was not loaded in eager-loading.

type KeyGroupBy

type KeyGroupBy struct {
	// contains filtered or unexported fields
}

KeyGroupBy is the group-by builder for Key entities.

func (*KeyGroupBy) Aggregate

func (_g *KeyGroupBy) Aggregate(fns ...AggregateFunc) *KeyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*KeyGroupBy) Bool

func (s *KeyGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) BoolX

func (s *KeyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KeyGroupBy) Bools

func (s *KeyGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) BoolsX

func (s *KeyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*KeyGroupBy) Float64

func (s *KeyGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) Float64X

func (s *KeyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KeyGroupBy) Float64s

func (s *KeyGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) Float64sX

func (s *KeyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KeyGroupBy) Int

func (s *KeyGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) IntX

func (s *KeyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KeyGroupBy) Ints

func (s *KeyGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) IntsX

func (s *KeyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*KeyGroupBy) Scan

func (_g *KeyGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KeyGroupBy) ScanX

func (s *KeyGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KeyGroupBy) String

func (s *KeyGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) StringX

func (s *KeyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KeyGroupBy) Strings

func (s *KeyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KeyGroupBy) StringsX

func (s *KeyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KeyMutation

type KeyMutation struct {
	// contains filtered or unexported fields
}

KeyMutation represents an operation that mutates the Key nodes in the graph.

func (*KeyMutation) AddField

func (m *KeyMutation) 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 (*KeyMutation) AddSecretIDs

func (m *KeyMutation) AddSecretIDs(ids ...uuid.UUID)

AddSecretIDs adds the "secrets" edge to the Secret entity by ids.

func (*KeyMutation) AddedEdges

func (m *KeyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*KeyMutation) AddedField

func (m *KeyMutation) 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 (*KeyMutation) AddedFields

func (m *KeyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*KeyMutation) AddedIDs

func (m *KeyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*KeyMutation) ClearEdge

func (m *KeyMutation) 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 (*KeyMutation) ClearField

func (m *KeyMutation) 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 (*KeyMutation) ClearLastUsedAt

func (m *KeyMutation) ClearLastUsedAt()

ClearLastUsedAt clears the value of the "last_used_at" field.

func (*KeyMutation) ClearSecrets

func (m *KeyMutation) ClearSecrets()

ClearSecrets clears the "secrets" edge to the Secret entity.

func (*KeyMutation) ClearedEdges

func (m *KeyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*KeyMutation) ClearedFields

func (m *KeyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (KeyMutation) Client

func (m KeyMutation) 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 (*KeyMutation) CreatedAt

func (m *KeyMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*KeyMutation) EdgeCleared

func (m *KeyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*KeyMutation) Field

func (m *KeyMutation) 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 (*KeyMutation) FieldCleared

func (m *KeyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*KeyMutation) Fields

func (m *KeyMutation) 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 (*KeyMutation) GetType

func (m *KeyMutation) GetType() (r key.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*KeyMutation) ID

func (m *KeyMutation) ID() (id uuid.UUID, 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 (*KeyMutation) IDs

func (m *KeyMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*KeyMutation) LastUsedAt

func (m *KeyMutation) LastUsedAt() (r time.Time, exists bool)

LastUsedAt returns the value of the "last_used_at" field in the mutation.

func (*KeyMutation) LastUsedAtCleared

func (m *KeyMutation) LastUsedAtCleared() bool

LastUsedAtCleared returns if the "last_used_at" field was cleared in this mutation.

func (*KeyMutation) Name

func (m *KeyMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*KeyMutation) OldCreatedAt

func (m *KeyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Key entity. If the Key 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 (*KeyMutation) OldField

func (m *KeyMutation) 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 (*KeyMutation) OldLastUsedAt

func (m *KeyMutation) OldLastUsedAt(ctx context.Context) (v *time.Time, err error)

OldLastUsedAt returns the old "last_used_at" field's value of the Key entity. If the Key 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 (*KeyMutation) OldName

func (m *KeyMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Key entity. If the Key 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 (*KeyMutation) OldRemoteKeyID

func (m *KeyMutation) OldRemoteKeyID(ctx context.Context) (v string, err error)

OldRemoteKeyID returns the old "remote_key_id" field's value of the Key entity. If the Key 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 (*KeyMutation) OldType

func (m *KeyMutation) OldType(ctx context.Context) (v key.Type, err error)

OldType returns the old "type" field's value of the Key entity. If the Key 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 (*KeyMutation) Op

func (m *KeyMutation) Op() Op

Op returns the operation name.

func (*KeyMutation) RemoteKeyID

func (m *KeyMutation) RemoteKeyID() (r string, exists bool)

RemoteKeyID returns the value of the "remote_key_id" field in the mutation.

func (*KeyMutation) RemoveSecretIDs

func (m *KeyMutation) RemoveSecretIDs(ids ...uuid.UUID)

RemoveSecretIDs removes the "secrets" edge to the Secret entity by IDs.

func (*KeyMutation) RemovedEdges

func (m *KeyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*KeyMutation) RemovedIDs

func (m *KeyMutation) 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 (*KeyMutation) RemovedSecretsIDs

func (m *KeyMutation) RemovedSecretsIDs() (ids []uuid.UUID)

RemovedSecrets returns the removed IDs of the "secrets" edge to the Secret entity.

func (*KeyMutation) ResetCreatedAt

func (m *KeyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*KeyMutation) ResetEdge

func (m *KeyMutation) 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 (*KeyMutation) ResetField

func (m *KeyMutation) 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 (*KeyMutation) ResetLastUsedAt

func (m *KeyMutation) ResetLastUsedAt()

ResetLastUsedAt resets all changes to the "last_used_at" field.

func (*KeyMutation) ResetName

func (m *KeyMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*KeyMutation) ResetRemoteKeyID

func (m *KeyMutation) ResetRemoteKeyID()

ResetRemoteKeyID resets all changes to the "remote_key_id" field.

func (*KeyMutation) ResetSecrets

func (m *KeyMutation) ResetSecrets()

ResetSecrets resets all changes to the "secrets" edge.

func (*KeyMutation) ResetType

func (m *KeyMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*KeyMutation) SecretsCleared

func (m *KeyMutation) SecretsCleared() bool

SecretsCleared reports if the "secrets" edge to the Secret entity was cleared.

func (*KeyMutation) SecretsIDs

func (m *KeyMutation) SecretsIDs() (ids []uuid.UUID)

SecretsIDs returns the "secrets" edge IDs in the mutation.

func (*KeyMutation) SetCreatedAt

func (m *KeyMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*KeyMutation) SetField

func (m *KeyMutation) 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 (*KeyMutation) SetID

func (m *KeyMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Key entities.

func (*KeyMutation) SetLastUsedAt

func (m *KeyMutation) SetLastUsedAt(t time.Time)

SetLastUsedAt sets the "last_used_at" field.

func (*KeyMutation) SetName

func (m *KeyMutation) SetName(s string)

SetName sets the "name" field.

func (*KeyMutation) SetOp

func (m *KeyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*KeyMutation) SetRemoteKeyID

func (m *KeyMutation) SetRemoteKeyID(s string)

SetRemoteKeyID sets the "remote_key_id" field.

func (*KeyMutation) SetType

func (m *KeyMutation) SetType(k key.Type)

SetType sets the "type" field.

func (KeyMutation) Tx

func (m KeyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*KeyMutation) Type

func (m *KeyMutation) Type() string

Type returns the node type of this mutation (Key).

func (*KeyMutation) Where

func (m *KeyMutation) Where(ps ...predicate.Key)

Where appends a list predicates to the KeyMutation builder.

func (*KeyMutation) WhereP

func (m *KeyMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the KeyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type KeyQuery

type KeyQuery struct {
	// contains filtered or unexported fields
}

KeyQuery is the builder for querying Key entities.

func (*KeyQuery) Aggregate

func (_q *KeyQuery) Aggregate(fns ...AggregateFunc) *KeySelect

Aggregate returns a KeySelect configured with the given aggregations.

func (*KeyQuery) All

func (_q *KeyQuery) All(ctx context.Context) ([]*Key, error)

All executes the query and returns a list of Keys.

func (*KeyQuery) AllX

func (_q *KeyQuery) AllX(ctx context.Context) []*Key

AllX is like All, but panics if an error occurs.

func (*KeyQuery) Clone

func (_q *KeyQuery) Clone() *KeyQuery

Clone returns a duplicate of the KeyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*KeyQuery) Count

func (_q *KeyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*KeyQuery) CountX

func (_q *KeyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*KeyQuery) Exist

func (_q *KeyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*KeyQuery) ExistX

func (_q *KeyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*KeyQuery) First

func (_q *KeyQuery) First(ctx context.Context) (*Key, error)

First returns the first Key entity from the query. Returns a *NotFoundError when no Key was found.

func (*KeyQuery) FirstID

func (_q *KeyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Key ID from the query. Returns a *NotFoundError when no Key ID was found.

func (*KeyQuery) FirstIDX

func (_q *KeyQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*KeyQuery) FirstX

func (_q *KeyQuery) FirstX(ctx context.Context) *Key

FirstX is like First, but panics if an error occurs.

func (*KeyQuery) GroupBy

func (_q *KeyQuery) GroupBy(field string, fields ...string) *KeyGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Key.Query().
	GroupBy(key.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*KeyQuery) IDs

func (_q *KeyQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Key IDs.

func (*KeyQuery) IDsX

func (_q *KeyQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*KeyQuery) Limit

func (_q *KeyQuery) Limit(limit int) *KeyQuery

Limit the number of records to be returned by this query.

func (*KeyQuery) Offset

func (_q *KeyQuery) Offset(offset int) *KeyQuery

Offset to start from.

func (*KeyQuery) Only

func (_q *KeyQuery) Only(ctx context.Context) (*Key, error)

Only returns a single Key entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Key entity is found. Returns a *NotFoundError when no Key entities are found.

func (*KeyQuery) OnlyID

func (_q *KeyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Key ID in the query. Returns a *NotSingularError when more than one Key ID is found. Returns a *NotFoundError when no entities are found.

func (*KeyQuery) OnlyIDX

func (_q *KeyQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*KeyQuery) OnlyX

func (_q *KeyQuery) OnlyX(ctx context.Context) *Key

OnlyX is like Only, but panics if an error occurs.

func (*KeyQuery) Order

func (_q *KeyQuery) Order(o ...key.OrderOption) *KeyQuery

Order specifies how the records should be ordered.

func (*KeyQuery) QuerySecrets

func (_q *KeyQuery) QuerySecrets() *SecretQuery

QuerySecrets chains the current query on the "secrets" edge.

func (*KeyQuery) Select

func (_q *KeyQuery) Select(fields ...string) *KeySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Key.Query().
	Select(key.FieldName).
	Scan(ctx, &v)

func (*KeyQuery) Unique

func (_q *KeyQuery) Unique(unique bool) *KeyQuery

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 (*KeyQuery) Where

func (_q *KeyQuery) Where(ps ...predicate.Key) *KeyQuery

Where adds a new predicate for the KeyQuery builder.

func (*KeyQuery) WithSecrets

func (_q *KeyQuery) WithSecrets(opts ...func(*SecretQuery)) *KeyQuery

WithSecrets tells the query-builder to eager-load the nodes that are connected to the "secrets" edge. The optional arguments are used to configure the query builder of the edge.

type KeySelect

type KeySelect struct {
	*KeyQuery
	// contains filtered or unexported fields
}

KeySelect is the builder for selecting fields of Key entities.

func (*KeySelect) Aggregate

func (_s *KeySelect) Aggregate(fns ...AggregateFunc) *KeySelect

Aggregate adds the given aggregation functions to the selector query.

func (*KeySelect) Bool

func (s *KeySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KeySelect) BoolX

func (s *KeySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KeySelect) Bools

func (s *KeySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KeySelect) BoolsX

func (s *KeySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*KeySelect) Float64

func (s *KeySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KeySelect) Float64X

func (s *KeySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KeySelect) Float64s

func (s *KeySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KeySelect) Float64sX

func (s *KeySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KeySelect) Int

func (s *KeySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KeySelect) IntX

func (s *KeySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KeySelect) Ints

func (s *KeySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KeySelect) IntsX

func (s *KeySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*KeySelect) Scan

func (_s *KeySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KeySelect) ScanX

func (s *KeySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KeySelect) String

func (s *KeySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KeySelect) StringX

func (s *KeySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KeySelect) Strings

func (s *KeySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KeySelect) StringsX

func (s *KeySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KeyUpdate

type KeyUpdate struct {
	// contains filtered or unexported fields
}

KeyUpdate is the builder for updating Key entities.

func (*KeyUpdate) AddSecretIDs

func (_u *KeyUpdate) AddSecretIDs(ids ...uuid.UUID) *KeyUpdate

AddSecretIDs adds the "secrets" edge to the Secret entity by IDs.

func (*KeyUpdate) AddSecrets

func (_u *KeyUpdate) AddSecrets(v ...*Secret) *KeyUpdate

AddSecrets adds the "secrets" edges to the Secret entity.

func (*KeyUpdate) ClearLastUsedAt

func (_u *KeyUpdate) ClearLastUsedAt() *KeyUpdate

ClearLastUsedAt clears the value of the "last_used_at" field.

func (*KeyUpdate) ClearSecrets

func (_u *KeyUpdate) ClearSecrets() *KeyUpdate

ClearSecrets clears all "secrets" edges to the Secret entity.

func (*KeyUpdate) Exec

func (_u *KeyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*KeyUpdate) ExecX

func (_u *KeyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KeyUpdate) Mutation

func (_u *KeyUpdate) Mutation() *KeyMutation

Mutation returns the KeyMutation object of the builder.

func (*KeyUpdate) RemoveSecretIDs

func (_u *KeyUpdate) RemoveSecretIDs(ids ...uuid.UUID) *KeyUpdate

RemoveSecretIDs removes the "secrets" edge to Secret entities by IDs.

func (*KeyUpdate) RemoveSecrets

func (_u *KeyUpdate) RemoveSecrets(v ...*Secret) *KeyUpdate

RemoveSecrets removes "secrets" edges to Secret entities.

func (*KeyUpdate) Save

func (_u *KeyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*KeyUpdate) SaveX

func (_u *KeyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*KeyUpdate) SetLastUsedAt

func (_u *KeyUpdate) SetLastUsedAt(v time.Time) *KeyUpdate

SetLastUsedAt sets the "last_used_at" field.

func (*KeyUpdate) SetName

func (_u *KeyUpdate) SetName(v string) *KeyUpdate

SetName sets the "name" field.

func (*KeyUpdate) SetNillableLastUsedAt

func (_u *KeyUpdate) SetNillableLastUsedAt(v *time.Time) *KeyUpdate

SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.

func (*KeyUpdate) SetNillableName

func (_u *KeyUpdate) SetNillableName(v *string) *KeyUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*KeyUpdate) SetNillableRemoteKeyID

func (_u *KeyUpdate) SetNillableRemoteKeyID(v *string) *KeyUpdate

SetNillableRemoteKeyID sets the "remote_key_id" field if the given value is not nil.

func (*KeyUpdate) SetNillableType

func (_u *KeyUpdate) SetNillableType(v *key.Type) *KeyUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*KeyUpdate) SetRemoteKeyID

func (_u *KeyUpdate) SetRemoteKeyID(v string) *KeyUpdate

SetRemoteKeyID sets the "remote_key_id" field.

func (*KeyUpdate) SetType

func (_u *KeyUpdate) SetType(v key.Type) *KeyUpdate

SetType sets the "type" field.

func (*KeyUpdate) Where

func (_u *KeyUpdate) Where(ps ...predicate.Key) *KeyUpdate

Where appends a list predicates to the KeyUpdate builder.

type KeyUpdateOne

type KeyUpdateOne struct {
	// contains filtered or unexported fields
}

KeyUpdateOne is the builder for updating a single Key entity.

func (*KeyUpdateOne) AddSecretIDs

func (_u *KeyUpdateOne) AddSecretIDs(ids ...uuid.UUID) *KeyUpdateOne

AddSecretIDs adds the "secrets" edge to the Secret entity by IDs.

func (*KeyUpdateOne) AddSecrets

func (_u *KeyUpdateOne) AddSecrets(v ...*Secret) *KeyUpdateOne

AddSecrets adds the "secrets" edges to the Secret entity.

func (*KeyUpdateOne) ClearLastUsedAt

func (_u *KeyUpdateOne) ClearLastUsedAt() *KeyUpdateOne

ClearLastUsedAt clears the value of the "last_used_at" field.

func (*KeyUpdateOne) ClearSecrets

func (_u *KeyUpdateOne) ClearSecrets() *KeyUpdateOne

ClearSecrets clears all "secrets" edges to the Secret entity.

func (*KeyUpdateOne) Exec

func (_u *KeyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*KeyUpdateOne) ExecX

func (_u *KeyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KeyUpdateOne) Mutation

func (_u *KeyUpdateOne) Mutation() *KeyMutation

Mutation returns the KeyMutation object of the builder.

func (*KeyUpdateOne) RemoveSecretIDs

func (_u *KeyUpdateOne) RemoveSecretIDs(ids ...uuid.UUID) *KeyUpdateOne

RemoveSecretIDs removes the "secrets" edge to Secret entities by IDs.

func (*KeyUpdateOne) RemoveSecrets

func (_u *KeyUpdateOne) RemoveSecrets(v ...*Secret) *KeyUpdateOne

RemoveSecrets removes "secrets" edges to Secret entities.

func (*KeyUpdateOne) Save

func (_u *KeyUpdateOne) Save(ctx context.Context) (*Key, error)

Save executes the query and returns the updated Key entity.

func (*KeyUpdateOne) SaveX

func (_u *KeyUpdateOne) SaveX(ctx context.Context) *Key

SaveX is like Save, but panics if an error occurs.

func (*KeyUpdateOne) Select

func (_u *KeyUpdateOne) Select(field string, fields ...string) *KeyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*KeyUpdateOne) SetLastUsedAt

func (_u *KeyUpdateOne) SetLastUsedAt(v time.Time) *KeyUpdateOne

SetLastUsedAt sets the "last_used_at" field.

func (*KeyUpdateOne) SetName

func (_u *KeyUpdateOne) SetName(v string) *KeyUpdateOne

SetName sets the "name" field.

func (*KeyUpdateOne) SetNillableLastUsedAt

func (_u *KeyUpdateOne) SetNillableLastUsedAt(v *time.Time) *KeyUpdateOne

SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.

func (*KeyUpdateOne) SetNillableName

func (_u *KeyUpdateOne) SetNillableName(v *string) *KeyUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*KeyUpdateOne) SetNillableRemoteKeyID

func (_u *KeyUpdateOne) SetNillableRemoteKeyID(v *string) *KeyUpdateOne

SetNillableRemoteKeyID sets the "remote_key_id" field if the given value is not nil.

func (*KeyUpdateOne) SetNillableType

func (_u *KeyUpdateOne) SetNillableType(v *key.Type) *KeyUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*KeyUpdateOne) SetRemoteKeyID

func (_u *KeyUpdateOne) SetRemoteKeyID(v string) *KeyUpdateOne

SetRemoteKeyID sets the "remote_key_id" field.

func (*KeyUpdateOne) SetType

func (_u *KeyUpdateOne) SetType(v key.Type) *KeyUpdateOne

SetType sets the "type" field.

func (*KeyUpdateOne) Where

func (_u *KeyUpdateOne) Where(ps ...predicate.Key) *KeyUpdateOne

Where appends a list predicates to the KeyUpdate builder.

type Keys

type Keys []*Key

Keys is a parsable slice of Key.

type Knowledge

type Knowledge struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Category holds the value of the "category" field.
	Category knowledge.Category `json:"category,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Tags holds the value of the "tags" field.
	Tags []string `json:"tags,omitempty"`
	// Source holds the value of the "source" field.
	Source string `json:"source,omitempty"`
	// UseCount holds the value of the "use_count" field.
	UseCount int `json:"use_count,omitempty"`
	// RelevanceScore holds the value of the "relevance_score" field.
	RelevanceScore float64 `json:"relevance_score,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Knowledge is the model entity for the Knowledge schema.

func (*Knowledge) String

func (_m *Knowledge) String() string

String implements the fmt.Stringer.

func (*Knowledge) Unwrap

func (_m *Knowledge) Unwrap() *Knowledge

Unwrap unwraps the Knowledge 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 (*Knowledge) Update

func (_m *Knowledge) Update() *KnowledgeUpdateOne

Update returns a builder for updating this Knowledge. Note that you need to call Knowledge.Unwrap() before calling this method if this Knowledge was returned from a transaction, and the transaction was committed or rolled back.

func (*Knowledge) Value

func (_m *Knowledge) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Knowledge. This includes values selected through modifiers, order, etc.

type KnowledgeClient

type KnowledgeClient struct {
	// contains filtered or unexported fields
}

KnowledgeClient is a client for the Knowledge schema.

func NewKnowledgeClient

func NewKnowledgeClient(c config) *KnowledgeClient

NewKnowledgeClient returns a client for the Knowledge from the given config.

func (*KnowledgeClient) Create

func (c *KnowledgeClient) Create() *KnowledgeCreate

Create returns a builder for creating a Knowledge entity.

func (*KnowledgeClient) CreateBulk

func (c *KnowledgeClient) CreateBulk(builders ...*KnowledgeCreate) *KnowledgeCreateBulk

CreateBulk returns a builder for creating a bulk of Knowledge entities.

func (*KnowledgeClient) Delete

func (c *KnowledgeClient) Delete() *KnowledgeDelete

Delete returns a delete builder for Knowledge.

func (*KnowledgeClient) DeleteOne

func (c *KnowledgeClient) DeleteOne(_m *Knowledge) *KnowledgeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*KnowledgeClient) DeleteOneID

func (c *KnowledgeClient) DeleteOneID(id uuid.UUID) *KnowledgeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*KnowledgeClient) Get

func (c *KnowledgeClient) Get(ctx context.Context, id uuid.UUID) (*Knowledge, error)

Get returns a Knowledge entity by its id.

func (*KnowledgeClient) GetX

func (c *KnowledgeClient) GetX(ctx context.Context, id uuid.UUID) *Knowledge

GetX is like Get, but panics if an error occurs.

func (*KnowledgeClient) Hooks

func (c *KnowledgeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*KnowledgeClient) Intercept

func (c *KnowledgeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `knowledge.Intercept(f(g(h())))`.

func (*KnowledgeClient) Interceptors

func (c *KnowledgeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*KnowledgeClient) MapCreateBulk

func (c *KnowledgeClient) MapCreateBulk(slice any, setFunc func(*KnowledgeCreate, int)) *KnowledgeCreateBulk

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 (*KnowledgeClient) Query

func (c *KnowledgeClient) Query() *KnowledgeQuery

Query returns a query builder for Knowledge.

func (*KnowledgeClient) Update

func (c *KnowledgeClient) Update() *KnowledgeUpdate

Update returns an update builder for Knowledge.

func (*KnowledgeClient) UpdateOne

func (c *KnowledgeClient) UpdateOne(_m *Knowledge) *KnowledgeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*KnowledgeClient) UpdateOneID

func (c *KnowledgeClient) UpdateOneID(id uuid.UUID) *KnowledgeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*KnowledgeClient) Use

func (c *KnowledgeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `knowledge.Hooks(f(g(h())))`.

type KnowledgeCreate

type KnowledgeCreate struct {
	// contains filtered or unexported fields
}

KnowledgeCreate is the builder for creating a Knowledge entity.

func (*KnowledgeCreate) Exec

func (_c *KnowledgeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*KnowledgeCreate) ExecX

func (_c *KnowledgeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KnowledgeCreate) Mutation

func (_c *KnowledgeCreate) Mutation() *KnowledgeMutation

Mutation returns the KnowledgeMutation object of the builder.

func (*KnowledgeCreate) Save

func (_c *KnowledgeCreate) Save(ctx context.Context) (*Knowledge, error)

Save creates the Knowledge in the database.

func (*KnowledgeCreate) SaveX

func (_c *KnowledgeCreate) SaveX(ctx context.Context) *Knowledge

SaveX calls Save and panics if Save returns an error.

func (*KnowledgeCreate) SetCategory

func (_c *KnowledgeCreate) SetCategory(v knowledge.Category) *KnowledgeCreate

SetCategory sets the "category" field.

func (*KnowledgeCreate) SetContent

func (_c *KnowledgeCreate) SetContent(v string) *KnowledgeCreate

SetContent sets the "content" field.

func (*KnowledgeCreate) SetCreatedAt

func (_c *KnowledgeCreate) SetCreatedAt(v time.Time) *KnowledgeCreate

SetCreatedAt sets the "created_at" field.

func (*KnowledgeCreate) SetID

func (_c *KnowledgeCreate) SetID(v uuid.UUID) *KnowledgeCreate

SetID sets the "id" field.

func (*KnowledgeCreate) SetKey

func (_c *KnowledgeCreate) SetKey(v string) *KnowledgeCreate

SetKey sets the "key" field.

func (*KnowledgeCreate) SetNillableCreatedAt

func (_c *KnowledgeCreate) SetNillableCreatedAt(v *time.Time) *KnowledgeCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*KnowledgeCreate) SetNillableID

func (_c *KnowledgeCreate) SetNillableID(v *uuid.UUID) *KnowledgeCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*KnowledgeCreate) SetNillableRelevanceScore

func (_c *KnowledgeCreate) SetNillableRelevanceScore(v *float64) *KnowledgeCreate

SetNillableRelevanceScore sets the "relevance_score" field if the given value is not nil.

func (*KnowledgeCreate) SetNillableSource

func (_c *KnowledgeCreate) SetNillableSource(v *string) *KnowledgeCreate

SetNillableSource sets the "source" field if the given value is not nil.

func (*KnowledgeCreate) SetNillableUpdatedAt

func (_c *KnowledgeCreate) SetNillableUpdatedAt(v *time.Time) *KnowledgeCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*KnowledgeCreate) SetNillableUseCount

func (_c *KnowledgeCreate) SetNillableUseCount(v *int) *KnowledgeCreate

SetNillableUseCount sets the "use_count" field if the given value is not nil.

func (*KnowledgeCreate) SetRelevanceScore

func (_c *KnowledgeCreate) SetRelevanceScore(v float64) *KnowledgeCreate

SetRelevanceScore sets the "relevance_score" field.

func (*KnowledgeCreate) SetSource

func (_c *KnowledgeCreate) SetSource(v string) *KnowledgeCreate

SetSource sets the "source" field.

func (*KnowledgeCreate) SetTags

func (_c *KnowledgeCreate) SetTags(v []string) *KnowledgeCreate

SetTags sets the "tags" field.

func (*KnowledgeCreate) SetUpdatedAt

func (_c *KnowledgeCreate) SetUpdatedAt(v time.Time) *KnowledgeCreate

SetUpdatedAt sets the "updated_at" field.

func (*KnowledgeCreate) SetUseCount

func (_c *KnowledgeCreate) SetUseCount(v int) *KnowledgeCreate

SetUseCount sets the "use_count" field.

type KnowledgeCreateBulk

type KnowledgeCreateBulk struct {
	// contains filtered or unexported fields
}

KnowledgeCreateBulk is the builder for creating many Knowledge entities in bulk.

func (*KnowledgeCreateBulk) Exec

func (_c *KnowledgeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*KnowledgeCreateBulk) ExecX

func (_c *KnowledgeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KnowledgeCreateBulk) Save

func (_c *KnowledgeCreateBulk) Save(ctx context.Context) ([]*Knowledge, error)

Save creates the Knowledge entities in the database.

func (*KnowledgeCreateBulk) SaveX

func (_c *KnowledgeCreateBulk) SaveX(ctx context.Context) []*Knowledge

SaveX is like Save, but panics if an error occurs.

type KnowledgeDelete

type KnowledgeDelete struct {
	// contains filtered or unexported fields
}

KnowledgeDelete is the builder for deleting a Knowledge entity.

func (*KnowledgeDelete) Exec

func (_d *KnowledgeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*KnowledgeDelete) ExecX

func (_d *KnowledgeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*KnowledgeDelete) Where

Where appends a list predicates to the KnowledgeDelete builder.

type KnowledgeDeleteOne

type KnowledgeDeleteOne struct {
	// contains filtered or unexported fields
}

KnowledgeDeleteOne is the builder for deleting a single Knowledge entity.

func (*KnowledgeDeleteOne) Exec

func (_d *KnowledgeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*KnowledgeDeleteOne) ExecX

func (_d *KnowledgeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KnowledgeDeleteOne) Where

Where appends a list predicates to the KnowledgeDelete builder.

type KnowledgeGroupBy

type KnowledgeGroupBy struct {
	// contains filtered or unexported fields
}

KnowledgeGroupBy is the group-by builder for Knowledge entities.

func (*KnowledgeGroupBy) Aggregate

func (_g *KnowledgeGroupBy) Aggregate(fns ...AggregateFunc) *KnowledgeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*KnowledgeGroupBy) Bool

func (s *KnowledgeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) BoolX

func (s *KnowledgeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KnowledgeGroupBy) Bools

func (s *KnowledgeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) BoolsX

func (s *KnowledgeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*KnowledgeGroupBy) Float64

func (s *KnowledgeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) Float64X

func (s *KnowledgeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KnowledgeGroupBy) Float64s

func (s *KnowledgeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) Float64sX

func (s *KnowledgeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KnowledgeGroupBy) Int

func (s *KnowledgeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) IntX

func (s *KnowledgeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KnowledgeGroupBy) Ints

func (s *KnowledgeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) IntsX

func (s *KnowledgeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*KnowledgeGroupBy) Scan

func (_g *KnowledgeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KnowledgeGroupBy) ScanX

func (s *KnowledgeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KnowledgeGroupBy) String

func (s *KnowledgeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) StringX

func (s *KnowledgeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KnowledgeGroupBy) Strings

func (s *KnowledgeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KnowledgeGroupBy) StringsX

func (s *KnowledgeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KnowledgeMutation

type KnowledgeMutation struct {
	// contains filtered or unexported fields
}

KnowledgeMutation represents an operation that mutates the Knowledge nodes in the graph.

func (*KnowledgeMutation) AddField

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) AddRelevanceScore

func (m *KnowledgeMutation) AddRelevanceScore(f float64)

AddRelevanceScore adds f to the "relevance_score" field.

func (*KnowledgeMutation) AddUseCount

func (m *KnowledgeMutation) AddUseCount(i int)

AddUseCount adds i to the "use_count" field.

func (*KnowledgeMutation) AddedEdges

func (m *KnowledgeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*KnowledgeMutation) AddedField

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) AddedFields

func (m *KnowledgeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*KnowledgeMutation) AddedIDs

func (m *KnowledgeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*KnowledgeMutation) AddedRelevanceScore

func (m *KnowledgeMutation) AddedRelevanceScore() (r float64, exists bool)

AddedRelevanceScore returns the value that was added to the "relevance_score" field in this mutation.

func (*KnowledgeMutation) AddedUseCount

func (m *KnowledgeMutation) AddedUseCount() (r int, exists bool)

AddedUseCount returns the value that was added to the "use_count" field in this mutation.

func (*KnowledgeMutation) AppendTags

func (m *KnowledgeMutation) AppendTags(s []string)

AppendTags adds s to the "tags" field.

func (*KnowledgeMutation) AppendedTags

func (m *KnowledgeMutation) AppendedTags() ([]string, bool)

AppendedTags returns the list of values that were appended to the "tags" field in this mutation.

func (*KnowledgeMutation) Category

func (m *KnowledgeMutation) Category() (r knowledge.Category, exists bool)

Category returns the value of the "category" field in the mutation.

func (*KnowledgeMutation) ClearEdge

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) ClearField

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) ClearSource

func (m *KnowledgeMutation) ClearSource()

ClearSource clears the value of the "source" field.

func (*KnowledgeMutation) ClearTags

func (m *KnowledgeMutation) ClearTags()

ClearTags clears the value of the "tags" field.

func (*KnowledgeMutation) ClearedEdges

func (m *KnowledgeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*KnowledgeMutation) ClearedFields

func (m *KnowledgeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (KnowledgeMutation) Client

func (m KnowledgeMutation) 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 (*KnowledgeMutation) Content

func (m *KnowledgeMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*KnowledgeMutation) CreatedAt

func (m *KnowledgeMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*KnowledgeMutation) EdgeCleared

func (m *KnowledgeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*KnowledgeMutation) Field

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) FieldCleared

func (m *KnowledgeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*KnowledgeMutation) Fields

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) ID

func (m *KnowledgeMutation) ID() (id uuid.UUID, 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 (*KnowledgeMutation) IDs

func (m *KnowledgeMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*KnowledgeMutation) Key

func (m *KnowledgeMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*KnowledgeMutation) OldCategory

func (m *KnowledgeMutation) OldCategory(ctx context.Context) (v knowledge.Category, err error)

OldCategory returns the old "category" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldContent

func (m *KnowledgeMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldCreatedAt

func (m *KnowledgeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldField

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) OldKey

func (m *KnowledgeMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldRelevanceScore

func (m *KnowledgeMutation) OldRelevanceScore(ctx context.Context) (v float64, err error)

OldRelevanceScore returns the old "relevance_score" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldSource

func (m *KnowledgeMutation) OldSource(ctx context.Context) (v string, err error)

OldSource returns the old "source" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldTags

func (m *KnowledgeMutation) OldTags(ctx context.Context) (v []string, err error)

OldTags returns the old "tags" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldUpdatedAt

func (m *KnowledgeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) OldUseCount

func (m *KnowledgeMutation) OldUseCount(ctx context.Context) (v int, err error)

OldUseCount returns the old "use_count" field's value of the Knowledge entity. If the Knowledge 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 (*KnowledgeMutation) Op

func (m *KnowledgeMutation) Op() Op

Op returns the operation name.

func (*KnowledgeMutation) RelevanceScore

func (m *KnowledgeMutation) RelevanceScore() (r float64, exists bool)

RelevanceScore returns the value of the "relevance_score" field in the mutation.

func (*KnowledgeMutation) RemovedEdges

func (m *KnowledgeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*KnowledgeMutation) RemovedIDs

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) ResetCategory

func (m *KnowledgeMutation) ResetCategory()

ResetCategory resets all changes to the "category" field.

func (*KnowledgeMutation) ResetContent

func (m *KnowledgeMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*KnowledgeMutation) ResetCreatedAt

func (m *KnowledgeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*KnowledgeMutation) ResetEdge

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) ResetField

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) ResetKey

func (m *KnowledgeMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*KnowledgeMutation) ResetRelevanceScore

func (m *KnowledgeMutation) ResetRelevanceScore()

ResetRelevanceScore resets all changes to the "relevance_score" field.

func (*KnowledgeMutation) ResetSource

func (m *KnowledgeMutation) ResetSource()

ResetSource resets all changes to the "source" field.

func (*KnowledgeMutation) ResetTags

func (m *KnowledgeMutation) ResetTags()

ResetTags resets all changes to the "tags" field.

func (*KnowledgeMutation) ResetUpdatedAt

func (m *KnowledgeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*KnowledgeMutation) ResetUseCount

func (m *KnowledgeMutation) ResetUseCount()

ResetUseCount resets all changes to the "use_count" field.

func (*KnowledgeMutation) SetCategory

func (m *KnowledgeMutation) SetCategory(k knowledge.Category)

SetCategory sets the "category" field.

func (*KnowledgeMutation) SetContent

func (m *KnowledgeMutation) SetContent(s string)

SetContent sets the "content" field.

func (*KnowledgeMutation) SetCreatedAt

func (m *KnowledgeMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*KnowledgeMutation) SetField

func (m *KnowledgeMutation) 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 (*KnowledgeMutation) SetID

func (m *KnowledgeMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Knowledge entities.

func (*KnowledgeMutation) SetKey

func (m *KnowledgeMutation) SetKey(s string)

SetKey sets the "key" field.

func (*KnowledgeMutation) SetOp

func (m *KnowledgeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*KnowledgeMutation) SetRelevanceScore

func (m *KnowledgeMutation) SetRelevanceScore(f float64)

SetRelevanceScore sets the "relevance_score" field.

func (*KnowledgeMutation) SetSource

func (m *KnowledgeMutation) SetSource(s string)

SetSource sets the "source" field.

func (*KnowledgeMutation) SetTags

func (m *KnowledgeMutation) SetTags(s []string)

SetTags sets the "tags" field.

func (*KnowledgeMutation) SetUpdatedAt

func (m *KnowledgeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*KnowledgeMutation) SetUseCount

func (m *KnowledgeMutation) SetUseCount(i int)

SetUseCount sets the "use_count" field.

func (*KnowledgeMutation) Source

func (m *KnowledgeMutation) Source() (r string, exists bool)

Source returns the value of the "source" field in the mutation.

func (*KnowledgeMutation) SourceCleared

func (m *KnowledgeMutation) SourceCleared() bool

SourceCleared returns if the "source" field was cleared in this mutation.

func (*KnowledgeMutation) Tags

func (m *KnowledgeMutation) Tags() (r []string, exists bool)

Tags returns the value of the "tags" field in the mutation.

func (*KnowledgeMutation) TagsCleared

func (m *KnowledgeMutation) TagsCleared() bool

TagsCleared returns if the "tags" field was cleared in this mutation.

func (KnowledgeMutation) Tx

func (m KnowledgeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*KnowledgeMutation) Type

func (m *KnowledgeMutation) Type() string

Type returns the node type of this mutation (Knowledge).

func (*KnowledgeMutation) UpdatedAt

func (m *KnowledgeMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*KnowledgeMutation) UseCount

func (m *KnowledgeMutation) UseCount() (r int, exists bool)

UseCount returns the value of the "use_count" field in the mutation.

func (*KnowledgeMutation) Where

func (m *KnowledgeMutation) Where(ps ...predicate.Knowledge)

Where appends a list predicates to the KnowledgeMutation builder.

func (*KnowledgeMutation) WhereP

func (m *KnowledgeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the KnowledgeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type KnowledgeQuery

type KnowledgeQuery struct {
	// contains filtered or unexported fields
}

KnowledgeQuery is the builder for querying Knowledge entities.

func (*KnowledgeQuery) Aggregate

func (_q *KnowledgeQuery) Aggregate(fns ...AggregateFunc) *KnowledgeSelect

Aggregate returns a KnowledgeSelect configured with the given aggregations.

func (*KnowledgeQuery) All

func (_q *KnowledgeQuery) All(ctx context.Context) ([]*Knowledge, error)

All executes the query and returns a list of Knowledges.

func (*KnowledgeQuery) AllX

func (_q *KnowledgeQuery) AllX(ctx context.Context) []*Knowledge

AllX is like All, but panics if an error occurs.

func (*KnowledgeQuery) Clone

func (_q *KnowledgeQuery) Clone() *KnowledgeQuery

Clone returns a duplicate of the KnowledgeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*KnowledgeQuery) Count

func (_q *KnowledgeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*KnowledgeQuery) CountX

func (_q *KnowledgeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*KnowledgeQuery) Exist

func (_q *KnowledgeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*KnowledgeQuery) ExistX

func (_q *KnowledgeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*KnowledgeQuery) First

func (_q *KnowledgeQuery) First(ctx context.Context) (*Knowledge, error)

First returns the first Knowledge entity from the query. Returns a *NotFoundError when no Knowledge was found.

func (*KnowledgeQuery) FirstID

func (_q *KnowledgeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Knowledge ID from the query. Returns a *NotFoundError when no Knowledge ID was found.

func (*KnowledgeQuery) FirstIDX

func (_q *KnowledgeQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*KnowledgeQuery) FirstX

func (_q *KnowledgeQuery) FirstX(ctx context.Context) *Knowledge

FirstX is like First, but panics if an error occurs.

func (*KnowledgeQuery) GroupBy

func (_q *KnowledgeQuery) GroupBy(field string, fields ...string) *KnowledgeGroupBy

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 {
	Key string `json:"key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Knowledge.Query().
	GroupBy(knowledge.FieldKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*KnowledgeQuery) IDs

func (_q *KnowledgeQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Knowledge IDs.

func (*KnowledgeQuery) IDsX

func (_q *KnowledgeQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*KnowledgeQuery) Limit

func (_q *KnowledgeQuery) Limit(limit int) *KnowledgeQuery

Limit the number of records to be returned by this query.

func (*KnowledgeQuery) Offset

func (_q *KnowledgeQuery) Offset(offset int) *KnowledgeQuery

Offset to start from.

func (*KnowledgeQuery) Only

func (_q *KnowledgeQuery) Only(ctx context.Context) (*Knowledge, error)

Only returns a single Knowledge entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Knowledge entity is found. Returns a *NotFoundError when no Knowledge entities are found.

func (*KnowledgeQuery) OnlyID

func (_q *KnowledgeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Knowledge ID in the query. Returns a *NotSingularError when more than one Knowledge ID is found. Returns a *NotFoundError when no entities are found.

func (*KnowledgeQuery) OnlyIDX

func (_q *KnowledgeQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*KnowledgeQuery) OnlyX

func (_q *KnowledgeQuery) OnlyX(ctx context.Context) *Knowledge

OnlyX is like Only, but panics if an error occurs.

func (*KnowledgeQuery) Order

Order specifies how the records should be ordered.

func (*KnowledgeQuery) Select

func (_q *KnowledgeQuery) Select(fields ...string) *KnowledgeSelect

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 {
	Key string `json:"key,omitempty"`
}

client.Knowledge.Query().
	Select(knowledge.FieldKey).
	Scan(ctx, &v)

func (*KnowledgeQuery) Unique

func (_q *KnowledgeQuery) Unique(unique bool) *KnowledgeQuery

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 (*KnowledgeQuery) Where

Where adds a new predicate for the KnowledgeQuery builder.

type KnowledgeSelect

type KnowledgeSelect struct {
	*KnowledgeQuery
	// contains filtered or unexported fields
}

KnowledgeSelect is the builder for selecting fields of Knowledge entities.

func (*KnowledgeSelect) Aggregate

func (_s *KnowledgeSelect) Aggregate(fns ...AggregateFunc) *KnowledgeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*KnowledgeSelect) Bool

func (s *KnowledgeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) BoolX

func (s *KnowledgeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*KnowledgeSelect) Bools

func (s *KnowledgeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) BoolsX

func (s *KnowledgeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*KnowledgeSelect) Float64

func (s *KnowledgeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) Float64X

func (s *KnowledgeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*KnowledgeSelect) Float64s

func (s *KnowledgeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) Float64sX

func (s *KnowledgeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*KnowledgeSelect) Int

func (s *KnowledgeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) IntX

func (s *KnowledgeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*KnowledgeSelect) Ints

func (s *KnowledgeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) IntsX

func (s *KnowledgeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*KnowledgeSelect) Scan

func (_s *KnowledgeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*KnowledgeSelect) ScanX

func (s *KnowledgeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*KnowledgeSelect) String

func (s *KnowledgeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) StringX

func (s *KnowledgeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*KnowledgeSelect) Strings

func (s *KnowledgeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*KnowledgeSelect) StringsX

func (s *KnowledgeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type KnowledgeUpdate

type KnowledgeUpdate struct {
	// contains filtered or unexported fields
}

KnowledgeUpdate is the builder for updating Knowledge entities.

func (*KnowledgeUpdate) AddRelevanceScore

func (_u *KnowledgeUpdate) AddRelevanceScore(v float64) *KnowledgeUpdate

AddRelevanceScore adds value to the "relevance_score" field.

func (*KnowledgeUpdate) AddUseCount

func (_u *KnowledgeUpdate) AddUseCount(v int) *KnowledgeUpdate

AddUseCount adds value to the "use_count" field.

func (*KnowledgeUpdate) AppendTags

func (_u *KnowledgeUpdate) AppendTags(v []string) *KnowledgeUpdate

AppendTags appends value to the "tags" field.

func (*KnowledgeUpdate) ClearSource

func (_u *KnowledgeUpdate) ClearSource() *KnowledgeUpdate

ClearSource clears the value of the "source" field.

func (*KnowledgeUpdate) ClearTags

func (_u *KnowledgeUpdate) ClearTags() *KnowledgeUpdate

ClearTags clears the value of the "tags" field.

func (*KnowledgeUpdate) Exec

func (_u *KnowledgeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*KnowledgeUpdate) ExecX

func (_u *KnowledgeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KnowledgeUpdate) Mutation

func (_u *KnowledgeUpdate) Mutation() *KnowledgeMutation

Mutation returns the KnowledgeMutation object of the builder.

func (*KnowledgeUpdate) Save

func (_u *KnowledgeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*KnowledgeUpdate) SaveX

func (_u *KnowledgeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*KnowledgeUpdate) SetCategory

func (_u *KnowledgeUpdate) SetCategory(v knowledge.Category) *KnowledgeUpdate

SetCategory sets the "category" field.

func (*KnowledgeUpdate) SetContent

func (_u *KnowledgeUpdate) SetContent(v string) *KnowledgeUpdate

SetContent sets the "content" field.

func (*KnowledgeUpdate) SetKey

func (_u *KnowledgeUpdate) SetKey(v string) *KnowledgeUpdate

SetKey sets the "key" field.

func (*KnowledgeUpdate) SetNillableCategory

func (_u *KnowledgeUpdate) SetNillableCategory(v *knowledge.Category) *KnowledgeUpdate

SetNillableCategory sets the "category" field if the given value is not nil.

func (*KnowledgeUpdate) SetNillableContent

func (_u *KnowledgeUpdate) SetNillableContent(v *string) *KnowledgeUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*KnowledgeUpdate) SetNillableKey

func (_u *KnowledgeUpdate) SetNillableKey(v *string) *KnowledgeUpdate

SetNillableKey sets the "key" field if the given value is not nil.

func (*KnowledgeUpdate) SetNillableRelevanceScore

func (_u *KnowledgeUpdate) SetNillableRelevanceScore(v *float64) *KnowledgeUpdate

SetNillableRelevanceScore sets the "relevance_score" field if the given value is not nil.

func (*KnowledgeUpdate) SetNillableSource

func (_u *KnowledgeUpdate) SetNillableSource(v *string) *KnowledgeUpdate

SetNillableSource sets the "source" field if the given value is not nil.

func (*KnowledgeUpdate) SetNillableUseCount

func (_u *KnowledgeUpdate) SetNillableUseCount(v *int) *KnowledgeUpdate

SetNillableUseCount sets the "use_count" field if the given value is not nil.

func (*KnowledgeUpdate) SetRelevanceScore

func (_u *KnowledgeUpdate) SetRelevanceScore(v float64) *KnowledgeUpdate

SetRelevanceScore sets the "relevance_score" field.

func (*KnowledgeUpdate) SetSource

func (_u *KnowledgeUpdate) SetSource(v string) *KnowledgeUpdate

SetSource sets the "source" field.

func (*KnowledgeUpdate) SetTags

func (_u *KnowledgeUpdate) SetTags(v []string) *KnowledgeUpdate

SetTags sets the "tags" field.

func (*KnowledgeUpdate) SetUpdatedAt

func (_u *KnowledgeUpdate) SetUpdatedAt(v time.Time) *KnowledgeUpdate

SetUpdatedAt sets the "updated_at" field.

func (*KnowledgeUpdate) SetUseCount

func (_u *KnowledgeUpdate) SetUseCount(v int) *KnowledgeUpdate

SetUseCount sets the "use_count" field.

func (*KnowledgeUpdate) Where

Where appends a list predicates to the KnowledgeUpdate builder.

type KnowledgeUpdateOne

type KnowledgeUpdateOne struct {
	// contains filtered or unexported fields
}

KnowledgeUpdateOne is the builder for updating a single Knowledge entity.

func (*KnowledgeUpdateOne) AddRelevanceScore

func (_u *KnowledgeUpdateOne) AddRelevanceScore(v float64) *KnowledgeUpdateOne

AddRelevanceScore adds value to the "relevance_score" field.

func (*KnowledgeUpdateOne) AddUseCount

func (_u *KnowledgeUpdateOne) AddUseCount(v int) *KnowledgeUpdateOne

AddUseCount adds value to the "use_count" field.

func (*KnowledgeUpdateOne) AppendTags

func (_u *KnowledgeUpdateOne) AppendTags(v []string) *KnowledgeUpdateOne

AppendTags appends value to the "tags" field.

func (*KnowledgeUpdateOne) ClearSource

func (_u *KnowledgeUpdateOne) ClearSource() *KnowledgeUpdateOne

ClearSource clears the value of the "source" field.

func (*KnowledgeUpdateOne) ClearTags

func (_u *KnowledgeUpdateOne) ClearTags() *KnowledgeUpdateOne

ClearTags clears the value of the "tags" field.

func (*KnowledgeUpdateOne) Exec

func (_u *KnowledgeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*KnowledgeUpdateOne) ExecX

func (_u *KnowledgeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*KnowledgeUpdateOne) Mutation

func (_u *KnowledgeUpdateOne) Mutation() *KnowledgeMutation

Mutation returns the KnowledgeMutation object of the builder.

func (*KnowledgeUpdateOne) Save

func (_u *KnowledgeUpdateOne) Save(ctx context.Context) (*Knowledge, error)

Save executes the query and returns the updated Knowledge entity.

func (*KnowledgeUpdateOne) SaveX

func (_u *KnowledgeUpdateOne) SaveX(ctx context.Context) *Knowledge

SaveX is like Save, but panics if an error occurs.

func (*KnowledgeUpdateOne) Select

func (_u *KnowledgeUpdateOne) Select(field string, fields ...string) *KnowledgeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*KnowledgeUpdateOne) SetCategory

SetCategory sets the "category" field.

func (*KnowledgeUpdateOne) SetContent

func (_u *KnowledgeUpdateOne) SetContent(v string) *KnowledgeUpdateOne

SetContent sets the "content" field.

func (*KnowledgeUpdateOne) SetKey

SetKey sets the "key" field.

func (*KnowledgeUpdateOne) SetNillableCategory

func (_u *KnowledgeUpdateOne) SetNillableCategory(v *knowledge.Category) *KnowledgeUpdateOne

SetNillableCategory sets the "category" field if the given value is not nil.

func (*KnowledgeUpdateOne) SetNillableContent

func (_u *KnowledgeUpdateOne) SetNillableContent(v *string) *KnowledgeUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*KnowledgeUpdateOne) SetNillableKey

func (_u *KnowledgeUpdateOne) SetNillableKey(v *string) *KnowledgeUpdateOne

SetNillableKey sets the "key" field if the given value is not nil.

func (*KnowledgeUpdateOne) SetNillableRelevanceScore

func (_u *KnowledgeUpdateOne) SetNillableRelevanceScore(v *float64) *KnowledgeUpdateOne

SetNillableRelevanceScore sets the "relevance_score" field if the given value is not nil.

func (*KnowledgeUpdateOne) SetNillableSource

func (_u *KnowledgeUpdateOne) SetNillableSource(v *string) *KnowledgeUpdateOne

SetNillableSource sets the "source" field if the given value is not nil.

func (*KnowledgeUpdateOne) SetNillableUseCount

func (_u *KnowledgeUpdateOne) SetNillableUseCount(v *int) *KnowledgeUpdateOne

SetNillableUseCount sets the "use_count" field if the given value is not nil.

func (*KnowledgeUpdateOne) SetRelevanceScore

func (_u *KnowledgeUpdateOne) SetRelevanceScore(v float64) *KnowledgeUpdateOne

SetRelevanceScore sets the "relevance_score" field.

func (*KnowledgeUpdateOne) SetSource

func (_u *KnowledgeUpdateOne) SetSource(v string) *KnowledgeUpdateOne

SetSource sets the "source" field.

func (*KnowledgeUpdateOne) SetTags

func (_u *KnowledgeUpdateOne) SetTags(v []string) *KnowledgeUpdateOne

SetTags sets the "tags" field.

func (*KnowledgeUpdateOne) SetUpdatedAt

func (_u *KnowledgeUpdateOne) SetUpdatedAt(v time.Time) *KnowledgeUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*KnowledgeUpdateOne) SetUseCount

func (_u *KnowledgeUpdateOne) SetUseCount(v int) *KnowledgeUpdateOne

SetUseCount sets the "use_count" field.

func (*KnowledgeUpdateOne) Where

Where appends a list predicates to the KnowledgeUpdate builder.

type Knowledges

type Knowledges []*Knowledge

Knowledges is a parsable slice of Knowledge.

type Learning

type Learning struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Trigger holds the value of the "trigger" field.
	Trigger string `json:"trigger,omitempty"`
	// ErrorPattern holds the value of the "error_pattern" field.
	ErrorPattern string `json:"error_pattern,omitempty"`
	// Diagnosis holds the value of the "diagnosis" field.
	Diagnosis string `json:"diagnosis,omitempty"`
	// Fix holds the value of the "fix" field.
	Fix string `json:"fix,omitempty"`
	// Category holds the value of the "category" field.
	Category learning.Category `json:"category,omitempty"`
	// Tags holds the value of the "tags" field.
	Tags []string `json:"tags,omitempty"`
	// OccurrenceCount holds the value of the "occurrence_count" field.
	OccurrenceCount int `json:"occurrence_count,omitempty"`
	// SuccessCount holds the value of the "success_count" field.
	SuccessCount int `json:"success_count,omitempty"`
	// Confidence holds the value of the "confidence" field.
	Confidence float64 `json:"confidence,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Learning is the model entity for the Learning schema.

func (*Learning) String

func (_m *Learning) String() string

String implements the fmt.Stringer.

func (*Learning) Unwrap

func (_m *Learning) Unwrap() *Learning

Unwrap unwraps the Learning 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 (*Learning) Update

func (_m *Learning) Update() *LearningUpdateOne

Update returns a builder for updating this Learning. Note that you need to call Learning.Unwrap() before calling this method if this Learning was returned from a transaction, and the transaction was committed or rolled back.

func (*Learning) Value

func (_m *Learning) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Learning. This includes values selected through modifiers, order, etc.

type LearningClient

type LearningClient struct {
	// contains filtered or unexported fields
}

LearningClient is a client for the Learning schema.

func NewLearningClient

func NewLearningClient(c config) *LearningClient

NewLearningClient returns a client for the Learning from the given config.

func (*LearningClient) Create

func (c *LearningClient) Create() *LearningCreate

Create returns a builder for creating a Learning entity.

func (*LearningClient) CreateBulk

func (c *LearningClient) CreateBulk(builders ...*LearningCreate) *LearningCreateBulk

CreateBulk returns a builder for creating a bulk of Learning entities.

func (*LearningClient) Delete

func (c *LearningClient) Delete() *LearningDelete

Delete returns a delete builder for Learning.

func (*LearningClient) DeleteOne

func (c *LearningClient) DeleteOne(_m *Learning) *LearningDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LearningClient) DeleteOneID

func (c *LearningClient) DeleteOneID(id uuid.UUID) *LearningDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LearningClient) Get

func (c *LearningClient) Get(ctx context.Context, id uuid.UUID) (*Learning, error)

Get returns a Learning entity by its id.

func (*LearningClient) GetX

func (c *LearningClient) GetX(ctx context.Context, id uuid.UUID) *Learning

GetX is like Get, but panics if an error occurs.

func (*LearningClient) Hooks

func (c *LearningClient) Hooks() []Hook

Hooks returns the client hooks.

func (*LearningClient) Intercept

func (c *LearningClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `learning.Intercept(f(g(h())))`.

func (*LearningClient) Interceptors

func (c *LearningClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LearningClient) MapCreateBulk

func (c *LearningClient) MapCreateBulk(slice any, setFunc func(*LearningCreate, int)) *LearningCreateBulk

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 (*LearningClient) Query

func (c *LearningClient) Query() *LearningQuery

Query returns a query builder for Learning.

func (*LearningClient) Update

func (c *LearningClient) Update() *LearningUpdate

Update returns an update builder for Learning.

func (*LearningClient) UpdateOne

func (c *LearningClient) UpdateOne(_m *Learning) *LearningUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LearningClient) UpdateOneID

func (c *LearningClient) UpdateOneID(id uuid.UUID) *LearningUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LearningClient) Use

func (c *LearningClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `learning.Hooks(f(g(h())))`.

type LearningCreate

type LearningCreate struct {
	// contains filtered or unexported fields
}

LearningCreate is the builder for creating a Learning entity.

func (*LearningCreate) Exec

func (_c *LearningCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LearningCreate) ExecX

func (_c *LearningCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LearningCreate) Mutation

func (_c *LearningCreate) Mutation() *LearningMutation

Mutation returns the LearningMutation object of the builder.

func (*LearningCreate) Save

func (_c *LearningCreate) Save(ctx context.Context) (*Learning, error)

Save creates the Learning in the database.

func (*LearningCreate) SaveX

func (_c *LearningCreate) SaveX(ctx context.Context) *Learning

SaveX calls Save and panics if Save returns an error.

func (*LearningCreate) SetCategory

func (_c *LearningCreate) SetCategory(v learning.Category) *LearningCreate

SetCategory sets the "category" field.

func (*LearningCreate) SetConfidence

func (_c *LearningCreate) SetConfidence(v float64) *LearningCreate

SetConfidence sets the "confidence" field.

func (*LearningCreate) SetCreatedAt

func (_c *LearningCreate) SetCreatedAt(v time.Time) *LearningCreate

SetCreatedAt sets the "created_at" field.

func (*LearningCreate) SetDiagnosis

func (_c *LearningCreate) SetDiagnosis(v string) *LearningCreate

SetDiagnosis sets the "diagnosis" field.

func (*LearningCreate) SetErrorPattern

func (_c *LearningCreate) SetErrorPattern(v string) *LearningCreate

SetErrorPattern sets the "error_pattern" field.

func (*LearningCreate) SetFix

func (_c *LearningCreate) SetFix(v string) *LearningCreate

SetFix sets the "fix" field.

func (*LearningCreate) SetID

func (_c *LearningCreate) SetID(v uuid.UUID) *LearningCreate

SetID sets the "id" field.

func (*LearningCreate) SetNillableConfidence

func (_c *LearningCreate) SetNillableConfidence(v *float64) *LearningCreate

SetNillableConfidence sets the "confidence" field if the given value is not nil.

func (*LearningCreate) SetNillableCreatedAt

func (_c *LearningCreate) SetNillableCreatedAt(v *time.Time) *LearningCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*LearningCreate) SetNillableDiagnosis

func (_c *LearningCreate) SetNillableDiagnosis(v *string) *LearningCreate

SetNillableDiagnosis sets the "diagnosis" field if the given value is not nil.

func (*LearningCreate) SetNillableErrorPattern

func (_c *LearningCreate) SetNillableErrorPattern(v *string) *LearningCreate

SetNillableErrorPattern sets the "error_pattern" field if the given value is not nil.

func (*LearningCreate) SetNillableFix

func (_c *LearningCreate) SetNillableFix(v *string) *LearningCreate

SetNillableFix sets the "fix" field if the given value is not nil.

func (*LearningCreate) SetNillableID

func (_c *LearningCreate) SetNillableID(v *uuid.UUID) *LearningCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*LearningCreate) SetNillableOccurrenceCount

func (_c *LearningCreate) SetNillableOccurrenceCount(v *int) *LearningCreate

SetNillableOccurrenceCount sets the "occurrence_count" field if the given value is not nil.

func (*LearningCreate) SetNillableSuccessCount

func (_c *LearningCreate) SetNillableSuccessCount(v *int) *LearningCreate

SetNillableSuccessCount sets the "success_count" field if the given value is not nil.

func (*LearningCreate) SetNillableUpdatedAt

func (_c *LearningCreate) SetNillableUpdatedAt(v *time.Time) *LearningCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*LearningCreate) SetOccurrenceCount

func (_c *LearningCreate) SetOccurrenceCount(v int) *LearningCreate

SetOccurrenceCount sets the "occurrence_count" field.

func (*LearningCreate) SetSuccessCount

func (_c *LearningCreate) SetSuccessCount(v int) *LearningCreate

SetSuccessCount sets the "success_count" field.

func (*LearningCreate) SetTags

func (_c *LearningCreate) SetTags(v []string) *LearningCreate

SetTags sets the "tags" field.

func (*LearningCreate) SetTrigger

func (_c *LearningCreate) SetTrigger(v string) *LearningCreate

SetTrigger sets the "trigger" field.

func (*LearningCreate) SetUpdatedAt

func (_c *LearningCreate) SetUpdatedAt(v time.Time) *LearningCreate

SetUpdatedAt sets the "updated_at" field.

type LearningCreateBulk

type LearningCreateBulk struct {
	// contains filtered or unexported fields
}

LearningCreateBulk is the builder for creating many Learning entities in bulk.

func (*LearningCreateBulk) Exec

func (_c *LearningCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LearningCreateBulk) ExecX

func (_c *LearningCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LearningCreateBulk) Save

func (_c *LearningCreateBulk) Save(ctx context.Context) ([]*Learning, error)

Save creates the Learning entities in the database.

func (*LearningCreateBulk) SaveX

func (_c *LearningCreateBulk) SaveX(ctx context.Context) []*Learning

SaveX is like Save, but panics if an error occurs.

type LearningDelete

type LearningDelete struct {
	// contains filtered or unexported fields
}

LearningDelete is the builder for deleting a Learning entity.

func (*LearningDelete) Exec

func (_d *LearningDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*LearningDelete) ExecX

func (_d *LearningDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*LearningDelete) Where

func (_d *LearningDelete) Where(ps ...predicate.Learning) *LearningDelete

Where appends a list predicates to the LearningDelete builder.

type LearningDeleteOne

type LearningDeleteOne struct {
	// contains filtered or unexported fields
}

LearningDeleteOne is the builder for deleting a single Learning entity.

func (*LearningDeleteOne) Exec

func (_d *LearningDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LearningDeleteOne) ExecX

func (_d *LearningDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LearningDeleteOne) Where

Where appends a list predicates to the LearningDelete builder.

type LearningGroupBy

type LearningGroupBy struct {
	// contains filtered or unexported fields
}

LearningGroupBy is the group-by builder for Learning entities.

func (*LearningGroupBy) Aggregate

func (_g *LearningGroupBy) Aggregate(fns ...AggregateFunc) *LearningGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*LearningGroupBy) Bool

func (s *LearningGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) BoolX

func (s *LearningGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LearningGroupBy) Bools

func (s *LearningGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) BoolsX

func (s *LearningGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LearningGroupBy) Float64

func (s *LearningGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) Float64X

func (s *LearningGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LearningGroupBy) Float64s

func (s *LearningGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) Float64sX

func (s *LearningGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LearningGroupBy) Int

func (s *LearningGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) IntX

func (s *LearningGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LearningGroupBy) Ints

func (s *LearningGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) IntsX

func (s *LearningGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LearningGroupBy) Scan

func (_g *LearningGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LearningGroupBy) ScanX

func (s *LearningGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LearningGroupBy) String

func (s *LearningGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) StringX

func (s *LearningGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LearningGroupBy) Strings

func (s *LearningGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LearningGroupBy) StringsX

func (s *LearningGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LearningMutation

type LearningMutation struct {
	// contains filtered or unexported fields
}

LearningMutation represents an operation that mutates the Learning nodes in the graph.

func (*LearningMutation) AddConfidence

func (m *LearningMutation) AddConfidence(f float64)

AddConfidence adds f to the "confidence" field.

func (*LearningMutation) AddField

func (m *LearningMutation) 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 (*LearningMutation) AddOccurrenceCount

func (m *LearningMutation) AddOccurrenceCount(i int)

AddOccurrenceCount adds i to the "occurrence_count" field.

func (*LearningMutation) AddSuccessCount

func (m *LearningMutation) AddSuccessCount(i int)

AddSuccessCount adds i to the "success_count" field.

func (*LearningMutation) AddedConfidence

func (m *LearningMutation) AddedConfidence() (r float64, exists bool)

AddedConfidence returns the value that was added to the "confidence" field in this mutation.

func (*LearningMutation) AddedEdges

func (m *LearningMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*LearningMutation) AddedField

func (m *LearningMutation) 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 (*LearningMutation) AddedFields

func (m *LearningMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*LearningMutation) AddedIDs

func (m *LearningMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*LearningMutation) AddedOccurrenceCount

func (m *LearningMutation) AddedOccurrenceCount() (r int, exists bool)

AddedOccurrenceCount returns the value that was added to the "occurrence_count" field in this mutation.

func (*LearningMutation) AddedSuccessCount

func (m *LearningMutation) AddedSuccessCount() (r int, exists bool)

AddedSuccessCount returns the value that was added to the "success_count" field in this mutation.

func (*LearningMutation) AppendTags

func (m *LearningMutation) AppendTags(s []string)

AppendTags adds s to the "tags" field.

func (*LearningMutation) AppendedTags

func (m *LearningMutation) AppendedTags() ([]string, bool)

AppendedTags returns the list of values that were appended to the "tags" field in this mutation.

func (*LearningMutation) Category

func (m *LearningMutation) Category() (r learning.Category, exists bool)

Category returns the value of the "category" field in the mutation.

func (*LearningMutation) ClearDiagnosis

func (m *LearningMutation) ClearDiagnosis()

ClearDiagnosis clears the value of the "diagnosis" field.

func (*LearningMutation) ClearEdge

func (m *LearningMutation) 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 (*LearningMutation) ClearErrorPattern

func (m *LearningMutation) ClearErrorPattern()

ClearErrorPattern clears the value of the "error_pattern" field.

func (*LearningMutation) ClearField

func (m *LearningMutation) 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 (*LearningMutation) ClearFix

func (m *LearningMutation) ClearFix()

ClearFix clears the value of the "fix" field.

func (*LearningMutation) ClearTags

func (m *LearningMutation) ClearTags()

ClearTags clears the value of the "tags" field.

func (*LearningMutation) ClearedEdges

func (m *LearningMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*LearningMutation) ClearedFields

func (m *LearningMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (LearningMutation) Client

func (m LearningMutation) 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 (*LearningMutation) Confidence

func (m *LearningMutation) Confidence() (r float64, exists bool)

Confidence returns the value of the "confidence" field in the mutation.

func (*LearningMutation) CreatedAt

func (m *LearningMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*LearningMutation) Diagnosis

func (m *LearningMutation) Diagnosis() (r string, exists bool)

Diagnosis returns the value of the "diagnosis" field in the mutation.

func (*LearningMutation) DiagnosisCleared

func (m *LearningMutation) DiagnosisCleared() bool

DiagnosisCleared returns if the "diagnosis" field was cleared in this mutation.

func (*LearningMutation) EdgeCleared

func (m *LearningMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*LearningMutation) ErrorPattern

func (m *LearningMutation) ErrorPattern() (r string, exists bool)

ErrorPattern returns the value of the "error_pattern" field in the mutation.

func (*LearningMutation) ErrorPatternCleared

func (m *LearningMutation) ErrorPatternCleared() bool

ErrorPatternCleared returns if the "error_pattern" field was cleared in this mutation.

func (*LearningMutation) Field

func (m *LearningMutation) 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 (*LearningMutation) FieldCleared

func (m *LearningMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*LearningMutation) Fields

func (m *LearningMutation) 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 (*LearningMutation) Fix

func (m *LearningMutation) Fix() (r string, exists bool)

Fix returns the value of the "fix" field in the mutation.

func (*LearningMutation) FixCleared

func (m *LearningMutation) FixCleared() bool

FixCleared returns if the "fix" field was cleared in this mutation.

func (*LearningMutation) ID

func (m *LearningMutation) ID() (id uuid.UUID, 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 (*LearningMutation) IDs

func (m *LearningMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*LearningMutation) OccurrenceCount

func (m *LearningMutation) OccurrenceCount() (r int, exists bool)

OccurrenceCount returns the value of the "occurrence_count" field in the mutation.

func (*LearningMutation) OldCategory

func (m *LearningMutation) OldCategory(ctx context.Context) (v learning.Category, err error)

OldCategory returns the old "category" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldConfidence

func (m *LearningMutation) OldConfidence(ctx context.Context) (v float64, err error)

OldConfidence returns the old "confidence" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldCreatedAt

func (m *LearningMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldDiagnosis

func (m *LearningMutation) OldDiagnosis(ctx context.Context) (v string, err error)

OldDiagnosis returns the old "diagnosis" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldErrorPattern

func (m *LearningMutation) OldErrorPattern(ctx context.Context) (v string, err error)

OldErrorPattern returns the old "error_pattern" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldField

func (m *LearningMutation) 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 (*LearningMutation) OldFix

func (m *LearningMutation) OldFix(ctx context.Context) (v string, err error)

OldFix returns the old "fix" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldOccurrenceCount

func (m *LearningMutation) OldOccurrenceCount(ctx context.Context) (v int, err error)

OldOccurrenceCount returns the old "occurrence_count" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldSuccessCount

func (m *LearningMutation) OldSuccessCount(ctx context.Context) (v int, err error)

OldSuccessCount returns the old "success_count" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldTags

func (m *LearningMutation) OldTags(ctx context.Context) (v []string, err error)

OldTags returns the old "tags" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldTrigger

func (m *LearningMutation) OldTrigger(ctx context.Context) (v string, err error)

OldTrigger returns the old "trigger" field's value of the Learning entity. If the Learning 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 (*LearningMutation) OldUpdatedAt

func (m *LearningMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Learning entity. If the Learning 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 (*LearningMutation) Op

func (m *LearningMutation) Op() Op

Op returns the operation name.

func (*LearningMutation) RemovedEdges

func (m *LearningMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*LearningMutation) RemovedIDs

func (m *LearningMutation) 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 (*LearningMutation) ResetCategory

func (m *LearningMutation) ResetCategory()

ResetCategory resets all changes to the "category" field.

func (*LearningMutation) ResetConfidence

func (m *LearningMutation) ResetConfidence()

ResetConfidence resets all changes to the "confidence" field.

func (*LearningMutation) ResetCreatedAt

func (m *LearningMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LearningMutation) ResetDiagnosis

func (m *LearningMutation) ResetDiagnosis()

ResetDiagnosis resets all changes to the "diagnosis" field.

func (*LearningMutation) ResetEdge

func (m *LearningMutation) 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 (*LearningMutation) ResetErrorPattern

func (m *LearningMutation) ResetErrorPattern()

ResetErrorPattern resets all changes to the "error_pattern" field.

func (*LearningMutation) ResetField

func (m *LearningMutation) 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 (*LearningMutation) ResetFix

func (m *LearningMutation) ResetFix()

ResetFix resets all changes to the "fix" field.

func (*LearningMutation) ResetOccurrenceCount

func (m *LearningMutation) ResetOccurrenceCount()

ResetOccurrenceCount resets all changes to the "occurrence_count" field.

func (*LearningMutation) ResetSuccessCount

func (m *LearningMutation) ResetSuccessCount()

ResetSuccessCount resets all changes to the "success_count" field.

func (*LearningMutation) ResetTags

func (m *LearningMutation) ResetTags()

ResetTags resets all changes to the "tags" field.

func (*LearningMutation) ResetTrigger

func (m *LearningMutation) ResetTrigger()

ResetTrigger resets all changes to the "trigger" field.

func (*LearningMutation) ResetUpdatedAt

func (m *LearningMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*LearningMutation) SetCategory

func (m *LearningMutation) SetCategory(l learning.Category)

SetCategory sets the "category" field.

func (*LearningMutation) SetConfidence

func (m *LearningMutation) SetConfidence(f float64)

SetConfidence sets the "confidence" field.

func (*LearningMutation) SetCreatedAt

func (m *LearningMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*LearningMutation) SetDiagnosis

func (m *LearningMutation) SetDiagnosis(s string)

SetDiagnosis sets the "diagnosis" field.

func (*LearningMutation) SetErrorPattern

func (m *LearningMutation) SetErrorPattern(s string)

SetErrorPattern sets the "error_pattern" field.

func (*LearningMutation) SetField

func (m *LearningMutation) 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 (*LearningMutation) SetFix

func (m *LearningMutation) SetFix(s string)

SetFix sets the "fix" field.

func (*LearningMutation) SetID

func (m *LearningMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Learning entities.

func (*LearningMutation) SetOccurrenceCount

func (m *LearningMutation) SetOccurrenceCount(i int)

SetOccurrenceCount sets the "occurrence_count" field.

func (*LearningMutation) SetOp

func (m *LearningMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LearningMutation) SetSuccessCount

func (m *LearningMutation) SetSuccessCount(i int)

SetSuccessCount sets the "success_count" field.

func (*LearningMutation) SetTags

func (m *LearningMutation) SetTags(s []string)

SetTags sets the "tags" field.

func (*LearningMutation) SetTrigger

func (m *LearningMutation) SetTrigger(s string)

SetTrigger sets the "trigger" field.

func (*LearningMutation) SetUpdatedAt

func (m *LearningMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*LearningMutation) SuccessCount

func (m *LearningMutation) SuccessCount() (r int, exists bool)

SuccessCount returns the value of the "success_count" field in the mutation.

func (*LearningMutation) Tags

func (m *LearningMutation) Tags() (r []string, exists bool)

Tags returns the value of the "tags" field in the mutation.

func (*LearningMutation) TagsCleared

func (m *LearningMutation) TagsCleared() bool

TagsCleared returns if the "tags" field was cleared in this mutation.

func (*LearningMutation) Trigger

func (m *LearningMutation) Trigger() (r string, exists bool)

Trigger returns the value of the "trigger" field in the mutation.

func (LearningMutation) Tx

func (m LearningMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*LearningMutation) Type

func (m *LearningMutation) Type() string

Type returns the node type of this mutation (Learning).

func (*LearningMutation) UpdatedAt

func (m *LearningMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*LearningMutation) Where

func (m *LearningMutation) Where(ps ...predicate.Learning)

Where appends a list predicates to the LearningMutation builder.

func (*LearningMutation) WhereP

func (m *LearningMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LearningMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LearningQuery

type LearningQuery struct {
	// contains filtered or unexported fields
}

LearningQuery is the builder for querying Learning entities.

func (*LearningQuery) Aggregate

func (_q *LearningQuery) Aggregate(fns ...AggregateFunc) *LearningSelect

Aggregate returns a LearningSelect configured with the given aggregations.

func (*LearningQuery) All

func (_q *LearningQuery) All(ctx context.Context) ([]*Learning, error)

All executes the query and returns a list of Learnings.

func (*LearningQuery) AllX

func (_q *LearningQuery) AllX(ctx context.Context) []*Learning

AllX is like All, but panics if an error occurs.

func (*LearningQuery) Clone

func (_q *LearningQuery) Clone() *LearningQuery

Clone returns a duplicate of the LearningQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*LearningQuery) Count

func (_q *LearningQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LearningQuery) CountX

func (_q *LearningQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*LearningQuery) Exist

func (_q *LearningQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*LearningQuery) ExistX

func (_q *LearningQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*LearningQuery) First

func (_q *LearningQuery) First(ctx context.Context) (*Learning, error)

First returns the first Learning entity from the query. Returns a *NotFoundError when no Learning was found.

func (*LearningQuery) FirstID

func (_q *LearningQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Learning ID from the query. Returns a *NotFoundError when no Learning ID was found.

func (*LearningQuery) FirstIDX

func (_q *LearningQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*LearningQuery) FirstX

func (_q *LearningQuery) FirstX(ctx context.Context) *Learning

FirstX is like First, but panics if an error occurs.

func (*LearningQuery) GroupBy

func (_q *LearningQuery) GroupBy(field string, fields ...string) *LearningGroupBy

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 {
	Trigger string `json:"trigger,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Learning.Query().
	GroupBy(learning.FieldTrigger).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LearningQuery) IDs

func (_q *LearningQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Learning IDs.

func (*LearningQuery) IDsX

func (_q *LearningQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*LearningQuery) Limit

func (_q *LearningQuery) Limit(limit int) *LearningQuery

Limit the number of records to be returned by this query.

func (*LearningQuery) Offset

func (_q *LearningQuery) Offset(offset int) *LearningQuery

Offset to start from.

func (*LearningQuery) Only

func (_q *LearningQuery) Only(ctx context.Context) (*Learning, error)

Only returns a single Learning entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Learning entity is found. Returns a *NotFoundError when no Learning entities are found.

func (*LearningQuery) OnlyID

func (_q *LearningQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Learning ID in the query. Returns a *NotSingularError when more than one Learning ID is found. Returns a *NotFoundError when no entities are found.

func (*LearningQuery) OnlyIDX

func (_q *LearningQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*LearningQuery) OnlyX

func (_q *LearningQuery) OnlyX(ctx context.Context) *Learning

OnlyX is like Only, but panics if an error occurs.

func (*LearningQuery) Order

Order specifies how the records should be ordered.

func (*LearningQuery) Select

func (_q *LearningQuery) Select(fields ...string) *LearningSelect

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 {
	Trigger string `json:"trigger,omitempty"`
}

client.Learning.Query().
	Select(learning.FieldTrigger).
	Scan(ctx, &v)

func (*LearningQuery) Unique

func (_q *LearningQuery) Unique(unique bool) *LearningQuery

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 (*LearningQuery) Where

func (_q *LearningQuery) Where(ps ...predicate.Learning) *LearningQuery

Where adds a new predicate for the LearningQuery builder.

type LearningSelect

type LearningSelect struct {
	*LearningQuery
	// contains filtered or unexported fields
}

LearningSelect is the builder for selecting fields of Learning entities.

func (*LearningSelect) Aggregate

func (_s *LearningSelect) Aggregate(fns ...AggregateFunc) *LearningSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LearningSelect) Bool

func (s *LearningSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LearningSelect) BoolX

func (s *LearningSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LearningSelect) Bools

func (s *LearningSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LearningSelect) BoolsX

func (s *LearningSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LearningSelect) Float64

func (s *LearningSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LearningSelect) Float64X

func (s *LearningSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LearningSelect) Float64s

func (s *LearningSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LearningSelect) Float64sX

func (s *LearningSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LearningSelect) Int

func (s *LearningSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LearningSelect) IntX

func (s *LearningSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LearningSelect) Ints

func (s *LearningSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LearningSelect) IntsX

func (s *LearningSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LearningSelect) Scan

func (_s *LearningSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LearningSelect) ScanX

func (s *LearningSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LearningSelect) String

func (s *LearningSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LearningSelect) StringX

func (s *LearningSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LearningSelect) Strings

func (s *LearningSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LearningSelect) StringsX

func (s *LearningSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LearningUpdate

type LearningUpdate struct {
	// contains filtered or unexported fields
}

LearningUpdate is the builder for updating Learning entities.

func (*LearningUpdate) AddConfidence

func (_u *LearningUpdate) AddConfidence(v float64) *LearningUpdate

AddConfidence adds value to the "confidence" field.

func (*LearningUpdate) AddOccurrenceCount

func (_u *LearningUpdate) AddOccurrenceCount(v int) *LearningUpdate

AddOccurrenceCount adds value to the "occurrence_count" field.

func (*LearningUpdate) AddSuccessCount

func (_u *LearningUpdate) AddSuccessCount(v int) *LearningUpdate

AddSuccessCount adds value to the "success_count" field.

func (*LearningUpdate) AppendTags

func (_u *LearningUpdate) AppendTags(v []string) *LearningUpdate

AppendTags appends value to the "tags" field.

func (*LearningUpdate) ClearDiagnosis

func (_u *LearningUpdate) ClearDiagnosis() *LearningUpdate

ClearDiagnosis clears the value of the "diagnosis" field.

func (*LearningUpdate) ClearErrorPattern

func (_u *LearningUpdate) ClearErrorPattern() *LearningUpdate

ClearErrorPattern clears the value of the "error_pattern" field.

func (*LearningUpdate) ClearFix

func (_u *LearningUpdate) ClearFix() *LearningUpdate

ClearFix clears the value of the "fix" field.

func (*LearningUpdate) ClearTags

func (_u *LearningUpdate) ClearTags() *LearningUpdate

ClearTags clears the value of the "tags" field.

func (*LearningUpdate) Exec

func (_u *LearningUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LearningUpdate) ExecX

func (_u *LearningUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LearningUpdate) Mutation

func (_u *LearningUpdate) Mutation() *LearningMutation

Mutation returns the LearningMutation object of the builder.

func (*LearningUpdate) Save

func (_u *LearningUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LearningUpdate) SaveX

func (_u *LearningUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LearningUpdate) SetCategory

func (_u *LearningUpdate) SetCategory(v learning.Category) *LearningUpdate

SetCategory sets the "category" field.

func (*LearningUpdate) SetConfidence

func (_u *LearningUpdate) SetConfidence(v float64) *LearningUpdate

SetConfidence sets the "confidence" field.

func (*LearningUpdate) SetDiagnosis

func (_u *LearningUpdate) SetDiagnosis(v string) *LearningUpdate

SetDiagnosis sets the "diagnosis" field.

func (*LearningUpdate) SetErrorPattern

func (_u *LearningUpdate) SetErrorPattern(v string) *LearningUpdate

SetErrorPattern sets the "error_pattern" field.

func (*LearningUpdate) SetFix

func (_u *LearningUpdate) SetFix(v string) *LearningUpdate

SetFix sets the "fix" field.

func (*LearningUpdate) SetNillableCategory

func (_u *LearningUpdate) SetNillableCategory(v *learning.Category) *LearningUpdate

SetNillableCategory sets the "category" field if the given value is not nil.

func (*LearningUpdate) SetNillableConfidence

func (_u *LearningUpdate) SetNillableConfidence(v *float64) *LearningUpdate

SetNillableConfidence sets the "confidence" field if the given value is not nil.

func (*LearningUpdate) SetNillableDiagnosis

func (_u *LearningUpdate) SetNillableDiagnosis(v *string) *LearningUpdate

SetNillableDiagnosis sets the "diagnosis" field if the given value is not nil.

func (*LearningUpdate) SetNillableErrorPattern

func (_u *LearningUpdate) SetNillableErrorPattern(v *string) *LearningUpdate

SetNillableErrorPattern sets the "error_pattern" field if the given value is not nil.

func (*LearningUpdate) SetNillableFix

func (_u *LearningUpdate) SetNillableFix(v *string) *LearningUpdate

SetNillableFix sets the "fix" field if the given value is not nil.

func (*LearningUpdate) SetNillableOccurrenceCount

func (_u *LearningUpdate) SetNillableOccurrenceCount(v *int) *LearningUpdate

SetNillableOccurrenceCount sets the "occurrence_count" field if the given value is not nil.

func (*LearningUpdate) SetNillableSuccessCount

func (_u *LearningUpdate) SetNillableSuccessCount(v *int) *LearningUpdate

SetNillableSuccessCount sets the "success_count" field if the given value is not nil.

func (*LearningUpdate) SetNillableTrigger

func (_u *LearningUpdate) SetNillableTrigger(v *string) *LearningUpdate

SetNillableTrigger sets the "trigger" field if the given value is not nil.

func (*LearningUpdate) SetOccurrenceCount

func (_u *LearningUpdate) SetOccurrenceCount(v int) *LearningUpdate

SetOccurrenceCount sets the "occurrence_count" field.

func (*LearningUpdate) SetSuccessCount

func (_u *LearningUpdate) SetSuccessCount(v int) *LearningUpdate

SetSuccessCount sets the "success_count" field.

func (*LearningUpdate) SetTags

func (_u *LearningUpdate) SetTags(v []string) *LearningUpdate

SetTags sets the "tags" field.

func (*LearningUpdate) SetTrigger

func (_u *LearningUpdate) SetTrigger(v string) *LearningUpdate

SetTrigger sets the "trigger" field.

func (*LearningUpdate) SetUpdatedAt

func (_u *LearningUpdate) SetUpdatedAt(v time.Time) *LearningUpdate

SetUpdatedAt sets the "updated_at" field.

func (*LearningUpdate) Where

func (_u *LearningUpdate) Where(ps ...predicate.Learning) *LearningUpdate

Where appends a list predicates to the LearningUpdate builder.

type LearningUpdateOne

type LearningUpdateOne struct {
	// contains filtered or unexported fields
}

LearningUpdateOne is the builder for updating a single Learning entity.

func (*LearningUpdateOne) AddConfidence

func (_u *LearningUpdateOne) AddConfidence(v float64) *LearningUpdateOne

AddConfidence adds value to the "confidence" field.

func (*LearningUpdateOne) AddOccurrenceCount

func (_u *LearningUpdateOne) AddOccurrenceCount(v int) *LearningUpdateOne

AddOccurrenceCount adds value to the "occurrence_count" field.

func (*LearningUpdateOne) AddSuccessCount

func (_u *LearningUpdateOne) AddSuccessCount(v int) *LearningUpdateOne

AddSuccessCount adds value to the "success_count" field.

func (*LearningUpdateOne) AppendTags

func (_u *LearningUpdateOne) AppendTags(v []string) *LearningUpdateOne

AppendTags appends value to the "tags" field.

func (*LearningUpdateOne) ClearDiagnosis

func (_u *LearningUpdateOne) ClearDiagnosis() *LearningUpdateOne

ClearDiagnosis clears the value of the "diagnosis" field.

func (*LearningUpdateOne) ClearErrorPattern

func (_u *LearningUpdateOne) ClearErrorPattern() *LearningUpdateOne

ClearErrorPattern clears the value of the "error_pattern" field.

func (*LearningUpdateOne) ClearFix

func (_u *LearningUpdateOne) ClearFix() *LearningUpdateOne

ClearFix clears the value of the "fix" field.

func (*LearningUpdateOne) ClearTags

func (_u *LearningUpdateOne) ClearTags() *LearningUpdateOne

ClearTags clears the value of the "tags" field.

func (*LearningUpdateOne) Exec

func (_u *LearningUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LearningUpdateOne) ExecX

func (_u *LearningUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LearningUpdateOne) Mutation

func (_u *LearningUpdateOne) Mutation() *LearningMutation

Mutation returns the LearningMutation object of the builder.

func (*LearningUpdateOne) Save

func (_u *LearningUpdateOne) Save(ctx context.Context) (*Learning, error)

Save executes the query and returns the updated Learning entity.

func (*LearningUpdateOne) SaveX

func (_u *LearningUpdateOne) SaveX(ctx context.Context) *Learning

SaveX is like Save, but panics if an error occurs.

func (*LearningUpdateOne) Select

func (_u *LearningUpdateOne) Select(field string, fields ...string) *LearningUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LearningUpdateOne) SetCategory

SetCategory sets the "category" field.

func (*LearningUpdateOne) SetConfidence

func (_u *LearningUpdateOne) SetConfidence(v float64) *LearningUpdateOne

SetConfidence sets the "confidence" field.

func (*LearningUpdateOne) SetDiagnosis

func (_u *LearningUpdateOne) SetDiagnosis(v string) *LearningUpdateOne

SetDiagnosis sets the "diagnosis" field.

func (*LearningUpdateOne) SetErrorPattern

func (_u *LearningUpdateOne) SetErrorPattern(v string) *LearningUpdateOne

SetErrorPattern sets the "error_pattern" field.

func (*LearningUpdateOne) SetFix

SetFix sets the "fix" field.

func (*LearningUpdateOne) SetNillableCategory

func (_u *LearningUpdateOne) SetNillableCategory(v *learning.Category) *LearningUpdateOne

SetNillableCategory sets the "category" field if the given value is not nil.

func (*LearningUpdateOne) SetNillableConfidence

func (_u *LearningUpdateOne) SetNillableConfidence(v *float64) *LearningUpdateOne

SetNillableConfidence sets the "confidence" field if the given value is not nil.

func (*LearningUpdateOne) SetNillableDiagnosis

func (_u *LearningUpdateOne) SetNillableDiagnosis(v *string) *LearningUpdateOne

SetNillableDiagnosis sets the "diagnosis" field if the given value is not nil.

func (*LearningUpdateOne) SetNillableErrorPattern

func (_u *LearningUpdateOne) SetNillableErrorPattern(v *string) *LearningUpdateOne

SetNillableErrorPattern sets the "error_pattern" field if the given value is not nil.

func (*LearningUpdateOne) SetNillableFix

func (_u *LearningUpdateOne) SetNillableFix(v *string) *LearningUpdateOne

SetNillableFix sets the "fix" field if the given value is not nil.

func (*LearningUpdateOne) SetNillableOccurrenceCount

func (_u *LearningUpdateOne) SetNillableOccurrenceCount(v *int) *LearningUpdateOne

SetNillableOccurrenceCount sets the "occurrence_count" field if the given value is not nil.

func (*LearningUpdateOne) SetNillableSuccessCount

func (_u *LearningUpdateOne) SetNillableSuccessCount(v *int) *LearningUpdateOne

SetNillableSuccessCount sets the "success_count" field if the given value is not nil.

func (*LearningUpdateOne) SetNillableTrigger

func (_u *LearningUpdateOne) SetNillableTrigger(v *string) *LearningUpdateOne

SetNillableTrigger sets the "trigger" field if the given value is not nil.

func (*LearningUpdateOne) SetOccurrenceCount

func (_u *LearningUpdateOne) SetOccurrenceCount(v int) *LearningUpdateOne

SetOccurrenceCount sets the "occurrence_count" field.

func (*LearningUpdateOne) SetSuccessCount

func (_u *LearningUpdateOne) SetSuccessCount(v int) *LearningUpdateOne

SetSuccessCount sets the "success_count" field.

func (*LearningUpdateOne) SetTags

func (_u *LearningUpdateOne) SetTags(v []string) *LearningUpdateOne

SetTags sets the "tags" field.

func (*LearningUpdateOne) SetTrigger

func (_u *LearningUpdateOne) SetTrigger(v string) *LearningUpdateOne

SetTrigger sets the "trigger" field.

func (*LearningUpdateOne) SetUpdatedAt

func (_u *LearningUpdateOne) SetUpdatedAt(v time.Time) *LearningUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*LearningUpdateOne) Where

Where appends a list predicates to the LearningUpdate builder.

type Learnings

type Learnings []*Learning

Learnings is a parsable slice of Learning.

type Message

type Message struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Role holds the value of the "role" field.
	Role string `json:"role,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// ToolCalls holds the value of the "tool_calls" field.
	ToolCalls []schema.ToolCall `json:"tool_calls,omitempty"`
	// Author holds the value of the "author" field.
	Author string `json:"author,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QuerySession

func (_m *Message) QuerySession() *SessionQuery

QuerySession queries the "session" edge of the Message entity.

func (*Message) String

func (_m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (_m *Message) Unwrap() *Message

Unwrap unwraps the Message 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 (*Message) Update

func (_m *Message) Update() *MessageUpdateOne

Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.

func (*Message) Value

func (_m *Message) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Message. This includes values selected through modifiers, order, etc.

type MessageClient

type MessageClient struct {
	// contains filtered or unexported fields
}

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

CreateBulk returns a builder for creating a bulk of Message entities.

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(_m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id int) *MessageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id int) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id int) *Message

GetX is like Get, but panics if an error occurs.

func (*MessageClient) Hooks

func (c *MessageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MessageClient) Intercept

func (c *MessageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `message.Intercept(f(g(h())))`.

func (*MessageClient) Interceptors

func (c *MessageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

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 (*MessageClient) Query

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QuerySession

func (c *MessageClient) QuerySession(_m *Message) *SessionQuery

QuerySession queries the session edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(_m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id int) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

func (c *MessageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `message.Hooks(f(g(h())))`.

type MessageCreate

type MessageCreate struct {
	// contains filtered or unexported fields
}

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec

func (_c *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (_c *MessageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreate) Mutation

func (_c *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (_c *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (_c *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetAuthor

func (_c *MessageCreate) SetAuthor(v string) *MessageCreate

SetAuthor sets the "author" field.

func (*MessageCreate) SetContent

func (_c *MessageCreate) SetContent(v string) *MessageCreate

SetContent sets the "content" field.

func (*MessageCreate) SetNillableAuthor

func (_c *MessageCreate) SetNillableAuthor(v *string) *MessageCreate

SetNillableAuthor sets the "author" field if the given value is not nil.

func (*MessageCreate) SetNillableSessionID

func (_c *MessageCreate) SetNillableSessionID(id *int) *MessageCreate

SetNillableSessionID sets the "session" edge to the Session entity by ID if the given value is not nil.

func (*MessageCreate) SetNillableTimestamp

func (_c *MessageCreate) SetNillableTimestamp(v *time.Time) *MessageCreate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*MessageCreate) SetRole

func (_c *MessageCreate) SetRole(v string) *MessageCreate

SetRole sets the "role" field.

func (*MessageCreate) SetSession

func (_c *MessageCreate) SetSession(v *Session) *MessageCreate

SetSession sets the "session" edge to the Session entity.

func (*MessageCreate) SetSessionID

func (_c *MessageCreate) SetSessionID(id int) *MessageCreate

SetSessionID sets the "session" edge to the Session entity by ID.

func (*MessageCreate) SetTimestamp

func (_c *MessageCreate) SetTimestamp(v time.Time) *MessageCreate

SetTimestamp sets the "timestamp" field.

func (*MessageCreate) SetToolCalls

func (_c *MessageCreate) SetToolCalls(v []schema.ToolCall) *MessageCreate

SetToolCalls sets the "tool_calls" field.

type MessageCreateBulk

type MessageCreateBulk struct {
	// contains filtered or unexported fields
}

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (_c *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (_c *MessageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreateBulk) Save

func (_c *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (_c *MessageCreateBulk) SaveX(ctx context.Context) []*Message

SaveX is like Save, but panics if an error occurs.

type MessageDelete

type MessageDelete struct {
	// contains filtered or unexported fields
}

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (_d *MessageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MessageDelete) ExecX

func (_d *MessageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MessageDelete) Where

func (_d *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

type MessageDeleteOne struct {
	// contains filtered or unexported fields
}

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (_d *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (_d *MessageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Session holds the value of the session edge.
	Session *Session `json:"session,omitempty"`
	// contains filtered or unexported fields
}

MessageEdges holds the relations/edges for other nodes in the graph.

func (MessageEdges) SessionOrErr

func (e MessageEdges) SessionOrErr() (*Session, error)

SessionOrErr returns the Session value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MessageGroupBy

type MessageGroupBy struct {
	// contains filtered or unexported fields
}

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (_g *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MessageGroupBy) Bool

func (s *MessageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolX

func (s *MessageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageGroupBy) Bools

func (s *MessageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolsX

func (s *MessageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageGroupBy) Float64

func (s *MessageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64X

func (s *MessageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageGroupBy) Float64s

func (s *MessageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64sX

func (s *MessageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageGroupBy) Int

func (s *MessageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntX

func (s *MessageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageGroupBy) Ints

func (s *MessageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntsX

func (s *MessageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageGroupBy) Scan

func (_g *MessageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageGroupBy) ScanX

func (s *MessageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageGroupBy) String

func (s *MessageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringX

func (s *MessageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageGroupBy) Strings

func (s *MessageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringsX

func (s *MessageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageMutation

type MessageMutation struct {
	// contains filtered or unexported fields
}

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

func (m *MessageMutation) 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 (*MessageMutation) AddedEdges

func (m *MessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageMutation) AddedField

func (m *MessageMutation) 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 (*MessageMutation) AddedFields

func (m *MessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageMutation) AddedIDs

func (m *MessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageMutation) AppendToolCalls

func (m *MessageMutation) AppendToolCalls(sc []schema.ToolCall)

AppendToolCalls adds sc to the "tool_calls" field.

func (*MessageMutation) AppendedToolCalls

func (m *MessageMutation) AppendedToolCalls() ([]schema.ToolCall, bool)

AppendedToolCalls returns the list of values that were appended to the "tool_calls" field in this mutation.

func (*MessageMutation) Author

func (m *MessageMutation) Author() (r string, exists bool)

Author returns the value of the "author" field in the mutation.

func (*MessageMutation) AuthorCleared

func (m *MessageMutation) AuthorCleared() bool

AuthorCleared returns if the "author" field was cleared in this mutation.

func (*MessageMutation) ClearAuthor

func (m *MessageMutation) ClearAuthor()

ClearAuthor clears the value of the "author" field.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) 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 (*MessageMutation) ClearField

func (m *MessageMutation) 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 (*MessageMutation) ClearSession

func (m *MessageMutation) ClearSession()

ClearSession clears the "session" edge to the Session entity.

func (*MessageMutation) ClearToolCalls

func (m *MessageMutation) ClearToolCalls()

ClearToolCalls clears the value of the "tool_calls" field.

func (*MessageMutation) ClearedEdges

func (m *MessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageMutation) ClearedFields

func (m *MessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageMutation) Client

func (m MessageMutation) 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 (*MessageMutation) Content

func (m *MessageMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*MessageMutation) EdgeCleared

func (m *MessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageMutation) Field

func (m *MessageMutation) 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 (*MessageMutation) FieldCleared

func (m *MessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageMutation) Fields

func (m *MessageMutation) 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 (*MessageMutation) ID

func (m *MessageMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MessageMutation) IDs

func (m *MessageMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MessageMutation) OldAuthor

func (m *MessageMutation) OldAuthor(ctx context.Context) (v string, err error)

OldAuthor returns the old "author" field's value of the Message entity. If the Message 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 (*MessageMutation) OldContent

func (m *MessageMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Message entity. If the Message 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 (*MessageMutation) OldField

func (m *MessageMutation) 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 (*MessageMutation) OldRole

func (m *MessageMutation) OldRole(ctx context.Context) (v string, err error)

OldRole returns the old "role" field's value of the Message entity. If the Message 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 (*MessageMutation) OldTimestamp

func (m *MessageMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the Message entity. If the Message 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 (*MessageMutation) OldToolCalls

func (m *MessageMutation) OldToolCalls(ctx context.Context) (v []schema.ToolCall, err error)

OldToolCalls returns the old "tool_calls" field's value of the Message entity. If the Message 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 (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) RemovedEdges

func (m *MessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) 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 (*MessageMutation) ResetAuthor

func (m *MessageMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" field.

func (*MessageMutation) ResetContent

func (m *MessageMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) 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 (*MessageMutation) ResetField

func (m *MessageMutation) 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 (*MessageMutation) ResetRole

func (m *MessageMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*MessageMutation) ResetSession

func (m *MessageMutation) ResetSession()

ResetSession resets all changes to the "session" edge.

func (*MessageMutation) ResetTimestamp

func (m *MessageMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*MessageMutation) ResetToolCalls

func (m *MessageMutation) ResetToolCalls()

ResetToolCalls resets all changes to the "tool_calls" field.

func (*MessageMutation) Role

func (m *MessageMutation) Role() (r string, exists bool)

Role returns the value of the "role" field in the mutation.

func (*MessageMutation) SessionCleared

func (m *MessageMutation) SessionCleared() bool

SessionCleared reports if the "session" edge to the Session entity was cleared.

func (*MessageMutation) SessionID

func (m *MessageMutation) SessionID() (id int, exists bool)

SessionID returns the "session" edge ID in the mutation.

func (*MessageMutation) SessionIDs

func (m *MessageMutation) SessionIDs() (ids []int)

SessionIDs returns the "session" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SessionID instead. It exists only for internal usage by the builders.

func (*MessageMutation) SetAuthor

func (m *MessageMutation) SetAuthor(s string)

SetAuthor sets the "author" field.

func (*MessageMutation) SetContent

func (m *MessageMutation) SetContent(s string)

SetContent sets the "content" field.

func (*MessageMutation) SetField

func (m *MessageMutation) 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 (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetRole

func (m *MessageMutation) SetRole(s string)

SetRole sets the "role" field.

func (*MessageMutation) SetSessionID

func (m *MessageMutation) SetSessionID(id int)

SetSessionID sets the "session" edge to the Session entity by id.

func (*MessageMutation) SetTimestamp

func (m *MessageMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*MessageMutation) SetToolCalls

func (m *MessageMutation) SetToolCalls(sc []schema.ToolCall)

SetToolCalls sets the "tool_calls" field.

func (*MessageMutation) Timestamp

func (m *MessageMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*MessageMutation) ToolCalls

func (m *MessageMutation) ToolCalls() (r []schema.ToolCall, exists bool)

ToolCalls returns the value of the "tool_calls" field in the mutation.

func (*MessageMutation) ToolCallsCleared

func (m *MessageMutation) ToolCallsCleared() bool

ToolCallsCleared returns if the "tool_calls" field was cleared in this mutation.

func (MessageMutation) Tx

func (m MessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

Type returns the node type of this mutation (Message).

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MessageQuery

type MessageQuery struct {
	// contains filtered or unexported fields
}

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (_q *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (_q *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (_q *MessageQuery) AllX(ctx context.Context) []*Message

AllX is like All, but panics if an error occurs.

func (*MessageQuery) Clone

func (_q *MessageQuery) Clone() *MessageQuery

Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageQuery) Count

func (_q *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (_q *MessageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MessageQuery) Exist

func (_q *MessageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MessageQuery) ExistX

func (_q *MessageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MessageQuery) First

func (_q *MessageQuery) First(ctx context.Context) (*Message, error)

First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.

func (*MessageQuery) FirstID

func (_q *MessageQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.

func (*MessageQuery) FirstIDX

func (_q *MessageQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MessageQuery) FirstX

func (_q *MessageQuery) FirstX(ctx context.Context) *Message

FirstX is like First, but panics if an error occurs.

func (*MessageQuery) GroupBy

func (_q *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

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 {
	Role string `json:"role,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldRole).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

func (_q *MessageQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Message IDs.

func (*MessageQuery) IDsX

func (_q *MessageQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MessageQuery) Limit

func (_q *MessageQuery) Limit(limit int) *MessageQuery

Limit the number of records to be returned by this query.

func (*MessageQuery) Offset

func (_q *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only

func (_q *MessageQuery) Only(ctx context.Context) (*Message, error)

Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.

func (*MessageQuery) OnlyID

func (_q *MessageQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageQuery) OnlyIDX

func (_q *MessageQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MessageQuery) OnlyX

func (_q *MessageQuery) OnlyX(ctx context.Context) *Message

OnlyX is like Only, but panics if an error occurs.

func (*MessageQuery) Order

func (_q *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QuerySession

func (_q *MessageQuery) QuerySession() *SessionQuery

QuerySession chains the current query on the "session" edge.

func (*MessageQuery) Select

func (_q *MessageQuery) Select(fields ...string) *MessageSelect

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 {
	Role string `json:"role,omitempty"`
}

client.Message.Query().
	Select(message.FieldRole).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (_q *MessageQuery) Unique(unique bool) *MessageQuery

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 (*MessageQuery) Where

func (_q *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithSession

func (_q *MessageQuery) WithSession(opts ...func(*SessionQuery)) *MessageQuery

WithSession tells the query-builder to eager-load the nodes that are connected to the "session" edge. The optional arguments are used to configure the query builder of the edge.

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

func (_s *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

func (s *MessageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolX

func (s *MessageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageSelect) Bools

func (s *MessageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolsX

func (s *MessageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageSelect) Float64

func (s *MessageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64X

func (s *MessageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageSelect) Float64s

func (s *MessageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64sX

func (s *MessageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageSelect) Int

func (s *MessageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntX

func (s *MessageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageSelect) Ints

func (s *MessageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntsX

func (s *MessageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageSelect) Scan

func (_s *MessageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageSelect) ScanX

func (s *MessageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageSelect) String

func (s *MessageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringX

func (s *MessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageSelect) Strings

func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringsX

func (s *MessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageUpdate

type MessageUpdate struct {
	// contains filtered or unexported fields
}

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) AppendToolCalls

func (_u *MessageUpdate) AppendToolCalls(v []schema.ToolCall) *MessageUpdate

AppendToolCalls appends value to the "tool_calls" field.

func (*MessageUpdate) ClearAuthor

func (_u *MessageUpdate) ClearAuthor() *MessageUpdate

ClearAuthor clears the value of the "author" field.

func (*MessageUpdate) ClearSession

func (_u *MessageUpdate) ClearSession() *MessageUpdate

ClearSession clears the "session" edge to the Session entity.

func (*MessageUpdate) ClearToolCalls

func (_u *MessageUpdate) ClearToolCalls() *MessageUpdate

ClearToolCalls clears the value of the "tool_calls" field.

func (*MessageUpdate) Exec

func (_u *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (_u *MessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdate) Mutation

func (_u *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) Save

func (_u *MessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageUpdate) SaveX

func (_u *MessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdate) SetAuthor

func (_u *MessageUpdate) SetAuthor(v string) *MessageUpdate

SetAuthor sets the "author" field.

func (*MessageUpdate) SetContent

func (_u *MessageUpdate) SetContent(v string) *MessageUpdate

SetContent sets the "content" field.

func (*MessageUpdate) SetNillableAuthor

func (_u *MessageUpdate) SetNillableAuthor(v *string) *MessageUpdate

SetNillableAuthor sets the "author" field if the given value is not nil.

func (*MessageUpdate) SetNillableContent

func (_u *MessageUpdate) SetNillableContent(v *string) *MessageUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdate) SetNillableRole

func (_u *MessageUpdate) SetNillableRole(v *string) *MessageUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*MessageUpdate) SetNillableSessionID

func (_u *MessageUpdate) SetNillableSessionID(id *int) *MessageUpdate

SetNillableSessionID sets the "session" edge to the Session entity by ID if the given value is not nil.

func (*MessageUpdate) SetNillableTimestamp

func (_u *MessageUpdate) SetNillableTimestamp(v *time.Time) *MessageUpdate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*MessageUpdate) SetRole

func (_u *MessageUpdate) SetRole(v string) *MessageUpdate

SetRole sets the "role" field.

func (*MessageUpdate) SetSession

func (_u *MessageUpdate) SetSession(v *Session) *MessageUpdate

SetSession sets the "session" edge to the Session entity.

func (*MessageUpdate) SetSessionID

func (_u *MessageUpdate) SetSessionID(id int) *MessageUpdate

SetSessionID sets the "session" edge to the Session entity by ID.

func (*MessageUpdate) SetTimestamp

func (_u *MessageUpdate) SetTimestamp(v time.Time) *MessageUpdate

SetTimestamp sets the "timestamp" field.

func (*MessageUpdate) SetToolCalls

func (_u *MessageUpdate) SetToolCalls(v []schema.ToolCall) *MessageUpdate

SetToolCalls sets the "tool_calls" field.

func (*MessageUpdate) Where

func (_u *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

type MessageUpdateOne struct {
	// contains filtered or unexported fields
}

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) AppendToolCalls

func (_u *MessageUpdateOne) AppendToolCalls(v []schema.ToolCall) *MessageUpdateOne

AppendToolCalls appends value to the "tool_calls" field.

func (*MessageUpdateOne) ClearAuthor

func (_u *MessageUpdateOne) ClearAuthor() *MessageUpdateOne

ClearAuthor clears the value of the "author" field.

func (*MessageUpdateOne) ClearSession

func (_u *MessageUpdateOne) ClearSession() *MessageUpdateOne

ClearSession clears the "session" edge to the Session entity.

func (*MessageUpdateOne) ClearToolCalls

func (_u *MessageUpdateOne) ClearToolCalls() *MessageUpdateOne

ClearToolCalls clears the value of the "tool_calls" field.

func (*MessageUpdateOne) Exec

func (_u *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (_u *MessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdateOne) Mutation

func (_u *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) Save

func (_u *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (_u *MessageUpdateOne) SaveX(ctx context.Context) *Message

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdateOne) Select

func (_u *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetAuthor

func (_u *MessageUpdateOne) SetAuthor(v string) *MessageUpdateOne

SetAuthor sets the "author" field.

func (*MessageUpdateOne) SetContent

func (_u *MessageUpdateOne) SetContent(v string) *MessageUpdateOne

SetContent sets the "content" field.

func (*MessageUpdateOne) SetNillableAuthor

func (_u *MessageUpdateOne) SetNillableAuthor(v *string) *MessageUpdateOne

SetNillableAuthor sets the "author" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableContent

func (_u *MessageUpdateOne) SetNillableContent(v *string) *MessageUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableRole

func (_u *MessageUpdateOne) SetNillableRole(v *string) *MessageUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableSessionID

func (_u *MessageUpdateOne) SetNillableSessionID(id *int) *MessageUpdateOne

SetNillableSessionID sets the "session" edge to the Session entity by ID if the given value is not nil.

func (*MessageUpdateOne) SetNillableTimestamp

func (_u *MessageUpdateOne) SetNillableTimestamp(v *time.Time) *MessageUpdateOne

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*MessageUpdateOne) SetRole

func (_u *MessageUpdateOne) SetRole(v string) *MessageUpdateOne

SetRole sets the "role" field.

func (*MessageUpdateOne) SetSession

func (_u *MessageUpdateOne) SetSession(v *Session) *MessageUpdateOne

SetSession sets the "session" edge to the Session entity.

func (*MessageUpdateOne) SetSessionID

func (_u *MessageUpdateOne) SetSessionID(id int) *MessageUpdateOne

SetSessionID sets the "session" edge to the Session entity by ID.

func (*MessageUpdateOne) SetTimestamp

func (_u *MessageUpdateOne) SetTimestamp(v time.Time) *MessageUpdateOne

SetTimestamp sets the "timestamp" field.

func (*MessageUpdateOne) SetToolCalls

func (_u *MessageUpdateOne) SetToolCalls(v []schema.ToolCall) *MessageUpdateOne

SetToolCalls sets the "tool_calls" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

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 Observation

type Observation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SessionKey holds the value of the "session_key" field.
	SessionKey string `json:"session_key,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// TokenCount holds the value of the "token_count" field.
	TokenCount int `json:"token_count,omitempty"`
	// SourceStartIndex holds the value of the "source_start_index" field.
	SourceStartIndex int `json:"source_start_index,omitempty"`
	// SourceEndIndex holds the value of the "source_end_index" field.
	SourceEndIndex int `json:"source_end_index,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Observation is the model entity for the Observation schema.

func (*Observation) String

func (_m *Observation) String() string

String implements the fmt.Stringer.

func (*Observation) Unwrap

func (_m *Observation) Unwrap() *Observation

Unwrap unwraps the Observation 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 (*Observation) Update

func (_m *Observation) Update() *ObservationUpdateOne

Update returns a builder for updating this Observation. Note that you need to call Observation.Unwrap() before calling this method if this Observation was returned from a transaction, and the transaction was committed or rolled back.

func (*Observation) Value

func (_m *Observation) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Observation. This includes values selected through modifiers, order, etc.

type ObservationClient

type ObservationClient struct {
	// contains filtered or unexported fields
}

ObservationClient is a client for the Observation schema.

func NewObservationClient

func NewObservationClient(c config) *ObservationClient

NewObservationClient returns a client for the Observation from the given config.

func (*ObservationClient) Create

func (c *ObservationClient) Create() *ObservationCreate

Create returns a builder for creating a Observation entity.

func (*ObservationClient) CreateBulk

func (c *ObservationClient) CreateBulk(builders ...*ObservationCreate) *ObservationCreateBulk

CreateBulk returns a builder for creating a bulk of Observation entities.

func (*ObservationClient) Delete

func (c *ObservationClient) Delete() *ObservationDelete

Delete returns a delete builder for Observation.

func (*ObservationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ObservationClient) DeleteOneID

func (c *ObservationClient) DeleteOneID(id uuid.UUID) *ObservationDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ObservationClient) Get

Get returns a Observation entity by its id.

func (*ObservationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ObservationClient) Hooks

func (c *ObservationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ObservationClient) Intercept

func (c *ObservationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `observation.Intercept(f(g(h())))`.

func (*ObservationClient) Interceptors

func (c *ObservationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ObservationClient) MapCreateBulk

func (c *ObservationClient) MapCreateBulk(slice any, setFunc func(*ObservationCreate, int)) *ObservationCreateBulk

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 (*ObservationClient) Query

func (c *ObservationClient) Query() *ObservationQuery

Query returns a query builder for Observation.

func (*ObservationClient) Update

func (c *ObservationClient) Update() *ObservationUpdate

Update returns an update builder for Observation.

func (*ObservationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ObservationClient) UpdateOneID

func (c *ObservationClient) UpdateOneID(id uuid.UUID) *ObservationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ObservationClient) Use

func (c *ObservationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `observation.Hooks(f(g(h())))`.

type ObservationCreate

type ObservationCreate struct {
	// contains filtered or unexported fields
}

ObservationCreate is the builder for creating a Observation entity.

func (*ObservationCreate) Exec

func (_c *ObservationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ObservationCreate) ExecX

func (_c *ObservationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObservationCreate) Mutation

func (_c *ObservationCreate) Mutation() *ObservationMutation

Mutation returns the ObservationMutation object of the builder.

func (*ObservationCreate) Save

Save creates the Observation in the database.

func (*ObservationCreate) SaveX

func (_c *ObservationCreate) SaveX(ctx context.Context) *Observation

SaveX calls Save and panics if Save returns an error.

func (*ObservationCreate) SetContent

func (_c *ObservationCreate) SetContent(v string) *ObservationCreate

SetContent sets the "content" field.

func (*ObservationCreate) SetCreatedAt

func (_c *ObservationCreate) SetCreatedAt(v time.Time) *ObservationCreate

SetCreatedAt sets the "created_at" field.

func (*ObservationCreate) SetID

SetID sets the "id" field.

func (*ObservationCreate) SetNillableCreatedAt

func (_c *ObservationCreate) SetNillableCreatedAt(v *time.Time) *ObservationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ObservationCreate) SetNillableID

func (_c *ObservationCreate) SetNillableID(v *uuid.UUID) *ObservationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ObservationCreate) SetNillableSourceEndIndex

func (_c *ObservationCreate) SetNillableSourceEndIndex(v *int) *ObservationCreate

SetNillableSourceEndIndex sets the "source_end_index" field if the given value is not nil.

func (*ObservationCreate) SetNillableSourceStartIndex

func (_c *ObservationCreate) SetNillableSourceStartIndex(v *int) *ObservationCreate

SetNillableSourceStartIndex sets the "source_start_index" field if the given value is not nil.

func (*ObservationCreate) SetNillableTokenCount

func (_c *ObservationCreate) SetNillableTokenCount(v *int) *ObservationCreate

SetNillableTokenCount sets the "token_count" field if the given value is not nil.

func (*ObservationCreate) SetSessionKey

func (_c *ObservationCreate) SetSessionKey(v string) *ObservationCreate

SetSessionKey sets the "session_key" field.

func (*ObservationCreate) SetSourceEndIndex

func (_c *ObservationCreate) SetSourceEndIndex(v int) *ObservationCreate

SetSourceEndIndex sets the "source_end_index" field.

func (*ObservationCreate) SetSourceStartIndex

func (_c *ObservationCreate) SetSourceStartIndex(v int) *ObservationCreate

SetSourceStartIndex sets the "source_start_index" field.

func (*ObservationCreate) SetTokenCount

func (_c *ObservationCreate) SetTokenCount(v int) *ObservationCreate

SetTokenCount sets the "token_count" field.

type ObservationCreateBulk

type ObservationCreateBulk struct {
	// contains filtered or unexported fields
}

ObservationCreateBulk is the builder for creating many Observation entities in bulk.

func (*ObservationCreateBulk) Exec

Exec executes the query.

func (*ObservationCreateBulk) ExecX

func (_c *ObservationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObservationCreateBulk) Save

Save creates the Observation entities in the database.

func (*ObservationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ObservationDelete

type ObservationDelete struct {
	// contains filtered or unexported fields
}

ObservationDelete is the builder for deleting a Observation entity.

func (*ObservationDelete) Exec

func (_d *ObservationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ObservationDelete) ExecX

func (_d *ObservationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ObservationDelete) Where

Where appends a list predicates to the ObservationDelete builder.

type ObservationDeleteOne

type ObservationDeleteOne struct {
	// contains filtered or unexported fields
}

ObservationDeleteOne is the builder for deleting a single Observation entity.

func (*ObservationDeleteOne) Exec

func (_d *ObservationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ObservationDeleteOne) ExecX

func (_d *ObservationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObservationDeleteOne) Where

Where appends a list predicates to the ObservationDelete builder.

type ObservationGroupBy

type ObservationGroupBy struct {
	// contains filtered or unexported fields
}

ObservationGroupBy is the group-by builder for Observation entities.

func (*ObservationGroupBy) Aggregate

func (_g *ObservationGroupBy) Aggregate(fns ...AggregateFunc) *ObservationGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ObservationGroupBy) Bool

func (s *ObservationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) BoolX

func (s *ObservationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ObservationGroupBy) Bools

func (s *ObservationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) BoolsX

func (s *ObservationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ObservationGroupBy) Float64

func (s *ObservationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) Float64X

func (s *ObservationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ObservationGroupBy) Float64s

func (s *ObservationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) Float64sX

func (s *ObservationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ObservationGroupBy) Int

func (s *ObservationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) IntX

func (s *ObservationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ObservationGroupBy) Ints

func (s *ObservationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) IntsX

func (s *ObservationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ObservationGroupBy) Scan

func (_g *ObservationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ObservationGroupBy) ScanX

func (s *ObservationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ObservationGroupBy) String

func (s *ObservationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) StringX

func (s *ObservationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ObservationGroupBy) Strings

func (s *ObservationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ObservationGroupBy) StringsX

func (s *ObservationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ObservationMutation

type ObservationMutation struct {
	// contains filtered or unexported fields
}

ObservationMutation represents an operation that mutates the Observation nodes in the graph.

func (*ObservationMutation) AddField

func (m *ObservationMutation) 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 (*ObservationMutation) AddSourceEndIndex

func (m *ObservationMutation) AddSourceEndIndex(i int)

AddSourceEndIndex adds i to the "source_end_index" field.

func (*ObservationMutation) AddSourceStartIndex

func (m *ObservationMutation) AddSourceStartIndex(i int)

AddSourceStartIndex adds i to the "source_start_index" field.

func (*ObservationMutation) AddTokenCount

func (m *ObservationMutation) AddTokenCount(i int)

AddTokenCount adds i to the "token_count" field.

func (*ObservationMutation) AddedEdges

func (m *ObservationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ObservationMutation) AddedField

func (m *ObservationMutation) 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 (*ObservationMutation) AddedFields

func (m *ObservationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ObservationMutation) AddedIDs

func (m *ObservationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ObservationMutation) AddedSourceEndIndex

func (m *ObservationMutation) AddedSourceEndIndex() (r int, exists bool)

AddedSourceEndIndex returns the value that was added to the "source_end_index" field in this mutation.

func (*ObservationMutation) AddedSourceStartIndex

func (m *ObservationMutation) AddedSourceStartIndex() (r int, exists bool)

AddedSourceStartIndex returns the value that was added to the "source_start_index" field in this mutation.

func (*ObservationMutation) AddedTokenCount

func (m *ObservationMutation) AddedTokenCount() (r int, exists bool)

AddedTokenCount returns the value that was added to the "token_count" field in this mutation.

func (*ObservationMutation) ClearEdge

func (m *ObservationMutation) 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 (*ObservationMutation) ClearField

func (m *ObservationMutation) 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 (*ObservationMutation) ClearedEdges

func (m *ObservationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ObservationMutation) ClearedFields

func (m *ObservationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ObservationMutation) Client

func (m ObservationMutation) 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 (*ObservationMutation) Content

func (m *ObservationMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*ObservationMutation) CreatedAt

func (m *ObservationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ObservationMutation) EdgeCleared

func (m *ObservationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ObservationMutation) Field

func (m *ObservationMutation) 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 (*ObservationMutation) FieldCleared

func (m *ObservationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ObservationMutation) Fields

func (m *ObservationMutation) 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 (*ObservationMutation) ID

func (m *ObservationMutation) ID() (id uuid.UUID, 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 (*ObservationMutation) IDs

func (m *ObservationMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ObservationMutation) OldContent

func (m *ObservationMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Observation entity. If the Observation 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 (*ObservationMutation) OldCreatedAt

func (m *ObservationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Observation entity. If the Observation 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 (*ObservationMutation) OldField

func (m *ObservationMutation) 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 (*ObservationMutation) OldSessionKey

func (m *ObservationMutation) OldSessionKey(ctx context.Context) (v string, err error)

OldSessionKey returns the old "session_key" field's value of the Observation entity. If the Observation 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 (*ObservationMutation) OldSourceEndIndex

func (m *ObservationMutation) OldSourceEndIndex(ctx context.Context) (v int, err error)

OldSourceEndIndex returns the old "source_end_index" field's value of the Observation entity. If the Observation 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 (*ObservationMutation) OldSourceStartIndex

func (m *ObservationMutation) OldSourceStartIndex(ctx context.Context) (v int, err error)

OldSourceStartIndex returns the old "source_start_index" field's value of the Observation entity. If the Observation 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 (*ObservationMutation) OldTokenCount

func (m *ObservationMutation) OldTokenCount(ctx context.Context) (v int, err error)

OldTokenCount returns the old "token_count" field's value of the Observation entity. If the Observation 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 (*ObservationMutation) Op

func (m *ObservationMutation) Op() Op

Op returns the operation name.

func (*ObservationMutation) RemovedEdges

func (m *ObservationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ObservationMutation) RemovedIDs

func (m *ObservationMutation) 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 (*ObservationMutation) ResetContent

func (m *ObservationMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*ObservationMutation) ResetCreatedAt

func (m *ObservationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ObservationMutation) ResetEdge

func (m *ObservationMutation) 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 (*ObservationMutation) ResetField

func (m *ObservationMutation) 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 (*ObservationMutation) ResetSessionKey

func (m *ObservationMutation) ResetSessionKey()

ResetSessionKey resets all changes to the "session_key" field.

func (*ObservationMutation) ResetSourceEndIndex

func (m *ObservationMutation) ResetSourceEndIndex()

ResetSourceEndIndex resets all changes to the "source_end_index" field.

func (*ObservationMutation) ResetSourceStartIndex

func (m *ObservationMutation) ResetSourceStartIndex()

ResetSourceStartIndex resets all changes to the "source_start_index" field.

func (*ObservationMutation) ResetTokenCount

func (m *ObservationMutation) ResetTokenCount()

ResetTokenCount resets all changes to the "token_count" field.

func (*ObservationMutation) SessionKey

func (m *ObservationMutation) SessionKey() (r string, exists bool)

SessionKey returns the value of the "session_key" field in the mutation.

func (*ObservationMutation) SetContent

func (m *ObservationMutation) SetContent(s string)

SetContent sets the "content" field.

func (*ObservationMutation) SetCreatedAt

func (m *ObservationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ObservationMutation) SetField

func (m *ObservationMutation) 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 (*ObservationMutation) SetID

func (m *ObservationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Observation entities.

func (*ObservationMutation) SetOp

func (m *ObservationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ObservationMutation) SetSessionKey

func (m *ObservationMutation) SetSessionKey(s string)

SetSessionKey sets the "session_key" field.

func (*ObservationMutation) SetSourceEndIndex

func (m *ObservationMutation) SetSourceEndIndex(i int)

SetSourceEndIndex sets the "source_end_index" field.

func (*ObservationMutation) SetSourceStartIndex

func (m *ObservationMutation) SetSourceStartIndex(i int)

SetSourceStartIndex sets the "source_start_index" field.

func (*ObservationMutation) SetTokenCount

func (m *ObservationMutation) SetTokenCount(i int)

SetTokenCount sets the "token_count" field.

func (*ObservationMutation) SourceEndIndex

func (m *ObservationMutation) SourceEndIndex() (r int, exists bool)

SourceEndIndex returns the value of the "source_end_index" field in the mutation.

func (*ObservationMutation) SourceStartIndex

func (m *ObservationMutation) SourceStartIndex() (r int, exists bool)

SourceStartIndex returns the value of the "source_start_index" field in the mutation.

func (*ObservationMutation) TokenCount

func (m *ObservationMutation) TokenCount() (r int, exists bool)

TokenCount returns the value of the "token_count" field in the mutation.

func (ObservationMutation) Tx

func (m ObservationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ObservationMutation) Type

func (m *ObservationMutation) Type() string

Type returns the node type of this mutation (Observation).

func (*ObservationMutation) Where

func (m *ObservationMutation) Where(ps ...predicate.Observation)

Where appends a list predicates to the ObservationMutation builder.

func (*ObservationMutation) WhereP

func (m *ObservationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ObservationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ObservationQuery

type ObservationQuery struct {
	// contains filtered or unexported fields
}

ObservationQuery is the builder for querying Observation entities.

func (*ObservationQuery) Aggregate

func (_q *ObservationQuery) Aggregate(fns ...AggregateFunc) *ObservationSelect

Aggregate returns a ObservationSelect configured with the given aggregations.

func (*ObservationQuery) All

func (_q *ObservationQuery) All(ctx context.Context) ([]*Observation, error)

All executes the query and returns a list of Observations.

func (*ObservationQuery) AllX

func (_q *ObservationQuery) AllX(ctx context.Context) []*Observation

AllX is like All, but panics if an error occurs.

func (*ObservationQuery) Clone

func (_q *ObservationQuery) Clone() *ObservationQuery

Clone returns a duplicate of the ObservationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ObservationQuery) Count

func (_q *ObservationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ObservationQuery) CountX

func (_q *ObservationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ObservationQuery) Exist

func (_q *ObservationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ObservationQuery) ExistX

func (_q *ObservationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ObservationQuery) First

func (_q *ObservationQuery) First(ctx context.Context) (*Observation, error)

First returns the first Observation entity from the query. Returns a *NotFoundError when no Observation was found.

func (*ObservationQuery) FirstID

func (_q *ObservationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Observation ID from the query. Returns a *NotFoundError when no Observation ID was found.

func (*ObservationQuery) FirstIDX

func (_q *ObservationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ObservationQuery) FirstX

func (_q *ObservationQuery) FirstX(ctx context.Context) *Observation

FirstX is like First, but panics if an error occurs.

func (*ObservationQuery) GroupBy

func (_q *ObservationQuery) GroupBy(field string, fields ...string) *ObservationGroupBy

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 {
	SessionKey string `json:"session_key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Observation.Query().
	GroupBy(observation.FieldSessionKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ObservationQuery) IDs

func (_q *ObservationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Observation IDs.

func (*ObservationQuery) IDsX

func (_q *ObservationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ObservationQuery) Limit

func (_q *ObservationQuery) Limit(limit int) *ObservationQuery

Limit the number of records to be returned by this query.

func (*ObservationQuery) Offset

func (_q *ObservationQuery) Offset(offset int) *ObservationQuery

Offset to start from.

func (*ObservationQuery) Only

func (_q *ObservationQuery) Only(ctx context.Context) (*Observation, error)

Only returns a single Observation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Observation entity is found. Returns a *NotFoundError when no Observation entities are found.

func (*ObservationQuery) OnlyID

func (_q *ObservationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Observation ID in the query. Returns a *NotSingularError when more than one Observation ID is found. Returns a *NotFoundError when no entities are found.

func (*ObservationQuery) OnlyIDX

func (_q *ObservationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ObservationQuery) OnlyX

func (_q *ObservationQuery) OnlyX(ctx context.Context) *Observation

OnlyX is like Only, but panics if an error occurs.

func (*ObservationQuery) Order

Order specifies how the records should be ordered.

func (*ObservationQuery) Select

func (_q *ObservationQuery) Select(fields ...string) *ObservationSelect

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 {
	SessionKey string `json:"session_key,omitempty"`
}

client.Observation.Query().
	Select(observation.FieldSessionKey).
	Scan(ctx, &v)

func (*ObservationQuery) Unique

func (_q *ObservationQuery) Unique(unique bool) *ObservationQuery

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 (*ObservationQuery) Where

Where adds a new predicate for the ObservationQuery builder.

type ObservationSelect

type ObservationSelect struct {
	*ObservationQuery
	// contains filtered or unexported fields
}

ObservationSelect is the builder for selecting fields of Observation entities.

func (*ObservationSelect) Aggregate

func (_s *ObservationSelect) Aggregate(fns ...AggregateFunc) *ObservationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ObservationSelect) Bool

func (s *ObservationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) BoolX

func (s *ObservationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ObservationSelect) Bools

func (s *ObservationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) BoolsX

func (s *ObservationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ObservationSelect) Float64

func (s *ObservationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) Float64X

func (s *ObservationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ObservationSelect) Float64s

func (s *ObservationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) Float64sX

func (s *ObservationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ObservationSelect) Int

func (s *ObservationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) IntX

func (s *ObservationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ObservationSelect) Ints

func (s *ObservationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) IntsX

func (s *ObservationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ObservationSelect) Scan

func (_s *ObservationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ObservationSelect) ScanX

func (s *ObservationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ObservationSelect) String

func (s *ObservationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) StringX

func (s *ObservationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ObservationSelect) Strings

func (s *ObservationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ObservationSelect) StringsX

func (s *ObservationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ObservationUpdate

type ObservationUpdate struct {
	// contains filtered or unexported fields
}

ObservationUpdate is the builder for updating Observation entities.

func (*ObservationUpdate) AddSourceEndIndex

func (_u *ObservationUpdate) AddSourceEndIndex(v int) *ObservationUpdate

AddSourceEndIndex adds value to the "source_end_index" field.

func (*ObservationUpdate) AddSourceStartIndex

func (_u *ObservationUpdate) AddSourceStartIndex(v int) *ObservationUpdate

AddSourceStartIndex adds value to the "source_start_index" field.

func (*ObservationUpdate) AddTokenCount

func (_u *ObservationUpdate) AddTokenCount(v int) *ObservationUpdate

AddTokenCount adds value to the "token_count" field.

func (*ObservationUpdate) Exec

func (_u *ObservationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ObservationUpdate) ExecX

func (_u *ObservationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObservationUpdate) Mutation

func (_u *ObservationUpdate) Mutation() *ObservationMutation

Mutation returns the ObservationMutation object of the builder.

func (*ObservationUpdate) Save

func (_u *ObservationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ObservationUpdate) SaveX

func (_u *ObservationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ObservationUpdate) SetContent

func (_u *ObservationUpdate) SetContent(v string) *ObservationUpdate

SetContent sets the "content" field.

func (*ObservationUpdate) SetNillableContent

func (_u *ObservationUpdate) SetNillableContent(v *string) *ObservationUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*ObservationUpdate) SetNillableSessionKey

func (_u *ObservationUpdate) SetNillableSessionKey(v *string) *ObservationUpdate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*ObservationUpdate) SetNillableSourceEndIndex

func (_u *ObservationUpdate) SetNillableSourceEndIndex(v *int) *ObservationUpdate

SetNillableSourceEndIndex sets the "source_end_index" field if the given value is not nil.

func (*ObservationUpdate) SetNillableSourceStartIndex

func (_u *ObservationUpdate) SetNillableSourceStartIndex(v *int) *ObservationUpdate

SetNillableSourceStartIndex sets the "source_start_index" field if the given value is not nil.

func (*ObservationUpdate) SetNillableTokenCount

func (_u *ObservationUpdate) SetNillableTokenCount(v *int) *ObservationUpdate

SetNillableTokenCount sets the "token_count" field if the given value is not nil.

func (*ObservationUpdate) SetSessionKey

func (_u *ObservationUpdate) SetSessionKey(v string) *ObservationUpdate

SetSessionKey sets the "session_key" field.

func (*ObservationUpdate) SetSourceEndIndex

func (_u *ObservationUpdate) SetSourceEndIndex(v int) *ObservationUpdate

SetSourceEndIndex sets the "source_end_index" field.

func (*ObservationUpdate) SetSourceStartIndex

func (_u *ObservationUpdate) SetSourceStartIndex(v int) *ObservationUpdate

SetSourceStartIndex sets the "source_start_index" field.

func (*ObservationUpdate) SetTokenCount

func (_u *ObservationUpdate) SetTokenCount(v int) *ObservationUpdate

SetTokenCount sets the "token_count" field.

func (*ObservationUpdate) Where

Where appends a list predicates to the ObservationUpdate builder.

type ObservationUpdateOne

type ObservationUpdateOne struct {
	// contains filtered or unexported fields
}

ObservationUpdateOne is the builder for updating a single Observation entity.

func (*ObservationUpdateOne) AddSourceEndIndex

func (_u *ObservationUpdateOne) AddSourceEndIndex(v int) *ObservationUpdateOne

AddSourceEndIndex adds value to the "source_end_index" field.

func (*ObservationUpdateOne) AddSourceStartIndex

func (_u *ObservationUpdateOne) AddSourceStartIndex(v int) *ObservationUpdateOne

AddSourceStartIndex adds value to the "source_start_index" field.

func (*ObservationUpdateOne) AddTokenCount

func (_u *ObservationUpdateOne) AddTokenCount(v int) *ObservationUpdateOne

AddTokenCount adds value to the "token_count" field.

func (*ObservationUpdateOne) Exec

func (_u *ObservationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ObservationUpdateOne) ExecX

func (_u *ObservationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObservationUpdateOne) Mutation

func (_u *ObservationUpdateOne) Mutation() *ObservationMutation

Mutation returns the ObservationMutation object of the builder.

func (*ObservationUpdateOne) Save

Save executes the query and returns the updated Observation entity.

func (*ObservationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ObservationUpdateOne) Select

func (_u *ObservationUpdateOne) Select(field string, fields ...string) *ObservationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ObservationUpdateOne) SetContent

SetContent sets the "content" field.

func (*ObservationUpdateOne) SetNillableContent

func (_u *ObservationUpdateOne) SetNillableContent(v *string) *ObservationUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*ObservationUpdateOne) SetNillableSessionKey

func (_u *ObservationUpdateOne) SetNillableSessionKey(v *string) *ObservationUpdateOne

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*ObservationUpdateOne) SetNillableSourceEndIndex

func (_u *ObservationUpdateOne) SetNillableSourceEndIndex(v *int) *ObservationUpdateOne

SetNillableSourceEndIndex sets the "source_end_index" field if the given value is not nil.

func (*ObservationUpdateOne) SetNillableSourceStartIndex

func (_u *ObservationUpdateOne) SetNillableSourceStartIndex(v *int) *ObservationUpdateOne

SetNillableSourceStartIndex sets the "source_start_index" field if the given value is not nil.

func (*ObservationUpdateOne) SetNillableTokenCount

func (_u *ObservationUpdateOne) SetNillableTokenCount(v *int) *ObservationUpdateOne

SetNillableTokenCount sets the "token_count" field if the given value is not nil.

func (*ObservationUpdateOne) SetSessionKey

func (_u *ObservationUpdateOne) SetSessionKey(v string) *ObservationUpdateOne

SetSessionKey sets the "session_key" field.

func (*ObservationUpdateOne) SetSourceEndIndex

func (_u *ObservationUpdateOne) SetSourceEndIndex(v int) *ObservationUpdateOne

SetSourceEndIndex sets the "source_end_index" field.

func (*ObservationUpdateOne) SetSourceStartIndex

func (_u *ObservationUpdateOne) SetSourceStartIndex(v int) *ObservationUpdateOne

SetSourceStartIndex sets the "source_start_index" field.

func (*ObservationUpdateOne) SetTokenCount

func (_u *ObservationUpdateOne) SetTokenCount(v int) *ObservationUpdateOne

SetTokenCount sets the "token_count" field.

func (*ObservationUpdateOne) Where

Where appends a list predicates to the ObservationUpdate builder.

type Observations

type Observations []*Observation

Observations is a parsable slice of Observation.

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 PaymentTx

type PaymentTx struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// On-chain transaction hash
	TxHash string `json:"tx_hash,omitempty"`
	// Sender wallet address
	FromAddress string `json:"from_address,omitempty"`
	// Recipient wallet address
	ToAddress string `json:"to_address,omitempty"`
	// Transaction amount in USDC (decimal string)
	Amount string `json:"amount,omitempty"`
	// EVM chain ID
	ChainID int64 `json:"chain_id,omitempty"`
	// Transaction lifecycle status
	Status paymenttx.Status `json:"status,omitempty"`
	// Agent session key that initiated this transaction
	SessionKey string `json:"session_key,omitempty"`
	// Human-readable purpose of the payment
	Purpose string `json:"purpose,omitempty"`
	// URL that triggered X402 payment (if applicable)
	X402URL string `json:"x402_url,omitempty"`
	// How the payment was made: direct ERC-20 transfer, X402 V2, or P2P settlement
	PaymentMethod paymenttx.PaymentMethod `json:"payment_method,omitempty"`
	// Error details if transaction failed
	ErrorMessage string `json:"error_message,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

PaymentTx is the model entity for the PaymentTx schema.

func (*PaymentTx) String

func (_m *PaymentTx) String() string

String implements the fmt.Stringer.

func (*PaymentTx) Unwrap

func (_m *PaymentTx) Unwrap() *PaymentTx

Unwrap unwraps the PaymentTx 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 (*PaymentTx) Update

func (_m *PaymentTx) Update() *PaymentTxUpdateOne

Update returns a builder for updating this PaymentTx. Note that you need to call PaymentTx.Unwrap() before calling this method if this PaymentTx was returned from a transaction, and the transaction was committed or rolled back.

func (*PaymentTx) Value

func (_m *PaymentTx) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PaymentTx. This includes values selected through modifiers, order, etc.

type PaymentTxClient

type PaymentTxClient struct {
	// contains filtered or unexported fields
}

PaymentTxClient is a client for the PaymentTx schema.

func NewPaymentTxClient

func NewPaymentTxClient(c config) *PaymentTxClient

NewPaymentTxClient returns a client for the PaymentTx from the given config.

func (*PaymentTxClient) Create

func (c *PaymentTxClient) Create() *PaymentTxCreate

Create returns a builder for creating a PaymentTx entity.

func (*PaymentTxClient) CreateBulk

func (c *PaymentTxClient) CreateBulk(builders ...*PaymentTxCreate) *PaymentTxCreateBulk

CreateBulk returns a builder for creating a bulk of PaymentTx entities.

func (*PaymentTxClient) Delete

func (c *PaymentTxClient) Delete() *PaymentTxDelete

Delete returns a delete builder for PaymentTx.

func (*PaymentTxClient) DeleteOne

func (c *PaymentTxClient) DeleteOne(_m *PaymentTx) *PaymentTxDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PaymentTxClient) DeleteOneID

func (c *PaymentTxClient) DeleteOneID(id uuid.UUID) *PaymentTxDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PaymentTxClient) Get

func (c *PaymentTxClient) Get(ctx context.Context, id uuid.UUID) (*PaymentTx, error)

Get returns a PaymentTx entity by its id.

func (*PaymentTxClient) GetX

func (c *PaymentTxClient) GetX(ctx context.Context, id uuid.UUID) *PaymentTx

GetX is like Get, but panics if an error occurs.

func (*PaymentTxClient) Hooks

func (c *PaymentTxClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PaymentTxClient) Intercept

func (c *PaymentTxClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `paymenttx.Intercept(f(g(h())))`.

func (*PaymentTxClient) Interceptors

func (c *PaymentTxClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PaymentTxClient) MapCreateBulk

func (c *PaymentTxClient) MapCreateBulk(slice any, setFunc func(*PaymentTxCreate, int)) *PaymentTxCreateBulk

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 (*PaymentTxClient) Query

func (c *PaymentTxClient) Query() *PaymentTxQuery

Query returns a query builder for PaymentTx.

func (*PaymentTxClient) Update

func (c *PaymentTxClient) Update() *PaymentTxUpdate

Update returns an update builder for PaymentTx.

func (*PaymentTxClient) UpdateOne

func (c *PaymentTxClient) UpdateOne(_m *PaymentTx) *PaymentTxUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PaymentTxClient) UpdateOneID

func (c *PaymentTxClient) UpdateOneID(id uuid.UUID) *PaymentTxUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PaymentTxClient) Use

func (c *PaymentTxClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `paymenttx.Hooks(f(g(h())))`.

type PaymentTxCreate

type PaymentTxCreate struct {
	// contains filtered or unexported fields
}

PaymentTxCreate is the builder for creating a PaymentTx entity.

func (*PaymentTxCreate) Exec

func (_c *PaymentTxCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentTxCreate) ExecX

func (_c *PaymentTxCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentTxCreate) Mutation

func (_c *PaymentTxCreate) Mutation() *PaymentTxMutation

Mutation returns the PaymentTxMutation object of the builder.

func (*PaymentTxCreate) Save

func (_c *PaymentTxCreate) Save(ctx context.Context) (*PaymentTx, error)

Save creates the PaymentTx in the database.

func (*PaymentTxCreate) SaveX

func (_c *PaymentTxCreate) SaveX(ctx context.Context) *PaymentTx

SaveX calls Save and panics if Save returns an error.

func (*PaymentTxCreate) SetAmount

func (_c *PaymentTxCreate) SetAmount(v string) *PaymentTxCreate

SetAmount sets the "amount" field.

func (*PaymentTxCreate) SetChainID

func (_c *PaymentTxCreate) SetChainID(v int64) *PaymentTxCreate

SetChainID sets the "chain_id" field.

func (*PaymentTxCreate) SetCreatedAt

func (_c *PaymentTxCreate) SetCreatedAt(v time.Time) *PaymentTxCreate

SetCreatedAt sets the "created_at" field.

func (*PaymentTxCreate) SetErrorMessage

func (_c *PaymentTxCreate) SetErrorMessage(v string) *PaymentTxCreate

SetErrorMessage sets the "error_message" field.

func (*PaymentTxCreate) SetFromAddress

func (_c *PaymentTxCreate) SetFromAddress(v string) *PaymentTxCreate

SetFromAddress sets the "from_address" field.

func (*PaymentTxCreate) SetID

func (_c *PaymentTxCreate) SetID(v uuid.UUID) *PaymentTxCreate

SetID sets the "id" field.

func (*PaymentTxCreate) SetNillableCreatedAt

func (_c *PaymentTxCreate) SetNillableCreatedAt(v *time.Time) *PaymentTxCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PaymentTxCreate) SetNillableErrorMessage

func (_c *PaymentTxCreate) SetNillableErrorMessage(v *string) *PaymentTxCreate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*PaymentTxCreate) SetNillableID

func (_c *PaymentTxCreate) SetNillableID(v *uuid.UUID) *PaymentTxCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PaymentTxCreate) SetNillablePaymentMethod

func (_c *PaymentTxCreate) SetNillablePaymentMethod(v *paymenttx.PaymentMethod) *PaymentTxCreate

SetNillablePaymentMethod sets the "payment_method" field if the given value is not nil.

func (*PaymentTxCreate) SetNillablePurpose

func (_c *PaymentTxCreate) SetNillablePurpose(v *string) *PaymentTxCreate

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*PaymentTxCreate) SetNillableSessionKey

func (_c *PaymentTxCreate) SetNillableSessionKey(v *string) *PaymentTxCreate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*PaymentTxCreate) SetNillableStatus

func (_c *PaymentTxCreate) SetNillableStatus(v *paymenttx.Status) *PaymentTxCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PaymentTxCreate) SetNillableTxHash

func (_c *PaymentTxCreate) SetNillableTxHash(v *string) *PaymentTxCreate

SetNillableTxHash sets the "tx_hash" field if the given value is not nil.

func (*PaymentTxCreate) SetNillableUpdatedAt

func (_c *PaymentTxCreate) SetNillableUpdatedAt(v *time.Time) *PaymentTxCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PaymentTxCreate) SetNillableX402URL

func (_c *PaymentTxCreate) SetNillableX402URL(v *string) *PaymentTxCreate

SetNillableX402URL sets the "x402_url" field if the given value is not nil.

func (*PaymentTxCreate) SetPaymentMethod

func (_c *PaymentTxCreate) SetPaymentMethod(v paymenttx.PaymentMethod) *PaymentTxCreate

SetPaymentMethod sets the "payment_method" field.

func (*PaymentTxCreate) SetPurpose

func (_c *PaymentTxCreate) SetPurpose(v string) *PaymentTxCreate

SetPurpose sets the "purpose" field.

func (*PaymentTxCreate) SetSessionKey

func (_c *PaymentTxCreate) SetSessionKey(v string) *PaymentTxCreate

SetSessionKey sets the "session_key" field.

func (*PaymentTxCreate) SetStatus

func (_c *PaymentTxCreate) SetStatus(v paymenttx.Status) *PaymentTxCreate

SetStatus sets the "status" field.

func (*PaymentTxCreate) SetToAddress

func (_c *PaymentTxCreate) SetToAddress(v string) *PaymentTxCreate

SetToAddress sets the "to_address" field.

func (*PaymentTxCreate) SetTxHash

func (_c *PaymentTxCreate) SetTxHash(v string) *PaymentTxCreate

SetTxHash sets the "tx_hash" field.

func (*PaymentTxCreate) SetUpdatedAt

func (_c *PaymentTxCreate) SetUpdatedAt(v time.Time) *PaymentTxCreate

SetUpdatedAt sets the "updated_at" field.

func (*PaymentTxCreate) SetX402URL

func (_c *PaymentTxCreate) SetX402URL(v string) *PaymentTxCreate

SetX402URL sets the "x402_url" field.

type PaymentTxCreateBulk

type PaymentTxCreateBulk struct {
	// contains filtered or unexported fields
}

PaymentTxCreateBulk is the builder for creating many PaymentTx entities in bulk.

func (*PaymentTxCreateBulk) Exec

func (_c *PaymentTxCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentTxCreateBulk) ExecX

func (_c *PaymentTxCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentTxCreateBulk) Save

func (_c *PaymentTxCreateBulk) Save(ctx context.Context) ([]*PaymentTx, error)

Save creates the PaymentTx entities in the database.

func (*PaymentTxCreateBulk) SaveX

func (_c *PaymentTxCreateBulk) SaveX(ctx context.Context) []*PaymentTx

SaveX is like Save, but panics if an error occurs.

type PaymentTxDelete

type PaymentTxDelete struct {
	// contains filtered or unexported fields
}

PaymentTxDelete is the builder for deleting a PaymentTx entity.

func (*PaymentTxDelete) Exec

func (_d *PaymentTxDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PaymentTxDelete) ExecX

func (_d *PaymentTxDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PaymentTxDelete) Where

Where appends a list predicates to the PaymentTxDelete builder.

type PaymentTxDeleteOne

type PaymentTxDeleteOne struct {
	// contains filtered or unexported fields
}

PaymentTxDeleteOne is the builder for deleting a single PaymentTx entity.

func (*PaymentTxDeleteOne) Exec

func (_d *PaymentTxDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PaymentTxDeleteOne) ExecX

func (_d *PaymentTxDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentTxDeleteOne) Where

Where appends a list predicates to the PaymentTxDelete builder.

type PaymentTxGroupBy

type PaymentTxGroupBy struct {
	// contains filtered or unexported fields
}

PaymentTxGroupBy is the group-by builder for PaymentTx entities.

func (*PaymentTxGroupBy) Aggregate

func (_g *PaymentTxGroupBy) Aggregate(fns ...AggregateFunc) *PaymentTxGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PaymentTxGroupBy) Bool

func (s *PaymentTxGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) BoolX

func (s *PaymentTxGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentTxGroupBy) Bools

func (s *PaymentTxGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) BoolsX

func (s *PaymentTxGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentTxGroupBy) Float64

func (s *PaymentTxGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) Float64X

func (s *PaymentTxGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentTxGroupBy) Float64s

func (s *PaymentTxGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) Float64sX

func (s *PaymentTxGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentTxGroupBy) Int

func (s *PaymentTxGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) IntX

func (s *PaymentTxGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentTxGroupBy) Ints

func (s *PaymentTxGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) IntsX

func (s *PaymentTxGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentTxGroupBy) Scan

func (_g *PaymentTxGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentTxGroupBy) ScanX

func (s *PaymentTxGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentTxGroupBy) String

func (s *PaymentTxGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) StringX

func (s *PaymentTxGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentTxGroupBy) Strings

func (s *PaymentTxGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentTxGroupBy) StringsX

func (s *PaymentTxGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentTxMutation

type PaymentTxMutation struct {
	// contains filtered or unexported fields
}

PaymentTxMutation represents an operation that mutates the PaymentTx nodes in the graph.

func (*PaymentTxMutation) AddChainID

func (m *PaymentTxMutation) AddChainID(i int64)

AddChainID adds i to the "chain_id" field.

func (*PaymentTxMutation) AddField

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) AddedChainID

func (m *PaymentTxMutation) AddedChainID() (r int64, exists bool)

AddedChainID returns the value that was added to the "chain_id" field in this mutation.

func (*PaymentTxMutation) AddedEdges

func (m *PaymentTxMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PaymentTxMutation) AddedField

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) AddedFields

func (m *PaymentTxMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PaymentTxMutation) AddedIDs

func (m *PaymentTxMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PaymentTxMutation) Amount

func (m *PaymentTxMutation) Amount() (r string, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*PaymentTxMutation) ChainID

func (m *PaymentTxMutation) ChainID() (r int64, exists bool)

ChainID returns the value of the "chain_id" field in the mutation.

func (*PaymentTxMutation) ClearEdge

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) ClearErrorMessage

func (m *PaymentTxMutation) ClearErrorMessage()

ClearErrorMessage clears the value of the "error_message" field.

func (*PaymentTxMutation) ClearField

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) ClearPurpose

func (m *PaymentTxMutation) ClearPurpose()

ClearPurpose clears the value of the "purpose" field.

func (*PaymentTxMutation) ClearSessionKey

func (m *PaymentTxMutation) ClearSessionKey()

ClearSessionKey clears the value of the "session_key" field.

func (*PaymentTxMutation) ClearTxHash

func (m *PaymentTxMutation) ClearTxHash()

ClearTxHash clears the value of the "tx_hash" field.

func (*PaymentTxMutation) ClearX402URL

func (m *PaymentTxMutation) ClearX402URL()

ClearX402URL clears the value of the "x402_url" field.

func (*PaymentTxMutation) ClearedEdges

func (m *PaymentTxMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PaymentTxMutation) ClearedFields

func (m *PaymentTxMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PaymentTxMutation) Client

func (m PaymentTxMutation) 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 (*PaymentTxMutation) CreatedAt

func (m *PaymentTxMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PaymentTxMutation) EdgeCleared

func (m *PaymentTxMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PaymentTxMutation) ErrorMessage

func (m *PaymentTxMutation) ErrorMessage() (r string, exists bool)

ErrorMessage returns the value of the "error_message" field in the mutation.

func (*PaymentTxMutation) ErrorMessageCleared

func (m *PaymentTxMutation) ErrorMessageCleared() bool

ErrorMessageCleared returns if the "error_message" field was cleared in this mutation.

func (*PaymentTxMutation) Field

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) FieldCleared

func (m *PaymentTxMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PaymentTxMutation) Fields

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) FromAddress

func (m *PaymentTxMutation) FromAddress() (r string, exists bool)

FromAddress returns the value of the "from_address" field in the mutation.

func (*PaymentTxMutation) ID

func (m *PaymentTxMutation) ID() (id uuid.UUID, 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 (*PaymentTxMutation) IDs

func (m *PaymentTxMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*PaymentTxMutation) OldAmount

func (m *PaymentTxMutation) OldAmount(ctx context.Context) (v string, err error)

OldAmount returns the old "amount" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldChainID

func (m *PaymentTxMutation) OldChainID(ctx context.Context) (v int64, err error)

OldChainID returns the old "chain_id" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldCreatedAt

func (m *PaymentTxMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldErrorMessage

func (m *PaymentTxMutation) OldErrorMessage(ctx context.Context) (v string, err error)

OldErrorMessage returns the old "error_message" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldField

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) OldFromAddress

func (m *PaymentTxMutation) OldFromAddress(ctx context.Context) (v string, err error)

OldFromAddress returns the old "from_address" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldPaymentMethod

func (m *PaymentTxMutation) OldPaymentMethod(ctx context.Context) (v paymenttx.PaymentMethod, err error)

OldPaymentMethod returns the old "payment_method" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldPurpose

func (m *PaymentTxMutation) OldPurpose(ctx context.Context) (v string, err error)

OldPurpose returns the old "purpose" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldSessionKey

func (m *PaymentTxMutation) OldSessionKey(ctx context.Context) (v string, err error)

OldSessionKey returns the old "session_key" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldStatus

func (m *PaymentTxMutation) OldStatus(ctx context.Context) (v paymenttx.Status, err error)

OldStatus returns the old "status" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldToAddress

func (m *PaymentTxMutation) OldToAddress(ctx context.Context) (v string, err error)

OldToAddress returns the old "to_address" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldTxHash

func (m *PaymentTxMutation) OldTxHash(ctx context.Context) (v string, err error)

OldTxHash returns the old "tx_hash" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldUpdatedAt

func (m *PaymentTxMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) OldX402URL

func (m *PaymentTxMutation) OldX402URL(ctx context.Context) (v string, err error)

OldX402URL returns the old "x402_url" field's value of the PaymentTx entity. If the PaymentTx 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 (*PaymentTxMutation) Op

func (m *PaymentTxMutation) Op() Op

Op returns the operation name.

func (*PaymentTxMutation) PaymentMethod

func (m *PaymentTxMutation) PaymentMethod() (r paymenttx.PaymentMethod, exists bool)

PaymentMethod returns the value of the "payment_method" field in the mutation.

func (*PaymentTxMutation) Purpose

func (m *PaymentTxMutation) Purpose() (r string, exists bool)

Purpose returns the value of the "purpose" field in the mutation.

func (*PaymentTxMutation) PurposeCleared

func (m *PaymentTxMutation) PurposeCleared() bool

PurposeCleared returns if the "purpose" field was cleared in this mutation.

func (*PaymentTxMutation) RemovedEdges

func (m *PaymentTxMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PaymentTxMutation) RemovedIDs

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) ResetAmount

func (m *PaymentTxMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*PaymentTxMutation) ResetChainID

func (m *PaymentTxMutation) ResetChainID()

ResetChainID resets all changes to the "chain_id" field.

func (*PaymentTxMutation) ResetCreatedAt

func (m *PaymentTxMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PaymentTxMutation) ResetEdge

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) ResetErrorMessage

func (m *PaymentTxMutation) ResetErrorMessage()

ResetErrorMessage resets all changes to the "error_message" field.

func (*PaymentTxMutation) ResetField

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) ResetFromAddress

func (m *PaymentTxMutation) ResetFromAddress()

ResetFromAddress resets all changes to the "from_address" field.

func (*PaymentTxMutation) ResetPaymentMethod

func (m *PaymentTxMutation) ResetPaymentMethod()

ResetPaymentMethod resets all changes to the "payment_method" field.

func (*PaymentTxMutation) ResetPurpose

func (m *PaymentTxMutation) ResetPurpose()

ResetPurpose resets all changes to the "purpose" field.

func (*PaymentTxMutation) ResetSessionKey

func (m *PaymentTxMutation) ResetSessionKey()

ResetSessionKey resets all changes to the "session_key" field.

func (*PaymentTxMutation) ResetStatus

func (m *PaymentTxMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*PaymentTxMutation) ResetToAddress

func (m *PaymentTxMutation) ResetToAddress()

ResetToAddress resets all changes to the "to_address" field.

func (*PaymentTxMutation) ResetTxHash

func (m *PaymentTxMutation) ResetTxHash()

ResetTxHash resets all changes to the "tx_hash" field.

func (*PaymentTxMutation) ResetUpdatedAt

func (m *PaymentTxMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PaymentTxMutation) ResetX402URL

func (m *PaymentTxMutation) ResetX402URL()

ResetX402URL resets all changes to the "x402_url" field.

func (*PaymentTxMutation) SessionKey

func (m *PaymentTxMutation) SessionKey() (r string, exists bool)

SessionKey returns the value of the "session_key" field in the mutation.

func (*PaymentTxMutation) SessionKeyCleared

func (m *PaymentTxMutation) SessionKeyCleared() bool

SessionKeyCleared returns if the "session_key" field was cleared in this mutation.

func (*PaymentTxMutation) SetAmount

func (m *PaymentTxMutation) SetAmount(s string)

SetAmount sets the "amount" field.

func (*PaymentTxMutation) SetChainID

func (m *PaymentTxMutation) SetChainID(i int64)

SetChainID sets the "chain_id" field.

func (*PaymentTxMutation) SetCreatedAt

func (m *PaymentTxMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PaymentTxMutation) SetErrorMessage

func (m *PaymentTxMutation) SetErrorMessage(s string)

SetErrorMessage sets the "error_message" field.

func (*PaymentTxMutation) SetField

func (m *PaymentTxMutation) 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 (*PaymentTxMutation) SetFromAddress

func (m *PaymentTxMutation) SetFromAddress(s string)

SetFromAddress sets the "from_address" field.

func (*PaymentTxMutation) SetID

func (m *PaymentTxMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of PaymentTx entities.

func (*PaymentTxMutation) SetOp

func (m *PaymentTxMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PaymentTxMutation) SetPaymentMethod

func (m *PaymentTxMutation) SetPaymentMethod(pm paymenttx.PaymentMethod)

SetPaymentMethod sets the "payment_method" field.

func (*PaymentTxMutation) SetPurpose

func (m *PaymentTxMutation) SetPurpose(s string)

SetPurpose sets the "purpose" field.

func (*PaymentTxMutation) SetSessionKey

func (m *PaymentTxMutation) SetSessionKey(s string)

SetSessionKey sets the "session_key" field.

func (*PaymentTxMutation) SetStatus

func (m *PaymentTxMutation) SetStatus(pa paymenttx.Status)

SetStatus sets the "status" field.

func (*PaymentTxMutation) SetToAddress

func (m *PaymentTxMutation) SetToAddress(s string)

SetToAddress sets the "to_address" field.

func (*PaymentTxMutation) SetTxHash

func (m *PaymentTxMutation) SetTxHash(s string)

SetTxHash sets the "tx_hash" field.

func (*PaymentTxMutation) SetUpdatedAt

func (m *PaymentTxMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PaymentTxMutation) SetX402URL

func (m *PaymentTxMutation) SetX402URL(s string)

SetX402URL sets the "x402_url" field.

func (*PaymentTxMutation) Status

func (m *PaymentTxMutation) Status() (r paymenttx.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*PaymentTxMutation) ToAddress

func (m *PaymentTxMutation) ToAddress() (r string, exists bool)

ToAddress returns the value of the "to_address" field in the mutation.

func (PaymentTxMutation) Tx

func (m PaymentTxMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PaymentTxMutation) TxHash

func (m *PaymentTxMutation) TxHash() (r string, exists bool)

TxHash returns the value of the "tx_hash" field in the mutation.

func (*PaymentTxMutation) TxHashCleared

func (m *PaymentTxMutation) TxHashCleared() bool

TxHashCleared returns if the "tx_hash" field was cleared in this mutation.

func (*PaymentTxMutation) Type

func (m *PaymentTxMutation) Type() string

Type returns the node type of this mutation (PaymentTx).

func (*PaymentTxMutation) UpdatedAt

func (m *PaymentTxMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PaymentTxMutation) Where

func (m *PaymentTxMutation) Where(ps ...predicate.PaymentTx)

Where appends a list predicates to the PaymentTxMutation builder.

func (*PaymentTxMutation) WhereP

func (m *PaymentTxMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PaymentTxMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*PaymentTxMutation) X402URL

func (m *PaymentTxMutation) X402URL() (r string, exists bool)

X402URL returns the value of the "x402_url" field in the mutation.

func (*PaymentTxMutation) X402URLCleared

func (m *PaymentTxMutation) X402URLCleared() bool

X402URLCleared returns if the "x402_url" field was cleared in this mutation.

type PaymentTxQuery

type PaymentTxQuery struct {
	// contains filtered or unexported fields
}

PaymentTxQuery is the builder for querying PaymentTx entities.

func (*PaymentTxQuery) Aggregate

func (_q *PaymentTxQuery) Aggregate(fns ...AggregateFunc) *PaymentTxSelect

Aggregate returns a PaymentTxSelect configured with the given aggregations.

func (*PaymentTxQuery) All

func (_q *PaymentTxQuery) All(ctx context.Context) ([]*PaymentTx, error)

All executes the query and returns a list of PaymentTxes.

func (*PaymentTxQuery) AllX

func (_q *PaymentTxQuery) AllX(ctx context.Context) []*PaymentTx

AllX is like All, but panics if an error occurs.

func (*PaymentTxQuery) Clone

func (_q *PaymentTxQuery) Clone() *PaymentTxQuery

Clone returns a duplicate of the PaymentTxQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PaymentTxQuery) Count

func (_q *PaymentTxQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PaymentTxQuery) CountX

func (_q *PaymentTxQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PaymentTxQuery) Exist

func (_q *PaymentTxQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PaymentTxQuery) ExistX

func (_q *PaymentTxQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PaymentTxQuery) First

func (_q *PaymentTxQuery) First(ctx context.Context) (*PaymentTx, error)

First returns the first PaymentTx entity from the query. Returns a *NotFoundError when no PaymentTx was found.

func (*PaymentTxQuery) FirstID

func (_q *PaymentTxQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first PaymentTx ID from the query. Returns a *NotFoundError when no PaymentTx ID was found.

func (*PaymentTxQuery) FirstIDX

func (_q *PaymentTxQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*PaymentTxQuery) FirstX

func (_q *PaymentTxQuery) FirstX(ctx context.Context) *PaymentTx

FirstX is like First, but panics if an error occurs.

func (*PaymentTxQuery) GroupBy

func (_q *PaymentTxQuery) GroupBy(field string, fields ...string) *PaymentTxGroupBy

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 {
	TxHash string `json:"tx_hash,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PaymentTx.Query().
	GroupBy(paymenttx.FieldTxHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PaymentTxQuery) IDs

func (_q *PaymentTxQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of PaymentTx IDs.

func (*PaymentTxQuery) IDsX

func (_q *PaymentTxQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*PaymentTxQuery) Limit

func (_q *PaymentTxQuery) Limit(limit int) *PaymentTxQuery

Limit the number of records to be returned by this query.

func (*PaymentTxQuery) Offset

func (_q *PaymentTxQuery) Offset(offset int) *PaymentTxQuery

Offset to start from.

func (*PaymentTxQuery) Only

func (_q *PaymentTxQuery) Only(ctx context.Context) (*PaymentTx, error)

Only returns a single PaymentTx entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PaymentTx entity is found. Returns a *NotFoundError when no PaymentTx entities are found.

func (*PaymentTxQuery) OnlyID

func (_q *PaymentTxQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only PaymentTx ID in the query. Returns a *NotSingularError when more than one PaymentTx ID is found. Returns a *NotFoundError when no entities are found.

func (*PaymentTxQuery) OnlyIDX

func (_q *PaymentTxQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PaymentTxQuery) OnlyX

func (_q *PaymentTxQuery) OnlyX(ctx context.Context) *PaymentTx

OnlyX is like Only, but panics if an error occurs.

func (*PaymentTxQuery) Order

Order specifies how the records should be ordered.

func (*PaymentTxQuery) Select

func (_q *PaymentTxQuery) Select(fields ...string) *PaymentTxSelect

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 {
	TxHash string `json:"tx_hash,omitempty"`
}

client.PaymentTx.Query().
	Select(paymenttx.FieldTxHash).
	Scan(ctx, &v)

func (*PaymentTxQuery) Unique

func (_q *PaymentTxQuery) Unique(unique bool) *PaymentTxQuery

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 (*PaymentTxQuery) Where

Where adds a new predicate for the PaymentTxQuery builder.

type PaymentTxSelect

type PaymentTxSelect struct {
	*PaymentTxQuery
	// contains filtered or unexported fields
}

PaymentTxSelect is the builder for selecting fields of PaymentTx entities.

func (*PaymentTxSelect) Aggregate

func (_s *PaymentTxSelect) Aggregate(fns ...AggregateFunc) *PaymentTxSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PaymentTxSelect) Bool

func (s *PaymentTxSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) BoolX

func (s *PaymentTxSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentTxSelect) Bools

func (s *PaymentTxSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) BoolsX

func (s *PaymentTxSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentTxSelect) Float64

func (s *PaymentTxSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) Float64X

func (s *PaymentTxSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentTxSelect) Float64s

func (s *PaymentTxSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) Float64sX

func (s *PaymentTxSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentTxSelect) Int

func (s *PaymentTxSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) IntX

func (s *PaymentTxSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentTxSelect) Ints

func (s *PaymentTxSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) IntsX

func (s *PaymentTxSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentTxSelect) Scan

func (_s *PaymentTxSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentTxSelect) ScanX

func (s *PaymentTxSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentTxSelect) String

func (s *PaymentTxSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) StringX

func (s *PaymentTxSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentTxSelect) Strings

func (s *PaymentTxSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentTxSelect) StringsX

func (s *PaymentTxSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentTxUpdate

type PaymentTxUpdate struct {
	// contains filtered or unexported fields
}

PaymentTxUpdate is the builder for updating PaymentTx entities.

func (*PaymentTxUpdate) AddChainID

func (_u *PaymentTxUpdate) AddChainID(v int64) *PaymentTxUpdate

AddChainID adds value to the "chain_id" field.

func (*PaymentTxUpdate) ClearErrorMessage

func (_u *PaymentTxUpdate) ClearErrorMessage() *PaymentTxUpdate

ClearErrorMessage clears the value of the "error_message" field.

func (*PaymentTxUpdate) ClearPurpose

func (_u *PaymentTxUpdate) ClearPurpose() *PaymentTxUpdate

ClearPurpose clears the value of the "purpose" field.

func (*PaymentTxUpdate) ClearSessionKey

func (_u *PaymentTxUpdate) ClearSessionKey() *PaymentTxUpdate

ClearSessionKey clears the value of the "session_key" field.

func (*PaymentTxUpdate) ClearTxHash

func (_u *PaymentTxUpdate) ClearTxHash() *PaymentTxUpdate

ClearTxHash clears the value of the "tx_hash" field.

func (*PaymentTxUpdate) ClearX402URL

func (_u *PaymentTxUpdate) ClearX402URL() *PaymentTxUpdate

ClearX402URL clears the value of the "x402_url" field.

func (*PaymentTxUpdate) Exec

func (_u *PaymentTxUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentTxUpdate) ExecX

func (_u *PaymentTxUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentTxUpdate) Mutation

func (_u *PaymentTxUpdate) Mutation() *PaymentTxMutation

Mutation returns the PaymentTxMutation object of the builder.

func (*PaymentTxUpdate) Save

func (_u *PaymentTxUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PaymentTxUpdate) SaveX

func (_u *PaymentTxUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PaymentTxUpdate) SetAmount

func (_u *PaymentTxUpdate) SetAmount(v string) *PaymentTxUpdate

SetAmount sets the "amount" field.

func (*PaymentTxUpdate) SetChainID

func (_u *PaymentTxUpdate) SetChainID(v int64) *PaymentTxUpdate

SetChainID sets the "chain_id" field.

func (*PaymentTxUpdate) SetErrorMessage

func (_u *PaymentTxUpdate) SetErrorMessage(v string) *PaymentTxUpdate

SetErrorMessage sets the "error_message" field.

func (*PaymentTxUpdate) SetFromAddress

func (_u *PaymentTxUpdate) SetFromAddress(v string) *PaymentTxUpdate

SetFromAddress sets the "from_address" field.

func (*PaymentTxUpdate) SetNillableAmount

func (_u *PaymentTxUpdate) SetNillableAmount(v *string) *PaymentTxUpdate

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableChainID

func (_u *PaymentTxUpdate) SetNillableChainID(v *int64) *PaymentTxUpdate

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableErrorMessage

func (_u *PaymentTxUpdate) SetNillableErrorMessage(v *string) *PaymentTxUpdate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableFromAddress

func (_u *PaymentTxUpdate) SetNillableFromAddress(v *string) *PaymentTxUpdate

SetNillableFromAddress sets the "from_address" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillablePaymentMethod

func (_u *PaymentTxUpdate) SetNillablePaymentMethod(v *paymenttx.PaymentMethod) *PaymentTxUpdate

SetNillablePaymentMethod sets the "payment_method" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillablePurpose

func (_u *PaymentTxUpdate) SetNillablePurpose(v *string) *PaymentTxUpdate

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableSessionKey

func (_u *PaymentTxUpdate) SetNillableSessionKey(v *string) *PaymentTxUpdate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableStatus

func (_u *PaymentTxUpdate) SetNillableStatus(v *paymenttx.Status) *PaymentTxUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableToAddress

func (_u *PaymentTxUpdate) SetNillableToAddress(v *string) *PaymentTxUpdate

SetNillableToAddress sets the "to_address" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableTxHash

func (_u *PaymentTxUpdate) SetNillableTxHash(v *string) *PaymentTxUpdate

SetNillableTxHash sets the "tx_hash" field if the given value is not nil.

func (*PaymentTxUpdate) SetNillableX402URL

func (_u *PaymentTxUpdate) SetNillableX402URL(v *string) *PaymentTxUpdate

SetNillableX402URL sets the "x402_url" field if the given value is not nil.

func (*PaymentTxUpdate) SetPaymentMethod

func (_u *PaymentTxUpdate) SetPaymentMethod(v paymenttx.PaymentMethod) *PaymentTxUpdate

SetPaymentMethod sets the "payment_method" field.

func (*PaymentTxUpdate) SetPurpose

func (_u *PaymentTxUpdate) SetPurpose(v string) *PaymentTxUpdate

SetPurpose sets the "purpose" field.

func (*PaymentTxUpdate) SetSessionKey

func (_u *PaymentTxUpdate) SetSessionKey(v string) *PaymentTxUpdate

SetSessionKey sets the "session_key" field.

func (*PaymentTxUpdate) SetStatus

func (_u *PaymentTxUpdate) SetStatus(v paymenttx.Status) *PaymentTxUpdate

SetStatus sets the "status" field.

func (*PaymentTxUpdate) SetToAddress

func (_u *PaymentTxUpdate) SetToAddress(v string) *PaymentTxUpdate

SetToAddress sets the "to_address" field.

func (*PaymentTxUpdate) SetTxHash

func (_u *PaymentTxUpdate) SetTxHash(v string) *PaymentTxUpdate

SetTxHash sets the "tx_hash" field.

func (*PaymentTxUpdate) SetUpdatedAt

func (_u *PaymentTxUpdate) SetUpdatedAt(v time.Time) *PaymentTxUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PaymentTxUpdate) SetX402URL

func (_u *PaymentTxUpdate) SetX402URL(v string) *PaymentTxUpdate

SetX402URL sets the "x402_url" field.

func (*PaymentTxUpdate) Where

Where appends a list predicates to the PaymentTxUpdate builder.

type PaymentTxUpdateOne

type PaymentTxUpdateOne struct {
	// contains filtered or unexported fields
}

PaymentTxUpdateOne is the builder for updating a single PaymentTx entity.

func (*PaymentTxUpdateOne) AddChainID

func (_u *PaymentTxUpdateOne) AddChainID(v int64) *PaymentTxUpdateOne

AddChainID adds value to the "chain_id" field.

func (*PaymentTxUpdateOne) ClearErrorMessage

func (_u *PaymentTxUpdateOne) ClearErrorMessage() *PaymentTxUpdateOne

ClearErrorMessage clears the value of the "error_message" field.

func (*PaymentTxUpdateOne) ClearPurpose

func (_u *PaymentTxUpdateOne) ClearPurpose() *PaymentTxUpdateOne

ClearPurpose clears the value of the "purpose" field.

func (*PaymentTxUpdateOne) ClearSessionKey

func (_u *PaymentTxUpdateOne) ClearSessionKey() *PaymentTxUpdateOne

ClearSessionKey clears the value of the "session_key" field.

func (*PaymentTxUpdateOne) ClearTxHash

func (_u *PaymentTxUpdateOne) ClearTxHash() *PaymentTxUpdateOne

ClearTxHash clears the value of the "tx_hash" field.

func (*PaymentTxUpdateOne) ClearX402URL

func (_u *PaymentTxUpdateOne) ClearX402URL() *PaymentTxUpdateOne

ClearX402URL clears the value of the "x402_url" field.

func (*PaymentTxUpdateOne) Exec

func (_u *PaymentTxUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PaymentTxUpdateOne) ExecX

func (_u *PaymentTxUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentTxUpdateOne) Mutation

func (_u *PaymentTxUpdateOne) Mutation() *PaymentTxMutation

Mutation returns the PaymentTxMutation object of the builder.

func (*PaymentTxUpdateOne) Save

func (_u *PaymentTxUpdateOne) Save(ctx context.Context) (*PaymentTx, error)

Save executes the query and returns the updated PaymentTx entity.

func (*PaymentTxUpdateOne) SaveX

func (_u *PaymentTxUpdateOne) SaveX(ctx context.Context) *PaymentTx

SaveX is like Save, but panics if an error occurs.

func (*PaymentTxUpdateOne) Select

func (_u *PaymentTxUpdateOne) Select(field string, fields ...string) *PaymentTxUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PaymentTxUpdateOne) SetAmount

func (_u *PaymentTxUpdateOne) SetAmount(v string) *PaymentTxUpdateOne

SetAmount sets the "amount" field.

func (*PaymentTxUpdateOne) SetChainID

func (_u *PaymentTxUpdateOne) SetChainID(v int64) *PaymentTxUpdateOne

SetChainID sets the "chain_id" field.

func (*PaymentTxUpdateOne) SetErrorMessage

func (_u *PaymentTxUpdateOne) SetErrorMessage(v string) *PaymentTxUpdateOne

SetErrorMessage sets the "error_message" field.

func (*PaymentTxUpdateOne) SetFromAddress

func (_u *PaymentTxUpdateOne) SetFromAddress(v string) *PaymentTxUpdateOne

SetFromAddress sets the "from_address" field.

func (*PaymentTxUpdateOne) SetNillableAmount

func (_u *PaymentTxUpdateOne) SetNillableAmount(v *string) *PaymentTxUpdateOne

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableChainID

func (_u *PaymentTxUpdateOne) SetNillableChainID(v *int64) *PaymentTxUpdateOne

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableErrorMessage

func (_u *PaymentTxUpdateOne) SetNillableErrorMessage(v *string) *PaymentTxUpdateOne

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableFromAddress

func (_u *PaymentTxUpdateOne) SetNillableFromAddress(v *string) *PaymentTxUpdateOne

SetNillableFromAddress sets the "from_address" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillablePaymentMethod

func (_u *PaymentTxUpdateOne) SetNillablePaymentMethod(v *paymenttx.PaymentMethod) *PaymentTxUpdateOne

SetNillablePaymentMethod sets the "payment_method" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillablePurpose

func (_u *PaymentTxUpdateOne) SetNillablePurpose(v *string) *PaymentTxUpdateOne

SetNillablePurpose sets the "purpose" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableSessionKey

func (_u *PaymentTxUpdateOne) SetNillableSessionKey(v *string) *PaymentTxUpdateOne

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableStatus

func (_u *PaymentTxUpdateOne) SetNillableStatus(v *paymenttx.Status) *PaymentTxUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableToAddress

func (_u *PaymentTxUpdateOne) SetNillableToAddress(v *string) *PaymentTxUpdateOne

SetNillableToAddress sets the "to_address" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableTxHash

func (_u *PaymentTxUpdateOne) SetNillableTxHash(v *string) *PaymentTxUpdateOne

SetNillableTxHash sets the "tx_hash" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetNillableX402URL

func (_u *PaymentTxUpdateOne) SetNillableX402URL(v *string) *PaymentTxUpdateOne

SetNillableX402URL sets the "x402_url" field if the given value is not nil.

func (*PaymentTxUpdateOne) SetPaymentMethod

SetPaymentMethod sets the "payment_method" field.

func (*PaymentTxUpdateOne) SetPurpose

func (_u *PaymentTxUpdateOne) SetPurpose(v string) *PaymentTxUpdateOne

SetPurpose sets the "purpose" field.

func (*PaymentTxUpdateOne) SetSessionKey

func (_u *PaymentTxUpdateOne) SetSessionKey(v string) *PaymentTxUpdateOne

SetSessionKey sets the "session_key" field.

func (*PaymentTxUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*PaymentTxUpdateOne) SetToAddress

func (_u *PaymentTxUpdateOne) SetToAddress(v string) *PaymentTxUpdateOne

SetToAddress sets the "to_address" field.

func (*PaymentTxUpdateOne) SetTxHash

func (_u *PaymentTxUpdateOne) SetTxHash(v string) *PaymentTxUpdateOne

SetTxHash sets the "tx_hash" field.

func (*PaymentTxUpdateOne) SetUpdatedAt

func (_u *PaymentTxUpdateOne) SetUpdatedAt(v time.Time) *PaymentTxUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PaymentTxUpdateOne) SetX402URL

func (_u *PaymentTxUpdateOne) SetX402URL(v string) *PaymentTxUpdateOne

SetX402URL sets the "x402_url" field.

func (*PaymentTxUpdateOne) Where

Where appends a list predicates to the PaymentTxUpdate builder.

type PaymentTxes

type PaymentTxes []*PaymentTx

PaymentTxes is a parsable slice of PaymentTx.

type PeerReputation

type PeerReputation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// DID of the peer
	PeerDid string `json:"peer_did,omitempty"`
	// Count of successful paid exchanges
	SuccessfulExchanges int `json:"successful_exchanges,omitempty"`
	// Count of failed exchanges
	FailedExchanges int `json:"failed_exchanges,omitempty"`
	// Count of timed-out exchanges
	TimeoutCount int `json:"timeout_count,omitempty"`
	// Computed trust score
	TrustScore float64 `json:"trust_score,omitempty"`
	// When this peer was first observed
	FirstSeen time.Time `json:"first_seen,omitempty"`
	// Most recent interaction timestamp
	LastInteraction time.Time `json:"last_interaction,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

PeerReputation is the model entity for the PeerReputation schema.

func (*PeerReputation) String

func (_m *PeerReputation) String() string

String implements the fmt.Stringer.

func (*PeerReputation) Unwrap

func (_m *PeerReputation) Unwrap() *PeerReputation

Unwrap unwraps the PeerReputation 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 (*PeerReputation) Update

Update returns a builder for updating this PeerReputation. Note that you need to call PeerReputation.Unwrap() before calling this method if this PeerReputation was returned from a transaction, and the transaction was committed or rolled back.

func (*PeerReputation) Value

func (_m *PeerReputation) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PeerReputation. This includes values selected through modifiers, order, etc.

type PeerReputationClient

type PeerReputationClient struct {
	// contains filtered or unexported fields
}

PeerReputationClient is a client for the PeerReputation schema.

func NewPeerReputationClient

func NewPeerReputationClient(c config) *PeerReputationClient

NewPeerReputationClient returns a client for the PeerReputation from the given config.

func (*PeerReputationClient) Create

Create returns a builder for creating a PeerReputation entity.

func (*PeerReputationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PeerReputation entities.

func (*PeerReputationClient) Delete

Delete returns a delete builder for PeerReputation.

func (*PeerReputationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PeerReputationClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PeerReputationClient) Get

Get returns a PeerReputation entity by its id.

func (*PeerReputationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PeerReputationClient) Hooks

func (c *PeerReputationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PeerReputationClient) Intercept

func (c *PeerReputationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `peerreputation.Intercept(f(g(h())))`.

func (*PeerReputationClient) Interceptors

func (c *PeerReputationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PeerReputationClient) MapCreateBulk

func (c *PeerReputationClient) MapCreateBulk(slice any, setFunc func(*PeerReputationCreate, int)) *PeerReputationCreateBulk

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 (*PeerReputationClient) Query

Query returns a query builder for PeerReputation.

func (*PeerReputationClient) Update

Update returns an update builder for PeerReputation.

func (*PeerReputationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PeerReputationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PeerReputationClient) Use

func (c *PeerReputationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `peerreputation.Hooks(f(g(h())))`.

type PeerReputationCreate

type PeerReputationCreate struct {
	// contains filtered or unexported fields
}

PeerReputationCreate is the builder for creating a PeerReputation entity.

func (*PeerReputationCreate) Exec

func (_c *PeerReputationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PeerReputationCreate) ExecX

func (_c *PeerReputationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PeerReputationCreate) Mutation

Mutation returns the PeerReputationMutation object of the builder.

func (*PeerReputationCreate) Save

Save creates the PeerReputation in the database.

func (*PeerReputationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PeerReputationCreate) SetCreatedAt

func (_c *PeerReputationCreate) SetCreatedAt(v time.Time) *PeerReputationCreate

SetCreatedAt sets the "created_at" field.

func (*PeerReputationCreate) SetFailedExchanges

func (_c *PeerReputationCreate) SetFailedExchanges(v int) *PeerReputationCreate

SetFailedExchanges sets the "failed_exchanges" field.

func (*PeerReputationCreate) SetFirstSeen

func (_c *PeerReputationCreate) SetFirstSeen(v time.Time) *PeerReputationCreate

SetFirstSeen sets the "first_seen" field.

func (*PeerReputationCreate) SetID

SetID sets the "id" field.

func (*PeerReputationCreate) SetLastInteraction

func (_c *PeerReputationCreate) SetLastInteraction(v time.Time) *PeerReputationCreate

SetLastInteraction sets the "last_interaction" field.

func (*PeerReputationCreate) SetNillableCreatedAt

func (_c *PeerReputationCreate) SetNillableCreatedAt(v *time.Time) *PeerReputationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableFailedExchanges

func (_c *PeerReputationCreate) SetNillableFailedExchanges(v *int) *PeerReputationCreate

SetNillableFailedExchanges sets the "failed_exchanges" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableFirstSeen

func (_c *PeerReputationCreate) SetNillableFirstSeen(v *time.Time) *PeerReputationCreate

SetNillableFirstSeen sets the "first_seen" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableID

func (_c *PeerReputationCreate) SetNillableID(v *uuid.UUID) *PeerReputationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableLastInteraction

func (_c *PeerReputationCreate) SetNillableLastInteraction(v *time.Time) *PeerReputationCreate

SetNillableLastInteraction sets the "last_interaction" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableSuccessfulExchanges

func (_c *PeerReputationCreate) SetNillableSuccessfulExchanges(v *int) *PeerReputationCreate

SetNillableSuccessfulExchanges sets the "successful_exchanges" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableTimeoutCount

func (_c *PeerReputationCreate) SetNillableTimeoutCount(v *int) *PeerReputationCreate

SetNillableTimeoutCount sets the "timeout_count" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableTrustScore

func (_c *PeerReputationCreate) SetNillableTrustScore(v *float64) *PeerReputationCreate

SetNillableTrustScore sets the "trust_score" field if the given value is not nil.

func (*PeerReputationCreate) SetNillableUpdatedAt

func (_c *PeerReputationCreate) SetNillableUpdatedAt(v *time.Time) *PeerReputationCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PeerReputationCreate) SetPeerDid

SetPeerDid sets the "peer_did" field.

func (*PeerReputationCreate) SetSuccessfulExchanges

func (_c *PeerReputationCreate) SetSuccessfulExchanges(v int) *PeerReputationCreate

SetSuccessfulExchanges sets the "successful_exchanges" field.

func (*PeerReputationCreate) SetTimeoutCount

func (_c *PeerReputationCreate) SetTimeoutCount(v int) *PeerReputationCreate

SetTimeoutCount sets the "timeout_count" field.

func (*PeerReputationCreate) SetTrustScore

func (_c *PeerReputationCreate) SetTrustScore(v float64) *PeerReputationCreate

SetTrustScore sets the "trust_score" field.

func (*PeerReputationCreate) SetUpdatedAt

func (_c *PeerReputationCreate) SetUpdatedAt(v time.Time) *PeerReputationCreate

SetUpdatedAt sets the "updated_at" field.

type PeerReputationCreateBulk

type PeerReputationCreateBulk struct {
	// contains filtered or unexported fields
}

PeerReputationCreateBulk is the builder for creating many PeerReputation entities in bulk.

func (*PeerReputationCreateBulk) Exec

Exec executes the query.

func (*PeerReputationCreateBulk) ExecX

func (_c *PeerReputationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PeerReputationCreateBulk) Save

Save creates the PeerReputation entities in the database.

func (*PeerReputationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PeerReputationDelete

type PeerReputationDelete struct {
	// contains filtered or unexported fields
}

PeerReputationDelete is the builder for deleting a PeerReputation entity.

func (*PeerReputationDelete) Exec

func (_d *PeerReputationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PeerReputationDelete) ExecX

func (_d *PeerReputationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PeerReputationDelete) Where

Where appends a list predicates to the PeerReputationDelete builder.

type PeerReputationDeleteOne

type PeerReputationDeleteOne struct {
	// contains filtered or unexported fields
}

PeerReputationDeleteOne is the builder for deleting a single PeerReputation entity.

func (*PeerReputationDeleteOne) Exec

Exec executes the deletion query.

func (*PeerReputationDeleteOne) ExecX

func (_d *PeerReputationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PeerReputationDeleteOne) Where

Where appends a list predicates to the PeerReputationDelete builder.

type PeerReputationGroupBy

type PeerReputationGroupBy struct {
	// contains filtered or unexported fields
}

PeerReputationGroupBy is the group-by builder for PeerReputation entities.

func (*PeerReputationGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PeerReputationGroupBy) Bool

func (s *PeerReputationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) BoolX

func (s *PeerReputationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PeerReputationGroupBy) Bools

func (s *PeerReputationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) BoolsX

func (s *PeerReputationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PeerReputationGroupBy) Float64

func (s *PeerReputationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) Float64X

func (s *PeerReputationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PeerReputationGroupBy) Float64s

func (s *PeerReputationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) Float64sX

func (s *PeerReputationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PeerReputationGroupBy) Int

func (s *PeerReputationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) IntX

func (s *PeerReputationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PeerReputationGroupBy) Ints

func (s *PeerReputationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) IntsX

func (s *PeerReputationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PeerReputationGroupBy) Scan

func (_g *PeerReputationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PeerReputationGroupBy) ScanX

func (s *PeerReputationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PeerReputationGroupBy) String

func (s *PeerReputationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) StringX

func (s *PeerReputationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PeerReputationGroupBy) Strings

func (s *PeerReputationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PeerReputationGroupBy) StringsX

func (s *PeerReputationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PeerReputationMutation

type PeerReputationMutation struct {
	// contains filtered or unexported fields
}

PeerReputationMutation represents an operation that mutates the PeerReputation nodes in the graph.

func (*PeerReputationMutation) AddFailedExchanges

func (m *PeerReputationMutation) AddFailedExchanges(i int)

AddFailedExchanges adds i to the "failed_exchanges" field.

func (*PeerReputationMutation) AddField

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) AddSuccessfulExchanges

func (m *PeerReputationMutation) AddSuccessfulExchanges(i int)

AddSuccessfulExchanges adds i to the "successful_exchanges" field.

func (*PeerReputationMutation) AddTimeoutCount

func (m *PeerReputationMutation) AddTimeoutCount(i int)

AddTimeoutCount adds i to the "timeout_count" field.

func (*PeerReputationMutation) AddTrustScore

func (m *PeerReputationMutation) AddTrustScore(f float64)

AddTrustScore adds f to the "trust_score" field.

func (*PeerReputationMutation) AddedEdges

func (m *PeerReputationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PeerReputationMutation) AddedFailedExchanges

func (m *PeerReputationMutation) AddedFailedExchanges() (r int, exists bool)

AddedFailedExchanges returns the value that was added to the "failed_exchanges" field in this mutation.

func (*PeerReputationMutation) AddedField

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) AddedFields

func (m *PeerReputationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PeerReputationMutation) AddedIDs

func (m *PeerReputationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PeerReputationMutation) AddedSuccessfulExchanges

func (m *PeerReputationMutation) AddedSuccessfulExchanges() (r int, exists bool)

AddedSuccessfulExchanges returns the value that was added to the "successful_exchanges" field in this mutation.

func (*PeerReputationMutation) AddedTimeoutCount

func (m *PeerReputationMutation) AddedTimeoutCount() (r int, exists bool)

AddedTimeoutCount returns the value that was added to the "timeout_count" field in this mutation.

func (*PeerReputationMutation) AddedTrustScore

func (m *PeerReputationMutation) AddedTrustScore() (r float64, exists bool)

AddedTrustScore returns the value that was added to the "trust_score" field in this mutation.

func (*PeerReputationMutation) ClearEdge

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) ClearField

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) ClearedEdges

func (m *PeerReputationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PeerReputationMutation) ClearedFields

func (m *PeerReputationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PeerReputationMutation) Client

func (m PeerReputationMutation) 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 (*PeerReputationMutation) CreatedAt

func (m *PeerReputationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PeerReputationMutation) EdgeCleared

func (m *PeerReputationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PeerReputationMutation) FailedExchanges

func (m *PeerReputationMutation) FailedExchanges() (r int, exists bool)

FailedExchanges returns the value of the "failed_exchanges" field in the mutation.

func (*PeerReputationMutation) Field

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) FieldCleared

func (m *PeerReputationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PeerReputationMutation) Fields

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) FirstSeen

func (m *PeerReputationMutation) FirstSeen() (r time.Time, exists bool)

FirstSeen returns the value of the "first_seen" field in the mutation.

func (*PeerReputationMutation) ID

func (m *PeerReputationMutation) ID() (id uuid.UUID, 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 (*PeerReputationMutation) 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 (*PeerReputationMutation) LastInteraction

func (m *PeerReputationMutation) LastInteraction() (r time.Time, exists bool)

LastInteraction returns the value of the "last_interaction" field in the mutation.

func (*PeerReputationMutation) OldCreatedAt

func (m *PeerReputationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldFailedExchanges

func (m *PeerReputationMutation) OldFailedExchanges(ctx context.Context) (v int, err error)

OldFailedExchanges returns the old "failed_exchanges" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldField

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) OldFirstSeen

func (m *PeerReputationMutation) OldFirstSeen(ctx context.Context) (v time.Time, err error)

OldFirstSeen returns the old "first_seen" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldLastInteraction

func (m *PeerReputationMutation) OldLastInteraction(ctx context.Context) (v time.Time, err error)

OldLastInteraction returns the old "last_interaction" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldPeerDid

func (m *PeerReputationMutation) OldPeerDid(ctx context.Context) (v string, err error)

OldPeerDid returns the old "peer_did" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldSuccessfulExchanges

func (m *PeerReputationMutation) OldSuccessfulExchanges(ctx context.Context) (v int, err error)

OldSuccessfulExchanges returns the old "successful_exchanges" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldTimeoutCount

func (m *PeerReputationMutation) OldTimeoutCount(ctx context.Context) (v int, err error)

OldTimeoutCount returns the old "timeout_count" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldTrustScore

func (m *PeerReputationMutation) OldTrustScore(ctx context.Context) (v float64, err error)

OldTrustScore returns the old "trust_score" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) OldUpdatedAt

func (m *PeerReputationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PeerReputation entity. If the PeerReputation 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 (*PeerReputationMutation) Op

func (m *PeerReputationMutation) Op() Op

Op returns the operation name.

func (*PeerReputationMutation) PeerDid

func (m *PeerReputationMutation) PeerDid() (r string, exists bool)

PeerDid returns the value of the "peer_did" field in the mutation.

func (*PeerReputationMutation) RemovedEdges

func (m *PeerReputationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PeerReputationMutation) RemovedIDs

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) ResetCreatedAt

func (m *PeerReputationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PeerReputationMutation) ResetEdge

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) ResetFailedExchanges

func (m *PeerReputationMutation) ResetFailedExchanges()

ResetFailedExchanges resets all changes to the "failed_exchanges" field.

func (*PeerReputationMutation) ResetField

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) ResetFirstSeen

func (m *PeerReputationMutation) ResetFirstSeen()

ResetFirstSeen resets all changes to the "first_seen" field.

func (*PeerReputationMutation) ResetLastInteraction

func (m *PeerReputationMutation) ResetLastInteraction()

ResetLastInteraction resets all changes to the "last_interaction" field.

func (*PeerReputationMutation) ResetPeerDid

func (m *PeerReputationMutation) ResetPeerDid()

ResetPeerDid resets all changes to the "peer_did" field.

func (*PeerReputationMutation) ResetSuccessfulExchanges

func (m *PeerReputationMutation) ResetSuccessfulExchanges()

ResetSuccessfulExchanges resets all changes to the "successful_exchanges" field.

func (*PeerReputationMutation) ResetTimeoutCount

func (m *PeerReputationMutation) ResetTimeoutCount()

ResetTimeoutCount resets all changes to the "timeout_count" field.

func (*PeerReputationMutation) ResetTrustScore

func (m *PeerReputationMutation) ResetTrustScore()

ResetTrustScore resets all changes to the "trust_score" field.

func (*PeerReputationMutation) ResetUpdatedAt

func (m *PeerReputationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PeerReputationMutation) SetCreatedAt

func (m *PeerReputationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PeerReputationMutation) SetFailedExchanges

func (m *PeerReputationMutation) SetFailedExchanges(i int)

SetFailedExchanges sets the "failed_exchanges" field.

func (*PeerReputationMutation) SetField

func (m *PeerReputationMutation) 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 (*PeerReputationMutation) SetFirstSeen

func (m *PeerReputationMutation) SetFirstSeen(t time.Time)

SetFirstSeen sets the "first_seen" field.

func (*PeerReputationMutation) SetID

func (m *PeerReputationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of PeerReputation entities.

func (*PeerReputationMutation) SetLastInteraction

func (m *PeerReputationMutation) SetLastInteraction(t time.Time)

SetLastInteraction sets the "last_interaction" field.

func (*PeerReputationMutation) SetOp

func (m *PeerReputationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PeerReputationMutation) SetPeerDid

func (m *PeerReputationMutation) SetPeerDid(s string)

SetPeerDid sets the "peer_did" field.

func (*PeerReputationMutation) SetSuccessfulExchanges

func (m *PeerReputationMutation) SetSuccessfulExchanges(i int)

SetSuccessfulExchanges sets the "successful_exchanges" field.

func (*PeerReputationMutation) SetTimeoutCount

func (m *PeerReputationMutation) SetTimeoutCount(i int)

SetTimeoutCount sets the "timeout_count" field.

func (*PeerReputationMutation) SetTrustScore

func (m *PeerReputationMutation) SetTrustScore(f float64)

SetTrustScore sets the "trust_score" field.

func (*PeerReputationMutation) SetUpdatedAt

func (m *PeerReputationMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PeerReputationMutation) SuccessfulExchanges

func (m *PeerReputationMutation) SuccessfulExchanges() (r int, exists bool)

SuccessfulExchanges returns the value of the "successful_exchanges" field in the mutation.

func (*PeerReputationMutation) TimeoutCount

func (m *PeerReputationMutation) TimeoutCount() (r int, exists bool)

TimeoutCount returns the value of the "timeout_count" field in the mutation.

func (*PeerReputationMutation) TrustScore

func (m *PeerReputationMutation) TrustScore() (r float64, exists bool)

TrustScore returns the value of the "trust_score" field in the mutation.

func (PeerReputationMutation) Tx

func (m PeerReputationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PeerReputationMutation) Type

func (m *PeerReputationMutation) Type() string

Type returns the node type of this mutation (PeerReputation).

func (*PeerReputationMutation) UpdatedAt

func (m *PeerReputationMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PeerReputationMutation) Where

Where appends a list predicates to the PeerReputationMutation builder.

func (*PeerReputationMutation) WhereP

func (m *PeerReputationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PeerReputationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PeerReputationQuery

type PeerReputationQuery struct {
	// contains filtered or unexported fields
}

PeerReputationQuery is the builder for querying PeerReputation entities.

func (*PeerReputationQuery) Aggregate

Aggregate returns a PeerReputationSelect configured with the given aggregations.

func (*PeerReputationQuery) All

All executes the query and returns a list of PeerReputations.

func (*PeerReputationQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PeerReputationQuery) Clone

Clone returns a duplicate of the PeerReputationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PeerReputationQuery) Count

func (_q *PeerReputationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PeerReputationQuery) CountX

func (_q *PeerReputationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PeerReputationQuery) Exist

func (_q *PeerReputationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PeerReputationQuery) ExistX

func (_q *PeerReputationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PeerReputationQuery) First

First returns the first PeerReputation entity from the query. Returns a *NotFoundError when no PeerReputation was found.

func (*PeerReputationQuery) FirstID

func (_q *PeerReputationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first PeerReputation ID from the query. Returns a *NotFoundError when no PeerReputation ID was found.

func (*PeerReputationQuery) FirstIDX

func (_q *PeerReputationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*PeerReputationQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PeerReputationQuery) GroupBy

func (_q *PeerReputationQuery) GroupBy(field string, fields ...string) *PeerReputationGroupBy

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 {
	PeerDid string `json:"peer_did,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PeerReputation.Query().
	GroupBy(peerreputation.FieldPeerDid).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PeerReputationQuery) IDs

func (_q *PeerReputationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of PeerReputation IDs.

func (*PeerReputationQuery) IDsX

func (_q *PeerReputationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*PeerReputationQuery) Limit

func (_q *PeerReputationQuery) Limit(limit int) *PeerReputationQuery

Limit the number of records to be returned by this query.

func (*PeerReputationQuery) Offset

func (_q *PeerReputationQuery) Offset(offset int) *PeerReputationQuery

Offset to start from.

func (*PeerReputationQuery) Only

Only returns a single PeerReputation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PeerReputation entity is found. Returns a *NotFoundError when no PeerReputation entities are found.

func (*PeerReputationQuery) OnlyID

func (_q *PeerReputationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only PeerReputation ID in the query. Returns a *NotSingularError when more than one PeerReputation ID is found. Returns a *NotFoundError when no entities are found.

func (*PeerReputationQuery) OnlyIDX

func (_q *PeerReputationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PeerReputationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PeerReputationQuery) Order

Order specifies how the records should be ordered.

func (*PeerReputationQuery) Select

func (_q *PeerReputationQuery) Select(fields ...string) *PeerReputationSelect

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 {
	PeerDid string `json:"peer_did,omitempty"`
}

client.PeerReputation.Query().
	Select(peerreputation.FieldPeerDid).
	Scan(ctx, &v)

func (*PeerReputationQuery) Unique

func (_q *PeerReputationQuery) Unique(unique bool) *PeerReputationQuery

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 (*PeerReputationQuery) Where

Where adds a new predicate for the PeerReputationQuery builder.

type PeerReputationSelect

type PeerReputationSelect struct {
	*PeerReputationQuery
	// contains filtered or unexported fields
}

PeerReputationSelect is the builder for selecting fields of PeerReputation entities.

func (*PeerReputationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PeerReputationSelect) Bool

func (s *PeerReputationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) BoolX

func (s *PeerReputationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PeerReputationSelect) Bools

func (s *PeerReputationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) BoolsX

func (s *PeerReputationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PeerReputationSelect) Float64

func (s *PeerReputationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) Float64X

func (s *PeerReputationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PeerReputationSelect) Float64s

func (s *PeerReputationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) Float64sX

func (s *PeerReputationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PeerReputationSelect) Int

func (s *PeerReputationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) IntX

func (s *PeerReputationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PeerReputationSelect) Ints

func (s *PeerReputationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) IntsX

func (s *PeerReputationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PeerReputationSelect) Scan

func (_s *PeerReputationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PeerReputationSelect) ScanX

func (s *PeerReputationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PeerReputationSelect) String

func (s *PeerReputationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) StringX

func (s *PeerReputationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PeerReputationSelect) Strings

func (s *PeerReputationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PeerReputationSelect) StringsX

func (s *PeerReputationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PeerReputationUpdate

type PeerReputationUpdate struct {
	// contains filtered or unexported fields
}

PeerReputationUpdate is the builder for updating PeerReputation entities.

func (*PeerReputationUpdate) AddFailedExchanges

func (_u *PeerReputationUpdate) AddFailedExchanges(v int) *PeerReputationUpdate

AddFailedExchanges adds value to the "failed_exchanges" field.

func (*PeerReputationUpdate) AddSuccessfulExchanges

func (_u *PeerReputationUpdate) AddSuccessfulExchanges(v int) *PeerReputationUpdate

AddSuccessfulExchanges adds value to the "successful_exchanges" field.

func (*PeerReputationUpdate) AddTimeoutCount

func (_u *PeerReputationUpdate) AddTimeoutCount(v int) *PeerReputationUpdate

AddTimeoutCount adds value to the "timeout_count" field.

func (*PeerReputationUpdate) AddTrustScore

func (_u *PeerReputationUpdate) AddTrustScore(v float64) *PeerReputationUpdate

AddTrustScore adds value to the "trust_score" field.

func (*PeerReputationUpdate) Exec

func (_u *PeerReputationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PeerReputationUpdate) ExecX

func (_u *PeerReputationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PeerReputationUpdate) Mutation

Mutation returns the PeerReputationMutation object of the builder.

func (*PeerReputationUpdate) Save

func (_u *PeerReputationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PeerReputationUpdate) SaveX

func (_u *PeerReputationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PeerReputationUpdate) SetFailedExchanges

func (_u *PeerReputationUpdate) SetFailedExchanges(v int) *PeerReputationUpdate

SetFailedExchanges sets the "failed_exchanges" field.

func (*PeerReputationUpdate) SetLastInteraction

func (_u *PeerReputationUpdate) SetLastInteraction(v time.Time) *PeerReputationUpdate

SetLastInteraction sets the "last_interaction" field.

func (*PeerReputationUpdate) SetNillableFailedExchanges

func (_u *PeerReputationUpdate) SetNillableFailedExchanges(v *int) *PeerReputationUpdate

SetNillableFailedExchanges sets the "failed_exchanges" field if the given value is not nil.

func (*PeerReputationUpdate) SetNillablePeerDid

func (_u *PeerReputationUpdate) SetNillablePeerDid(v *string) *PeerReputationUpdate

SetNillablePeerDid sets the "peer_did" field if the given value is not nil.

func (*PeerReputationUpdate) SetNillableSuccessfulExchanges

func (_u *PeerReputationUpdate) SetNillableSuccessfulExchanges(v *int) *PeerReputationUpdate

SetNillableSuccessfulExchanges sets the "successful_exchanges" field if the given value is not nil.

func (*PeerReputationUpdate) SetNillableTimeoutCount

func (_u *PeerReputationUpdate) SetNillableTimeoutCount(v *int) *PeerReputationUpdate

SetNillableTimeoutCount sets the "timeout_count" field if the given value is not nil.

func (*PeerReputationUpdate) SetNillableTrustScore

func (_u *PeerReputationUpdate) SetNillableTrustScore(v *float64) *PeerReputationUpdate

SetNillableTrustScore sets the "trust_score" field if the given value is not nil.

func (*PeerReputationUpdate) SetPeerDid

SetPeerDid sets the "peer_did" field.

func (*PeerReputationUpdate) SetSuccessfulExchanges

func (_u *PeerReputationUpdate) SetSuccessfulExchanges(v int) *PeerReputationUpdate

SetSuccessfulExchanges sets the "successful_exchanges" field.

func (*PeerReputationUpdate) SetTimeoutCount

func (_u *PeerReputationUpdate) SetTimeoutCount(v int) *PeerReputationUpdate

SetTimeoutCount sets the "timeout_count" field.

func (*PeerReputationUpdate) SetTrustScore

func (_u *PeerReputationUpdate) SetTrustScore(v float64) *PeerReputationUpdate

SetTrustScore sets the "trust_score" field.

func (*PeerReputationUpdate) SetUpdatedAt

func (_u *PeerReputationUpdate) SetUpdatedAt(v time.Time) *PeerReputationUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PeerReputationUpdate) Where

Where appends a list predicates to the PeerReputationUpdate builder.

type PeerReputationUpdateOne

type PeerReputationUpdateOne struct {
	// contains filtered or unexported fields
}

PeerReputationUpdateOne is the builder for updating a single PeerReputation entity.

func (*PeerReputationUpdateOne) AddFailedExchanges

func (_u *PeerReputationUpdateOne) AddFailedExchanges(v int) *PeerReputationUpdateOne

AddFailedExchanges adds value to the "failed_exchanges" field.

func (*PeerReputationUpdateOne) AddSuccessfulExchanges

func (_u *PeerReputationUpdateOne) AddSuccessfulExchanges(v int) *PeerReputationUpdateOne

AddSuccessfulExchanges adds value to the "successful_exchanges" field.

func (*PeerReputationUpdateOne) AddTimeoutCount

func (_u *PeerReputationUpdateOne) AddTimeoutCount(v int) *PeerReputationUpdateOne

AddTimeoutCount adds value to the "timeout_count" field.

func (*PeerReputationUpdateOne) AddTrustScore

AddTrustScore adds value to the "trust_score" field.

func (*PeerReputationUpdateOne) Exec

Exec executes the query on the entity.

func (*PeerReputationUpdateOne) ExecX

func (_u *PeerReputationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PeerReputationUpdateOne) Mutation

Mutation returns the PeerReputationMutation object of the builder.

func (*PeerReputationUpdateOne) Save

Save executes the query and returns the updated PeerReputation entity.

func (*PeerReputationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PeerReputationUpdateOne) Select

func (_u *PeerReputationUpdateOne) Select(field string, fields ...string) *PeerReputationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PeerReputationUpdateOne) SetFailedExchanges

func (_u *PeerReputationUpdateOne) SetFailedExchanges(v int) *PeerReputationUpdateOne

SetFailedExchanges sets the "failed_exchanges" field.

func (*PeerReputationUpdateOne) SetLastInteraction

func (_u *PeerReputationUpdateOne) SetLastInteraction(v time.Time) *PeerReputationUpdateOne

SetLastInteraction sets the "last_interaction" field.

func (*PeerReputationUpdateOne) SetNillableFailedExchanges

func (_u *PeerReputationUpdateOne) SetNillableFailedExchanges(v *int) *PeerReputationUpdateOne

SetNillableFailedExchanges sets the "failed_exchanges" field if the given value is not nil.

func (*PeerReputationUpdateOne) SetNillablePeerDid

func (_u *PeerReputationUpdateOne) SetNillablePeerDid(v *string) *PeerReputationUpdateOne

SetNillablePeerDid sets the "peer_did" field if the given value is not nil.

func (*PeerReputationUpdateOne) SetNillableSuccessfulExchanges

func (_u *PeerReputationUpdateOne) SetNillableSuccessfulExchanges(v *int) *PeerReputationUpdateOne

SetNillableSuccessfulExchanges sets the "successful_exchanges" field if the given value is not nil.

func (*PeerReputationUpdateOne) SetNillableTimeoutCount

func (_u *PeerReputationUpdateOne) SetNillableTimeoutCount(v *int) *PeerReputationUpdateOne

SetNillableTimeoutCount sets the "timeout_count" field if the given value is not nil.

func (*PeerReputationUpdateOne) SetNillableTrustScore

func (_u *PeerReputationUpdateOne) SetNillableTrustScore(v *float64) *PeerReputationUpdateOne

SetNillableTrustScore sets the "trust_score" field if the given value is not nil.

func (*PeerReputationUpdateOne) SetPeerDid

SetPeerDid sets the "peer_did" field.

func (*PeerReputationUpdateOne) SetSuccessfulExchanges

func (_u *PeerReputationUpdateOne) SetSuccessfulExchanges(v int) *PeerReputationUpdateOne

SetSuccessfulExchanges sets the "successful_exchanges" field.

func (*PeerReputationUpdateOne) SetTimeoutCount

func (_u *PeerReputationUpdateOne) SetTimeoutCount(v int) *PeerReputationUpdateOne

SetTimeoutCount sets the "timeout_count" field.

func (*PeerReputationUpdateOne) SetTrustScore

SetTrustScore sets the "trust_score" field.

func (*PeerReputationUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PeerReputationUpdateOne) Where

Where appends a list predicates to the PeerReputationUpdate builder.

type PeerReputations

type PeerReputations []*PeerReputation

PeerReputations is a parsable slice of PeerReputation.

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 Reflection

type Reflection struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SessionKey holds the value of the "session_key" field.
	SessionKey string `json:"session_key,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// TokenCount holds the value of the "token_count" field.
	TokenCount int `json:"token_count,omitempty"`
	// Generation holds the value of the "generation" field.
	Generation int `json:"generation,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Reflection is the model entity for the Reflection schema.

func (*Reflection) String

func (_m *Reflection) String() string

String implements the fmt.Stringer.

func (*Reflection) Unwrap

func (_m *Reflection) Unwrap() *Reflection

Unwrap unwraps the Reflection 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 (*Reflection) Update

func (_m *Reflection) Update() *ReflectionUpdateOne

Update returns a builder for updating this Reflection. Note that you need to call Reflection.Unwrap() before calling this method if this Reflection was returned from a transaction, and the transaction was committed or rolled back.

func (*Reflection) Value

func (_m *Reflection) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Reflection. This includes values selected through modifiers, order, etc.

type ReflectionClient

type ReflectionClient struct {
	// contains filtered or unexported fields
}

ReflectionClient is a client for the Reflection schema.

func NewReflectionClient

func NewReflectionClient(c config) *ReflectionClient

NewReflectionClient returns a client for the Reflection from the given config.

func (*ReflectionClient) Create

func (c *ReflectionClient) Create() *ReflectionCreate

Create returns a builder for creating a Reflection entity.

func (*ReflectionClient) CreateBulk

func (c *ReflectionClient) CreateBulk(builders ...*ReflectionCreate) *ReflectionCreateBulk

CreateBulk returns a builder for creating a bulk of Reflection entities.

func (*ReflectionClient) Delete

func (c *ReflectionClient) Delete() *ReflectionDelete

Delete returns a delete builder for Reflection.

func (*ReflectionClient) DeleteOne

func (c *ReflectionClient) DeleteOne(_m *Reflection) *ReflectionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReflectionClient) DeleteOneID

func (c *ReflectionClient) DeleteOneID(id uuid.UUID) *ReflectionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ReflectionClient) Get

Get returns a Reflection entity by its id.

func (*ReflectionClient) GetX

func (c *ReflectionClient) GetX(ctx context.Context, id uuid.UUID) *Reflection

GetX is like Get, but panics if an error occurs.

func (*ReflectionClient) Hooks

func (c *ReflectionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ReflectionClient) Intercept

func (c *ReflectionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `reflection.Intercept(f(g(h())))`.

func (*ReflectionClient) Interceptors

func (c *ReflectionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ReflectionClient) MapCreateBulk

func (c *ReflectionClient) MapCreateBulk(slice any, setFunc func(*ReflectionCreate, int)) *ReflectionCreateBulk

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 (*ReflectionClient) Query

func (c *ReflectionClient) Query() *ReflectionQuery

Query returns a query builder for Reflection.

func (*ReflectionClient) Update

func (c *ReflectionClient) Update() *ReflectionUpdate

Update returns an update builder for Reflection.

func (*ReflectionClient) UpdateOne

func (c *ReflectionClient) UpdateOne(_m *Reflection) *ReflectionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReflectionClient) UpdateOneID

func (c *ReflectionClient) UpdateOneID(id uuid.UUID) *ReflectionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReflectionClient) Use

func (c *ReflectionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `reflection.Hooks(f(g(h())))`.

type ReflectionCreate

type ReflectionCreate struct {
	// contains filtered or unexported fields
}

ReflectionCreate is the builder for creating a Reflection entity.

func (*ReflectionCreate) Exec

func (_c *ReflectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReflectionCreate) ExecX

func (_c *ReflectionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReflectionCreate) Mutation

func (_c *ReflectionCreate) Mutation() *ReflectionMutation

Mutation returns the ReflectionMutation object of the builder.

func (*ReflectionCreate) Save

func (_c *ReflectionCreate) Save(ctx context.Context) (*Reflection, error)

Save creates the Reflection in the database.

func (*ReflectionCreate) SaveX

func (_c *ReflectionCreate) SaveX(ctx context.Context) *Reflection

SaveX calls Save and panics if Save returns an error.

func (*ReflectionCreate) SetContent

func (_c *ReflectionCreate) SetContent(v string) *ReflectionCreate

SetContent sets the "content" field.

func (*ReflectionCreate) SetCreatedAt

func (_c *ReflectionCreate) SetCreatedAt(v time.Time) *ReflectionCreate

SetCreatedAt sets the "created_at" field.

func (*ReflectionCreate) SetGeneration

func (_c *ReflectionCreate) SetGeneration(v int) *ReflectionCreate

SetGeneration sets the "generation" field.

func (*ReflectionCreate) SetID

SetID sets the "id" field.

func (*ReflectionCreate) SetNillableCreatedAt

func (_c *ReflectionCreate) SetNillableCreatedAt(v *time.Time) *ReflectionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReflectionCreate) SetNillableGeneration

func (_c *ReflectionCreate) SetNillableGeneration(v *int) *ReflectionCreate

SetNillableGeneration sets the "generation" field if the given value is not nil.

func (*ReflectionCreate) SetNillableID

func (_c *ReflectionCreate) SetNillableID(v *uuid.UUID) *ReflectionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ReflectionCreate) SetNillableTokenCount

func (_c *ReflectionCreate) SetNillableTokenCount(v *int) *ReflectionCreate

SetNillableTokenCount sets the "token_count" field if the given value is not nil.

func (*ReflectionCreate) SetSessionKey

func (_c *ReflectionCreate) SetSessionKey(v string) *ReflectionCreate

SetSessionKey sets the "session_key" field.

func (*ReflectionCreate) SetTokenCount

func (_c *ReflectionCreate) SetTokenCount(v int) *ReflectionCreate

SetTokenCount sets the "token_count" field.

type ReflectionCreateBulk

type ReflectionCreateBulk struct {
	// contains filtered or unexported fields
}

ReflectionCreateBulk is the builder for creating many Reflection entities in bulk.

func (*ReflectionCreateBulk) Exec

func (_c *ReflectionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReflectionCreateBulk) ExecX

func (_c *ReflectionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReflectionCreateBulk) Save

func (_c *ReflectionCreateBulk) Save(ctx context.Context) ([]*Reflection, error)

Save creates the Reflection entities in the database.

func (*ReflectionCreateBulk) SaveX

func (_c *ReflectionCreateBulk) SaveX(ctx context.Context) []*Reflection

SaveX is like Save, but panics if an error occurs.

type ReflectionDelete

type ReflectionDelete struct {
	// contains filtered or unexported fields
}

ReflectionDelete is the builder for deleting a Reflection entity.

func (*ReflectionDelete) Exec

func (_d *ReflectionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ReflectionDelete) ExecX

func (_d *ReflectionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ReflectionDelete) Where

Where appends a list predicates to the ReflectionDelete builder.

type ReflectionDeleteOne

type ReflectionDeleteOne struct {
	// contains filtered or unexported fields
}

ReflectionDeleteOne is the builder for deleting a single Reflection entity.

func (*ReflectionDeleteOne) Exec

func (_d *ReflectionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReflectionDeleteOne) ExecX

func (_d *ReflectionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReflectionDeleteOne) Where

Where appends a list predicates to the ReflectionDelete builder.

type ReflectionGroupBy

type ReflectionGroupBy struct {
	// contains filtered or unexported fields
}

ReflectionGroupBy is the group-by builder for Reflection entities.

func (*ReflectionGroupBy) Aggregate

func (_g *ReflectionGroupBy) Aggregate(fns ...AggregateFunc) *ReflectionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ReflectionGroupBy) Bool

func (s *ReflectionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) BoolX

func (s *ReflectionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReflectionGroupBy) Bools

func (s *ReflectionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) BoolsX

func (s *ReflectionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReflectionGroupBy) Float64

func (s *ReflectionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) Float64X

func (s *ReflectionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReflectionGroupBy) Float64s

func (s *ReflectionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) Float64sX

func (s *ReflectionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReflectionGroupBy) Int

func (s *ReflectionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) IntX

func (s *ReflectionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReflectionGroupBy) Ints

func (s *ReflectionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) IntsX

func (s *ReflectionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReflectionGroupBy) Scan

func (_g *ReflectionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReflectionGroupBy) ScanX

func (s *ReflectionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReflectionGroupBy) String

func (s *ReflectionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) StringX

func (s *ReflectionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReflectionGroupBy) Strings

func (s *ReflectionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReflectionGroupBy) StringsX

func (s *ReflectionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReflectionMutation

type ReflectionMutation struct {
	// contains filtered or unexported fields
}

ReflectionMutation represents an operation that mutates the Reflection nodes in the graph.

func (*ReflectionMutation) AddField

func (m *ReflectionMutation) 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 (*ReflectionMutation) AddGeneration

func (m *ReflectionMutation) AddGeneration(i int)

AddGeneration adds i to the "generation" field.

func (*ReflectionMutation) AddTokenCount

func (m *ReflectionMutation) AddTokenCount(i int)

AddTokenCount adds i to the "token_count" field.

func (*ReflectionMutation) AddedEdges

func (m *ReflectionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ReflectionMutation) AddedField

func (m *ReflectionMutation) 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 (*ReflectionMutation) AddedFields

func (m *ReflectionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ReflectionMutation) AddedGeneration

func (m *ReflectionMutation) AddedGeneration() (r int, exists bool)

AddedGeneration returns the value that was added to the "generation" field in this mutation.

func (*ReflectionMutation) AddedIDs

func (m *ReflectionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ReflectionMutation) AddedTokenCount

func (m *ReflectionMutation) AddedTokenCount() (r int, exists bool)

AddedTokenCount returns the value that was added to the "token_count" field in this mutation.

func (*ReflectionMutation) ClearEdge

func (m *ReflectionMutation) 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 (*ReflectionMutation) ClearField

func (m *ReflectionMutation) 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 (*ReflectionMutation) ClearedEdges

func (m *ReflectionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ReflectionMutation) ClearedFields

func (m *ReflectionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ReflectionMutation) Client

func (m ReflectionMutation) 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 (*ReflectionMutation) Content

func (m *ReflectionMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*ReflectionMutation) CreatedAt

func (m *ReflectionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ReflectionMutation) EdgeCleared

func (m *ReflectionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ReflectionMutation) Field

func (m *ReflectionMutation) 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 (*ReflectionMutation) FieldCleared

func (m *ReflectionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ReflectionMutation) Fields

func (m *ReflectionMutation) 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 (*ReflectionMutation) Generation

func (m *ReflectionMutation) Generation() (r int, exists bool)

Generation returns the value of the "generation" field in the mutation.

func (*ReflectionMutation) ID

func (m *ReflectionMutation) ID() (id uuid.UUID, 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 (*ReflectionMutation) IDs

func (m *ReflectionMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ReflectionMutation) OldContent

func (m *ReflectionMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Reflection entity. If the Reflection 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 (*ReflectionMutation) OldCreatedAt

func (m *ReflectionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Reflection entity. If the Reflection 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 (*ReflectionMutation) OldField

func (m *ReflectionMutation) 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 (*ReflectionMutation) OldGeneration

func (m *ReflectionMutation) OldGeneration(ctx context.Context) (v int, err error)

OldGeneration returns the old "generation" field's value of the Reflection entity. If the Reflection 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 (*ReflectionMutation) OldSessionKey

func (m *ReflectionMutation) OldSessionKey(ctx context.Context) (v string, err error)

OldSessionKey returns the old "session_key" field's value of the Reflection entity. If the Reflection 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 (*ReflectionMutation) OldTokenCount

func (m *ReflectionMutation) OldTokenCount(ctx context.Context) (v int, err error)

OldTokenCount returns the old "token_count" field's value of the Reflection entity. If the Reflection 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 (*ReflectionMutation) Op

func (m *ReflectionMutation) Op() Op

Op returns the operation name.

func (*ReflectionMutation) RemovedEdges

func (m *ReflectionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ReflectionMutation) RemovedIDs

func (m *ReflectionMutation) 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 (*ReflectionMutation) ResetContent

func (m *ReflectionMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*ReflectionMutation) ResetCreatedAt

func (m *ReflectionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReflectionMutation) ResetEdge

func (m *ReflectionMutation) 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 (*ReflectionMutation) ResetField

func (m *ReflectionMutation) 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 (*ReflectionMutation) ResetGeneration

func (m *ReflectionMutation) ResetGeneration()

ResetGeneration resets all changes to the "generation" field.

func (*ReflectionMutation) ResetSessionKey

func (m *ReflectionMutation) ResetSessionKey()

ResetSessionKey resets all changes to the "session_key" field.

func (*ReflectionMutation) ResetTokenCount

func (m *ReflectionMutation) ResetTokenCount()

ResetTokenCount resets all changes to the "token_count" field.

func (*ReflectionMutation) SessionKey

func (m *ReflectionMutation) SessionKey() (r string, exists bool)

SessionKey returns the value of the "session_key" field in the mutation.

func (*ReflectionMutation) SetContent

func (m *ReflectionMutation) SetContent(s string)

SetContent sets the "content" field.

func (*ReflectionMutation) SetCreatedAt

func (m *ReflectionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ReflectionMutation) SetField

func (m *ReflectionMutation) 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 (*ReflectionMutation) SetGeneration

func (m *ReflectionMutation) SetGeneration(i int)

SetGeneration sets the "generation" field.

func (*ReflectionMutation) SetID

func (m *ReflectionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Reflection entities.

func (*ReflectionMutation) SetOp

func (m *ReflectionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReflectionMutation) SetSessionKey

func (m *ReflectionMutation) SetSessionKey(s string)

SetSessionKey sets the "session_key" field.

func (*ReflectionMutation) SetTokenCount

func (m *ReflectionMutation) SetTokenCount(i int)

SetTokenCount sets the "token_count" field.

func (*ReflectionMutation) TokenCount

func (m *ReflectionMutation) TokenCount() (r int, exists bool)

TokenCount returns the value of the "token_count" field in the mutation.

func (ReflectionMutation) Tx

func (m ReflectionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ReflectionMutation) Type

func (m *ReflectionMutation) Type() string

Type returns the node type of this mutation (Reflection).

func (*ReflectionMutation) Where

func (m *ReflectionMutation) Where(ps ...predicate.Reflection)

Where appends a list predicates to the ReflectionMutation builder.

func (*ReflectionMutation) WhereP

func (m *ReflectionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ReflectionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ReflectionQuery

type ReflectionQuery struct {
	// contains filtered or unexported fields
}

ReflectionQuery is the builder for querying Reflection entities.

func (*ReflectionQuery) Aggregate

func (_q *ReflectionQuery) Aggregate(fns ...AggregateFunc) *ReflectionSelect

Aggregate returns a ReflectionSelect configured with the given aggregations.

func (*ReflectionQuery) All

func (_q *ReflectionQuery) All(ctx context.Context) ([]*Reflection, error)

All executes the query and returns a list of Reflections.

func (*ReflectionQuery) AllX

func (_q *ReflectionQuery) AllX(ctx context.Context) []*Reflection

AllX is like All, but panics if an error occurs.

func (*ReflectionQuery) Clone

func (_q *ReflectionQuery) Clone() *ReflectionQuery

Clone returns a duplicate of the ReflectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ReflectionQuery) Count

func (_q *ReflectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReflectionQuery) CountX

func (_q *ReflectionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ReflectionQuery) Exist

func (_q *ReflectionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ReflectionQuery) ExistX

func (_q *ReflectionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ReflectionQuery) First

func (_q *ReflectionQuery) First(ctx context.Context) (*Reflection, error)

First returns the first Reflection entity from the query. Returns a *NotFoundError when no Reflection was found.

func (*ReflectionQuery) FirstID

func (_q *ReflectionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Reflection ID from the query. Returns a *NotFoundError when no Reflection ID was found.

func (*ReflectionQuery) FirstIDX

func (_q *ReflectionQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ReflectionQuery) FirstX

func (_q *ReflectionQuery) FirstX(ctx context.Context) *Reflection

FirstX is like First, but panics if an error occurs.

func (*ReflectionQuery) GroupBy

func (_q *ReflectionQuery) GroupBy(field string, fields ...string) *ReflectionGroupBy

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 {
	SessionKey string `json:"session_key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Reflection.Query().
	GroupBy(reflection.FieldSessionKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReflectionQuery) IDs

func (_q *ReflectionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Reflection IDs.

func (*ReflectionQuery) IDsX

func (_q *ReflectionQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ReflectionQuery) Limit

func (_q *ReflectionQuery) Limit(limit int) *ReflectionQuery

Limit the number of records to be returned by this query.

func (*ReflectionQuery) Offset

func (_q *ReflectionQuery) Offset(offset int) *ReflectionQuery

Offset to start from.

func (*ReflectionQuery) Only

func (_q *ReflectionQuery) Only(ctx context.Context) (*Reflection, error)

Only returns a single Reflection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Reflection entity is found. Returns a *NotFoundError when no Reflection entities are found.

func (*ReflectionQuery) OnlyID

func (_q *ReflectionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Reflection ID in the query. Returns a *NotSingularError when more than one Reflection ID is found. Returns a *NotFoundError when no entities are found.

func (*ReflectionQuery) OnlyIDX

func (_q *ReflectionQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ReflectionQuery) OnlyX

func (_q *ReflectionQuery) OnlyX(ctx context.Context) *Reflection

OnlyX is like Only, but panics if an error occurs.

func (*ReflectionQuery) Order

Order specifies how the records should be ordered.

func (*ReflectionQuery) Select

func (_q *ReflectionQuery) Select(fields ...string) *ReflectionSelect

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 {
	SessionKey string `json:"session_key,omitempty"`
}

client.Reflection.Query().
	Select(reflection.FieldSessionKey).
	Scan(ctx, &v)

func (*ReflectionQuery) Unique

func (_q *ReflectionQuery) Unique(unique bool) *ReflectionQuery

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 (*ReflectionQuery) Where

Where adds a new predicate for the ReflectionQuery builder.

type ReflectionSelect

type ReflectionSelect struct {
	*ReflectionQuery
	// contains filtered or unexported fields
}

ReflectionSelect is the builder for selecting fields of Reflection entities.

func (*ReflectionSelect) Aggregate

func (_s *ReflectionSelect) Aggregate(fns ...AggregateFunc) *ReflectionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReflectionSelect) Bool

func (s *ReflectionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) BoolX

func (s *ReflectionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReflectionSelect) Bools

func (s *ReflectionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) BoolsX

func (s *ReflectionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReflectionSelect) Float64

func (s *ReflectionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) Float64X

func (s *ReflectionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReflectionSelect) Float64s

func (s *ReflectionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) Float64sX

func (s *ReflectionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReflectionSelect) Int

func (s *ReflectionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) IntX

func (s *ReflectionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReflectionSelect) Ints

func (s *ReflectionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) IntsX

func (s *ReflectionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReflectionSelect) Scan

func (_s *ReflectionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReflectionSelect) ScanX

func (s *ReflectionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReflectionSelect) String

func (s *ReflectionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) StringX

func (s *ReflectionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReflectionSelect) Strings

func (s *ReflectionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReflectionSelect) StringsX

func (s *ReflectionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReflectionUpdate

type ReflectionUpdate struct {
	// contains filtered or unexported fields
}

ReflectionUpdate is the builder for updating Reflection entities.

func (*ReflectionUpdate) AddGeneration

func (_u *ReflectionUpdate) AddGeneration(v int) *ReflectionUpdate

AddGeneration adds value to the "generation" field.

func (*ReflectionUpdate) AddTokenCount

func (_u *ReflectionUpdate) AddTokenCount(v int) *ReflectionUpdate

AddTokenCount adds value to the "token_count" field.

func (*ReflectionUpdate) Exec

func (_u *ReflectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReflectionUpdate) ExecX

func (_u *ReflectionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReflectionUpdate) Mutation

func (_u *ReflectionUpdate) Mutation() *ReflectionMutation

Mutation returns the ReflectionMutation object of the builder.

func (*ReflectionUpdate) Save

func (_u *ReflectionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ReflectionUpdate) SaveX

func (_u *ReflectionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ReflectionUpdate) SetContent

func (_u *ReflectionUpdate) SetContent(v string) *ReflectionUpdate

SetContent sets the "content" field.

func (*ReflectionUpdate) SetGeneration

func (_u *ReflectionUpdate) SetGeneration(v int) *ReflectionUpdate

SetGeneration sets the "generation" field.

func (*ReflectionUpdate) SetNillableContent

func (_u *ReflectionUpdate) SetNillableContent(v *string) *ReflectionUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*ReflectionUpdate) SetNillableGeneration

func (_u *ReflectionUpdate) SetNillableGeneration(v *int) *ReflectionUpdate

SetNillableGeneration sets the "generation" field if the given value is not nil.

func (*ReflectionUpdate) SetNillableSessionKey

func (_u *ReflectionUpdate) SetNillableSessionKey(v *string) *ReflectionUpdate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*ReflectionUpdate) SetNillableTokenCount

func (_u *ReflectionUpdate) SetNillableTokenCount(v *int) *ReflectionUpdate

SetNillableTokenCount sets the "token_count" field if the given value is not nil.

func (*ReflectionUpdate) SetSessionKey

func (_u *ReflectionUpdate) SetSessionKey(v string) *ReflectionUpdate

SetSessionKey sets the "session_key" field.

func (*ReflectionUpdate) SetTokenCount

func (_u *ReflectionUpdate) SetTokenCount(v int) *ReflectionUpdate

SetTokenCount sets the "token_count" field.

func (*ReflectionUpdate) Where

Where appends a list predicates to the ReflectionUpdate builder.

type ReflectionUpdateOne

type ReflectionUpdateOne struct {
	// contains filtered or unexported fields
}

ReflectionUpdateOne is the builder for updating a single Reflection entity.

func (*ReflectionUpdateOne) AddGeneration

func (_u *ReflectionUpdateOne) AddGeneration(v int) *ReflectionUpdateOne

AddGeneration adds value to the "generation" field.

func (*ReflectionUpdateOne) AddTokenCount

func (_u *ReflectionUpdateOne) AddTokenCount(v int) *ReflectionUpdateOne

AddTokenCount adds value to the "token_count" field.

func (*ReflectionUpdateOne) Exec

func (_u *ReflectionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReflectionUpdateOne) ExecX

func (_u *ReflectionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReflectionUpdateOne) Mutation

func (_u *ReflectionUpdateOne) Mutation() *ReflectionMutation

Mutation returns the ReflectionMutation object of the builder.

func (*ReflectionUpdateOne) Save

Save executes the query and returns the updated Reflection entity.

func (*ReflectionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ReflectionUpdateOne) Select

func (_u *ReflectionUpdateOne) Select(field string, fields ...string) *ReflectionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReflectionUpdateOne) SetContent

func (_u *ReflectionUpdateOne) SetContent(v string) *ReflectionUpdateOne

SetContent sets the "content" field.

func (*ReflectionUpdateOne) SetGeneration

func (_u *ReflectionUpdateOne) SetGeneration(v int) *ReflectionUpdateOne

SetGeneration sets the "generation" field.

func (*ReflectionUpdateOne) SetNillableContent

func (_u *ReflectionUpdateOne) SetNillableContent(v *string) *ReflectionUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*ReflectionUpdateOne) SetNillableGeneration

func (_u *ReflectionUpdateOne) SetNillableGeneration(v *int) *ReflectionUpdateOne

SetNillableGeneration sets the "generation" field if the given value is not nil.

func (*ReflectionUpdateOne) SetNillableSessionKey

func (_u *ReflectionUpdateOne) SetNillableSessionKey(v *string) *ReflectionUpdateOne

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*ReflectionUpdateOne) SetNillableTokenCount

func (_u *ReflectionUpdateOne) SetNillableTokenCount(v *int) *ReflectionUpdateOne

SetNillableTokenCount sets the "token_count" field if the given value is not nil.

func (*ReflectionUpdateOne) SetSessionKey

func (_u *ReflectionUpdateOne) SetSessionKey(v string) *ReflectionUpdateOne

SetSessionKey sets the "session_key" field.

func (*ReflectionUpdateOne) SetTokenCount

func (_u *ReflectionUpdateOne) SetTokenCount(v int) *ReflectionUpdateOne

SetTokenCount sets the "token_count" field.

func (*ReflectionUpdateOne) Where

Where appends a list predicates to the ReflectionUpdate builder.

type Reflections

type Reflections []*Reflection

Reflections is a parsable slice of Reflection.

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 Secret

type Secret struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Lookup key for the secret
	Name string `json:"name,omitempty"`
	// Encrypted secret data
	EncryptedValue []byte `json:"encrypted_value,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Number of times this secret has been accessed
	AccessCount int `json:"access_count,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SecretQuery when eager-loading is set.
	Edges SecretEdges `json:"edges"`
	// contains filtered or unexported fields
}

Secret is the model entity for the Secret schema.

func (*Secret) QueryKey

func (_m *Secret) QueryKey() *KeyQuery

QueryKey queries the "key" edge of the Secret entity.

func (*Secret) String

func (_m *Secret) String() string

String implements the fmt.Stringer.

func (*Secret) Unwrap

func (_m *Secret) Unwrap() *Secret

Unwrap unwraps the Secret entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Secret) Update

func (_m *Secret) Update() *SecretUpdateOne

Update returns a builder for updating this Secret. Note that you need to call Secret.Unwrap() before calling this method if this Secret was returned from a transaction, and the transaction was committed or rolled back.

func (*Secret) Value

func (_m *Secret) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Secret. This includes values selected through modifiers, order, etc.

type SecretClient

type SecretClient struct {
	// contains filtered or unexported fields
}

SecretClient is a client for the Secret schema.

func NewSecretClient

func NewSecretClient(c config) *SecretClient

NewSecretClient returns a client for the Secret from the given config.

func (*SecretClient) Create

func (c *SecretClient) Create() *SecretCreate

Create returns a builder for creating a Secret entity.

func (*SecretClient) CreateBulk

func (c *SecretClient) CreateBulk(builders ...*SecretCreate) *SecretCreateBulk

CreateBulk returns a builder for creating a bulk of Secret entities.

func (*SecretClient) Delete

func (c *SecretClient) Delete() *SecretDelete

Delete returns a delete builder for Secret.

func (*SecretClient) DeleteOne

func (c *SecretClient) DeleteOne(_m *Secret) *SecretDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SecretClient) DeleteOneID

func (c *SecretClient) DeleteOneID(id uuid.UUID) *SecretDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SecretClient) Get

func (c *SecretClient) Get(ctx context.Context, id uuid.UUID) (*Secret, error)

Get returns a Secret entity by its id.

func (*SecretClient) GetX

func (c *SecretClient) GetX(ctx context.Context, id uuid.UUID) *Secret

GetX is like Get, but panics if an error occurs.

func (*SecretClient) Hooks

func (c *SecretClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SecretClient) Intercept

func (c *SecretClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `secret.Intercept(f(g(h())))`.

func (*SecretClient) Interceptors

func (c *SecretClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SecretClient) MapCreateBulk

func (c *SecretClient) MapCreateBulk(slice any, setFunc func(*SecretCreate, int)) *SecretCreateBulk

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 (*SecretClient) Query

func (c *SecretClient) Query() *SecretQuery

Query returns a query builder for Secret.

func (*SecretClient) QueryKey

func (c *SecretClient) QueryKey(_m *Secret) *KeyQuery

QueryKey queries the key edge of a Secret.

func (*SecretClient) Update

func (c *SecretClient) Update() *SecretUpdate

Update returns an update builder for Secret.

func (*SecretClient) UpdateOne

func (c *SecretClient) UpdateOne(_m *Secret) *SecretUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SecretClient) UpdateOneID

func (c *SecretClient) UpdateOneID(id uuid.UUID) *SecretUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SecretClient) Use

func (c *SecretClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `secret.Hooks(f(g(h())))`.

type SecretCreate

type SecretCreate struct {
	// contains filtered or unexported fields
}

SecretCreate is the builder for creating a Secret entity.

func (*SecretCreate) Exec

func (_c *SecretCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretCreate) ExecX

func (_c *SecretCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretCreate) Mutation

func (_c *SecretCreate) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretCreate) Save

func (_c *SecretCreate) Save(ctx context.Context) (*Secret, error)

Save creates the Secret in the database.

func (*SecretCreate) SaveX

func (_c *SecretCreate) SaveX(ctx context.Context) *Secret

SaveX calls Save and panics if Save returns an error.

func (*SecretCreate) SetAccessCount

func (_c *SecretCreate) SetAccessCount(v int) *SecretCreate

SetAccessCount sets the "access_count" field.

func (*SecretCreate) SetCreatedAt

func (_c *SecretCreate) SetCreatedAt(v time.Time) *SecretCreate

SetCreatedAt sets the "created_at" field.

func (*SecretCreate) SetEncryptedValue

func (_c *SecretCreate) SetEncryptedValue(v []byte) *SecretCreate

SetEncryptedValue sets the "encrypted_value" field.

func (*SecretCreate) SetID

func (_c *SecretCreate) SetID(v uuid.UUID) *SecretCreate

SetID sets the "id" field.

func (*SecretCreate) SetKey

func (_c *SecretCreate) SetKey(v *Key) *SecretCreate

SetKey sets the "key" edge to the Key entity.

func (*SecretCreate) SetKeyID

func (_c *SecretCreate) SetKeyID(id uuid.UUID) *SecretCreate

SetKeyID sets the "key" edge to the Key entity by ID.

func (*SecretCreate) SetName

func (_c *SecretCreate) SetName(v string) *SecretCreate

SetName sets the "name" field.

func (*SecretCreate) SetNillableAccessCount

func (_c *SecretCreate) SetNillableAccessCount(v *int) *SecretCreate

SetNillableAccessCount sets the "access_count" field if the given value is not nil.

func (*SecretCreate) SetNillableCreatedAt

func (_c *SecretCreate) SetNillableCreatedAt(v *time.Time) *SecretCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SecretCreate) SetNillableID

func (_c *SecretCreate) SetNillableID(v *uuid.UUID) *SecretCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SecretCreate) SetNillableUpdatedAt

func (_c *SecretCreate) SetNillableUpdatedAt(v *time.Time) *SecretCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SecretCreate) SetUpdatedAt

func (_c *SecretCreate) SetUpdatedAt(v time.Time) *SecretCreate

SetUpdatedAt sets the "updated_at" field.

type SecretCreateBulk

type SecretCreateBulk struct {
	// contains filtered or unexported fields
}

SecretCreateBulk is the builder for creating many Secret entities in bulk.

func (*SecretCreateBulk) Exec

func (_c *SecretCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretCreateBulk) ExecX

func (_c *SecretCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretCreateBulk) Save

func (_c *SecretCreateBulk) Save(ctx context.Context) ([]*Secret, error)

Save creates the Secret entities in the database.

func (*SecretCreateBulk) SaveX

func (_c *SecretCreateBulk) SaveX(ctx context.Context) []*Secret

SaveX is like Save, but panics if an error occurs.

type SecretDelete

type SecretDelete struct {
	// contains filtered or unexported fields
}

SecretDelete is the builder for deleting a Secret entity.

func (*SecretDelete) Exec

func (_d *SecretDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SecretDelete) ExecX

func (_d *SecretDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SecretDelete) Where

func (_d *SecretDelete) Where(ps ...predicate.Secret) *SecretDelete

Where appends a list predicates to the SecretDelete builder.

type SecretDeleteOne

type SecretDeleteOne struct {
	// contains filtered or unexported fields
}

SecretDeleteOne is the builder for deleting a single Secret entity.

func (*SecretDeleteOne) Exec

func (_d *SecretDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SecretDeleteOne) ExecX

func (_d *SecretDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretDeleteOne) Where

func (_d *SecretDeleteOne) Where(ps ...predicate.Secret) *SecretDeleteOne

Where appends a list predicates to the SecretDelete builder.

type SecretEdges

type SecretEdges struct {
	// Encryption key used for this secret
	Key *Key `json:"key,omitempty"`
	// contains filtered or unexported fields
}

SecretEdges holds the relations/edges for other nodes in the graph.

func (SecretEdges) KeyOrErr

func (e SecretEdges) KeyOrErr() (*Key, error)

KeyOrErr returns the Key value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SecretGroupBy

type SecretGroupBy struct {
	// contains filtered or unexported fields
}

SecretGroupBy is the group-by builder for Secret entities.

func (*SecretGroupBy) Aggregate

func (_g *SecretGroupBy) Aggregate(fns ...AggregateFunc) *SecretGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SecretGroupBy) Bool

func (s *SecretGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) BoolX

func (s *SecretGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SecretGroupBy) Bools

func (s *SecretGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) BoolsX

func (s *SecretGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SecretGroupBy) Float64

func (s *SecretGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) Float64X

func (s *SecretGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SecretGroupBy) Float64s

func (s *SecretGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) Float64sX

func (s *SecretGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SecretGroupBy) Int

func (s *SecretGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) IntX

func (s *SecretGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SecretGroupBy) Ints

func (s *SecretGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) IntsX

func (s *SecretGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SecretGroupBy) Scan

func (_g *SecretGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SecretGroupBy) ScanX

func (s *SecretGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SecretGroupBy) String

func (s *SecretGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) StringX

func (s *SecretGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SecretGroupBy) Strings

func (s *SecretGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SecretGroupBy) StringsX

func (s *SecretGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SecretMutation

type SecretMutation struct {
	// contains filtered or unexported fields
}

SecretMutation represents an operation that mutates the Secret nodes in the graph.

func (*SecretMutation) AccessCount

func (m *SecretMutation) AccessCount() (r int, exists bool)

AccessCount returns the value of the "access_count" field in the mutation.

func (*SecretMutation) AddAccessCount

func (m *SecretMutation) AddAccessCount(i int)

AddAccessCount adds i to the "access_count" field.

func (*SecretMutation) AddField

func (m *SecretMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SecretMutation) AddedAccessCount

func (m *SecretMutation) AddedAccessCount() (r int, exists bool)

AddedAccessCount returns the value that was added to the "access_count" field in this mutation.

func (*SecretMutation) AddedEdges

func (m *SecretMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SecretMutation) AddedField

func (m *SecretMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SecretMutation) AddedFields

func (m *SecretMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SecretMutation) AddedIDs

func (m *SecretMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SecretMutation) ClearEdge

func (m *SecretMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*SecretMutation) ClearField

func (m *SecretMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*SecretMutation) ClearKey

func (m *SecretMutation) ClearKey()

ClearKey clears the "key" edge to the Key entity.

func (*SecretMutation) ClearedEdges

func (m *SecretMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SecretMutation) ClearedFields

func (m *SecretMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SecretMutation) Client

func (m SecretMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*SecretMutation) CreatedAt

func (m *SecretMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SecretMutation) EdgeCleared

func (m *SecretMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SecretMutation) EncryptedValue

func (m *SecretMutation) EncryptedValue() (r []byte, exists bool)

EncryptedValue returns the value of the "encrypted_value" field in the mutation.

func (*SecretMutation) Field

func (m *SecretMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SecretMutation) FieldCleared

func (m *SecretMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SecretMutation) Fields

func (m *SecretMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*SecretMutation) ID

func (m *SecretMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SecretMutation) IDs

func (m *SecretMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SecretMutation) KeyCleared

func (m *SecretMutation) KeyCleared() bool

KeyCleared reports if the "key" edge to the Key entity was cleared.

func (*SecretMutation) KeyID

func (m *SecretMutation) KeyID() (id uuid.UUID, exists bool)

KeyID returns the "key" edge ID in the mutation.

func (*SecretMutation) KeyIDs

func (m *SecretMutation) KeyIDs() (ids []uuid.UUID)

KeyIDs returns the "key" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use KeyID instead. It exists only for internal usage by the builders.

func (*SecretMutation) Name

func (m *SecretMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SecretMutation) OldAccessCount

func (m *SecretMutation) OldAccessCount(ctx context.Context) (v int, err error)

OldAccessCount returns the old "access_count" field's value of the Secret entity. If the Secret object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SecretMutation) OldCreatedAt

func (m *SecretMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Secret entity. If the Secret object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SecretMutation) OldEncryptedValue

func (m *SecretMutation) OldEncryptedValue(ctx context.Context) (v []byte, err error)

OldEncryptedValue returns the old "encrypted_value" field's value of the Secret entity. If the Secret object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SecretMutation) OldField

func (m *SecretMutation) 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 (*SecretMutation) OldName

func (m *SecretMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Secret entity. If the Secret object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SecretMutation) OldUpdatedAt

func (m *SecretMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Secret entity. If the Secret object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SecretMutation) Op

func (m *SecretMutation) Op() Op

Op returns the operation name.

func (*SecretMutation) RemovedEdges

func (m *SecretMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SecretMutation) RemovedIDs

func (m *SecretMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SecretMutation) ResetAccessCount

func (m *SecretMutation) ResetAccessCount()

ResetAccessCount resets all changes to the "access_count" field.

func (*SecretMutation) ResetCreatedAt

func (m *SecretMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SecretMutation) ResetEdge

func (m *SecretMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*SecretMutation) ResetEncryptedValue

func (m *SecretMutation) ResetEncryptedValue()

ResetEncryptedValue resets all changes to the "encrypted_value" field.

func (*SecretMutation) ResetField

func (m *SecretMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*SecretMutation) ResetKey

func (m *SecretMutation) ResetKey()

ResetKey resets all changes to the "key" edge.

func (*SecretMutation) ResetName

func (m *SecretMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SecretMutation) ResetUpdatedAt

func (m *SecretMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SecretMutation) SetAccessCount

func (m *SecretMutation) SetAccessCount(i int)

SetAccessCount sets the "access_count" field.

func (*SecretMutation) SetCreatedAt

func (m *SecretMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SecretMutation) SetEncryptedValue

func (m *SecretMutation) SetEncryptedValue(b []byte)

SetEncryptedValue sets the "encrypted_value" field.

func (*SecretMutation) SetField

func (m *SecretMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SecretMutation) SetID

func (m *SecretMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Secret entities.

func (*SecretMutation) SetKeyID

func (m *SecretMutation) SetKeyID(id uuid.UUID)

SetKeyID sets the "key" edge to the Key entity by id.

func (*SecretMutation) SetName

func (m *SecretMutation) SetName(s string)

SetName sets the "name" field.

func (*SecretMutation) SetOp

func (m *SecretMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SecretMutation) SetUpdatedAt

func (m *SecretMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (SecretMutation) Tx

func (m SecretMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SecretMutation) Type

func (m *SecretMutation) Type() string

Type returns the node type of this mutation (Secret).

func (*SecretMutation) UpdatedAt

func (m *SecretMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SecretMutation) Where

func (m *SecretMutation) Where(ps ...predicate.Secret)

Where appends a list predicates to the SecretMutation builder.

func (*SecretMutation) WhereP

func (m *SecretMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SecretMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SecretQuery

type SecretQuery struct {
	// contains filtered or unexported fields
}

SecretQuery is the builder for querying Secret entities.

func (*SecretQuery) Aggregate

func (_q *SecretQuery) Aggregate(fns ...AggregateFunc) *SecretSelect

Aggregate returns a SecretSelect configured with the given aggregations.

func (*SecretQuery) All

func (_q *SecretQuery) All(ctx context.Context) ([]*Secret, error)

All executes the query and returns a list of Secrets.

func (*SecretQuery) AllX

func (_q *SecretQuery) AllX(ctx context.Context) []*Secret

AllX is like All, but panics if an error occurs.

func (*SecretQuery) Clone

func (_q *SecretQuery) Clone() *SecretQuery

Clone returns a duplicate of the SecretQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SecretQuery) Count

func (_q *SecretQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SecretQuery) CountX

func (_q *SecretQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SecretQuery) Exist

func (_q *SecretQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SecretQuery) ExistX

func (_q *SecretQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SecretQuery) First

func (_q *SecretQuery) First(ctx context.Context) (*Secret, error)

First returns the first Secret entity from the query. Returns a *NotFoundError when no Secret was found.

func (*SecretQuery) FirstID

func (_q *SecretQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Secret ID from the query. Returns a *NotFoundError when no Secret ID was found.

func (*SecretQuery) FirstIDX

func (_q *SecretQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SecretQuery) FirstX

func (_q *SecretQuery) FirstX(ctx context.Context) *Secret

FirstX is like First, but panics if an error occurs.

func (*SecretQuery) GroupBy

func (_q *SecretQuery) GroupBy(field string, fields ...string) *SecretGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Secret.Query().
	GroupBy(secret.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SecretQuery) IDs

func (_q *SecretQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Secret IDs.

func (*SecretQuery) IDsX

func (_q *SecretQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SecretQuery) Limit

func (_q *SecretQuery) Limit(limit int) *SecretQuery

Limit the number of records to be returned by this query.

func (*SecretQuery) Offset

func (_q *SecretQuery) Offset(offset int) *SecretQuery

Offset to start from.

func (*SecretQuery) Only

func (_q *SecretQuery) Only(ctx context.Context) (*Secret, error)

Only returns a single Secret entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Secret entity is found. Returns a *NotFoundError when no Secret entities are found.

func (*SecretQuery) OnlyID

func (_q *SecretQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Secret ID in the query. Returns a *NotSingularError when more than one Secret ID is found. Returns a *NotFoundError when no entities are found.

func (*SecretQuery) OnlyIDX

func (_q *SecretQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SecretQuery) OnlyX

func (_q *SecretQuery) OnlyX(ctx context.Context) *Secret

OnlyX is like Only, but panics if an error occurs.

func (*SecretQuery) Order

func (_q *SecretQuery) Order(o ...secret.OrderOption) *SecretQuery

Order specifies how the records should be ordered.

func (*SecretQuery) QueryKey

func (_q *SecretQuery) QueryKey() *KeyQuery

QueryKey chains the current query on the "key" edge.

func (*SecretQuery) Select

func (_q *SecretQuery) Select(fields ...string) *SecretSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Secret.Query().
	Select(secret.FieldName).
	Scan(ctx, &v)

func (*SecretQuery) Unique

func (_q *SecretQuery) Unique(unique bool) *SecretQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SecretQuery) Where

func (_q *SecretQuery) Where(ps ...predicate.Secret) *SecretQuery

Where adds a new predicate for the SecretQuery builder.

func (*SecretQuery) WithKey

func (_q *SecretQuery) WithKey(opts ...func(*KeyQuery)) *SecretQuery

WithKey tells the query-builder to eager-load the nodes that are connected to the "key" edge. The optional arguments are used to configure the query builder of the edge.

type SecretSelect

type SecretSelect struct {
	*SecretQuery
	// contains filtered or unexported fields
}

SecretSelect is the builder for selecting fields of Secret entities.

func (*SecretSelect) Aggregate

func (_s *SecretSelect) Aggregate(fns ...AggregateFunc) *SecretSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SecretSelect) Bool

func (s *SecretSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SecretSelect) BoolX

func (s *SecretSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SecretSelect) Bools

func (s *SecretSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SecretSelect) BoolsX

func (s *SecretSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SecretSelect) Float64

func (s *SecretSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SecretSelect) Float64X

func (s *SecretSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SecretSelect) Float64s

func (s *SecretSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SecretSelect) Float64sX

func (s *SecretSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SecretSelect) Int

func (s *SecretSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SecretSelect) IntX

func (s *SecretSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SecretSelect) Ints

func (s *SecretSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SecretSelect) IntsX

func (s *SecretSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SecretSelect) Scan

func (_s *SecretSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SecretSelect) ScanX

func (s *SecretSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SecretSelect) String

func (s *SecretSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SecretSelect) StringX

func (s *SecretSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SecretSelect) Strings

func (s *SecretSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SecretSelect) StringsX

func (s *SecretSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SecretUpdate

type SecretUpdate struct {
	// contains filtered or unexported fields
}

SecretUpdate is the builder for updating Secret entities.

func (*SecretUpdate) AddAccessCount

func (_u *SecretUpdate) AddAccessCount(v int) *SecretUpdate

AddAccessCount adds value to the "access_count" field.

func (*SecretUpdate) ClearKey

func (_u *SecretUpdate) ClearKey() *SecretUpdate

ClearKey clears the "key" edge to the Key entity.

func (*SecretUpdate) Exec

func (_u *SecretUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretUpdate) ExecX

func (_u *SecretUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretUpdate) Mutation

func (_u *SecretUpdate) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretUpdate) Save

func (_u *SecretUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SecretUpdate) SaveX

func (_u *SecretUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SecretUpdate) SetAccessCount

func (_u *SecretUpdate) SetAccessCount(v int) *SecretUpdate

SetAccessCount sets the "access_count" field.

func (*SecretUpdate) SetEncryptedValue

func (_u *SecretUpdate) SetEncryptedValue(v []byte) *SecretUpdate

SetEncryptedValue sets the "encrypted_value" field.

func (*SecretUpdate) SetKey

func (_u *SecretUpdate) SetKey(v *Key) *SecretUpdate

SetKey sets the "key" edge to the Key entity.

func (*SecretUpdate) SetKeyID

func (_u *SecretUpdate) SetKeyID(id uuid.UUID) *SecretUpdate

SetKeyID sets the "key" edge to the Key entity by ID.

func (*SecretUpdate) SetName

func (_u *SecretUpdate) SetName(v string) *SecretUpdate

SetName sets the "name" field.

func (*SecretUpdate) SetNillableAccessCount

func (_u *SecretUpdate) SetNillableAccessCount(v *int) *SecretUpdate

SetNillableAccessCount sets the "access_count" field if the given value is not nil.

func (*SecretUpdate) SetNillableName

func (_u *SecretUpdate) SetNillableName(v *string) *SecretUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*SecretUpdate) SetUpdatedAt

func (_u *SecretUpdate) SetUpdatedAt(v time.Time) *SecretUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpdate) Where

func (_u *SecretUpdate) Where(ps ...predicate.Secret) *SecretUpdate

Where appends a list predicates to the SecretUpdate builder.

type SecretUpdateOne

type SecretUpdateOne struct {
	// contains filtered or unexported fields
}

SecretUpdateOne is the builder for updating a single Secret entity.

func (*SecretUpdateOne) AddAccessCount

func (_u *SecretUpdateOne) AddAccessCount(v int) *SecretUpdateOne

AddAccessCount adds value to the "access_count" field.

func (*SecretUpdateOne) ClearKey

func (_u *SecretUpdateOne) ClearKey() *SecretUpdateOne

ClearKey clears the "key" edge to the Key entity.

func (*SecretUpdateOne) Exec

func (_u *SecretUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SecretUpdateOne) ExecX

func (_u *SecretUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SecretUpdateOne) Mutation

func (_u *SecretUpdateOne) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretUpdateOne) Save

func (_u *SecretUpdateOne) Save(ctx context.Context) (*Secret, error)

Save executes the query and returns the updated Secret entity.

func (*SecretUpdateOne) SaveX

func (_u *SecretUpdateOne) SaveX(ctx context.Context) *Secret

SaveX is like Save, but panics if an error occurs.

func (*SecretUpdateOne) Select

func (_u *SecretUpdateOne) Select(field string, fields ...string) *SecretUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SecretUpdateOne) SetAccessCount

func (_u *SecretUpdateOne) SetAccessCount(v int) *SecretUpdateOne

SetAccessCount sets the "access_count" field.

func (*SecretUpdateOne) SetEncryptedValue

func (_u *SecretUpdateOne) SetEncryptedValue(v []byte) *SecretUpdateOne

SetEncryptedValue sets the "encrypted_value" field.

func (*SecretUpdateOne) SetKey

func (_u *SecretUpdateOne) SetKey(v *Key) *SecretUpdateOne

SetKey sets the "key" edge to the Key entity.

func (*SecretUpdateOne) SetKeyID

func (_u *SecretUpdateOne) SetKeyID(id uuid.UUID) *SecretUpdateOne

SetKeyID sets the "key" edge to the Key entity by ID.

func (*SecretUpdateOne) SetName

func (_u *SecretUpdateOne) SetName(v string) *SecretUpdateOne

SetName sets the "name" field.

func (*SecretUpdateOne) SetNillableAccessCount

func (_u *SecretUpdateOne) SetNillableAccessCount(v *int) *SecretUpdateOne

SetNillableAccessCount sets the "access_count" field if the given value is not nil.

func (*SecretUpdateOne) SetNillableName

func (_u *SecretUpdateOne) SetNillableName(v *string) *SecretUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*SecretUpdateOne) SetUpdatedAt

func (_u *SecretUpdateOne) SetUpdatedAt(v time.Time) *SecretUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpdateOne) Where

func (_u *SecretUpdateOne) Where(ps ...predicate.Secret) *SecretUpdateOne

Where appends a list predicates to the SecretUpdate builder.

type Secrets

type Secrets []*Secret

Secrets is a parsable slice of Secret.

type Session

type Session struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID string `json:"agent_id,omitempty"`
	// ChannelType holds the value of the "channel_type" field.
	ChannelType string `json:"channel_type,omitempty"`
	// ChannelID holds the value of the "channel_id" field.
	ChannelID string `json:"channel_id,omitempty"`
	// Model holds the value of the "model" field.
	Model string `json:"model,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]string `json:"metadata,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SessionQuery when eager-loading is set.
	Edges SessionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Session is the model entity for the Session schema.

func (*Session) QueryMessages

func (_m *Session) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the Session entity.

func (*Session) String

func (_m *Session) String() string

String implements the fmt.Stringer.

func (*Session) Unwrap

func (_m *Session) Unwrap() *Session

Unwrap unwraps the Session 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 (*Session) Update

func (_m *Session) Update() *SessionUpdateOne

Update returns a builder for updating this Session. Note that you need to call Session.Unwrap() before calling this method if this Session was returned from a transaction, and the transaction was committed or rolled back.

func (*Session) Value

func (_m *Session) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Session. This includes values selected through modifiers, order, etc.

type SessionClient

type SessionClient struct {
	// contains filtered or unexported fields
}

SessionClient is a client for the Session schema.

func NewSessionClient

func NewSessionClient(c config) *SessionClient

NewSessionClient returns a client for the Session from the given config.

func (*SessionClient) Create

func (c *SessionClient) Create() *SessionCreate

Create returns a builder for creating a Session entity.

func (*SessionClient) CreateBulk

func (c *SessionClient) CreateBulk(builders ...*SessionCreate) *SessionCreateBulk

CreateBulk returns a builder for creating a bulk of Session entities.

func (*SessionClient) Delete

func (c *SessionClient) Delete() *SessionDelete

Delete returns a delete builder for Session.

func (*SessionClient) DeleteOne

func (c *SessionClient) DeleteOne(_m *Session) *SessionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SessionClient) DeleteOneID

func (c *SessionClient) DeleteOneID(id int) *SessionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SessionClient) Get

func (c *SessionClient) Get(ctx context.Context, id int) (*Session, error)

Get returns a Session entity by its id.

func (*SessionClient) GetX

func (c *SessionClient) GetX(ctx context.Context, id int) *Session

GetX is like Get, but panics if an error occurs.

func (*SessionClient) Hooks

func (c *SessionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SessionClient) Intercept

func (c *SessionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `session.Intercept(f(g(h())))`.

func (*SessionClient) Interceptors

func (c *SessionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SessionClient) MapCreateBulk

func (c *SessionClient) MapCreateBulk(slice any, setFunc func(*SessionCreate, int)) *SessionCreateBulk

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 (*SessionClient) Query

func (c *SessionClient) Query() *SessionQuery

Query returns a query builder for Session.

func (*SessionClient) QueryMessages

func (c *SessionClient) QueryMessages(_m *Session) *MessageQuery

QueryMessages queries the messages edge of a Session.

func (*SessionClient) Update

func (c *SessionClient) Update() *SessionUpdate

Update returns an update builder for Session.

func (*SessionClient) UpdateOne

func (c *SessionClient) UpdateOne(_m *Session) *SessionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SessionClient) UpdateOneID

func (c *SessionClient) UpdateOneID(id int) *SessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SessionClient) Use

func (c *SessionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `session.Hooks(f(g(h())))`.

type SessionCreate

type SessionCreate struct {
	// contains filtered or unexported fields
}

SessionCreate is the builder for creating a Session entity.

func (*SessionCreate) AddMessageIDs

func (_c *SessionCreate) AddMessageIDs(ids ...int) *SessionCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*SessionCreate) AddMessages

func (_c *SessionCreate) AddMessages(v ...*Message) *SessionCreate

AddMessages adds the "messages" edges to the Message entity.

func (*SessionCreate) Exec

func (_c *SessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreate) ExecX

func (_c *SessionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionCreate) Mutation

func (_c *SessionCreate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionCreate) Save

func (_c *SessionCreate) Save(ctx context.Context) (*Session, error)

Save creates the Session in the database.

func (*SessionCreate) SaveX

func (_c *SessionCreate) SaveX(ctx context.Context) *Session

SaveX calls Save and panics if Save returns an error.

func (*SessionCreate) SetAgentID

func (_c *SessionCreate) SetAgentID(v string) *SessionCreate

SetAgentID sets the "agent_id" field.

func (*SessionCreate) SetChannelID

func (_c *SessionCreate) SetChannelID(v string) *SessionCreate

SetChannelID sets the "channel_id" field.

func (*SessionCreate) SetChannelType

func (_c *SessionCreate) SetChannelType(v string) *SessionCreate

SetChannelType sets the "channel_type" field.

func (*SessionCreate) SetCreatedAt

func (_c *SessionCreate) SetCreatedAt(v time.Time) *SessionCreate

SetCreatedAt sets the "created_at" field.

func (*SessionCreate) SetKey

func (_c *SessionCreate) SetKey(v string) *SessionCreate

SetKey sets the "key" field.

func (*SessionCreate) SetMetadata

func (_c *SessionCreate) SetMetadata(v map[string]string) *SessionCreate

SetMetadata sets the "metadata" field.

func (*SessionCreate) SetModel

func (_c *SessionCreate) SetModel(v string) *SessionCreate

SetModel sets the "model" field.

func (*SessionCreate) SetNillableAgentID

func (_c *SessionCreate) SetNillableAgentID(v *string) *SessionCreate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*SessionCreate) SetNillableChannelID

func (_c *SessionCreate) SetNillableChannelID(v *string) *SessionCreate

SetNillableChannelID sets the "channel_id" field if the given value is not nil.

func (*SessionCreate) SetNillableChannelType

func (_c *SessionCreate) SetNillableChannelType(v *string) *SessionCreate

SetNillableChannelType sets the "channel_type" field if the given value is not nil.

func (*SessionCreate) SetNillableCreatedAt

func (_c *SessionCreate) SetNillableCreatedAt(v *time.Time) *SessionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SessionCreate) SetNillableModel

func (_c *SessionCreate) SetNillableModel(v *string) *SessionCreate

SetNillableModel sets the "model" field if the given value is not nil.

func (*SessionCreate) SetNillableUpdatedAt

func (_c *SessionCreate) SetNillableUpdatedAt(v *time.Time) *SessionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SessionCreate) SetUpdatedAt

func (_c *SessionCreate) SetUpdatedAt(v time.Time) *SessionCreate

SetUpdatedAt sets the "updated_at" field.

type SessionCreateBulk

type SessionCreateBulk struct {
	// contains filtered or unexported fields
}

SessionCreateBulk is the builder for creating many Session entities in bulk.

func (*SessionCreateBulk) Exec

func (_c *SessionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreateBulk) ExecX

func (_c *SessionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionCreateBulk) Save

func (_c *SessionCreateBulk) Save(ctx context.Context) ([]*Session, error)

Save creates the Session entities in the database.

func (*SessionCreateBulk) SaveX

func (_c *SessionCreateBulk) SaveX(ctx context.Context) []*Session

SaveX is like Save, but panics if an error occurs.

type SessionDelete

type SessionDelete struct {
	// contains filtered or unexported fields
}

SessionDelete is the builder for deleting a Session entity.

func (*SessionDelete) Exec

func (_d *SessionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SessionDelete) ExecX

func (_d *SessionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SessionDelete) Where

func (_d *SessionDelete) Where(ps ...predicate.Session) *SessionDelete

Where appends a list predicates to the SessionDelete builder.

type SessionDeleteOne

type SessionDeleteOne struct {
	// contains filtered or unexported fields
}

SessionDeleteOne is the builder for deleting a single Session entity.

func (*SessionDeleteOne) Exec

func (_d *SessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SessionDeleteOne) ExecX

func (_d *SessionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionDeleteOne) Where

Where appends a list predicates to the SessionDelete builder.

type SessionEdges

type SessionEdges struct {
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// contains filtered or unexported fields
}

SessionEdges holds the relations/edges for other nodes in the graph.

func (SessionEdges) MessagesOrErr

func (e SessionEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

type SessionGroupBy

type SessionGroupBy struct {
	// contains filtered or unexported fields
}

SessionGroupBy is the group-by builder for Session entities.

func (*SessionGroupBy) Aggregate

func (_g *SessionGroupBy) Aggregate(fns ...AggregateFunc) *SessionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SessionGroupBy) Bool

func (s *SessionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) BoolX

func (s *SessionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SessionGroupBy) Bools

func (s *SessionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) BoolsX

func (s *SessionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SessionGroupBy) Float64

func (s *SessionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) Float64X

func (s *SessionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SessionGroupBy) Float64s

func (s *SessionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) Float64sX

func (s *SessionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SessionGroupBy) Int

func (s *SessionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) IntX

func (s *SessionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SessionGroupBy) Ints

func (s *SessionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) IntsX

func (s *SessionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SessionGroupBy) Scan

func (_g *SessionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SessionGroupBy) ScanX

func (s *SessionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SessionGroupBy) String

func (s *SessionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) StringX

func (s *SessionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SessionGroupBy) Strings

func (s *SessionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) StringsX

func (s *SessionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SessionMutation

type SessionMutation struct {
	// contains filtered or unexported fields
}

SessionMutation represents an operation that mutates the Session nodes in the graph.

func (*SessionMutation) AddField

func (m *SessionMutation) 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 (*SessionMutation) AddMessageIDs

func (m *SessionMutation) AddMessageIDs(ids ...int)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*SessionMutation) AddedEdges

func (m *SessionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SessionMutation) AddedField

func (m *SessionMutation) 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 (*SessionMutation) AddedFields

func (m *SessionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SessionMutation) AddedIDs

func (m *SessionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SessionMutation) AgentID

func (m *SessionMutation) AgentID() (r string, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*SessionMutation) AgentIDCleared

func (m *SessionMutation) AgentIDCleared() bool

AgentIDCleared returns if the "agent_id" field was cleared in this mutation.

func (*SessionMutation) ChannelID

func (m *SessionMutation) ChannelID() (r string, exists bool)

ChannelID returns the value of the "channel_id" field in the mutation.

func (*SessionMutation) ChannelIDCleared

func (m *SessionMutation) ChannelIDCleared() bool

ChannelIDCleared returns if the "channel_id" field was cleared in this mutation.

func (*SessionMutation) ChannelType

func (m *SessionMutation) ChannelType() (r string, exists bool)

ChannelType returns the value of the "channel_type" field in the mutation.

func (*SessionMutation) ChannelTypeCleared

func (m *SessionMutation) ChannelTypeCleared() bool

ChannelTypeCleared returns if the "channel_type" field was cleared in this mutation.

func (*SessionMutation) ClearAgentID

func (m *SessionMutation) ClearAgentID()

ClearAgentID clears the value of the "agent_id" field.

func (*SessionMutation) ClearChannelID

func (m *SessionMutation) ClearChannelID()

ClearChannelID clears the value of the "channel_id" field.

func (*SessionMutation) ClearChannelType

func (m *SessionMutation) ClearChannelType()

ClearChannelType clears the value of the "channel_type" field.

func (*SessionMutation) ClearEdge

func (m *SessionMutation) 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 (*SessionMutation) ClearField

func (m *SessionMutation) 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 (*SessionMutation) ClearMessages

func (m *SessionMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*SessionMutation) ClearMetadata

func (m *SessionMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*SessionMutation) ClearModel

func (m *SessionMutation) ClearModel()

ClearModel clears the value of the "model" field.

func (*SessionMutation) ClearedEdges

func (m *SessionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SessionMutation) ClearedFields

func (m *SessionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SessionMutation) Client

func (m SessionMutation) 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 (*SessionMutation) CreatedAt

func (m *SessionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SessionMutation) EdgeCleared

func (m *SessionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SessionMutation) Field

func (m *SessionMutation) 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 (*SessionMutation) FieldCleared

func (m *SessionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SessionMutation) Fields

func (m *SessionMutation) 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 (*SessionMutation) ID

func (m *SessionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SessionMutation) IDs

func (m *SessionMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SessionMutation) Key

func (m *SessionMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*SessionMutation) MessagesCleared

func (m *SessionMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*SessionMutation) MessagesIDs

func (m *SessionMutation) MessagesIDs() (ids []int)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*SessionMutation) Metadata

func (m *SessionMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*SessionMutation) MetadataCleared

func (m *SessionMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*SessionMutation) Model

func (m *SessionMutation) Model() (r string, exists bool)

Model returns the value of the "model" field in the mutation.

func (*SessionMutation) ModelCleared

func (m *SessionMutation) ModelCleared() bool

ModelCleared returns if the "model" field was cleared in this mutation.

func (*SessionMutation) OldAgentID

func (m *SessionMutation) OldAgentID(ctx context.Context) (v string, err error)

OldAgentID returns the old "agent_id" field's value of the Session entity. If the Session 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 (*SessionMutation) OldChannelID

func (m *SessionMutation) OldChannelID(ctx context.Context) (v string, err error)

OldChannelID returns the old "channel_id" field's value of the Session entity. If the Session 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 (*SessionMutation) OldChannelType

func (m *SessionMutation) OldChannelType(ctx context.Context) (v string, err error)

OldChannelType returns the old "channel_type" field's value of the Session entity. If the Session 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 (*SessionMutation) OldCreatedAt

func (m *SessionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Session entity. If the Session 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 (*SessionMutation) OldField

func (m *SessionMutation) 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 (*SessionMutation) OldKey

func (m *SessionMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Session entity. If the Session 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 (*SessionMutation) OldMetadata

func (m *SessionMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Session entity. If the Session 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 (*SessionMutation) OldModel

func (m *SessionMutation) OldModel(ctx context.Context) (v string, err error)

OldModel returns the old "model" field's value of the Session entity. If the Session 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 (*SessionMutation) OldUpdatedAt

func (m *SessionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Session entity. If the Session 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 (*SessionMutation) Op

func (m *SessionMutation) Op() Op

Op returns the operation name.

func (*SessionMutation) RemoveMessageIDs

func (m *SessionMutation) RemoveMessageIDs(ids ...int)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*SessionMutation) RemovedEdges

func (m *SessionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SessionMutation) RemovedIDs

func (m *SessionMutation) 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 (*SessionMutation) RemovedMessagesIDs

func (m *SessionMutation) RemovedMessagesIDs() (ids []int)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*SessionMutation) ResetAgentID

func (m *SessionMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*SessionMutation) ResetChannelID

func (m *SessionMutation) ResetChannelID()

ResetChannelID resets all changes to the "channel_id" field.

func (*SessionMutation) ResetChannelType

func (m *SessionMutation) ResetChannelType()

ResetChannelType resets all changes to the "channel_type" field.

func (*SessionMutation) ResetCreatedAt

func (m *SessionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SessionMutation) ResetEdge

func (m *SessionMutation) 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 (*SessionMutation) ResetField

func (m *SessionMutation) 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 (*SessionMutation) ResetKey

func (m *SessionMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*SessionMutation) ResetMessages

func (m *SessionMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*SessionMutation) ResetMetadata

func (m *SessionMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*SessionMutation) ResetModel

func (m *SessionMutation) ResetModel()

ResetModel resets all changes to the "model" field.

func (*SessionMutation) ResetUpdatedAt

func (m *SessionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SessionMutation) SetAgentID

func (m *SessionMutation) SetAgentID(s string)

SetAgentID sets the "agent_id" field.

func (*SessionMutation) SetChannelID

func (m *SessionMutation) SetChannelID(s string)

SetChannelID sets the "channel_id" field.

func (*SessionMutation) SetChannelType

func (m *SessionMutation) SetChannelType(s string)

SetChannelType sets the "channel_type" field.

func (*SessionMutation) SetCreatedAt

func (m *SessionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SessionMutation) SetField

func (m *SessionMutation) 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 (*SessionMutation) SetKey

func (m *SessionMutation) SetKey(s string)

SetKey sets the "key" field.

func (*SessionMutation) SetMetadata

func (m *SessionMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*SessionMutation) SetModel

func (m *SessionMutation) SetModel(s string)

SetModel sets the "model" field.

func (*SessionMutation) SetOp

func (m *SessionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SessionMutation) SetUpdatedAt

func (m *SessionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (SessionMutation) Tx

func (m SessionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SessionMutation) Type

func (m *SessionMutation) Type() string

Type returns the node type of this mutation (Session).

func (*SessionMutation) UpdatedAt

func (m *SessionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SessionMutation) Where

func (m *SessionMutation) Where(ps ...predicate.Session)

Where appends a list predicates to the SessionMutation builder.

func (*SessionMutation) WhereP

func (m *SessionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SessionQuery

type SessionQuery struct {
	// contains filtered or unexported fields
}

SessionQuery is the builder for querying Session entities.

func (*SessionQuery) Aggregate

func (_q *SessionQuery) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate returns a SessionSelect configured with the given aggregations.

func (*SessionQuery) All

func (_q *SessionQuery) All(ctx context.Context) ([]*Session, error)

All executes the query and returns a list of Sessions.

func (*SessionQuery) AllX

func (_q *SessionQuery) AllX(ctx context.Context) []*Session

AllX is like All, but panics if an error occurs.

func (*SessionQuery) Clone

func (_q *SessionQuery) Clone() *SessionQuery

Clone returns a duplicate of the SessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SessionQuery) Count

func (_q *SessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SessionQuery) CountX

func (_q *SessionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SessionQuery) Exist

func (_q *SessionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SessionQuery) ExistX

func (_q *SessionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SessionQuery) First

func (_q *SessionQuery) First(ctx context.Context) (*Session, error)

First returns the first Session entity from the query. Returns a *NotFoundError when no Session was found.

func (*SessionQuery) FirstID

func (_q *SessionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Session ID from the query. Returns a *NotFoundError when no Session ID was found.

func (*SessionQuery) FirstIDX

func (_q *SessionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SessionQuery) FirstX

func (_q *SessionQuery) FirstX(ctx context.Context) *Session

FirstX is like First, but panics if an error occurs.

func (*SessionQuery) GroupBy

func (_q *SessionQuery) GroupBy(field string, fields ...string) *SessionGroupBy

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 {
	Key string `json:"key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Session.Query().
	GroupBy(session.FieldKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SessionQuery) IDs

func (_q *SessionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Session IDs.

func (*SessionQuery) IDsX

func (_q *SessionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SessionQuery) Limit

func (_q *SessionQuery) Limit(limit int) *SessionQuery

Limit the number of records to be returned by this query.

func (*SessionQuery) Offset

func (_q *SessionQuery) Offset(offset int) *SessionQuery

Offset to start from.

func (*SessionQuery) Only

func (_q *SessionQuery) Only(ctx context.Context) (*Session, error)

Only returns a single Session entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Session entity is found. Returns a *NotFoundError when no Session entities are found.

func (*SessionQuery) OnlyID

func (_q *SessionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Session ID in the query. Returns a *NotSingularError when more than one Session ID is found. Returns a *NotFoundError when no entities are found.

func (*SessionQuery) OnlyIDX

func (_q *SessionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SessionQuery) OnlyX

func (_q *SessionQuery) OnlyX(ctx context.Context) *Session

OnlyX is like Only, but panics if an error occurs.

func (*SessionQuery) Order

func (_q *SessionQuery) Order(o ...session.OrderOption) *SessionQuery

Order specifies how the records should be ordered.

func (*SessionQuery) QueryMessages

func (_q *SessionQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*SessionQuery) Select

func (_q *SessionQuery) Select(fields ...string) *SessionSelect

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 {
	Key string `json:"key,omitempty"`
}

client.Session.Query().
	Select(session.FieldKey).
	Scan(ctx, &v)

func (*SessionQuery) Unique

func (_q *SessionQuery) Unique(unique bool) *SessionQuery

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 (*SessionQuery) Where

func (_q *SessionQuery) Where(ps ...predicate.Session) *SessionQuery

Where adds a new predicate for the SessionQuery builder.

func (*SessionQuery) WithMessages

func (_q *SessionQuery) WithMessages(opts ...func(*MessageQuery)) *SessionQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

type SessionSelect

type SessionSelect struct {
	*SessionQuery
	// contains filtered or unexported fields
}

SessionSelect is the builder for selecting fields of Session entities.

func (*SessionSelect) Aggregate

func (_s *SessionSelect) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SessionSelect) Bool

func (s *SessionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolX

func (s *SessionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SessionSelect) Bools

func (s *SessionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolsX

func (s *SessionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SessionSelect) Float64

func (s *SessionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64X

func (s *SessionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SessionSelect) Float64s

func (s *SessionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64sX

func (s *SessionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SessionSelect) Int

func (s *SessionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntX

func (s *SessionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SessionSelect) Ints

func (s *SessionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntsX

func (s *SessionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SessionSelect) Scan

func (_s *SessionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SessionSelect) ScanX

func (s *SessionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SessionSelect) String

func (s *SessionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringX

func (s *SessionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SessionSelect) Strings

func (s *SessionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringsX

func (s *SessionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SessionUpdate

type SessionUpdate struct {
	// contains filtered or unexported fields
}

SessionUpdate is the builder for updating Session entities.

func (*SessionUpdate) AddMessageIDs

func (_u *SessionUpdate) AddMessageIDs(ids ...int) *SessionUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*SessionUpdate) AddMessages

func (_u *SessionUpdate) AddMessages(v ...*Message) *SessionUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*SessionUpdate) ClearAgentID

func (_u *SessionUpdate) ClearAgentID() *SessionUpdate

ClearAgentID clears the value of the "agent_id" field.

func (*SessionUpdate) ClearChannelID

func (_u *SessionUpdate) ClearChannelID() *SessionUpdate

ClearChannelID clears the value of the "channel_id" field.

func (*SessionUpdate) ClearChannelType

func (_u *SessionUpdate) ClearChannelType() *SessionUpdate

ClearChannelType clears the value of the "channel_type" field.

func (*SessionUpdate) ClearMessages

func (_u *SessionUpdate) ClearMessages() *SessionUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*SessionUpdate) ClearMetadata

func (_u *SessionUpdate) ClearMetadata() *SessionUpdate

ClearMetadata clears the value of the "metadata" field.

func (*SessionUpdate) ClearModel

func (_u *SessionUpdate) ClearModel() *SessionUpdate

ClearModel clears the value of the "model" field.

func (*SessionUpdate) Exec

func (_u *SessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionUpdate) ExecX

func (_u *SessionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdate) Mutation

func (_u *SessionUpdate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdate) RemoveMessageIDs

func (_u *SessionUpdate) RemoveMessageIDs(ids ...int) *SessionUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*SessionUpdate) RemoveMessages

func (_u *SessionUpdate) RemoveMessages(v ...*Message) *SessionUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*SessionUpdate) Save

func (_u *SessionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SessionUpdate) SaveX

func (_u *SessionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdate) SetAgentID

func (_u *SessionUpdate) SetAgentID(v string) *SessionUpdate

SetAgentID sets the "agent_id" field.

func (*SessionUpdate) SetChannelID

func (_u *SessionUpdate) SetChannelID(v string) *SessionUpdate

SetChannelID sets the "channel_id" field.

func (*SessionUpdate) SetChannelType

func (_u *SessionUpdate) SetChannelType(v string) *SessionUpdate

SetChannelType sets the "channel_type" field.

func (*SessionUpdate) SetKey

func (_u *SessionUpdate) SetKey(v string) *SessionUpdate

SetKey sets the "key" field.

func (*SessionUpdate) SetMetadata

func (_u *SessionUpdate) SetMetadata(v map[string]string) *SessionUpdate

SetMetadata sets the "metadata" field.

func (*SessionUpdate) SetModel

func (_u *SessionUpdate) SetModel(v string) *SessionUpdate

SetModel sets the "model" field.

func (*SessionUpdate) SetNillableAgentID

func (_u *SessionUpdate) SetNillableAgentID(v *string) *SessionUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*SessionUpdate) SetNillableChannelID

func (_u *SessionUpdate) SetNillableChannelID(v *string) *SessionUpdate

SetNillableChannelID sets the "channel_id" field if the given value is not nil.

func (*SessionUpdate) SetNillableChannelType

func (_u *SessionUpdate) SetNillableChannelType(v *string) *SessionUpdate

SetNillableChannelType sets the "channel_type" field if the given value is not nil.

func (*SessionUpdate) SetNillableKey

func (_u *SessionUpdate) SetNillableKey(v *string) *SessionUpdate

SetNillableKey sets the "key" field if the given value is not nil.

func (*SessionUpdate) SetNillableModel

func (_u *SessionUpdate) SetNillableModel(v *string) *SessionUpdate

SetNillableModel sets the "model" field if the given value is not nil.

func (*SessionUpdate) SetUpdatedAt

func (_u *SessionUpdate) SetUpdatedAt(v time.Time) *SessionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SessionUpdate) Where

func (_u *SessionUpdate) Where(ps ...predicate.Session) *SessionUpdate

Where appends a list predicates to the SessionUpdate builder.

type SessionUpdateOne

type SessionUpdateOne struct {
	// contains filtered or unexported fields
}

SessionUpdateOne is the builder for updating a single Session entity.

func (*SessionUpdateOne) AddMessageIDs

func (_u *SessionUpdateOne) AddMessageIDs(ids ...int) *SessionUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*SessionUpdateOne) AddMessages

func (_u *SessionUpdateOne) AddMessages(v ...*Message) *SessionUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*SessionUpdateOne) ClearAgentID

func (_u *SessionUpdateOne) ClearAgentID() *SessionUpdateOne

ClearAgentID clears the value of the "agent_id" field.

func (*SessionUpdateOne) ClearChannelID

func (_u *SessionUpdateOne) ClearChannelID() *SessionUpdateOne

ClearChannelID clears the value of the "channel_id" field.

func (*SessionUpdateOne) ClearChannelType

func (_u *SessionUpdateOne) ClearChannelType() *SessionUpdateOne

ClearChannelType clears the value of the "channel_type" field.

func (*SessionUpdateOne) ClearMessages

func (_u *SessionUpdateOne) ClearMessages() *SessionUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*SessionUpdateOne) ClearMetadata

func (_u *SessionUpdateOne) ClearMetadata() *SessionUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*SessionUpdateOne) ClearModel

func (_u *SessionUpdateOne) ClearModel() *SessionUpdateOne

ClearModel clears the value of the "model" field.

func (*SessionUpdateOne) Exec

func (_u *SessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SessionUpdateOne) ExecX

func (_u *SessionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdateOne) Mutation

func (_u *SessionUpdateOne) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdateOne) RemoveMessageIDs

func (_u *SessionUpdateOne) RemoveMessageIDs(ids ...int) *SessionUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*SessionUpdateOne) RemoveMessages

func (_u *SessionUpdateOne) RemoveMessages(v ...*Message) *SessionUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*SessionUpdateOne) Save

func (_u *SessionUpdateOne) Save(ctx context.Context) (*Session, error)

Save executes the query and returns the updated Session entity.

func (*SessionUpdateOne) SaveX

func (_u *SessionUpdateOne) SaveX(ctx context.Context) *Session

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdateOne) Select

func (_u *SessionUpdateOne) Select(field string, fields ...string) *SessionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SessionUpdateOne) SetAgentID

func (_u *SessionUpdateOne) SetAgentID(v string) *SessionUpdateOne

SetAgentID sets the "agent_id" field.

func (*SessionUpdateOne) SetChannelID

func (_u *SessionUpdateOne) SetChannelID(v string) *SessionUpdateOne

SetChannelID sets the "channel_id" field.

func (*SessionUpdateOne) SetChannelType

func (_u *SessionUpdateOne) SetChannelType(v string) *SessionUpdateOne

SetChannelType sets the "channel_type" field.

func (*SessionUpdateOne) SetKey

func (_u *SessionUpdateOne) SetKey(v string) *SessionUpdateOne

SetKey sets the "key" field.

func (*SessionUpdateOne) SetMetadata

func (_u *SessionUpdateOne) SetMetadata(v map[string]string) *SessionUpdateOne

SetMetadata sets the "metadata" field.

func (*SessionUpdateOne) SetModel

func (_u *SessionUpdateOne) SetModel(v string) *SessionUpdateOne

SetModel sets the "model" field.

func (*SessionUpdateOne) SetNillableAgentID

func (_u *SessionUpdateOne) SetNillableAgentID(v *string) *SessionUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableChannelID

func (_u *SessionUpdateOne) SetNillableChannelID(v *string) *SessionUpdateOne

SetNillableChannelID sets the "channel_id" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableChannelType

func (_u *SessionUpdateOne) SetNillableChannelType(v *string) *SessionUpdateOne

SetNillableChannelType sets the "channel_type" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableKey

func (_u *SessionUpdateOne) SetNillableKey(v *string) *SessionUpdateOne

SetNillableKey sets the "key" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableModel

func (_u *SessionUpdateOne) SetNillableModel(v *string) *SessionUpdateOne

SetNillableModel sets the "model" field if the given value is not nil.

func (*SessionUpdateOne) SetUpdatedAt

func (_u *SessionUpdateOne) SetUpdatedAt(v time.Time) *SessionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SessionUpdateOne) Where

Where appends a list predicates to the SessionUpdate builder.

type Sessions

type Sessions []*Session

Sessions is a parsable slice of Session.

type TokenUsage added in v0.5.0

type TokenUsage struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SessionKey holds the value of the "session_key" field.
	SessionKey string `json:"session_key,omitempty"`
	// Provider holds the value of the "provider" field.
	Provider string `json:"provider,omitempty"`
	// Model holds the value of the "model" field.
	Model string `json:"model,omitempty"`
	// AgentName holds the value of the "agent_name" field.
	AgentName string `json:"agent_name,omitempty"`
	// InputTokens holds the value of the "input_tokens" field.
	InputTokens int64 `json:"input_tokens,omitempty"`
	// OutputTokens holds the value of the "output_tokens" field.
	OutputTokens int64 `json:"output_tokens,omitempty"`
	// TotalTokens holds the value of the "total_tokens" field.
	TotalTokens int64 `json:"total_tokens,omitempty"`
	// CacheTokens holds the value of the "cache_tokens" field.
	CacheTokens int64 `json:"cache_tokens,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

TokenUsage is the model entity for the TokenUsage schema.

func (*TokenUsage) String added in v0.5.0

func (_m *TokenUsage) String() string

String implements the fmt.Stringer.

func (*TokenUsage) Unwrap added in v0.5.0

func (_m *TokenUsage) Unwrap() *TokenUsage

Unwrap unwraps the TokenUsage 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 (*TokenUsage) Update added in v0.5.0

func (_m *TokenUsage) Update() *TokenUsageUpdateOne

Update returns a builder for updating this TokenUsage. Note that you need to call TokenUsage.Unwrap() before calling this method if this TokenUsage was returned from a transaction, and the transaction was committed or rolled back.

func (*TokenUsage) Value added in v0.5.0

func (_m *TokenUsage) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the TokenUsage. This includes values selected through modifiers, order, etc.

type TokenUsageClient added in v0.5.0

type TokenUsageClient struct {
	// contains filtered or unexported fields
}

TokenUsageClient is a client for the TokenUsage schema.

func NewTokenUsageClient added in v0.5.0

func NewTokenUsageClient(c config) *TokenUsageClient

NewTokenUsageClient returns a client for the TokenUsage from the given config.

func (*TokenUsageClient) Create added in v0.5.0

func (c *TokenUsageClient) Create() *TokenUsageCreate

Create returns a builder for creating a TokenUsage entity.

func (*TokenUsageClient) CreateBulk added in v0.5.0

func (c *TokenUsageClient) CreateBulk(builders ...*TokenUsageCreate) *TokenUsageCreateBulk

CreateBulk returns a builder for creating a bulk of TokenUsage entities.

func (*TokenUsageClient) Delete added in v0.5.0

func (c *TokenUsageClient) Delete() *TokenUsageDelete

Delete returns a delete builder for TokenUsage.

func (*TokenUsageClient) DeleteOne added in v0.5.0

func (c *TokenUsageClient) DeleteOne(_m *TokenUsage) *TokenUsageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TokenUsageClient) DeleteOneID added in v0.5.0

func (c *TokenUsageClient) DeleteOneID(id uuid.UUID) *TokenUsageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TokenUsageClient) Get added in v0.5.0

Get returns a TokenUsage entity by its id.

func (*TokenUsageClient) GetX added in v0.5.0

func (c *TokenUsageClient) GetX(ctx context.Context, id uuid.UUID) *TokenUsage

GetX is like Get, but panics if an error occurs.

func (*TokenUsageClient) Hooks added in v0.5.0

func (c *TokenUsageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TokenUsageClient) Intercept added in v0.5.0

func (c *TokenUsageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tokenusage.Intercept(f(g(h())))`.

func (*TokenUsageClient) Interceptors added in v0.5.0

func (c *TokenUsageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TokenUsageClient) MapCreateBulk added in v0.5.0

func (c *TokenUsageClient) MapCreateBulk(slice any, setFunc func(*TokenUsageCreate, int)) *TokenUsageCreateBulk

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 (*TokenUsageClient) Query added in v0.5.0

func (c *TokenUsageClient) Query() *TokenUsageQuery

Query returns a query builder for TokenUsage.

func (*TokenUsageClient) Update added in v0.5.0

func (c *TokenUsageClient) Update() *TokenUsageUpdate

Update returns an update builder for TokenUsage.

func (*TokenUsageClient) UpdateOne added in v0.5.0

func (c *TokenUsageClient) UpdateOne(_m *TokenUsage) *TokenUsageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TokenUsageClient) UpdateOneID added in v0.5.0

func (c *TokenUsageClient) UpdateOneID(id uuid.UUID) *TokenUsageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TokenUsageClient) Use added in v0.5.0

func (c *TokenUsageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tokenusage.Hooks(f(g(h())))`.

type TokenUsageCreate added in v0.5.0

type TokenUsageCreate struct {
	// contains filtered or unexported fields
}

TokenUsageCreate is the builder for creating a TokenUsage entity.

func (*TokenUsageCreate) Exec added in v0.5.0

func (_c *TokenUsageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUsageCreate) ExecX added in v0.5.0

func (_c *TokenUsageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUsageCreate) Mutation added in v0.5.0

func (_c *TokenUsageCreate) Mutation() *TokenUsageMutation

Mutation returns the TokenUsageMutation object of the builder.

func (*TokenUsageCreate) Save added in v0.5.0

func (_c *TokenUsageCreate) Save(ctx context.Context) (*TokenUsage, error)

Save creates the TokenUsage in the database.

func (*TokenUsageCreate) SaveX added in v0.5.0

func (_c *TokenUsageCreate) SaveX(ctx context.Context) *TokenUsage

SaveX calls Save and panics if Save returns an error.

func (*TokenUsageCreate) SetAgentName added in v0.5.0

func (_c *TokenUsageCreate) SetAgentName(v string) *TokenUsageCreate

SetAgentName sets the "agent_name" field.

func (*TokenUsageCreate) SetCacheTokens added in v0.5.0

func (_c *TokenUsageCreate) SetCacheTokens(v int64) *TokenUsageCreate

SetCacheTokens sets the "cache_tokens" field.

func (*TokenUsageCreate) SetID added in v0.5.0

SetID sets the "id" field.

func (*TokenUsageCreate) SetInputTokens added in v0.5.0

func (_c *TokenUsageCreate) SetInputTokens(v int64) *TokenUsageCreate

SetInputTokens sets the "input_tokens" field.

func (*TokenUsageCreate) SetModel added in v0.5.0

func (_c *TokenUsageCreate) SetModel(v string) *TokenUsageCreate

SetModel sets the "model" field.

func (*TokenUsageCreate) SetNillableAgentName added in v0.5.0

func (_c *TokenUsageCreate) SetNillableAgentName(v *string) *TokenUsageCreate

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*TokenUsageCreate) SetNillableCacheTokens added in v0.5.0

func (_c *TokenUsageCreate) SetNillableCacheTokens(v *int64) *TokenUsageCreate

SetNillableCacheTokens sets the "cache_tokens" field if the given value is not nil.

func (*TokenUsageCreate) SetNillableID added in v0.5.0

func (_c *TokenUsageCreate) SetNillableID(v *uuid.UUID) *TokenUsageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TokenUsageCreate) SetNillableInputTokens added in v0.5.0

func (_c *TokenUsageCreate) SetNillableInputTokens(v *int64) *TokenUsageCreate

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*TokenUsageCreate) SetNillableOutputTokens added in v0.5.0

func (_c *TokenUsageCreate) SetNillableOutputTokens(v *int64) *TokenUsageCreate

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*TokenUsageCreate) SetNillableSessionKey added in v0.5.0

func (_c *TokenUsageCreate) SetNillableSessionKey(v *string) *TokenUsageCreate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*TokenUsageCreate) SetNillableTimestamp added in v0.5.0

func (_c *TokenUsageCreate) SetNillableTimestamp(v *time.Time) *TokenUsageCreate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*TokenUsageCreate) SetNillableTotalTokens added in v0.5.0

func (_c *TokenUsageCreate) SetNillableTotalTokens(v *int64) *TokenUsageCreate

SetNillableTotalTokens sets the "total_tokens" field if the given value is not nil.

func (*TokenUsageCreate) SetOutputTokens added in v0.5.0

func (_c *TokenUsageCreate) SetOutputTokens(v int64) *TokenUsageCreate

SetOutputTokens sets the "output_tokens" field.

func (*TokenUsageCreate) SetProvider added in v0.5.0

func (_c *TokenUsageCreate) SetProvider(v string) *TokenUsageCreate

SetProvider sets the "provider" field.

func (*TokenUsageCreate) SetSessionKey added in v0.5.0

func (_c *TokenUsageCreate) SetSessionKey(v string) *TokenUsageCreate

SetSessionKey sets the "session_key" field.

func (*TokenUsageCreate) SetTimestamp added in v0.5.0

func (_c *TokenUsageCreate) SetTimestamp(v time.Time) *TokenUsageCreate

SetTimestamp sets the "timestamp" field.

func (*TokenUsageCreate) SetTotalTokens added in v0.5.0

func (_c *TokenUsageCreate) SetTotalTokens(v int64) *TokenUsageCreate

SetTotalTokens sets the "total_tokens" field.

type TokenUsageCreateBulk added in v0.5.0

type TokenUsageCreateBulk struct {
	// contains filtered or unexported fields
}

TokenUsageCreateBulk is the builder for creating many TokenUsage entities in bulk.

func (*TokenUsageCreateBulk) Exec added in v0.5.0

func (_c *TokenUsageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUsageCreateBulk) ExecX added in v0.5.0

func (_c *TokenUsageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUsageCreateBulk) Save added in v0.5.0

func (_c *TokenUsageCreateBulk) Save(ctx context.Context) ([]*TokenUsage, error)

Save creates the TokenUsage entities in the database.

func (*TokenUsageCreateBulk) SaveX added in v0.5.0

func (_c *TokenUsageCreateBulk) SaveX(ctx context.Context) []*TokenUsage

SaveX is like Save, but panics if an error occurs.

type TokenUsageDelete added in v0.5.0

type TokenUsageDelete struct {
	// contains filtered or unexported fields
}

TokenUsageDelete is the builder for deleting a TokenUsage entity.

func (*TokenUsageDelete) Exec added in v0.5.0

func (_d *TokenUsageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TokenUsageDelete) ExecX added in v0.5.0

func (_d *TokenUsageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TokenUsageDelete) Where added in v0.5.0

Where appends a list predicates to the TokenUsageDelete builder.

type TokenUsageDeleteOne added in v0.5.0

type TokenUsageDeleteOne struct {
	// contains filtered or unexported fields
}

TokenUsageDeleteOne is the builder for deleting a single TokenUsage entity.

func (*TokenUsageDeleteOne) Exec added in v0.5.0

func (_d *TokenUsageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TokenUsageDeleteOne) ExecX added in v0.5.0

func (_d *TokenUsageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUsageDeleteOne) Where added in v0.5.0

Where appends a list predicates to the TokenUsageDelete builder.

type TokenUsageGroupBy added in v0.5.0

type TokenUsageGroupBy struct {
	// contains filtered or unexported fields
}

TokenUsageGroupBy is the group-by builder for TokenUsage entities.

func (*TokenUsageGroupBy) Aggregate added in v0.5.0

func (_g *TokenUsageGroupBy) Aggregate(fns ...AggregateFunc) *TokenUsageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TokenUsageGroupBy) Bool added in v0.5.0

func (s *TokenUsageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) BoolX added in v0.5.0

func (s *TokenUsageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenUsageGroupBy) Bools added in v0.5.0

func (s *TokenUsageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) BoolsX added in v0.5.0

func (s *TokenUsageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenUsageGroupBy) Float64 added in v0.5.0

func (s *TokenUsageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) Float64X added in v0.5.0

func (s *TokenUsageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenUsageGroupBy) Float64s added in v0.5.0

func (s *TokenUsageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) Float64sX added in v0.5.0

func (s *TokenUsageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenUsageGroupBy) Int added in v0.5.0

func (s *TokenUsageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) IntX added in v0.5.0

func (s *TokenUsageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenUsageGroupBy) Ints added in v0.5.0

func (s *TokenUsageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) IntsX added in v0.5.0

func (s *TokenUsageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenUsageGroupBy) Scan added in v0.5.0

func (_g *TokenUsageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TokenUsageGroupBy) ScanX added in v0.5.0

func (s *TokenUsageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TokenUsageGroupBy) String added in v0.5.0

func (s *TokenUsageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) StringX added in v0.5.0

func (s *TokenUsageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenUsageGroupBy) Strings added in v0.5.0

func (s *TokenUsageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenUsageGroupBy) StringsX added in v0.5.0

func (s *TokenUsageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenUsageMutation added in v0.5.0

type TokenUsageMutation struct {
	// contains filtered or unexported fields
}

TokenUsageMutation represents an operation that mutates the TokenUsage nodes in the graph.

func (*TokenUsageMutation) AddCacheTokens added in v0.5.0

func (m *TokenUsageMutation) AddCacheTokens(i int64)

AddCacheTokens adds i to the "cache_tokens" field.

func (*TokenUsageMutation) AddField added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) AddInputTokens added in v0.5.0

func (m *TokenUsageMutation) AddInputTokens(i int64)

AddInputTokens adds i to the "input_tokens" field.

func (*TokenUsageMutation) AddOutputTokens added in v0.5.0

func (m *TokenUsageMutation) AddOutputTokens(i int64)

AddOutputTokens adds i to the "output_tokens" field.

func (*TokenUsageMutation) AddTotalTokens added in v0.5.0

func (m *TokenUsageMutation) AddTotalTokens(i int64)

AddTotalTokens adds i to the "total_tokens" field.

func (*TokenUsageMutation) AddedCacheTokens added in v0.5.0

func (m *TokenUsageMutation) AddedCacheTokens() (r int64, exists bool)

AddedCacheTokens returns the value that was added to the "cache_tokens" field in this mutation.

func (*TokenUsageMutation) AddedEdges added in v0.5.0

func (m *TokenUsageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TokenUsageMutation) AddedField added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) AddedFields added in v0.5.0

func (m *TokenUsageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TokenUsageMutation) AddedIDs added in v0.5.0

func (m *TokenUsageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TokenUsageMutation) AddedInputTokens added in v0.5.0

func (m *TokenUsageMutation) AddedInputTokens() (r int64, exists bool)

AddedInputTokens returns the value that was added to the "input_tokens" field in this mutation.

func (*TokenUsageMutation) AddedOutputTokens added in v0.5.0

func (m *TokenUsageMutation) AddedOutputTokens() (r int64, exists bool)

AddedOutputTokens returns the value that was added to the "output_tokens" field in this mutation.

func (*TokenUsageMutation) AddedTotalTokens added in v0.5.0

func (m *TokenUsageMutation) AddedTotalTokens() (r int64, exists bool)

AddedTotalTokens returns the value that was added to the "total_tokens" field in this mutation.

func (*TokenUsageMutation) AgentName added in v0.5.0

func (m *TokenUsageMutation) AgentName() (r string, exists bool)

AgentName returns the value of the "agent_name" field in the mutation.

func (*TokenUsageMutation) AgentNameCleared added in v0.5.0

func (m *TokenUsageMutation) AgentNameCleared() bool

AgentNameCleared returns if the "agent_name" field was cleared in this mutation.

func (*TokenUsageMutation) CacheTokens added in v0.5.0

func (m *TokenUsageMutation) CacheTokens() (r int64, exists bool)

CacheTokens returns the value of the "cache_tokens" field in the mutation.

func (*TokenUsageMutation) ClearAgentName added in v0.5.0

func (m *TokenUsageMutation) ClearAgentName()

ClearAgentName clears the value of the "agent_name" field.

func (*TokenUsageMutation) ClearEdge added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) ClearField added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) ClearSessionKey added in v0.5.0

func (m *TokenUsageMutation) ClearSessionKey()

ClearSessionKey clears the value of the "session_key" field.

func (*TokenUsageMutation) ClearedEdges added in v0.5.0

func (m *TokenUsageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TokenUsageMutation) ClearedFields added in v0.5.0

func (m *TokenUsageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TokenUsageMutation) Client added in v0.5.0

func (m TokenUsageMutation) 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 (*TokenUsageMutation) EdgeCleared added in v0.5.0

func (m *TokenUsageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TokenUsageMutation) Field added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) FieldCleared added in v0.5.0

func (m *TokenUsageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TokenUsageMutation) Fields added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) ID added in v0.5.0

func (m *TokenUsageMutation) ID() (id uuid.UUID, 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 (*TokenUsageMutation) IDs added in v0.5.0

func (m *TokenUsageMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*TokenUsageMutation) InputTokens added in v0.5.0

func (m *TokenUsageMutation) InputTokens() (r int64, exists bool)

InputTokens returns the value of the "input_tokens" field in the mutation.

func (*TokenUsageMutation) Model added in v0.5.0

func (m *TokenUsageMutation) Model() (r string, exists bool)

Model returns the value of the "model" field in the mutation.

func (*TokenUsageMutation) OldAgentName added in v0.5.0

func (m *TokenUsageMutation) OldAgentName(ctx context.Context) (v string, err error)

OldAgentName returns the old "agent_name" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldCacheTokens added in v0.5.0

func (m *TokenUsageMutation) OldCacheTokens(ctx context.Context) (v int64, err error)

OldCacheTokens returns the old "cache_tokens" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldField added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) OldInputTokens added in v0.5.0

func (m *TokenUsageMutation) OldInputTokens(ctx context.Context) (v int64, err error)

OldInputTokens returns the old "input_tokens" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldModel added in v0.5.0

func (m *TokenUsageMutation) OldModel(ctx context.Context) (v string, err error)

OldModel returns the old "model" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldOutputTokens added in v0.5.0

func (m *TokenUsageMutation) OldOutputTokens(ctx context.Context) (v int64, err error)

OldOutputTokens returns the old "output_tokens" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldProvider added in v0.5.0

func (m *TokenUsageMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldSessionKey added in v0.5.0

func (m *TokenUsageMutation) OldSessionKey(ctx context.Context) (v string, err error)

OldSessionKey returns the old "session_key" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldTimestamp added in v0.5.0

func (m *TokenUsageMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) OldTotalTokens added in v0.5.0

func (m *TokenUsageMutation) OldTotalTokens(ctx context.Context) (v int64, err error)

OldTotalTokens returns the old "total_tokens" field's value of the TokenUsage entity. If the TokenUsage 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 (*TokenUsageMutation) Op added in v0.5.0

func (m *TokenUsageMutation) Op() Op

Op returns the operation name.

func (*TokenUsageMutation) OutputTokens added in v0.5.0

func (m *TokenUsageMutation) OutputTokens() (r int64, exists bool)

OutputTokens returns the value of the "output_tokens" field in the mutation.

func (*TokenUsageMutation) Provider added in v0.5.0

func (m *TokenUsageMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*TokenUsageMutation) RemovedEdges added in v0.5.0

func (m *TokenUsageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TokenUsageMutation) RemovedIDs added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) ResetAgentName added in v0.5.0

func (m *TokenUsageMutation) ResetAgentName()

ResetAgentName resets all changes to the "agent_name" field.

func (*TokenUsageMutation) ResetCacheTokens added in v0.5.0

func (m *TokenUsageMutation) ResetCacheTokens()

ResetCacheTokens resets all changes to the "cache_tokens" field.

func (*TokenUsageMutation) ResetEdge added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) ResetField added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) ResetInputTokens added in v0.5.0

func (m *TokenUsageMutation) ResetInputTokens()

ResetInputTokens resets all changes to the "input_tokens" field.

func (*TokenUsageMutation) ResetModel added in v0.5.0

func (m *TokenUsageMutation) ResetModel()

ResetModel resets all changes to the "model" field.

func (*TokenUsageMutation) ResetOutputTokens added in v0.5.0

func (m *TokenUsageMutation) ResetOutputTokens()

ResetOutputTokens resets all changes to the "output_tokens" field.

func (*TokenUsageMutation) ResetProvider added in v0.5.0

func (m *TokenUsageMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*TokenUsageMutation) ResetSessionKey added in v0.5.0

func (m *TokenUsageMutation) ResetSessionKey()

ResetSessionKey resets all changes to the "session_key" field.

func (*TokenUsageMutation) ResetTimestamp added in v0.5.0

func (m *TokenUsageMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*TokenUsageMutation) ResetTotalTokens added in v0.5.0

func (m *TokenUsageMutation) ResetTotalTokens()

ResetTotalTokens resets all changes to the "total_tokens" field.

func (*TokenUsageMutation) SessionKey added in v0.5.0

func (m *TokenUsageMutation) SessionKey() (r string, exists bool)

SessionKey returns the value of the "session_key" field in the mutation.

func (*TokenUsageMutation) SessionKeyCleared added in v0.5.0

func (m *TokenUsageMutation) SessionKeyCleared() bool

SessionKeyCleared returns if the "session_key" field was cleared in this mutation.

func (*TokenUsageMutation) SetAgentName added in v0.5.0

func (m *TokenUsageMutation) SetAgentName(s string)

SetAgentName sets the "agent_name" field.

func (*TokenUsageMutation) SetCacheTokens added in v0.5.0

func (m *TokenUsageMutation) SetCacheTokens(i int64)

SetCacheTokens sets the "cache_tokens" field.

func (*TokenUsageMutation) SetField added in v0.5.0

func (m *TokenUsageMutation) 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 (*TokenUsageMutation) SetID added in v0.5.0

func (m *TokenUsageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of TokenUsage entities.

func (*TokenUsageMutation) SetInputTokens added in v0.5.0

func (m *TokenUsageMutation) SetInputTokens(i int64)

SetInputTokens sets the "input_tokens" field.

func (*TokenUsageMutation) SetModel added in v0.5.0

func (m *TokenUsageMutation) SetModel(s string)

SetModel sets the "model" field.

func (*TokenUsageMutation) SetOp added in v0.5.0

func (m *TokenUsageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TokenUsageMutation) SetOutputTokens added in v0.5.0

func (m *TokenUsageMutation) SetOutputTokens(i int64)

SetOutputTokens sets the "output_tokens" field.

func (*TokenUsageMutation) SetProvider added in v0.5.0

func (m *TokenUsageMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*TokenUsageMutation) SetSessionKey added in v0.5.0

func (m *TokenUsageMutation) SetSessionKey(s string)

SetSessionKey sets the "session_key" field.

func (*TokenUsageMutation) SetTimestamp added in v0.5.0

func (m *TokenUsageMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*TokenUsageMutation) SetTotalTokens added in v0.5.0

func (m *TokenUsageMutation) SetTotalTokens(i int64)

SetTotalTokens sets the "total_tokens" field.

func (*TokenUsageMutation) Timestamp added in v0.5.0

func (m *TokenUsageMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*TokenUsageMutation) TotalTokens added in v0.5.0

func (m *TokenUsageMutation) TotalTokens() (r int64, exists bool)

TotalTokens returns the value of the "total_tokens" field in the mutation.

func (TokenUsageMutation) Tx added in v0.5.0

func (m TokenUsageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TokenUsageMutation) Type added in v0.5.0

func (m *TokenUsageMutation) Type() string

Type returns the node type of this mutation (TokenUsage).

func (*TokenUsageMutation) Where added in v0.5.0

func (m *TokenUsageMutation) Where(ps ...predicate.TokenUsage)

Where appends a list predicates to the TokenUsageMutation builder.

func (*TokenUsageMutation) WhereP added in v0.5.0

func (m *TokenUsageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TokenUsageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TokenUsageQuery added in v0.5.0

type TokenUsageQuery struct {
	// contains filtered or unexported fields
}

TokenUsageQuery is the builder for querying TokenUsage entities.

func (*TokenUsageQuery) Aggregate added in v0.5.0

func (_q *TokenUsageQuery) Aggregate(fns ...AggregateFunc) *TokenUsageSelect

Aggregate returns a TokenUsageSelect configured with the given aggregations.

func (*TokenUsageQuery) All added in v0.5.0

func (_q *TokenUsageQuery) All(ctx context.Context) ([]*TokenUsage, error)

All executes the query and returns a list of TokenUsages.

func (*TokenUsageQuery) AllX added in v0.5.0

func (_q *TokenUsageQuery) AllX(ctx context.Context) []*TokenUsage

AllX is like All, but panics if an error occurs.

func (*TokenUsageQuery) Clone added in v0.5.0

func (_q *TokenUsageQuery) Clone() *TokenUsageQuery

Clone returns a duplicate of the TokenUsageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TokenUsageQuery) Count added in v0.5.0

func (_q *TokenUsageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TokenUsageQuery) CountX added in v0.5.0

func (_q *TokenUsageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TokenUsageQuery) Exist added in v0.5.0

func (_q *TokenUsageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TokenUsageQuery) ExistX added in v0.5.0

func (_q *TokenUsageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TokenUsageQuery) First added in v0.5.0

func (_q *TokenUsageQuery) First(ctx context.Context) (*TokenUsage, error)

First returns the first TokenUsage entity from the query. Returns a *NotFoundError when no TokenUsage was found.

func (*TokenUsageQuery) FirstID added in v0.5.0

func (_q *TokenUsageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first TokenUsage ID from the query. Returns a *NotFoundError when no TokenUsage ID was found.

func (*TokenUsageQuery) FirstIDX added in v0.5.0

func (_q *TokenUsageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TokenUsageQuery) FirstX added in v0.5.0

func (_q *TokenUsageQuery) FirstX(ctx context.Context) *TokenUsage

FirstX is like First, but panics if an error occurs.

func (*TokenUsageQuery) GroupBy added in v0.5.0

func (_q *TokenUsageQuery) GroupBy(field string, fields ...string) *TokenUsageGroupBy

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 {
	SessionKey string `json:"session_key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TokenUsage.Query().
	GroupBy(tokenusage.FieldSessionKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TokenUsageQuery) IDs added in v0.5.0

func (_q *TokenUsageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of TokenUsage IDs.

func (*TokenUsageQuery) IDsX added in v0.5.0

func (_q *TokenUsageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TokenUsageQuery) Limit added in v0.5.0

func (_q *TokenUsageQuery) Limit(limit int) *TokenUsageQuery

Limit the number of records to be returned by this query.

func (*TokenUsageQuery) Offset added in v0.5.0

func (_q *TokenUsageQuery) Offset(offset int) *TokenUsageQuery

Offset to start from.

func (*TokenUsageQuery) Only added in v0.5.0

func (_q *TokenUsageQuery) Only(ctx context.Context) (*TokenUsage, error)

Only returns a single TokenUsage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TokenUsage entity is found. Returns a *NotFoundError when no TokenUsage entities are found.

func (*TokenUsageQuery) OnlyID added in v0.5.0

func (_q *TokenUsageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only TokenUsage ID in the query. Returns a *NotSingularError when more than one TokenUsage ID is found. Returns a *NotFoundError when no entities are found.

func (*TokenUsageQuery) OnlyIDX added in v0.5.0

func (_q *TokenUsageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TokenUsageQuery) OnlyX added in v0.5.0

func (_q *TokenUsageQuery) OnlyX(ctx context.Context) *TokenUsage

OnlyX is like Only, but panics if an error occurs.

func (*TokenUsageQuery) Order added in v0.5.0

Order specifies how the records should be ordered.

func (*TokenUsageQuery) Select added in v0.5.0

func (_q *TokenUsageQuery) Select(fields ...string) *TokenUsageSelect

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 {
	SessionKey string `json:"session_key,omitempty"`
}

client.TokenUsage.Query().
	Select(tokenusage.FieldSessionKey).
	Scan(ctx, &v)

func (*TokenUsageQuery) Unique added in v0.5.0

func (_q *TokenUsageQuery) Unique(unique bool) *TokenUsageQuery

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 (*TokenUsageQuery) Where added in v0.5.0

Where adds a new predicate for the TokenUsageQuery builder.

type TokenUsageSelect added in v0.5.0

type TokenUsageSelect struct {
	*TokenUsageQuery
	// contains filtered or unexported fields
}

TokenUsageSelect is the builder for selecting fields of TokenUsage entities.

func (*TokenUsageSelect) Aggregate added in v0.5.0

func (_s *TokenUsageSelect) Aggregate(fns ...AggregateFunc) *TokenUsageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TokenUsageSelect) Bool added in v0.5.0

func (s *TokenUsageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) BoolX added in v0.5.0

func (s *TokenUsageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenUsageSelect) Bools added in v0.5.0

func (s *TokenUsageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) BoolsX added in v0.5.0

func (s *TokenUsageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenUsageSelect) Float64 added in v0.5.0

func (s *TokenUsageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) Float64X added in v0.5.0

func (s *TokenUsageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenUsageSelect) Float64s added in v0.5.0

func (s *TokenUsageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) Float64sX added in v0.5.0

func (s *TokenUsageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenUsageSelect) Int added in v0.5.0

func (s *TokenUsageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) IntX added in v0.5.0

func (s *TokenUsageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenUsageSelect) Ints added in v0.5.0

func (s *TokenUsageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) IntsX added in v0.5.0

func (s *TokenUsageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenUsageSelect) Scan added in v0.5.0

func (_s *TokenUsageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TokenUsageSelect) ScanX added in v0.5.0

func (s *TokenUsageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TokenUsageSelect) String added in v0.5.0

func (s *TokenUsageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) StringX added in v0.5.0

func (s *TokenUsageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenUsageSelect) Strings added in v0.5.0

func (s *TokenUsageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenUsageSelect) StringsX added in v0.5.0

func (s *TokenUsageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenUsageUpdate added in v0.5.0

type TokenUsageUpdate struct {
	// contains filtered or unexported fields
}

TokenUsageUpdate is the builder for updating TokenUsage entities.

func (*TokenUsageUpdate) AddCacheTokens added in v0.5.0

func (_u *TokenUsageUpdate) AddCacheTokens(v int64) *TokenUsageUpdate

AddCacheTokens adds value to the "cache_tokens" field.

func (*TokenUsageUpdate) AddInputTokens added in v0.5.0

func (_u *TokenUsageUpdate) AddInputTokens(v int64) *TokenUsageUpdate

AddInputTokens adds value to the "input_tokens" field.

func (*TokenUsageUpdate) AddOutputTokens added in v0.5.0

func (_u *TokenUsageUpdate) AddOutputTokens(v int64) *TokenUsageUpdate

AddOutputTokens adds value to the "output_tokens" field.

func (*TokenUsageUpdate) AddTotalTokens added in v0.5.0

func (_u *TokenUsageUpdate) AddTotalTokens(v int64) *TokenUsageUpdate

AddTotalTokens adds value to the "total_tokens" field.

func (*TokenUsageUpdate) ClearAgentName added in v0.5.0

func (_u *TokenUsageUpdate) ClearAgentName() *TokenUsageUpdate

ClearAgentName clears the value of the "agent_name" field.

func (*TokenUsageUpdate) ClearSessionKey added in v0.5.0

func (_u *TokenUsageUpdate) ClearSessionKey() *TokenUsageUpdate

ClearSessionKey clears the value of the "session_key" field.

func (*TokenUsageUpdate) Exec added in v0.5.0

func (_u *TokenUsageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUsageUpdate) ExecX added in v0.5.0

func (_u *TokenUsageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUsageUpdate) Mutation added in v0.5.0

func (_u *TokenUsageUpdate) Mutation() *TokenUsageMutation

Mutation returns the TokenUsageMutation object of the builder.

func (*TokenUsageUpdate) Save added in v0.5.0

func (_u *TokenUsageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TokenUsageUpdate) SaveX added in v0.5.0

func (_u *TokenUsageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TokenUsageUpdate) SetAgentName added in v0.5.0

func (_u *TokenUsageUpdate) SetAgentName(v string) *TokenUsageUpdate

SetAgentName sets the "agent_name" field.

func (*TokenUsageUpdate) SetCacheTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetCacheTokens(v int64) *TokenUsageUpdate

SetCacheTokens sets the "cache_tokens" field.

func (*TokenUsageUpdate) SetInputTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetInputTokens(v int64) *TokenUsageUpdate

SetInputTokens sets the "input_tokens" field.

func (*TokenUsageUpdate) SetModel added in v0.5.0

func (_u *TokenUsageUpdate) SetModel(v string) *TokenUsageUpdate

SetModel sets the "model" field.

func (*TokenUsageUpdate) SetNillableAgentName added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableAgentName(v *string) *TokenUsageUpdate

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*TokenUsageUpdate) SetNillableCacheTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableCacheTokens(v *int64) *TokenUsageUpdate

SetNillableCacheTokens sets the "cache_tokens" field if the given value is not nil.

func (*TokenUsageUpdate) SetNillableInputTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableInputTokens(v *int64) *TokenUsageUpdate

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*TokenUsageUpdate) SetNillableModel added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableModel(v *string) *TokenUsageUpdate

SetNillableModel sets the "model" field if the given value is not nil.

func (*TokenUsageUpdate) SetNillableOutputTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableOutputTokens(v *int64) *TokenUsageUpdate

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*TokenUsageUpdate) SetNillableProvider added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableProvider(v *string) *TokenUsageUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*TokenUsageUpdate) SetNillableSessionKey added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableSessionKey(v *string) *TokenUsageUpdate

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*TokenUsageUpdate) SetNillableTotalTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetNillableTotalTokens(v *int64) *TokenUsageUpdate

SetNillableTotalTokens sets the "total_tokens" field if the given value is not nil.

func (*TokenUsageUpdate) SetOutputTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetOutputTokens(v int64) *TokenUsageUpdate

SetOutputTokens sets the "output_tokens" field.

func (*TokenUsageUpdate) SetProvider added in v0.5.0

func (_u *TokenUsageUpdate) SetProvider(v string) *TokenUsageUpdate

SetProvider sets the "provider" field.

func (*TokenUsageUpdate) SetSessionKey added in v0.5.0

func (_u *TokenUsageUpdate) SetSessionKey(v string) *TokenUsageUpdate

SetSessionKey sets the "session_key" field.

func (*TokenUsageUpdate) SetTotalTokens added in v0.5.0

func (_u *TokenUsageUpdate) SetTotalTokens(v int64) *TokenUsageUpdate

SetTotalTokens sets the "total_tokens" field.

func (*TokenUsageUpdate) Where added in v0.5.0

Where appends a list predicates to the TokenUsageUpdate builder.

type TokenUsageUpdateOne added in v0.5.0

type TokenUsageUpdateOne struct {
	// contains filtered or unexported fields
}

TokenUsageUpdateOne is the builder for updating a single TokenUsage entity.

func (*TokenUsageUpdateOne) AddCacheTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) AddCacheTokens(v int64) *TokenUsageUpdateOne

AddCacheTokens adds value to the "cache_tokens" field.

func (*TokenUsageUpdateOne) AddInputTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) AddInputTokens(v int64) *TokenUsageUpdateOne

AddInputTokens adds value to the "input_tokens" field.

func (*TokenUsageUpdateOne) AddOutputTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) AddOutputTokens(v int64) *TokenUsageUpdateOne

AddOutputTokens adds value to the "output_tokens" field.

func (*TokenUsageUpdateOne) AddTotalTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) AddTotalTokens(v int64) *TokenUsageUpdateOne

AddTotalTokens adds value to the "total_tokens" field.

func (*TokenUsageUpdateOne) ClearAgentName added in v0.5.0

func (_u *TokenUsageUpdateOne) ClearAgentName() *TokenUsageUpdateOne

ClearAgentName clears the value of the "agent_name" field.

func (*TokenUsageUpdateOne) ClearSessionKey added in v0.5.0

func (_u *TokenUsageUpdateOne) ClearSessionKey() *TokenUsageUpdateOne

ClearSessionKey clears the value of the "session_key" field.

func (*TokenUsageUpdateOne) Exec added in v0.5.0

func (_u *TokenUsageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TokenUsageUpdateOne) ExecX added in v0.5.0

func (_u *TokenUsageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUsageUpdateOne) Mutation added in v0.5.0

func (_u *TokenUsageUpdateOne) Mutation() *TokenUsageMutation

Mutation returns the TokenUsageMutation object of the builder.

func (*TokenUsageUpdateOne) Save added in v0.5.0

Save executes the query and returns the updated TokenUsage entity.

func (*TokenUsageUpdateOne) SaveX added in v0.5.0

SaveX is like Save, but panics if an error occurs.

func (*TokenUsageUpdateOne) Select added in v0.5.0

func (_u *TokenUsageUpdateOne) Select(field string, fields ...string) *TokenUsageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TokenUsageUpdateOne) SetAgentName added in v0.5.0

func (_u *TokenUsageUpdateOne) SetAgentName(v string) *TokenUsageUpdateOne

SetAgentName sets the "agent_name" field.

func (*TokenUsageUpdateOne) SetCacheTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetCacheTokens(v int64) *TokenUsageUpdateOne

SetCacheTokens sets the "cache_tokens" field.

func (*TokenUsageUpdateOne) SetInputTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetInputTokens(v int64) *TokenUsageUpdateOne

SetInputTokens sets the "input_tokens" field.

func (*TokenUsageUpdateOne) SetModel added in v0.5.0

SetModel sets the "model" field.

func (*TokenUsageUpdateOne) SetNillableAgentName added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableAgentName(v *string) *TokenUsageUpdateOne

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetNillableCacheTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableCacheTokens(v *int64) *TokenUsageUpdateOne

SetNillableCacheTokens sets the "cache_tokens" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetNillableInputTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableInputTokens(v *int64) *TokenUsageUpdateOne

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetNillableModel added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableModel(v *string) *TokenUsageUpdateOne

SetNillableModel sets the "model" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetNillableOutputTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableOutputTokens(v *int64) *TokenUsageUpdateOne

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetNillableProvider added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableProvider(v *string) *TokenUsageUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetNillableSessionKey added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableSessionKey(v *string) *TokenUsageUpdateOne

SetNillableSessionKey sets the "session_key" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetNillableTotalTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetNillableTotalTokens(v *int64) *TokenUsageUpdateOne

SetNillableTotalTokens sets the "total_tokens" field if the given value is not nil.

func (*TokenUsageUpdateOne) SetOutputTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetOutputTokens(v int64) *TokenUsageUpdateOne

SetOutputTokens sets the "output_tokens" field.

func (*TokenUsageUpdateOne) SetProvider added in v0.5.0

func (_u *TokenUsageUpdateOne) SetProvider(v string) *TokenUsageUpdateOne

SetProvider sets the "provider" field.

func (*TokenUsageUpdateOne) SetSessionKey added in v0.5.0

func (_u *TokenUsageUpdateOne) SetSessionKey(v string) *TokenUsageUpdateOne

SetSessionKey sets the "session_key" field.

func (*TokenUsageUpdateOne) SetTotalTokens added in v0.5.0

func (_u *TokenUsageUpdateOne) SetTotalTokens(v int64) *TokenUsageUpdateOne

SetTotalTokens sets the "total_tokens" field.

func (*TokenUsageUpdateOne) Where added in v0.5.0

Where appends a list predicates to the TokenUsageUpdate builder.

type TokenUsages added in v0.5.0

type TokenUsages []*TokenUsage

TokenUsages is a parsable slice of TokenUsage.

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 {

	// AuditLog is the client for interacting with the AuditLog builders.
	AuditLog *AuditLogClient
	// ConfigProfile is the client for interacting with the ConfigProfile builders.
	ConfigProfile *ConfigProfileClient
	// CronJob is the client for interacting with the CronJob builders.
	CronJob *CronJobClient
	// CronJobHistory is the client for interacting with the CronJobHistory builders.
	CronJobHistory *CronJobHistoryClient
	// EscrowDeal is the client for interacting with the EscrowDeal builders.
	EscrowDeal *EscrowDealClient
	// ExternalRef is the client for interacting with the ExternalRef builders.
	ExternalRef *ExternalRefClient
	// Inquiry is the client for interacting with the Inquiry builders.
	Inquiry *InquiryClient
	// Key is the client for interacting with the Key builders.
	Key *KeyClient
	// Knowledge is the client for interacting with the Knowledge builders.
	Knowledge *KnowledgeClient
	// Learning is the client for interacting with the Learning builders.
	Learning *LearningClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Observation is the client for interacting with the Observation builders.
	Observation *ObservationClient
	// PaymentTx is the client for interacting with the PaymentTx builders.
	PaymentTx *PaymentTxClient
	// PeerReputation is the client for interacting with the PeerReputation builders.
	PeerReputation *PeerReputationClient
	// Reflection is the client for interacting with the Reflection builders.
	Reflection *ReflectionClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// TokenUsage is the client for interacting with the TokenUsage builders.
	TokenUsage *TokenUsageClient
	// WorkflowRun is the client for interacting with the WorkflowRun builders.
	WorkflowRun *WorkflowRunClient
	// WorkflowStepRun is the client for interacting with the WorkflowStepRun builders.
	WorkflowStepRun *WorkflowStepRunClient
	// 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.

type WorkflowRun

type WorkflowRun struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name of the workflow being executed
	WorkflowName string `json:"workflow_name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Status holds the value of the "status" field.
	Status workflowrun.Status `json:"status,omitempty"`
	// TotalSteps holds the value of the "total_steps" field.
	TotalSteps int `json:"total_steps,omitempty"`
	// CompletedSteps holds the value of the "completed_steps" field.
	CompletedSteps int `json:"completed_steps,omitempty"`
	// ErrorMessage holds the value of the "error_message" field.
	ErrorMessage string `json:"error_message,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// CompletedAt holds the value of the "completed_at" field.
	CompletedAt *time.Time `json:"completed_at,omitempty"`
	// contains filtered or unexported fields
}

WorkflowRun is the model entity for the WorkflowRun schema.

func (*WorkflowRun) String

func (_m *WorkflowRun) String() string

String implements the fmt.Stringer.

func (*WorkflowRun) Unwrap

func (_m *WorkflowRun) Unwrap() *WorkflowRun

Unwrap unwraps the WorkflowRun 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 (*WorkflowRun) Update

func (_m *WorkflowRun) Update() *WorkflowRunUpdateOne

Update returns a builder for updating this WorkflowRun. Note that you need to call WorkflowRun.Unwrap() before calling this method if this WorkflowRun was returned from a transaction, and the transaction was committed or rolled back.

func (*WorkflowRun) Value

func (_m *WorkflowRun) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WorkflowRun. This includes values selected through modifiers, order, etc.

type WorkflowRunClient

type WorkflowRunClient struct {
	// contains filtered or unexported fields
}

WorkflowRunClient is a client for the WorkflowRun schema.

func NewWorkflowRunClient

func NewWorkflowRunClient(c config) *WorkflowRunClient

NewWorkflowRunClient returns a client for the WorkflowRun from the given config.

func (*WorkflowRunClient) Create

func (c *WorkflowRunClient) Create() *WorkflowRunCreate

Create returns a builder for creating a WorkflowRun entity.

func (*WorkflowRunClient) CreateBulk

func (c *WorkflowRunClient) CreateBulk(builders ...*WorkflowRunCreate) *WorkflowRunCreateBulk

CreateBulk returns a builder for creating a bulk of WorkflowRun entities.

func (*WorkflowRunClient) Delete

func (c *WorkflowRunClient) Delete() *WorkflowRunDelete

Delete returns a delete builder for WorkflowRun.

func (*WorkflowRunClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkflowRunClient) DeleteOneID

func (c *WorkflowRunClient) DeleteOneID(id uuid.UUID) *WorkflowRunDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WorkflowRunClient) Get

Get returns a WorkflowRun entity by its id.

func (*WorkflowRunClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WorkflowRunClient) Hooks

func (c *WorkflowRunClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WorkflowRunClient) Intercept

func (c *WorkflowRunClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `workflowrun.Intercept(f(g(h())))`.

func (*WorkflowRunClient) Interceptors

func (c *WorkflowRunClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WorkflowRunClient) MapCreateBulk

func (c *WorkflowRunClient) MapCreateBulk(slice any, setFunc func(*WorkflowRunCreate, int)) *WorkflowRunCreateBulk

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 (*WorkflowRunClient) Query

func (c *WorkflowRunClient) Query() *WorkflowRunQuery

Query returns a query builder for WorkflowRun.

func (*WorkflowRunClient) Update

func (c *WorkflowRunClient) Update() *WorkflowRunUpdate

Update returns an update builder for WorkflowRun.

func (*WorkflowRunClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkflowRunClient) UpdateOneID

func (c *WorkflowRunClient) UpdateOneID(id uuid.UUID) *WorkflowRunUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WorkflowRunClient) Use

func (c *WorkflowRunClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `workflowrun.Hooks(f(g(h())))`.

type WorkflowRunCreate

type WorkflowRunCreate struct {
	// contains filtered or unexported fields
}

WorkflowRunCreate is the builder for creating a WorkflowRun entity.

func (*WorkflowRunCreate) Exec

func (_c *WorkflowRunCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkflowRunCreate) ExecX

func (_c *WorkflowRunCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowRunCreate) Mutation

func (_c *WorkflowRunCreate) Mutation() *WorkflowRunMutation

Mutation returns the WorkflowRunMutation object of the builder.

func (*WorkflowRunCreate) Save

Save creates the WorkflowRun in the database.

func (*WorkflowRunCreate) SaveX

func (_c *WorkflowRunCreate) SaveX(ctx context.Context) *WorkflowRun

SaveX calls Save and panics if Save returns an error.

func (*WorkflowRunCreate) SetCompletedAt

func (_c *WorkflowRunCreate) SetCompletedAt(v time.Time) *WorkflowRunCreate

SetCompletedAt sets the "completed_at" field.

func (*WorkflowRunCreate) SetCompletedSteps

func (_c *WorkflowRunCreate) SetCompletedSteps(v int) *WorkflowRunCreate

SetCompletedSteps sets the "completed_steps" field.

func (*WorkflowRunCreate) SetDescription

func (_c *WorkflowRunCreate) SetDescription(v string) *WorkflowRunCreate

SetDescription sets the "description" field.

func (*WorkflowRunCreate) SetErrorMessage

func (_c *WorkflowRunCreate) SetErrorMessage(v string) *WorkflowRunCreate

SetErrorMessage sets the "error_message" field.

func (*WorkflowRunCreate) SetID

SetID sets the "id" field.

func (*WorkflowRunCreate) SetNillableCompletedAt

func (_c *WorkflowRunCreate) SetNillableCompletedAt(v *time.Time) *WorkflowRunCreate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*WorkflowRunCreate) SetNillableCompletedSteps

func (_c *WorkflowRunCreate) SetNillableCompletedSteps(v *int) *WorkflowRunCreate

SetNillableCompletedSteps sets the "completed_steps" field if the given value is not nil.

func (*WorkflowRunCreate) SetNillableDescription

func (_c *WorkflowRunCreate) SetNillableDescription(v *string) *WorkflowRunCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WorkflowRunCreate) SetNillableErrorMessage

func (_c *WorkflowRunCreate) SetNillableErrorMessage(v *string) *WorkflowRunCreate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*WorkflowRunCreate) SetNillableID

func (_c *WorkflowRunCreate) SetNillableID(v *uuid.UUID) *WorkflowRunCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*WorkflowRunCreate) SetNillableStartedAt

func (_c *WorkflowRunCreate) SetNillableStartedAt(v *time.Time) *WorkflowRunCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*WorkflowRunCreate) SetNillableStatus

func (_c *WorkflowRunCreate) SetNillableStatus(v *workflowrun.Status) *WorkflowRunCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WorkflowRunCreate) SetNillableTotalSteps

func (_c *WorkflowRunCreate) SetNillableTotalSteps(v *int) *WorkflowRunCreate

SetNillableTotalSteps sets the "total_steps" field if the given value is not nil.

func (*WorkflowRunCreate) SetStartedAt

func (_c *WorkflowRunCreate) SetStartedAt(v time.Time) *WorkflowRunCreate

SetStartedAt sets the "started_at" field.

func (*WorkflowRunCreate) SetStatus

SetStatus sets the "status" field.

func (*WorkflowRunCreate) SetTotalSteps

func (_c *WorkflowRunCreate) SetTotalSteps(v int) *WorkflowRunCreate

SetTotalSteps sets the "total_steps" field.

func (*WorkflowRunCreate) SetWorkflowName

func (_c *WorkflowRunCreate) SetWorkflowName(v string) *WorkflowRunCreate

SetWorkflowName sets the "workflow_name" field.

type WorkflowRunCreateBulk

type WorkflowRunCreateBulk struct {
	// contains filtered or unexported fields
}

WorkflowRunCreateBulk is the builder for creating many WorkflowRun entities in bulk.

func (*WorkflowRunCreateBulk) Exec

Exec executes the query.

func (*WorkflowRunCreateBulk) ExecX

func (_c *WorkflowRunCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowRunCreateBulk) Save

Save creates the WorkflowRun entities in the database.

func (*WorkflowRunCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type WorkflowRunDelete

type WorkflowRunDelete struct {
	// contains filtered or unexported fields
}

WorkflowRunDelete is the builder for deleting a WorkflowRun entity.

func (*WorkflowRunDelete) Exec

func (_d *WorkflowRunDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WorkflowRunDelete) ExecX

func (_d *WorkflowRunDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowRunDelete) Where

Where appends a list predicates to the WorkflowRunDelete builder.

type WorkflowRunDeleteOne

type WorkflowRunDeleteOne struct {
	// contains filtered or unexported fields
}

WorkflowRunDeleteOne is the builder for deleting a single WorkflowRun entity.

func (*WorkflowRunDeleteOne) Exec

func (_d *WorkflowRunDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WorkflowRunDeleteOne) ExecX

func (_d *WorkflowRunDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowRunDeleteOne) Where

Where appends a list predicates to the WorkflowRunDelete builder.

type WorkflowRunGroupBy

type WorkflowRunGroupBy struct {
	// contains filtered or unexported fields
}

WorkflowRunGroupBy is the group-by builder for WorkflowRun entities.

func (*WorkflowRunGroupBy) Aggregate

func (_g *WorkflowRunGroupBy) Aggregate(fns ...AggregateFunc) *WorkflowRunGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*WorkflowRunGroupBy) Bool

func (s *WorkflowRunGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) BoolX

func (s *WorkflowRunGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowRunGroupBy) Bools

func (s *WorkflowRunGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) BoolsX

func (s *WorkflowRunGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowRunGroupBy) Float64

func (s *WorkflowRunGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) Float64X

func (s *WorkflowRunGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowRunGroupBy) Float64s

func (s *WorkflowRunGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) Float64sX

func (s *WorkflowRunGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowRunGroupBy) Int

func (s *WorkflowRunGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) IntX

func (s *WorkflowRunGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowRunGroupBy) Ints

func (s *WorkflowRunGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) IntsX

func (s *WorkflowRunGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowRunGroupBy) Scan

func (_g *WorkflowRunGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowRunGroupBy) ScanX

func (s *WorkflowRunGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowRunGroupBy) String

func (s *WorkflowRunGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) StringX

func (s *WorkflowRunGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowRunGroupBy) Strings

func (s *WorkflowRunGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowRunGroupBy) StringsX

func (s *WorkflowRunGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowRunMutation

type WorkflowRunMutation struct {
	// contains filtered or unexported fields
}

WorkflowRunMutation represents an operation that mutates the WorkflowRun nodes in the graph.

func (*WorkflowRunMutation) AddCompletedSteps

func (m *WorkflowRunMutation) AddCompletedSteps(i int)

AddCompletedSteps adds i to the "completed_steps" field.

func (*WorkflowRunMutation) AddField

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) AddTotalSteps

func (m *WorkflowRunMutation) AddTotalSteps(i int)

AddTotalSteps adds i to the "total_steps" field.

func (*WorkflowRunMutation) AddedCompletedSteps

func (m *WorkflowRunMutation) AddedCompletedSteps() (r int, exists bool)

AddedCompletedSteps returns the value that was added to the "completed_steps" field in this mutation.

func (*WorkflowRunMutation) AddedEdges

func (m *WorkflowRunMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WorkflowRunMutation) AddedField

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) AddedFields

func (m *WorkflowRunMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WorkflowRunMutation) AddedIDs

func (m *WorkflowRunMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WorkflowRunMutation) AddedTotalSteps

func (m *WorkflowRunMutation) AddedTotalSteps() (r int, exists bool)

AddedTotalSteps returns the value that was added to the "total_steps" field in this mutation.

func (*WorkflowRunMutation) ClearCompletedAt

func (m *WorkflowRunMutation) ClearCompletedAt()

ClearCompletedAt clears the value of the "completed_at" field.

func (*WorkflowRunMutation) ClearDescription

func (m *WorkflowRunMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*WorkflowRunMutation) ClearEdge

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) ClearErrorMessage

func (m *WorkflowRunMutation) ClearErrorMessage()

ClearErrorMessage clears the value of the "error_message" field.

func (*WorkflowRunMutation) ClearField

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) ClearedEdges

func (m *WorkflowRunMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WorkflowRunMutation) ClearedFields

func (m *WorkflowRunMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WorkflowRunMutation) Client

func (m WorkflowRunMutation) 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 (*WorkflowRunMutation) CompletedAt

func (m *WorkflowRunMutation) CompletedAt() (r time.Time, exists bool)

CompletedAt returns the value of the "completed_at" field in the mutation.

func (*WorkflowRunMutation) CompletedAtCleared

func (m *WorkflowRunMutation) CompletedAtCleared() bool

CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.

func (*WorkflowRunMutation) CompletedSteps

func (m *WorkflowRunMutation) CompletedSteps() (r int, exists bool)

CompletedSteps returns the value of the "completed_steps" field in the mutation.

func (*WorkflowRunMutation) Description

func (m *WorkflowRunMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*WorkflowRunMutation) DescriptionCleared

func (m *WorkflowRunMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*WorkflowRunMutation) EdgeCleared

func (m *WorkflowRunMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WorkflowRunMutation) ErrorMessage

func (m *WorkflowRunMutation) ErrorMessage() (r string, exists bool)

ErrorMessage returns the value of the "error_message" field in the mutation.

func (*WorkflowRunMutation) ErrorMessageCleared

func (m *WorkflowRunMutation) ErrorMessageCleared() bool

ErrorMessageCleared returns if the "error_message" field was cleared in this mutation.

func (*WorkflowRunMutation) Field

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) FieldCleared

func (m *WorkflowRunMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WorkflowRunMutation) Fields

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) ID

func (m *WorkflowRunMutation) ID() (id uuid.UUID, 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 (*WorkflowRunMutation) IDs

func (m *WorkflowRunMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*WorkflowRunMutation) OldCompletedAt

func (m *WorkflowRunMutation) OldCompletedAt(ctx context.Context) (v *time.Time, err error)

OldCompletedAt returns the old "completed_at" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) OldCompletedSteps

func (m *WorkflowRunMutation) OldCompletedSteps(ctx context.Context) (v int, err error)

OldCompletedSteps returns the old "completed_steps" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) OldDescription

func (m *WorkflowRunMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) OldErrorMessage

func (m *WorkflowRunMutation) OldErrorMessage(ctx context.Context) (v string, err error)

OldErrorMessage returns the old "error_message" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) OldField

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) OldStartedAt

func (m *WorkflowRunMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) OldStatus

func (m *WorkflowRunMutation) OldStatus(ctx context.Context) (v workflowrun.Status, err error)

OldStatus returns the old "status" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) OldTotalSteps

func (m *WorkflowRunMutation) OldTotalSteps(ctx context.Context) (v int, err error)

OldTotalSteps returns the old "total_steps" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) OldWorkflowName

func (m *WorkflowRunMutation) OldWorkflowName(ctx context.Context) (v string, err error)

OldWorkflowName returns the old "workflow_name" field's value of the WorkflowRun entity. If the WorkflowRun 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 (*WorkflowRunMutation) Op

func (m *WorkflowRunMutation) Op() Op

Op returns the operation name.

func (*WorkflowRunMutation) RemovedEdges

func (m *WorkflowRunMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WorkflowRunMutation) RemovedIDs

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) ResetCompletedAt

func (m *WorkflowRunMutation) ResetCompletedAt()

ResetCompletedAt resets all changes to the "completed_at" field.

func (*WorkflowRunMutation) ResetCompletedSteps

func (m *WorkflowRunMutation) ResetCompletedSteps()

ResetCompletedSteps resets all changes to the "completed_steps" field.

func (*WorkflowRunMutation) ResetDescription

func (m *WorkflowRunMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*WorkflowRunMutation) ResetEdge

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) ResetErrorMessage

func (m *WorkflowRunMutation) ResetErrorMessage()

ResetErrorMessage resets all changes to the "error_message" field.

func (*WorkflowRunMutation) ResetField

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) ResetStartedAt

func (m *WorkflowRunMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*WorkflowRunMutation) ResetStatus

func (m *WorkflowRunMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*WorkflowRunMutation) ResetTotalSteps

func (m *WorkflowRunMutation) ResetTotalSteps()

ResetTotalSteps resets all changes to the "total_steps" field.

func (*WorkflowRunMutation) ResetWorkflowName

func (m *WorkflowRunMutation) ResetWorkflowName()

ResetWorkflowName resets all changes to the "workflow_name" field.

func (*WorkflowRunMutation) SetCompletedAt

func (m *WorkflowRunMutation) SetCompletedAt(t time.Time)

SetCompletedAt sets the "completed_at" field.

func (*WorkflowRunMutation) SetCompletedSteps

func (m *WorkflowRunMutation) SetCompletedSteps(i int)

SetCompletedSteps sets the "completed_steps" field.

func (*WorkflowRunMutation) SetDescription

func (m *WorkflowRunMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*WorkflowRunMutation) SetErrorMessage

func (m *WorkflowRunMutation) SetErrorMessage(s string)

SetErrorMessage sets the "error_message" field.

func (*WorkflowRunMutation) SetField

func (m *WorkflowRunMutation) 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 (*WorkflowRunMutation) SetID

func (m *WorkflowRunMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WorkflowRun entities.

func (*WorkflowRunMutation) SetOp

func (m *WorkflowRunMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WorkflowRunMutation) SetStartedAt

func (m *WorkflowRunMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*WorkflowRunMutation) SetStatus

func (m *WorkflowRunMutation) SetStatus(w workflowrun.Status)

SetStatus sets the "status" field.

func (*WorkflowRunMutation) SetTotalSteps

func (m *WorkflowRunMutation) SetTotalSteps(i int)

SetTotalSteps sets the "total_steps" field.

func (*WorkflowRunMutation) SetWorkflowName

func (m *WorkflowRunMutation) SetWorkflowName(s string)

SetWorkflowName sets the "workflow_name" field.

func (*WorkflowRunMutation) StartedAt

func (m *WorkflowRunMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*WorkflowRunMutation) Status

func (m *WorkflowRunMutation) Status() (r workflowrun.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*WorkflowRunMutation) TotalSteps

func (m *WorkflowRunMutation) TotalSteps() (r int, exists bool)

TotalSteps returns the value of the "total_steps" field in the mutation.

func (WorkflowRunMutation) Tx

func (m WorkflowRunMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WorkflowRunMutation) Type

func (m *WorkflowRunMutation) Type() string

Type returns the node type of this mutation (WorkflowRun).

func (*WorkflowRunMutation) Where

func (m *WorkflowRunMutation) Where(ps ...predicate.WorkflowRun)

Where appends a list predicates to the WorkflowRunMutation builder.

func (*WorkflowRunMutation) WhereP

func (m *WorkflowRunMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WorkflowRunMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*WorkflowRunMutation) WorkflowName

func (m *WorkflowRunMutation) WorkflowName() (r string, exists bool)

WorkflowName returns the value of the "workflow_name" field in the mutation.

type WorkflowRunQuery

type WorkflowRunQuery struct {
	// contains filtered or unexported fields
}

WorkflowRunQuery is the builder for querying WorkflowRun entities.

func (*WorkflowRunQuery) Aggregate

func (_q *WorkflowRunQuery) Aggregate(fns ...AggregateFunc) *WorkflowRunSelect

Aggregate returns a WorkflowRunSelect configured with the given aggregations.

func (*WorkflowRunQuery) All

func (_q *WorkflowRunQuery) All(ctx context.Context) ([]*WorkflowRun, error)

All executes the query and returns a list of WorkflowRuns.

func (*WorkflowRunQuery) AllX

func (_q *WorkflowRunQuery) AllX(ctx context.Context) []*WorkflowRun

AllX is like All, but panics if an error occurs.

func (*WorkflowRunQuery) Clone

func (_q *WorkflowRunQuery) Clone() *WorkflowRunQuery

Clone returns a duplicate of the WorkflowRunQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WorkflowRunQuery) Count

func (_q *WorkflowRunQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkflowRunQuery) CountX

func (_q *WorkflowRunQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WorkflowRunQuery) Exist

func (_q *WorkflowRunQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WorkflowRunQuery) ExistX

func (_q *WorkflowRunQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WorkflowRunQuery) First

func (_q *WorkflowRunQuery) First(ctx context.Context) (*WorkflowRun, error)

First returns the first WorkflowRun entity from the query. Returns a *NotFoundError when no WorkflowRun was found.

func (*WorkflowRunQuery) FirstID

func (_q *WorkflowRunQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first WorkflowRun ID from the query. Returns a *NotFoundError when no WorkflowRun ID was found.

func (*WorkflowRunQuery) FirstIDX

func (_q *WorkflowRunQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*WorkflowRunQuery) FirstX

func (_q *WorkflowRunQuery) FirstX(ctx context.Context) *WorkflowRun

FirstX is like First, but panics if an error occurs.

func (*WorkflowRunQuery) GroupBy

func (_q *WorkflowRunQuery) GroupBy(field string, fields ...string) *WorkflowRunGroupBy

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 {
	WorkflowName string `json:"workflow_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.WorkflowRun.Query().
	GroupBy(workflowrun.FieldWorkflowName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WorkflowRunQuery) IDs

func (_q *WorkflowRunQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of WorkflowRun IDs.

func (*WorkflowRunQuery) IDsX

func (_q *WorkflowRunQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*WorkflowRunQuery) Limit

func (_q *WorkflowRunQuery) Limit(limit int) *WorkflowRunQuery

Limit the number of records to be returned by this query.

func (*WorkflowRunQuery) Offset

func (_q *WorkflowRunQuery) Offset(offset int) *WorkflowRunQuery

Offset to start from.

func (*WorkflowRunQuery) Only

func (_q *WorkflowRunQuery) Only(ctx context.Context) (*WorkflowRun, error)

Only returns a single WorkflowRun entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WorkflowRun entity is found. Returns a *NotFoundError when no WorkflowRun entities are found.

func (*WorkflowRunQuery) OnlyID

func (_q *WorkflowRunQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only WorkflowRun ID in the query. Returns a *NotSingularError when more than one WorkflowRun ID is found. Returns a *NotFoundError when no entities are found.

func (*WorkflowRunQuery) OnlyIDX

func (_q *WorkflowRunQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WorkflowRunQuery) OnlyX

func (_q *WorkflowRunQuery) OnlyX(ctx context.Context) *WorkflowRun

OnlyX is like Only, but panics if an error occurs.

func (*WorkflowRunQuery) Order

Order specifies how the records should be ordered.

func (*WorkflowRunQuery) Select

func (_q *WorkflowRunQuery) Select(fields ...string) *WorkflowRunSelect

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 {
	WorkflowName string `json:"workflow_name,omitempty"`
}

client.WorkflowRun.Query().
	Select(workflowrun.FieldWorkflowName).
	Scan(ctx, &v)

func (*WorkflowRunQuery) Unique

func (_q *WorkflowRunQuery) Unique(unique bool) *WorkflowRunQuery

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 (*WorkflowRunQuery) Where

Where adds a new predicate for the WorkflowRunQuery builder.

type WorkflowRunSelect

type WorkflowRunSelect struct {
	*WorkflowRunQuery
	// contains filtered or unexported fields
}

WorkflowRunSelect is the builder for selecting fields of WorkflowRun entities.

func (*WorkflowRunSelect) Aggregate

func (_s *WorkflowRunSelect) Aggregate(fns ...AggregateFunc) *WorkflowRunSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WorkflowRunSelect) Bool

func (s *WorkflowRunSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) BoolX

func (s *WorkflowRunSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowRunSelect) Bools

func (s *WorkflowRunSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) BoolsX

func (s *WorkflowRunSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowRunSelect) Float64

func (s *WorkflowRunSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) Float64X

func (s *WorkflowRunSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowRunSelect) Float64s

func (s *WorkflowRunSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) Float64sX

func (s *WorkflowRunSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowRunSelect) Int

func (s *WorkflowRunSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) IntX

func (s *WorkflowRunSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowRunSelect) Ints

func (s *WorkflowRunSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) IntsX

func (s *WorkflowRunSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowRunSelect) Scan

func (_s *WorkflowRunSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowRunSelect) ScanX

func (s *WorkflowRunSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowRunSelect) String

func (s *WorkflowRunSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) StringX

func (s *WorkflowRunSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowRunSelect) Strings

func (s *WorkflowRunSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowRunSelect) StringsX

func (s *WorkflowRunSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowRunUpdate

type WorkflowRunUpdate struct {
	// contains filtered or unexported fields
}

WorkflowRunUpdate is the builder for updating WorkflowRun entities.

func (*WorkflowRunUpdate) AddCompletedSteps

func (_u *WorkflowRunUpdate) AddCompletedSteps(v int) *WorkflowRunUpdate

AddCompletedSteps adds value to the "completed_steps" field.

func (*WorkflowRunUpdate) AddTotalSteps

func (_u *WorkflowRunUpdate) AddTotalSteps(v int) *WorkflowRunUpdate

AddTotalSteps adds value to the "total_steps" field.

func (*WorkflowRunUpdate) ClearCompletedAt

func (_u *WorkflowRunUpdate) ClearCompletedAt() *WorkflowRunUpdate

ClearCompletedAt clears the value of the "completed_at" field.

func (*WorkflowRunUpdate) ClearDescription

func (_u *WorkflowRunUpdate) ClearDescription() *WorkflowRunUpdate

ClearDescription clears the value of the "description" field.

func (*WorkflowRunUpdate) ClearErrorMessage

func (_u *WorkflowRunUpdate) ClearErrorMessage() *WorkflowRunUpdate

ClearErrorMessage clears the value of the "error_message" field.

func (*WorkflowRunUpdate) Exec

func (_u *WorkflowRunUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkflowRunUpdate) ExecX

func (_u *WorkflowRunUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowRunUpdate) Mutation

func (_u *WorkflowRunUpdate) Mutation() *WorkflowRunMutation

Mutation returns the WorkflowRunMutation object of the builder.

func (*WorkflowRunUpdate) Save

func (_u *WorkflowRunUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WorkflowRunUpdate) SaveX

func (_u *WorkflowRunUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WorkflowRunUpdate) SetCompletedAt

func (_u *WorkflowRunUpdate) SetCompletedAt(v time.Time) *WorkflowRunUpdate

SetCompletedAt sets the "completed_at" field.

func (*WorkflowRunUpdate) SetCompletedSteps

func (_u *WorkflowRunUpdate) SetCompletedSteps(v int) *WorkflowRunUpdate

SetCompletedSteps sets the "completed_steps" field.

func (*WorkflowRunUpdate) SetDescription

func (_u *WorkflowRunUpdate) SetDescription(v string) *WorkflowRunUpdate

SetDescription sets the "description" field.

func (*WorkflowRunUpdate) SetErrorMessage

func (_u *WorkflowRunUpdate) SetErrorMessage(v string) *WorkflowRunUpdate

SetErrorMessage sets the "error_message" field.

func (*WorkflowRunUpdate) SetNillableCompletedAt

func (_u *WorkflowRunUpdate) SetNillableCompletedAt(v *time.Time) *WorkflowRunUpdate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*WorkflowRunUpdate) SetNillableCompletedSteps

func (_u *WorkflowRunUpdate) SetNillableCompletedSteps(v *int) *WorkflowRunUpdate

SetNillableCompletedSteps sets the "completed_steps" field if the given value is not nil.

func (*WorkflowRunUpdate) SetNillableDescription

func (_u *WorkflowRunUpdate) SetNillableDescription(v *string) *WorkflowRunUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WorkflowRunUpdate) SetNillableErrorMessage

func (_u *WorkflowRunUpdate) SetNillableErrorMessage(v *string) *WorkflowRunUpdate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*WorkflowRunUpdate) SetNillableStatus

func (_u *WorkflowRunUpdate) SetNillableStatus(v *workflowrun.Status) *WorkflowRunUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WorkflowRunUpdate) SetNillableTotalSteps

func (_u *WorkflowRunUpdate) SetNillableTotalSteps(v *int) *WorkflowRunUpdate

SetNillableTotalSteps sets the "total_steps" field if the given value is not nil.

func (*WorkflowRunUpdate) SetNillableWorkflowName

func (_u *WorkflowRunUpdate) SetNillableWorkflowName(v *string) *WorkflowRunUpdate

SetNillableWorkflowName sets the "workflow_name" field if the given value is not nil.

func (*WorkflowRunUpdate) SetStatus

SetStatus sets the "status" field.

func (*WorkflowRunUpdate) SetTotalSteps

func (_u *WorkflowRunUpdate) SetTotalSteps(v int) *WorkflowRunUpdate

SetTotalSteps sets the "total_steps" field.

func (*WorkflowRunUpdate) SetWorkflowName

func (_u *WorkflowRunUpdate) SetWorkflowName(v string) *WorkflowRunUpdate

SetWorkflowName sets the "workflow_name" field.

func (*WorkflowRunUpdate) Where

Where appends a list predicates to the WorkflowRunUpdate builder.

type WorkflowRunUpdateOne

type WorkflowRunUpdateOne struct {
	// contains filtered or unexported fields
}

WorkflowRunUpdateOne is the builder for updating a single WorkflowRun entity.

func (*WorkflowRunUpdateOne) AddCompletedSteps

func (_u *WorkflowRunUpdateOne) AddCompletedSteps(v int) *WorkflowRunUpdateOne

AddCompletedSteps adds value to the "completed_steps" field.

func (*WorkflowRunUpdateOne) AddTotalSteps

func (_u *WorkflowRunUpdateOne) AddTotalSteps(v int) *WorkflowRunUpdateOne

AddTotalSteps adds value to the "total_steps" field.

func (*WorkflowRunUpdateOne) ClearCompletedAt

func (_u *WorkflowRunUpdateOne) ClearCompletedAt() *WorkflowRunUpdateOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*WorkflowRunUpdateOne) ClearDescription

func (_u *WorkflowRunUpdateOne) ClearDescription() *WorkflowRunUpdateOne

ClearDescription clears the value of the "description" field.

func (*WorkflowRunUpdateOne) ClearErrorMessage

func (_u *WorkflowRunUpdateOne) ClearErrorMessage() *WorkflowRunUpdateOne

ClearErrorMessage clears the value of the "error_message" field.

func (*WorkflowRunUpdateOne) Exec

func (_u *WorkflowRunUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WorkflowRunUpdateOne) ExecX

func (_u *WorkflowRunUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowRunUpdateOne) Mutation

func (_u *WorkflowRunUpdateOne) Mutation() *WorkflowRunMutation

Mutation returns the WorkflowRunMutation object of the builder.

func (*WorkflowRunUpdateOne) Save

Save executes the query and returns the updated WorkflowRun entity.

func (*WorkflowRunUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WorkflowRunUpdateOne) Select

func (_u *WorkflowRunUpdateOne) Select(field string, fields ...string) *WorkflowRunUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WorkflowRunUpdateOne) SetCompletedAt

func (_u *WorkflowRunUpdateOne) SetCompletedAt(v time.Time) *WorkflowRunUpdateOne

SetCompletedAt sets the "completed_at" field.

func (*WorkflowRunUpdateOne) SetCompletedSteps

func (_u *WorkflowRunUpdateOne) SetCompletedSteps(v int) *WorkflowRunUpdateOne

SetCompletedSteps sets the "completed_steps" field.

func (*WorkflowRunUpdateOne) SetDescription

func (_u *WorkflowRunUpdateOne) SetDescription(v string) *WorkflowRunUpdateOne

SetDescription sets the "description" field.

func (*WorkflowRunUpdateOne) SetErrorMessage

func (_u *WorkflowRunUpdateOne) SetErrorMessage(v string) *WorkflowRunUpdateOne

SetErrorMessage sets the "error_message" field.

func (*WorkflowRunUpdateOne) SetNillableCompletedAt

func (_u *WorkflowRunUpdateOne) SetNillableCompletedAt(v *time.Time) *WorkflowRunUpdateOne

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*WorkflowRunUpdateOne) SetNillableCompletedSteps

func (_u *WorkflowRunUpdateOne) SetNillableCompletedSteps(v *int) *WorkflowRunUpdateOne

SetNillableCompletedSteps sets the "completed_steps" field if the given value is not nil.

func (*WorkflowRunUpdateOne) SetNillableDescription

func (_u *WorkflowRunUpdateOne) SetNillableDescription(v *string) *WorkflowRunUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WorkflowRunUpdateOne) SetNillableErrorMessage

func (_u *WorkflowRunUpdateOne) SetNillableErrorMessage(v *string) *WorkflowRunUpdateOne

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*WorkflowRunUpdateOne) SetNillableStatus

func (_u *WorkflowRunUpdateOne) SetNillableStatus(v *workflowrun.Status) *WorkflowRunUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WorkflowRunUpdateOne) SetNillableTotalSteps

func (_u *WorkflowRunUpdateOne) SetNillableTotalSteps(v *int) *WorkflowRunUpdateOne

SetNillableTotalSteps sets the "total_steps" field if the given value is not nil.

func (*WorkflowRunUpdateOne) SetNillableWorkflowName

func (_u *WorkflowRunUpdateOne) SetNillableWorkflowName(v *string) *WorkflowRunUpdateOne

SetNillableWorkflowName sets the "workflow_name" field if the given value is not nil.

func (*WorkflowRunUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*WorkflowRunUpdateOne) SetTotalSteps

func (_u *WorkflowRunUpdateOne) SetTotalSteps(v int) *WorkflowRunUpdateOne

SetTotalSteps sets the "total_steps" field.

func (*WorkflowRunUpdateOne) SetWorkflowName

func (_u *WorkflowRunUpdateOne) SetWorkflowName(v string) *WorkflowRunUpdateOne

SetWorkflowName sets the "workflow_name" field.

func (*WorkflowRunUpdateOne) Where

Where appends a list predicates to the WorkflowRunUpdate builder.

type WorkflowRuns

type WorkflowRuns []*WorkflowRun

WorkflowRuns is a parsable slice of WorkflowRun.

type WorkflowStepRun

type WorkflowStepRun struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Reference to the parent WorkflowRun
	RunID uuid.UUID `json:"run_id,omitempty"`
	// Step identifier within the workflow YAML
	StepID string `json:"step_id,omitempty"`
	// Sub-agent that executed this step
	Agent string `json:"agent,omitempty"`
	// Rendered prompt (after template substitution)
	Prompt string `json:"prompt,omitempty"`
	// Status holds the value of the "status" field.
	Status workflowsteprun.Status `json:"status,omitempty"`
	// Step output/result
	Result string `json:"result,omitempty"`
	// ErrorMessage holds the value of the "error_message" field.
	ErrorMessage string `json:"error_message,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt *time.Time `json:"started_at,omitempty"`
	// CompletedAt holds the value of the "completed_at" field.
	CompletedAt *time.Time `json:"completed_at,omitempty"`
	// contains filtered or unexported fields
}

WorkflowStepRun is the model entity for the WorkflowStepRun schema.

func (*WorkflowStepRun) String

func (_m *WorkflowStepRun) String() string

String implements the fmt.Stringer.

func (*WorkflowStepRun) Unwrap

func (_m *WorkflowStepRun) Unwrap() *WorkflowStepRun

Unwrap unwraps the WorkflowStepRun 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 (*WorkflowStepRun) Update

Update returns a builder for updating this WorkflowStepRun. Note that you need to call WorkflowStepRun.Unwrap() before calling this method if this WorkflowStepRun was returned from a transaction, and the transaction was committed or rolled back.

func (*WorkflowStepRun) Value

func (_m *WorkflowStepRun) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WorkflowStepRun. This includes values selected through modifiers, order, etc.

type WorkflowStepRunClient

type WorkflowStepRunClient struct {
	// contains filtered or unexported fields
}

WorkflowStepRunClient is a client for the WorkflowStepRun schema.

func NewWorkflowStepRunClient

func NewWorkflowStepRunClient(c config) *WorkflowStepRunClient

NewWorkflowStepRunClient returns a client for the WorkflowStepRun from the given config.

func (*WorkflowStepRunClient) Create

Create returns a builder for creating a WorkflowStepRun entity.

func (*WorkflowStepRunClient) CreateBulk

CreateBulk returns a builder for creating a bulk of WorkflowStepRun entities.

func (*WorkflowStepRunClient) Delete

Delete returns a delete builder for WorkflowStepRun.

func (*WorkflowStepRunClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkflowStepRunClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WorkflowStepRunClient) Get

Get returns a WorkflowStepRun entity by its id.

func (*WorkflowStepRunClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WorkflowStepRunClient) Hooks

func (c *WorkflowStepRunClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WorkflowStepRunClient) Intercept

func (c *WorkflowStepRunClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `workflowsteprun.Intercept(f(g(h())))`.

func (*WorkflowStepRunClient) Interceptors

func (c *WorkflowStepRunClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WorkflowStepRunClient) MapCreateBulk

func (c *WorkflowStepRunClient) MapCreateBulk(slice any, setFunc func(*WorkflowStepRunCreate, int)) *WorkflowStepRunCreateBulk

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 (*WorkflowStepRunClient) Query

Query returns a query builder for WorkflowStepRun.

func (*WorkflowStepRunClient) Update

Update returns an update builder for WorkflowStepRun.

func (*WorkflowStepRunClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkflowStepRunClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*WorkflowStepRunClient) Use

func (c *WorkflowStepRunClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `workflowsteprun.Hooks(f(g(h())))`.

type WorkflowStepRunCreate

type WorkflowStepRunCreate struct {
	// contains filtered or unexported fields
}

WorkflowStepRunCreate is the builder for creating a WorkflowStepRun entity.

func (*WorkflowStepRunCreate) Exec

Exec executes the query.

func (*WorkflowStepRunCreate) ExecX

func (_c *WorkflowStepRunCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStepRunCreate) Mutation

Mutation returns the WorkflowStepRunMutation object of the builder.

func (*WorkflowStepRunCreate) Save

Save creates the WorkflowStepRun in the database.

func (*WorkflowStepRunCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WorkflowStepRunCreate) SetAgent

SetAgent sets the "agent" field.

func (*WorkflowStepRunCreate) SetCompletedAt

func (_c *WorkflowStepRunCreate) SetCompletedAt(v time.Time) *WorkflowStepRunCreate

SetCompletedAt sets the "completed_at" field.

func (*WorkflowStepRunCreate) SetErrorMessage

func (_c *WorkflowStepRunCreate) SetErrorMessage(v string) *WorkflowStepRunCreate

SetErrorMessage sets the "error_message" field.

func (*WorkflowStepRunCreate) SetID

SetID sets the "id" field.

func (*WorkflowStepRunCreate) SetNillableAgent

func (_c *WorkflowStepRunCreate) SetNillableAgent(v *string) *WorkflowStepRunCreate

SetNillableAgent sets the "agent" field if the given value is not nil.

func (*WorkflowStepRunCreate) SetNillableCompletedAt

func (_c *WorkflowStepRunCreate) SetNillableCompletedAt(v *time.Time) *WorkflowStepRunCreate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*WorkflowStepRunCreate) SetNillableErrorMessage

func (_c *WorkflowStepRunCreate) SetNillableErrorMessage(v *string) *WorkflowStepRunCreate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*WorkflowStepRunCreate) SetNillableID

func (_c *WorkflowStepRunCreate) SetNillableID(v *uuid.UUID) *WorkflowStepRunCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*WorkflowStepRunCreate) SetNillableResult

func (_c *WorkflowStepRunCreate) SetNillableResult(v *string) *WorkflowStepRunCreate

SetNillableResult sets the "result" field if the given value is not nil.

func (*WorkflowStepRunCreate) SetNillableStartedAt

func (_c *WorkflowStepRunCreate) SetNillableStartedAt(v *time.Time) *WorkflowStepRunCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*WorkflowStepRunCreate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WorkflowStepRunCreate) SetPrompt

SetPrompt sets the "prompt" field.

func (*WorkflowStepRunCreate) SetResult

SetResult sets the "result" field.

func (*WorkflowStepRunCreate) SetRunID

SetRunID sets the "run_id" field.

func (*WorkflowStepRunCreate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*WorkflowStepRunCreate) SetStatus

SetStatus sets the "status" field.

func (*WorkflowStepRunCreate) SetStepID

SetStepID sets the "step_id" field.

type WorkflowStepRunCreateBulk

type WorkflowStepRunCreateBulk struct {
	// contains filtered or unexported fields
}

WorkflowStepRunCreateBulk is the builder for creating many WorkflowStepRun entities in bulk.

func (*WorkflowStepRunCreateBulk) Exec

Exec executes the query.

func (*WorkflowStepRunCreateBulk) ExecX

func (_c *WorkflowStepRunCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStepRunCreateBulk) Save

Save creates the WorkflowStepRun entities in the database.

func (*WorkflowStepRunCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type WorkflowStepRunDelete

type WorkflowStepRunDelete struct {
	// contains filtered or unexported fields
}

WorkflowStepRunDelete is the builder for deleting a WorkflowStepRun entity.

func (*WorkflowStepRunDelete) Exec

func (_d *WorkflowStepRunDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WorkflowStepRunDelete) ExecX

func (_d *WorkflowStepRunDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStepRunDelete) Where

Where appends a list predicates to the WorkflowStepRunDelete builder.

type WorkflowStepRunDeleteOne

type WorkflowStepRunDeleteOne struct {
	// contains filtered or unexported fields
}

WorkflowStepRunDeleteOne is the builder for deleting a single WorkflowStepRun entity.

func (*WorkflowStepRunDeleteOne) Exec

Exec executes the deletion query.

func (*WorkflowStepRunDeleteOne) ExecX

func (_d *WorkflowStepRunDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStepRunDeleteOne) Where

Where appends a list predicates to the WorkflowStepRunDelete builder.

type WorkflowStepRunGroupBy

type WorkflowStepRunGroupBy struct {
	// contains filtered or unexported fields
}

WorkflowStepRunGroupBy is the group-by builder for WorkflowStepRun entities.

func (*WorkflowStepRunGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*WorkflowStepRunGroupBy) Bool

func (s *WorkflowStepRunGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) BoolX

func (s *WorkflowStepRunGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) Bools

func (s *WorkflowStepRunGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) BoolsX

func (s *WorkflowStepRunGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) Float64

func (s *WorkflowStepRunGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) Float64X

func (s *WorkflowStepRunGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) Float64s

func (s *WorkflowStepRunGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) Float64sX

func (s *WorkflowStepRunGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) Int

func (s *WorkflowStepRunGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) IntX

func (s *WorkflowStepRunGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) Ints

func (s *WorkflowStepRunGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) IntsX

func (s *WorkflowStepRunGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) Scan

func (_g *WorkflowStepRunGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowStepRunGroupBy) ScanX

func (s *WorkflowStepRunGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) String

func (s *WorkflowStepRunGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) StringX

func (s *WorkflowStepRunGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowStepRunGroupBy) Strings

func (s *WorkflowStepRunGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunGroupBy) StringsX

func (s *WorkflowStepRunGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowStepRunMutation

type WorkflowStepRunMutation struct {
	// contains filtered or unexported fields
}

WorkflowStepRunMutation represents an operation that mutates the WorkflowStepRun nodes in the graph.

func (*WorkflowStepRunMutation) AddField

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) AddedEdges

func (m *WorkflowStepRunMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WorkflowStepRunMutation) AddedField

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) AddedFields

func (m *WorkflowStepRunMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WorkflowStepRunMutation) AddedIDs

func (m *WorkflowStepRunMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WorkflowStepRunMutation) Agent

func (m *WorkflowStepRunMutation) Agent() (r string, exists bool)

Agent returns the value of the "agent" field in the mutation.

func (*WorkflowStepRunMutation) AgentCleared

func (m *WorkflowStepRunMutation) AgentCleared() bool

AgentCleared returns if the "agent" field was cleared in this mutation.

func (*WorkflowStepRunMutation) ClearAgent

func (m *WorkflowStepRunMutation) ClearAgent()

ClearAgent clears the value of the "agent" field.

func (*WorkflowStepRunMutation) ClearCompletedAt

func (m *WorkflowStepRunMutation) ClearCompletedAt()

ClearCompletedAt clears the value of the "completed_at" field.

func (*WorkflowStepRunMutation) ClearEdge

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) ClearErrorMessage

func (m *WorkflowStepRunMutation) ClearErrorMessage()

ClearErrorMessage clears the value of the "error_message" field.

func (*WorkflowStepRunMutation) ClearField

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) ClearResult

func (m *WorkflowStepRunMutation) ClearResult()

ClearResult clears the value of the "result" field.

func (*WorkflowStepRunMutation) ClearStartedAt

func (m *WorkflowStepRunMutation) ClearStartedAt()

ClearStartedAt clears the value of the "started_at" field.

func (*WorkflowStepRunMutation) ClearedEdges

func (m *WorkflowStepRunMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WorkflowStepRunMutation) ClearedFields

func (m *WorkflowStepRunMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WorkflowStepRunMutation) Client

func (m WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) CompletedAt

func (m *WorkflowStepRunMutation) CompletedAt() (r time.Time, exists bool)

CompletedAt returns the value of the "completed_at" field in the mutation.

func (*WorkflowStepRunMutation) CompletedAtCleared

func (m *WorkflowStepRunMutation) CompletedAtCleared() bool

CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.

func (*WorkflowStepRunMutation) EdgeCleared

func (m *WorkflowStepRunMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WorkflowStepRunMutation) ErrorMessage

func (m *WorkflowStepRunMutation) ErrorMessage() (r string, exists bool)

ErrorMessage returns the value of the "error_message" field in the mutation.

func (*WorkflowStepRunMutation) ErrorMessageCleared

func (m *WorkflowStepRunMutation) ErrorMessageCleared() bool

ErrorMessageCleared returns if the "error_message" field was cleared in this mutation.

func (*WorkflowStepRunMutation) Field

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) FieldCleared

func (m *WorkflowStepRunMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WorkflowStepRunMutation) Fields

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) ID

func (m *WorkflowStepRunMutation) ID() (id uuid.UUID, 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 (*WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) OldAgent

func (m *WorkflowStepRunMutation) OldAgent(ctx context.Context) (v string, err error)

OldAgent returns the old "agent" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldCompletedAt

func (m *WorkflowStepRunMutation) OldCompletedAt(ctx context.Context) (v *time.Time, err error)

OldCompletedAt returns the old "completed_at" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldErrorMessage

func (m *WorkflowStepRunMutation) OldErrorMessage(ctx context.Context) (v string, err error)

OldErrorMessage returns the old "error_message" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldField

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) OldPrompt

func (m *WorkflowStepRunMutation) OldPrompt(ctx context.Context) (v string, err error)

OldPrompt returns the old "prompt" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldResult

func (m *WorkflowStepRunMutation) OldResult(ctx context.Context) (v string, err error)

OldResult returns the old "result" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldRunID

func (m *WorkflowStepRunMutation) OldRunID(ctx context.Context) (v uuid.UUID, err error)

OldRunID returns the old "run_id" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldStartedAt

func (m *WorkflowStepRunMutation) OldStartedAt(ctx context.Context) (v *time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldStatus

OldStatus returns the old "status" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) OldStepID

func (m *WorkflowStepRunMutation) OldStepID(ctx context.Context) (v string, err error)

OldStepID returns the old "step_id" field's value of the WorkflowStepRun entity. If the WorkflowStepRun 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 (*WorkflowStepRunMutation) Op

func (m *WorkflowStepRunMutation) Op() Op

Op returns the operation name.

func (*WorkflowStepRunMutation) Prompt

func (m *WorkflowStepRunMutation) Prompt() (r string, exists bool)

Prompt returns the value of the "prompt" field in the mutation.

func (*WorkflowStepRunMutation) RemovedEdges

func (m *WorkflowStepRunMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WorkflowStepRunMutation) RemovedIDs

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) ResetAgent

func (m *WorkflowStepRunMutation) ResetAgent()

ResetAgent resets all changes to the "agent" field.

func (*WorkflowStepRunMutation) ResetCompletedAt

func (m *WorkflowStepRunMutation) ResetCompletedAt()

ResetCompletedAt resets all changes to the "completed_at" field.

func (*WorkflowStepRunMutation) ResetEdge

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) ResetErrorMessage

func (m *WorkflowStepRunMutation) ResetErrorMessage()

ResetErrorMessage resets all changes to the "error_message" field.

func (*WorkflowStepRunMutation) ResetField

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) ResetPrompt

func (m *WorkflowStepRunMutation) ResetPrompt()

ResetPrompt resets all changes to the "prompt" field.

func (*WorkflowStepRunMutation) ResetResult

func (m *WorkflowStepRunMutation) ResetResult()

ResetResult resets all changes to the "result" field.

func (*WorkflowStepRunMutation) ResetRunID

func (m *WorkflowStepRunMutation) ResetRunID()

ResetRunID resets all changes to the "run_id" field.

func (*WorkflowStepRunMutation) ResetStartedAt

func (m *WorkflowStepRunMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*WorkflowStepRunMutation) ResetStatus

func (m *WorkflowStepRunMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*WorkflowStepRunMutation) ResetStepID

func (m *WorkflowStepRunMutation) ResetStepID()

ResetStepID resets all changes to the "step_id" field.

func (*WorkflowStepRunMutation) Result

func (m *WorkflowStepRunMutation) Result() (r string, exists bool)

Result returns the value of the "result" field in the mutation.

func (*WorkflowStepRunMutation) ResultCleared

func (m *WorkflowStepRunMutation) ResultCleared() bool

ResultCleared returns if the "result" field was cleared in this mutation.

func (*WorkflowStepRunMutation) RunID

func (m *WorkflowStepRunMutation) RunID() (r uuid.UUID, exists bool)

RunID returns the value of the "run_id" field in the mutation.

func (*WorkflowStepRunMutation) SetAgent

func (m *WorkflowStepRunMutation) SetAgent(s string)

SetAgent sets the "agent" field.

func (*WorkflowStepRunMutation) SetCompletedAt

func (m *WorkflowStepRunMutation) SetCompletedAt(t time.Time)

SetCompletedAt sets the "completed_at" field.

func (*WorkflowStepRunMutation) SetErrorMessage

func (m *WorkflowStepRunMutation) SetErrorMessage(s string)

SetErrorMessage sets the "error_message" field.

func (*WorkflowStepRunMutation) SetField

func (m *WorkflowStepRunMutation) 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 (*WorkflowStepRunMutation) SetID

func (m *WorkflowStepRunMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WorkflowStepRun entities.

func (*WorkflowStepRunMutation) SetOp

func (m *WorkflowStepRunMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WorkflowStepRunMutation) SetPrompt

func (m *WorkflowStepRunMutation) SetPrompt(s string)

SetPrompt sets the "prompt" field.

func (*WorkflowStepRunMutation) SetResult

func (m *WorkflowStepRunMutation) SetResult(s string)

SetResult sets the "result" field.

func (*WorkflowStepRunMutation) SetRunID

func (m *WorkflowStepRunMutation) SetRunID(u uuid.UUID)

SetRunID sets the "run_id" field.

func (*WorkflowStepRunMutation) SetStartedAt

func (m *WorkflowStepRunMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*WorkflowStepRunMutation) SetStatus

SetStatus sets the "status" field.

func (*WorkflowStepRunMutation) SetStepID

func (m *WorkflowStepRunMutation) SetStepID(s string)

SetStepID sets the "step_id" field.

func (*WorkflowStepRunMutation) StartedAt

func (m *WorkflowStepRunMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*WorkflowStepRunMutation) StartedAtCleared

func (m *WorkflowStepRunMutation) StartedAtCleared() bool

StartedAtCleared returns if the "started_at" field was cleared in this mutation.

func (*WorkflowStepRunMutation) Status

func (m *WorkflowStepRunMutation) Status() (r workflowsteprun.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*WorkflowStepRunMutation) StepID

func (m *WorkflowStepRunMutation) StepID() (r string, exists bool)

StepID returns the value of the "step_id" field in the mutation.

func (WorkflowStepRunMutation) Tx

func (m WorkflowStepRunMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WorkflowStepRunMutation) Type

func (m *WorkflowStepRunMutation) Type() string

Type returns the node type of this mutation (WorkflowStepRun).

func (*WorkflowStepRunMutation) Where

Where appends a list predicates to the WorkflowStepRunMutation builder.

func (*WorkflowStepRunMutation) WhereP

func (m *WorkflowStepRunMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WorkflowStepRunMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WorkflowStepRunQuery

type WorkflowStepRunQuery struct {
	// contains filtered or unexported fields
}

WorkflowStepRunQuery is the builder for querying WorkflowStepRun entities.

func (*WorkflowStepRunQuery) Aggregate

Aggregate returns a WorkflowStepRunSelect configured with the given aggregations.

func (*WorkflowStepRunQuery) All

All executes the query and returns a list of WorkflowStepRuns.

func (*WorkflowStepRunQuery) AllX

AllX is like All, but panics if an error occurs.

func (*WorkflowStepRunQuery) Clone

Clone returns a duplicate of the WorkflowStepRunQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WorkflowStepRunQuery) Count

func (_q *WorkflowStepRunQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkflowStepRunQuery) CountX

func (_q *WorkflowStepRunQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WorkflowStepRunQuery) Exist

func (_q *WorkflowStepRunQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WorkflowStepRunQuery) ExistX

func (_q *WorkflowStepRunQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WorkflowStepRunQuery) First

First returns the first WorkflowStepRun entity from the query. Returns a *NotFoundError when no WorkflowStepRun was found.

func (*WorkflowStepRunQuery) FirstID

func (_q *WorkflowStepRunQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first WorkflowStepRun ID from the query. Returns a *NotFoundError when no WorkflowStepRun ID was found.

func (*WorkflowStepRunQuery) FirstIDX

func (_q *WorkflowStepRunQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*WorkflowStepRunQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*WorkflowStepRunQuery) GroupBy

func (_q *WorkflowStepRunQuery) GroupBy(field string, fields ...string) *WorkflowStepRunGroupBy

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 {
	RunID uuid.UUID `json:"run_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.WorkflowStepRun.Query().
	GroupBy(workflowsteprun.FieldRunID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WorkflowStepRunQuery) IDs

func (_q *WorkflowStepRunQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of WorkflowStepRun IDs.

func (*WorkflowStepRunQuery) IDsX

func (_q *WorkflowStepRunQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*WorkflowStepRunQuery) Limit

func (_q *WorkflowStepRunQuery) Limit(limit int) *WorkflowStepRunQuery

Limit the number of records to be returned by this query.

func (*WorkflowStepRunQuery) Offset

func (_q *WorkflowStepRunQuery) Offset(offset int) *WorkflowStepRunQuery

Offset to start from.

func (*WorkflowStepRunQuery) Only

Only returns a single WorkflowStepRun entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WorkflowStepRun entity is found. Returns a *NotFoundError when no WorkflowStepRun entities are found.

func (*WorkflowStepRunQuery) OnlyID

func (_q *WorkflowStepRunQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only WorkflowStepRun ID in the query. Returns a *NotSingularError when more than one WorkflowStepRun ID is found. Returns a *NotFoundError when no entities are found.

func (*WorkflowStepRunQuery) OnlyIDX

func (_q *WorkflowStepRunQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WorkflowStepRunQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*WorkflowStepRunQuery) Order

Order specifies how the records should be ordered.

func (*WorkflowStepRunQuery) Select

func (_q *WorkflowStepRunQuery) Select(fields ...string) *WorkflowStepRunSelect

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 {
	RunID uuid.UUID `json:"run_id,omitempty"`
}

client.WorkflowStepRun.Query().
	Select(workflowsteprun.FieldRunID).
	Scan(ctx, &v)

func (*WorkflowStepRunQuery) Unique

func (_q *WorkflowStepRunQuery) Unique(unique bool) *WorkflowStepRunQuery

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 (*WorkflowStepRunQuery) Where

Where adds a new predicate for the WorkflowStepRunQuery builder.

type WorkflowStepRunSelect

type WorkflowStepRunSelect struct {
	*WorkflowStepRunQuery
	// contains filtered or unexported fields
}

WorkflowStepRunSelect is the builder for selecting fields of WorkflowStepRun entities.

func (*WorkflowStepRunSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*WorkflowStepRunSelect) Bool

func (s *WorkflowStepRunSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) BoolX

func (s *WorkflowStepRunSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowStepRunSelect) Bools

func (s *WorkflowStepRunSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) BoolsX

func (s *WorkflowStepRunSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowStepRunSelect) Float64

func (s *WorkflowStepRunSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) Float64X

func (s *WorkflowStepRunSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowStepRunSelect) Float64s

func (s *WorkflowStepRunSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) Float64sX

func (s *WorkflowStepRunSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowStepRunSelect) Int

func (s *WorkflowStepRunSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) IntX

func (s *WorkflowStepRunSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowStepRunSelect) Ints

func (s *WorkflowStepRunSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) IntsX

func (s *WorkflowStepRunSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowStepRunSelect) Scan

func (_s *WorkflowStepRunSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowStepRunSelect) ScanX

func (s *WorkflowStepRunSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowStepRunSelect) String

func (s *WorkflowStepRunSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) StringX

func (s *WorkflowStepRunSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowStepRunSelect) Strings

func (s *WorkflowStepRunSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowStepRunSelect) StringsX

func (s *WorkflowStepRunSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowStepRunUpdate

type WorkflowStepRunUpdate struct {
	// contains filtered or unexported fields
}

WorkflowStepRunUpdate is the builder for updating WorkflowStepRun entities.

func (*WorkflowStepRunUpdate) ClearAgent

func (_u *WorkflowStepRunUpdate) ClearAgent() *WorkflowStepRunUpdate

ClearAgent clears the value of the "agent" field.

func (*WorkflowStepRunUpdate) ClearCompletedAt

func (_u *WorkflowStepRunUpdate) ClearCompletedAt() *WorkflowStepRunUpdate

ClearCompletedAt clears the value of the "completed_at" field.

func (*WorkflowStepRunUpdate) ClearErrorMessage

func (_u *WorkflowStepRunUpdate) ClearErrorMessage() *WorkflowStepRunUpdate

ClearErrorMessage clears the value of the "error_message" field.

func (*WorkflowStepRunUpdate) ClearResult

func (_u *WorkflowStepRunUpdate) ClearResult() *WorkflowStepRunUpdate

ClearResult clears the value of the "result" field.

func (*WorkflowStepRunUpdate) ClearStartedAt

func (_u *WorkflowStepRunUpdate) ClearStartedAt() *WorkflowStepRunUpdate

ClearStartedAt clears the value of the "started_at" field.

func (*WorkflowStepRunUpdate) Exec

Exec executes the query.

func (*WorkflowStepRunUpdate) ExecX

func (_u *WorkflowStepRunUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStepRunUpdate) Mutation

Mutation returns the WorkflowStepRunMutation object of the builder.

func (*WorkflowStepRunUpdate) Save

func (_u *WorkflowStepRunUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WorkflowStepRunUpdate) SaveX

func (_u *WorkflowStepRunUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WorkflowStepRunUpdate) SetAgent

SetAgent sets the "agent" field.

func (*WorkflowStepRunUpdate) SetCompletedAt

func (_u *WorkflowStepRunUpdate) SetCompletedAt(v time.Time) *WorkflowStepRunUpdate

SetCompletedAt sets the "completed_at" field.

func (*WorkflowStepRunUpdate) SetErrorMessage

func (_u *WorkflowStepRunUpdate) SetErrorMessage(v string) *WorkflowStepRunUpdate

SetErrorMessage sets the "error_message" field.

func (*WorkflowStepRunUpdate) SetNillableAgent

func (_u *WorkflowStepRunUpdate) SetNillableAgent(v *string) *WorkflowStepRunUpdate

SetNillableAgent sets the "agent" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillableCompletedAt

func (_u *WorkflowStepRunUpdate) SetNillableCompletedAt(v *time.Time) *WorkflowStepRunUpdate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillableErrorMessage

func (_u *WorkflowStepRunUpdate) SetNillableErrorMessage(v *string) *WorkflowStepRunUpdate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillablePrompt

func (_u *WorkflowStepRunUpdate) SetNillablePrompt(v *string) *WorkflowStepRunUpdate

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillableResult

func (_u *WorkflowStepRunUpdate) SetNillableResult(v *string) *WorkflowStepRunUpdate

SetNillableResult sets the "result" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillableRunID

func (_u *WorkflowStepRunUpdate) SetNillableRunID(v *uuid.UUID) *WorkflowStepRunUpdate

SetNillableRunID sets the "run_id" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillableStartedAt

func (_u *WorkflowStepRunUpdate) SetNillableStartedAt(v *time.Time) *WorkflowStepRunUpdate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetNillableStepID

func (_u *WorkflowStepRunUpdate) SetNillableStepID(v *string) *WorkflowStepRunUpdate

SetNillableStepID sets the "step_id" field if the given value is not nil.

func (*WorkflowStepRunUpdate) SetPrompt

SetPrompt sets the "prompt" field.

func (*WorkflowStepRunUpdate) SetResult

SetResult sets the "result" field.

func (*WorkflowStepRunUpdate) SetRunID

SetRunID sets the "run_id" field.

func (*WorkflowStepRunUpdate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*WorkflowStepRunUpdate) SetStatus

SetStatus sets the "status" field.

func (*WorkflowStepRunUpdate) SetStepID

SetStepID sets the "step_id" field.

func (*WorkflowStepRunUpdate) Where

Where appends a list predicates to the WorkflowStepRunUpdate builder.

type WorkflowStepRunUpdateOne

type WorkflowStepRunUpdateOne struct {
	// contains filtered or unexported fields
}

WorkflowStepRunUpdateOne is the builder for updating a single WorkflowStepRun entity.

func (*WorkflowStepRunUpdateOne) ClearAgent

ClearAgent clears the value of the "agent" field.

func (*WorkflowStepRunUpdateOne) ClearCompletedAt

func (_u *WorkflowStepRunUpdateOne) ClearCompletedAt() *WorkflowStepRunUpdateOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*WorkflowStepRunUpdateOne) ClearErrorMessage

func (_u *WorkflowStepRunUpdateOne) ClearErrorMessage() *WorkflowStepRunUpdateOne

ClearErrorMessage clears the value of the "error_message" field.

func (*WorkflowStepRunUpdateOne) ClearResult

ClearResult clears the value of the "result" field.

func (*WorkflowStepRunUpdateOne) ClearStartedAt

func (_u *WorkflowStepRunUpdateOne) ClearStartedAt() *WorkflowStepRunUpdateOne

ClearStartedAt clears the value of the "started_at" field.

func (*WorkflowStepRunUpdateOne) Exec

Exec executes the query on the entity.

func (*WorkflowStepRunUpdateOne) ExecX

func (_u *WorkflowStepRunUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStepRunUpdateOne) Mutation

Mutation returns the WorkflowStepRunMutation object of the builder.

func (*WorkflowStepRunUpdateOne) Save

Save executes the query and returns the updated WorkflowStepRun entity.

func (*WorkflowStepRunUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WorkflowStepRunUpdateOne) Select

func (_u *WorkflowStepRunUpdateOne) Select(field string, fields ...string) *WorkflowStepRunUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WorkflowStepRunUpdateOne) SetAgent

SetAgent sets the "agent" field.

func (*WorkflowStepRunUpdateOne) SetCompletedAt

SetCompletedAt sets the "completed_at" field.

func (*WorkflowStepRunUpdateOne) SetErrorMessage

SetErrorMessage sets the "error_message" field.

func (*WorkflowStepRunUpdateOne) SetNillableAgent

func (_u *WorkflowStepRunUpdateOne) SetNillableAgent(v *string) *WorkflowStepRunUpdateOne

SetNillableAgent sets the "agent" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillableCompletedAt

func (_u *WorkflowStepRunUpdateOne) SetNillableCompletedAt(v *time.Time) *WorkflowStepRunUpdateOne

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillableErrorMessage

func (_u *WorkflowStepRunUpdateOne) SetNillableErrorMessage(v *string) *WorkflowStepRunUpdateOne

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillablePrompt

func (_u *WorkflowStepRunUpdateOne) SetNillablePrompt(v *string) *WorkflowStepRunUpdateOne

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillableResult

func (_u *WorkflowStepRunUpdateOne) SetNillableResult(v *string) *WorkflowStepRunUpdateOne

SetNillableResult sets the "result" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillableRunID

func (_u *WorkflowStepRunUpdateOne) SetNillableRunID(v *uuid.UUID) *WorkflowStepRunUpdateOne

SetNillableRunID sets the "run_id" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillableStartedAt

func (_u *WorkflowStepRunUpdateOne) SetNillableStartedAt(v *time.Time) *WorkflowStepRunUpdateOne

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetNillableStepID

func (_u *WorkflowStepRunUpdateOne) SetNillableStepID(v *string) *WorkflowStepRunUpdateOne

SetNillableStepID sets the "step_id" field if the given value is not nil.

func (*WorkflowStepRunUpdateOne) SetPrompt

SetPrompt sets the "prompt" field.

func (*WorkflowStepRunUpdateOne) SetResult

SetResult sets the "result" field.

func (*WorkflowStepRunUpdateOne) SetRunID

SetRunID sets the "run_id" field.

func (*WorkflowStepRunUpdateOne) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*WorkflowStepRunUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*WorkflowStepRunUpdateOne) SetStepID

SetStepID sets the "step_id" field.

func (*WorkflowStepRunUpdateOne) Where

Where appends a list predicates to the WorkflowStepRunUpdate builder.

type WorkflowStepRuns

type WorkflowStepRuns []*WorkflowStepRun

WorkflowStepRuns is a parsable slice of WorkflowStepRun.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL