ent

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeCertification = "Certification"
	TypeLocalKey      = "LocalKey"
	TypeMessage       = "Message"
	TypeProcess       = "Process"
)

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 Certification

type Certification struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// AnchorID holds the value of the "anchor_id" field.
	AnchorID int `json:"anchor_id,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash string `json:"hash,omitempty"`
	// DataID holds the value of the "data_id" field.
	DataID string `json:"data_id,omitempty"`
	// Proof holds the value of the "proof" field.
	Proof json.RawMessage `json:"proof,omitempty"`
	// contains filtered or unexported fields
}

Certification is the model entity for the Certification schema.

func (*Certification) String

func (c *Certification) String() string

String implements the fmt.Stringer.

func (*Certification) Unwrap

func (c *Certification) Unwrap() *Certification

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

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

func (*Certification) Value

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

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

type CertificationClient

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

CertificationClient is a client for the Certification schema.

func NewCertificationClient

func NewCertificationClient(c config) *CertificationClient

NewCertificationClient returns a client for the Certification from the given config.

func (*CertificationClient) Create

Create returns a builder for creating a Certification entity.

func (*CertificationClient) CreateBulk

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

func (*CertificationClient) Delete

Delete returns a delete builder for Certification.

func (*CertificationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CertificationClient) DeleteOneID

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

func (*CertificationClient) Get

Get returns a Certification entity by its id.

func (*CertificationClient) GetX

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

func (*CertificationClient) Hooks

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

Hooks returns the client hooks.

func (*CertificationClient) Intercept

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

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

func (*CertificationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CertificationClient) MapCreateBulk

func (c *CertificationClient) MapCreateBulk(slice any, setFunc func(*CertificationCreate, int)) *CertificationCreateBulk

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

Query returns a query builder for Certification.

func (*CertificationClient) Update

Update returns an update builder for Certification.

func (*CertificationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CertificationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*CertificationClient) Use

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

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

type CertificationCreate

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

CertificationCreate is the builder for creating a Certification entity.

func (*CertificationCreate) Exec

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

Exec executes the query.

func (*CertificationCreate) ExecX

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

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

func (*CertificationCreate) Mutation

Mutation returns the CertificationMutation object of the builder.

func (*CertificationCreate) Save

Save creates the Certification in the database.

func (*CertificationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CertificationCreate) SetAnchorID

func (cc *CertificationCreate) SetAnchorID(i int) *CertificationCreate

SetAnchorID sets the "anchor_id" field.

func (*CertificationCreate) SetDataID

SetDataID sets the "data_id" field.

func (*CertificationCreate) SetHash

SetHash sets the "hash" field.

func (*CertificationCreate) SetID

SetID sets the "id" field.

func (*CertificationCreate) SetNillableID

func (cc *CertificationCreate) SetNillableID(u *uuid.UUID) *CertificationCreate

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

func (*CertificationCreate) SetProof added in v1.3.0

SetProof sets the "proof" field.

type CertificationCreateBulk

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

CertificationCreateBulk is the builder for creating many Certification entities in bulk.

func (*CertificationCreateBulk) Exec

Exec executes the query.

func (*CertificationCreateBulk) ExecX

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

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

func (*CertificationCreateBulk) Save

Save creates the Certification entities in the database.

func (*CertificationCreateBulk) SaveX

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

type CertificationDelete

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

CertificationDelete is the builder for deleting a Certification entity.

func (*CertificationDelete) Exec

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

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

func (*CertificationDelete) ExecX

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

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

func (*CertificationDelete) Where

Where appends a list predicates to the CertificationDelete builder.

type CertificationDeleteOne

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

CertificationDeleteOne is the builder for deleting a single Certification entity.

func (*CertificationDeleteOne) Exec

Exec executes the deletion query.

func (*CertificationDeleteOne) ExecX

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

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

func (*CertificationDeleteOne) Where

Where appends a list predicates to the CertificationDelete builder.

type CertificationGroupBy

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

CertificationGroupBy is the group-by builder for Certification entities.

func (*CertificationGroupBy) Aggregate

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

func (*CertificationGroupBy) Bool

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

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

func (*CertificationGroupBy) BoolX

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

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

func (*CertificationGroupBy) Bools

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

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

func (*CertificationGroupBy) BoolsX

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

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

func (*CertificationGroupBy) Float64

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

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

func (*CertificationGroupBy) Float64X

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

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

func (*CertificationGroupBy) Float64s

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

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

func (*CertificationGroupBy) Float64sX

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

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

func (*CertificationGroupBy) Int

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

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

func (*CertificationGroupBy) IntX

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

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

func (*CertificationGroupBy) Ints

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

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

func (*CertificationGroupBy) IntsX

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

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

func (*CertificationGroupBy) Scan

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

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

func (*CertificationGroupBy) ScanX

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

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

func (*CertificationGroupBy) String

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

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

func (*CertificationGroupBy) StringX

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

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

func (*CertificationGroupBy) Strings

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

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

func (*CertificationGroupBy) StringsX

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

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

type CertificationMutation

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

CertificationMutation represents an operation that mutates the Certification nodes in the graph.

func (*CertificationMutation) AddAnchorID

func (m *CertificationMutation) AddAnchorID(i int)

AddAnchorID adds i to the "anchor_id" field.

func (*CertificationMutation) AddField

func (m *CertificationMutation) 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 (*CertificationMutation) AddedAnchorID

func (m *CertificationMutation) AddedAnchorID() (r int, exists bool)

AddedAnchorID returns the value that was added to the "anchor_id" field in this mutation.

func (*CertificationMutation) AddedEdges

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

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

func (*CertificationMutation) AddedField

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

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

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

func (*CertificationMutation) AddedIDs

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

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

func (*CertificationMutation) AnchorID

func (m *CertificationMutation) AnchorID() (r int, exists bool)

AnchorID returns the value of the "anchor_id" field in the mutation.

func (*CertificationMutation) AppendProof added in v1.3.0

func (m *CertificationMutation) AppendProof(jm json.RawMessage)

AppendProof adds jm to the "proof" field.

func (*CertificationMutation) AppendedProof added in v1.3.0

func (m *CertificationMutation) AppendedProof() (json.RawMessage, bool)

AppendedProof returns the list of values that were appended to the "proof" field in this mutation.

func (*CertificationMutation) ClearEdge

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

func (m *CertificationMutation) 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 (*CertificationMutation) ClearProof added in v1.3.0

func (m *CertificationMutation) ClearProof()

ClearProof clears the value of the "proof" field.

func (*CertificationMutation) ClearedEdges

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

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

func (*CertificationMutation) ClearedFields

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

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

func (CertificationMutation) Client

func (m CertificationMutation) 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 (*CertificationMutation) DataID

func (m *CertificationMutation) DataID() (r string, exists bool)

DataID returns the value of the "data_id" field in the mutation.

func (*CertificationMutation) EdgeCleared

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

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

func (*CertificationMutation) Field

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

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

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

func (*CertificationMutation) Fields

func (m *CertificationMutation) 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 (*CertificationMutation) Hash

func (m *CertificationMutation) Hash() (r string, exists bool)

Hash returns the value of the "hash" field in the mutation.

func (*CertificationMutation) ID

func (m *CertificationMutation) 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 (*CertificationMutation) 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 (*CertificationMutation) OldAnchorID

func (m *CertificationMutation) OldAnchorID(ctx context.Context) (v int, err error)

OldAnchorID returns the old "anchor_id" field's value of the Certification entity. If the Certification object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CertificationMutation) OldDataID

func (m *CertificationMutation) OldDataID(ctx context.Context) (v string, err error)

OldDataID returns the old "data_id" field's value of the Certification entity. If the Certification object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CertificationMutation) OldField

func (m *CertificationMutation) 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 (*CertificationMutation) OldHash

func (m *CertificationMutation) OldHash(ctx context.Context) (v string, err error)

OldHash returns the old "hash" field's value of the Certification entity. If the Certification object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CertificationMutation) OldProof added in v1.3.0

func (m *CertificationMutation) OldProof(ctx context.Context) (v json.RawMessage, err error)

OldProof returns the old "proof" field's value of the Certification entity. If the Certification object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CertificationMutation) Op

func (m *CertificationMutation) Op() Op

Op returns the operation name.

func (*CertificationMutation) Proof added in v1.3.0

func (m *CertificationMutation) Proof() (r json.RawMessage, exists bool)

Proof returns the value of the "proof" field in the mutation.

func (*CertificationMutation) ProofCleared added in v1.3.0

func (m *CertificationMutation) ProofCleared() bool

ProofCleared returns if the "proof" field was cleared in this mutation.

func (*CertificationMutation) RemovedEdges

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

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

func (*CertificationMutation) RemovedIDs

func (m *CertificationMutation) 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 (*CertificationMutation) ResetAnchorID

func (m *CertificationMutation) ResetAnchorID()

ResetAnchorID resets all changes to the "anchor_id" field.

func (*CertificationMutation) ResetDataID

func (m *CertificationMutation) ResetDataID()

ResetDataID resets all changes to the "data_id" field.

func (*CertificationMutation) ResetEdge

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

func (m *CertificationMutation) 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 (*CertificationMutation) ResetHash

func (m *CertificationMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*CertificationMutation) ResetProof added in v1.3.0

func (m *CertificationMutation) ResetProof()

ResetProof resets all changes to the "proof" field.

func (*CertificationMutation) SetAnchorID

func (m *CertificationMutation) SetAnchorID(i int)

SetAnchorID sets the "anchor_id" field.

func (*CertificationMutation) SetDataID

func (m *CertificationMutation) SetDataID(s string)

SetDataID sets the "data_id" field.

func (*CertificationMutation) SetField

func (m *CertificationMutation) 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 (*CertificationMutation) SetHash

func (m *CertificationMutation) SetHash(s string)

SetHash sets the "hash" field.

func (*CertificationMutation) SetID

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

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

func (*CertificationMutation) SetOp

func (m *CertificationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CertificationMutation) SetProof added in v1.3.0

func (m *CertificationMutation) SetProof(jm json.RawMessage)

SetProof sets the "proof" field.

func (CertificationMutation) Tx

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

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

func (*CertificationMutation) Type

func (m *CertificationMutation) Type() string

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

func (*CertificationMutation) Where

Where appends a list predicates to the CertificationMutation builder.

func (*CertificationMutation) WhereP

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

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

type CertificationQuery

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

CertificationQuery is the builder for querying Certification entities.

func (*CertificationQuery) Aggregate

func (cq *CertificationQuery) Aggregate(fns ...AggregateFunc) *CertificationSelect

Aggregate returns a CertificationSelect configured with the given aggregations.

func (*CertificationQuery) All

All executes the query and returns a list of Certifications.

func (*CertificationQuery) AllX

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

func (*CertificationQuery) Clone

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

func (*CertificationQuery) Count

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

Count returns the count of the given query.

func (*CertificationQuery) CountX

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

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

func (*CertificationQuery) Exist

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

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

func (*CertificationQuery) ExistX

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

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

func (*CertificationQuery) First

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

func (*CertificationQuery) FirstID

func (cq *CertificationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CertificationQuery) FirstIDX

func (cq *CertificationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CertificationQuery) FirstX

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

func (*CertificationQuery) GroupBy

func (cq *CertificationQuery) GroupBy(field string, fields ...string) *CertificationGroupBy

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 {
	AnchorID int `json:"anchor_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Certification.Query().
	GroupBy(certification.FieldAnchorID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CertificationQuery) IDs

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

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

func (*CertificationQuery) IDsX

func (cq *CertificationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CertificationQuery) Limit

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

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

func (*CertificationQuery) Offset

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

Offset to start from.

func (*CertificationQuery) Only

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

func (*CertificationQuery) OnlyID

func (cq *CertificationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CertificationQuery) OnlyIDX

func (cq *CertificationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CertificationQuery) OnlyX

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

func (*CertificationQuery) Order

Order specifies how the records should be ordered.

func (*CertificationQuery) Select

func (cq *CertificationQuery) Select(fields ...string) *CertificationSelect

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 {
	AnchorID int `json:"anchor_id,omitempty"`
}

client.Certification.Query().
	Select(certification.FieldAnchorID).
	Scan(ctx, &v)

func (*CertificationQuery) Unique

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

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

Where adds a new predicate for the CertificationQuery builder.

type CertificationSelect

type CertificationSelect struct {
	*CertificationQuery
	// contains filtered or unexported fields
}

CertificationSelect is the builder for selecting fields of Certification entities.

func (*CertificationSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CertificationSelect) Bool

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

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

func (*CertificationSelect) BoolX

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

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

func (*CertificationSelect) Bools

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

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

func (*CertificationSelect) BoolsX

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

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

func (*CertificationSelect) Float64

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

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

func (*CertificationSelect) Float64X

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

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

func (*CertificationSelect) Float64s

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

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

func (*CertificationSelect) Float64sX

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

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

func (*CertificationSelect) Int

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

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

func (*CertificationSelect) IntX

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

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

func (*CertificationSelect) Ints

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

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

func (*CertificationSelect) IntsX

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

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

func (*CertificationSelect) Scan

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

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

func (*CertificationSelect) ScanX

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

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

func (*CertificationSelect) String

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

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

func (*CertificationSelect) StringX

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

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

func (*CertificationSelect) Strings

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

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

func (*CertificationSelect) StringsX

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

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

type CertificationUpdate

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

CertificationUpdate is the builder for updating Certification entities.

func (*CertificationUpdate) AddAnchorID

func (cu *CertificationUpdate) AddAnchorID(i int) *CertificationUpdate

AddAnchorID adds i to the "anchor_id" field.

func (*CertificationUpdate) AppendProof added in v1.3.0

AppendProof appends jm to the "proof" field.

func (*CertificationUpdate) ClearProof added in v1.3.0

func (cu *CertificationUpdate) ClearProof() *CertificationUpdate

ClearProof clears the value of the "proof" field.

func (*CertificationUpdate) Exec

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

Exec executes the query.

func (*CertificationUpdate) ExecX

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

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

func (*CertificationUpdate) Mutation

Mutation returns the CertificationMutation object of the builder.

func (*CertificationUpdate) Save

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

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

func (*CertificationUpdate) SaveX

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

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

func (*CertificationUpdate) SetAnchorID

func (cu *CertificationUpdate) SetAnchorID(i int) *CertificationUpdate

SetAnchorID sets the "anchor_id" field.

func (*CertificationUpdate) SetDataID

SetDataID sets the "data_id" field.

func (*CertificationUpdate) SetHash

SetHash sets the "hash" field.

func (*CertificationUpdate) SetProof added in v1.3.0

SetProof sets the "proof" field.

func (*CertificationUpdate) Where

Where appends a list predicates to the CertificationUpdate builder.

type CertificationUpdateOne

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

CertificationUpdateOne is the builder for updating a single Certification entity.

func (*CertificationUpdateOne) AddAnchorID

func (cuo *CertificationUpdateOne) AddAnchorID(i int) *CertificationUpdateOne

AddAnchorID adds i to the "anchor_id" field.

func (*CertificationUpdateOne) AppendProof added in v1.3.0

AppendProof appends jm to the "proof" field.

func (*CertificationUpdateOne) ClearProof added in v1.3.0

ClearProof clears the value of the "proof" field.

func (*CertificationUpdateOne) Exec

Exec executes the query on the entity.

func (*CertificationUpdateOne) ExecX

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

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

func (*CertificationUpdateOne) Mutation

Mutation returns the CertificationMutation object of the builder.

func (*CertificationUpdateOne) Save

Save executes the query and returns the updated Certification entity.

func (*CertificationUpdateOne) SaveX

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

func (*CertificationUpdateOne) Select

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

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

func (*CertificationUpdateOne) SetAnchorID

func (cuo *CertificationUpdateOne) SetAnchorID(i int) *CertificationUpdateOne

SetAnchorID sets the "anchor_id" field.

func (*CertificationUpdateOne) SetDataID

SetDataID sets the "data_id" field.

func (*CertificationUpdateOne) SetHash

SetHash sets the "hash" field.

func (*CertificationUpdateOne) SetProof added in v1.3.0

SetProof sets the "proof" field.

func (*CertificationUpdateOne) Where

Where appends a list predicates to the CertificationUpdate builder.

type Certifications

type Certifications []*Certification

Certifications is a parsable slice of Certification.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Certification is the client for interacting with the Certification builders.
	Certification *CertificationClient
	// LocalKey is the client for interacting with the LocalKey builders.
	LocalKey *LocalKeyClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Process is the client for interacting with the Process builders.
	Process *ProcessClient
	// 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().
	Certification.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

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

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type LocalKey

type LocalKey struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// LocalKey holds the value of the "local_key" field.
	LocalKey *key.LocalKey `json:"local_key,omitempty"`
	// KeyType holds the value of the "key_type" field.
	KeyType string `json:"key_type,omitempty"`
	// contains filtered or unexported fields
}

LocalKey is the model entity for the LocalKey schema.

func (*LocalKey) String

func (lk *LocalKey) String() string

String implements the fmt.Stringer.

func (*LocalKey) Unwrap

func (lk *LocalKey) Unwrap() *LocalKey

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

func (lk *LocalKey) Update() *LocalKeyUpdateOne

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

func (*LocalKey) Value

func (lk *LocalKey) Value(name string) (ent.Value, error)

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

type LocalKeyClient

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

LocalKeyClient is a client for the LocalKey schema.

func NewLocalKeyClient

func NewLocalKeyClient(c config) *LocalKeyClient

NewLocalKeyClient returns a client for the LocalKey from the given config.

func (*LocalKeyClient) Create

func (c *LocalKeyClient) Create() *LocalKeyCreate

Create returns a builder for creating a LocalKey entity.

func (*LocalKeyClient) CreateBulk

func (c *LocalKeyClient) CreateBulk(builders ...*LocalKeyCreate) *LocalKeyCreateBulk

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

func (*LocalKeyClient) Delete

func (c *LocalKeyClient) Delete() *LocalKeyDelete

Delete returns a delete builder for LocalKey.

func (*LocalKeyClient) DeleteOne

func (c *LocalKeyClient) DeleteOne(lk *LocalKey) *LocalKeyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LocalKeyClient) DeleteOneID

func (c *LocalKeyClient) DeleteOneID(id uuid.UUID) *LocalKeyDeleteOne

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

func (*LocalKeyClient) Get

func (c *LocalKeyClient) Get(ctx context.Context, id uuid.UUID) (*LocalKey, error)

Get returns a LocalKey entity by its id.

func (*LocalKeyClient) GetX

func (c *LocalKeyClient) GetX(ctx context.Context, id uuid.UUID) *LocalKey

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

func (*LocalKeyClient) Hooks

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

Hooks returns the client hooks.

func (*LocalKeyClient) Intercept

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

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

func (*LocalKeyClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LocalKeyClient) MapCreateBulk

func (c *LocalKeyClient) MapCreateBulk(slice any, setFunc func(*LocalKeyCreate, int)) *LocalKeyCreateBulk

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

func (c *LocalKeyClient) Query() *LocalKeyQuery

Query returns a query builder for LocalKey.

func (*LocalKeyClient) Update

func (c *LocalKeyClient) Update() *LocalKeyUpdate

Update returns an update builder for LocalKey.

func (*LocalKeyClient) UpdateOne

func (c *LocalKeyClient) UpdateOne(lk *LocalKey) *LocalKeyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LocalKeyClient) UpdateOneID

func (c *LocalKeyClient) UpdateOneID(id uuid.UUID) *LocalKeyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LocalKeyClient) Use

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

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

type LocalKeyCreate

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

LocalKeyCreate is the builder for creating a LocalKey entity.

func (*LocalKeyCreate) Exec

func (lkc *LocalKeyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocalKeyCreate) ExecX

func (lkc *LocalKeyCreate) ExecX(ctx context.Context)

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

func (*LocalKeyCreate) Mutation

func (lkc *LocalKeyCreate) Mutation() *LocalKeyMutation

Mutation returns the LocalKeyMutation object of the builder.

func (*LocalKeyCreate) Save

func (lkc *LocalKeyCreate) Save(ctx context.Context) (*LocalKey, error)

Save creates the LocalKey in the database.

func (*LocalKeyCreate) SaveX

func (lkc *LocalKeyCreate) SaveX(ctx context.Context) *LocalKey

SaveX calls Save and panics if Save returns an error.

func (*LocalKeyCreate) SetID

func (lkc *LocalKeyCreate) SetID(u uuid.UUID) *LocalKeyCreate

SetID sets the "id" field.

func (*LocalKeyCreate) SetKeyType

func (lkc *LocalKeyCreate) SetKeyType(s string) *LocalKeyCreate

SetKeyType sets the "key_type" field.

func (*LocalKeyCreate) SetLocalKey

func (lkc *LocalKeyCreate) SetLocalKey(kk *key.LocalKey) *LocalKeyCreate

SetLocalKey sets the "local_key" field.

func (*LocalKeyCreate) SetNillableID

func (lkc *LocalKeyCreate) SetNillableID(u *uuid.UUID) *LocalKeyCreate

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

type LocalKeyCreateBulk

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

LocalKeyCreateBulk is the builder for creating many LocalKey entities in bulk.

func (*LocalKeyCreateBulk) Exec

func (lkcb *LocalKeyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LocalKeyCreateBulk) ExecX

func (lkcb *LocalKeyCreateBulk) ExecX(ctx context.Context)

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

func (*LocalKeyCreateBulk) Save

func (lkcb *LocalKeyCreateBulk) Save(ctx context.Context) ([]*LocalKey, error)

Save creates the LocalKey entities in the database.

func (*LocalKeyCreateBulk) SaveX

func (lkcb *LocalKeyCreateBulk) SaveX(ctx context.Context) []*LocalKey

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

type LocalKeyDelete

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

LocalKeyDelete is the builder for deleting a LocalKey entity.

func (*LocalKeyDelete) Exec

func (lkd *LocalKeyDelete) Exec(ctx context.Context) (int, error)

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

func (*LocalKeyDelete) ExecX

func (lkd *LocalKeyDelete) ExecX(ctx context.Context) int

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

func (*LocalKeyDelete) Where

func (lkd *LocalKeyDelete) Where(ps ...predicate.LocalKey) *LocalKeyDelete

Where appends a list predicates to the LocalKeyDelete builder.

type LocalKeyDeleteOne

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

LocalKeyDeleteOne is the builder for deleting a single LocalKey entity.

func (*LocalKeyDeleteOne) Exec

func (lkdo *LocalKeyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LocalKeyDeleteOne) ExecX

func (lkdo *LocalKeyDeleteOne) ExecX(ctx context.Context)

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

func (*LocalKeyDeleteOne) Where

Where appends a list predicates to the LocalKeyDelete builder.

type LocalKeyGroupBy

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

LocalKeyGroupBy is the group-by builder for LocalKey entities.

func (*LocalKeyGroupBy) Aggregate

func (lkgb *LocalKeyGroupBy) Aggregate(fns ...AggregateFunc) *LocalKeyGroupBy

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

func (*LocalKeyGroupBy) Bool

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

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

func (*LocalKeyGroupBy) BoolX

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

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

func (*LocalKeyGroupBy) Bools

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

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

func (*LocalKeyGroupBy) BoolsX

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

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

func (*LocalKeyGroupBy) Float64

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

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

func (*LocalKeyGroupBy) Float64X

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

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

func (*LocalKeyGroupBy) Float64s

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

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

func (*LocalKeyGroupBy) Float64sX

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

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

func (*LocalKeyGroupBy) Int

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

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

func (*LocalKeyGroupBy) IntX

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

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

func (*LocalKeyGroupBy) Ints

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

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

func (*LocalKeyGroupBy) IntsX

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

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

func (*LocalKeyGroupBy) Scan

func (lkgb *LocalKeyGroupBy) Scan(ctx context.Context, v any) error

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

func (*LocalKeyGroupBy) ScanX

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

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

func (*LocalKeyGroupBy) String

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

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

func (*LocalKeyGroupBy) StringX

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

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

func (*LocalKeyGroupBy) Strings

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

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

func (*LocalKeyGroupBy) StringsX

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

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

type LocalKeyMutation

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

LocalKeyMutation represents an operation that mutates the LocalKey nodes in the graph.

func (*LocalKeyMutation) AddField

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

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

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

func (*LocalKeyMutation) AddedField

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

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

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

func (*LocalKeyMutation) AddedIDs

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

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

func (*LocalKeyMutation) ClearEdge

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

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

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

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

func (*LocalKeyMutation) ClearedFields

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

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

func (LocalKeyMutation) Client

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

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

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

func (*LocalKeyMutation) Field

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

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

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

func (*LocalKeyMutation) Fields

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

func (m *LocalKeyMutation) 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 (*LocalKeyMutation) IDs

func (m *LocalKeyMutation) 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 (*LocalKeyMutation) KeyType

func (m *LocalKeyMutation) KeyType() (r string, exists bool)

KeyType returns the value of the "key_type" field in the mutation.

func (*LocalKeyMutation) LocalKey

func (m *LocalKeyMutation) LocalKey() (r *key.LocalKey, exists bool)

LocalKey returns the value of the "local_key" field in the mutation.

func (*LocalKeyMutation) OldField

func (m *LocalKeyMutation) 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 (*LocalKeyMutation) OldKeyType

func (m *LocalKeyMutation) OldKeyType(ctx context.Context) (v string, err error)

OldKeyType returns the old "key_type" field's value of the LocalKey entity. If the LocalKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocalKeyMutation) OldLocalKey

func (m *LocalKeyMutation) OldLocalKey(ctx context.Context) (v *key.LocalKey, err error)

OldLocalKey returns the old "local_key" field's value of the LocalKey entity. If the LocalKey object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocalKeyMutation) Op

func (m *LocalKeyMutation) Op() Op

Op returns the operation name.

func (*LocalKeyMutation) RemovedEdges

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

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

func (*LocalKeyMutation) RemovedIDs

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

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

func (m *LocalKeyMutation) 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 (*LocalKeyMutation) ResetKeyType

func (m *LocalKeyMutation) ResetKeyType()

ResetKeyType resets all changes to the "key_type" field.

func (*LocalKeyMutation) ResetLocalKey

func (m *LocalKeyMutation) ResetLocalKey()

ResetLocalKey resets all changes to the "local_key" field.

func (*LocalKeyMutation) SetField

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

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

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

func (*LocalKeyMutation) SetKeyType

func (m *LocalKeyMutation) SetKeyType(s string)

SetKeyType sets the "key_type" field.

func (*LocalKeyMutation) SetLocalKey

func (m *LocalKeyMutation) SetLocalKey(kk *key.LocalKey)

SetLocalKey sets the "local_key" field.

func (*LocalKeyMutation) SetOp

func (m *LocalKeyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (LocalKeyMutation) Tx

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

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

func (*LocalKeyMutation) Type

func (m *LocalKeyMutation) Type() string

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

func (*LocalKeyMutation) Where

func (m *LocalKeyMutation) Where(ps ...predicate.LocalKey)

Where appends a list predicates to the LocalKeyMutation builder.

func (*LocalKeyMutation) WhereP

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

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

type LocalKeyQuery

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

LocalKeyQuery is the builder for querying LocalKey entities.

func (*LocalKeyQuery) Aggregate

func (lkq *LocalKeyQuery) Aggregate(fns ...AggregateFunc) *LocalKeySelect

Aggregate returns a LocalKeySelect configured with the given aggregations.

func (*LocalKeyQuery) All

func (lkq *LocalKeyQuery) All(ctx context.Context) ([]*LocalKey, error)

All executes the query and returns a list of LocalKeys.

func (*LocalKeyQuery) AllX

func (lkq *LocalKeyQuery) AllX(ctx context.Context) []*LocalKey

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

func (*LocalKeyQuery) Clone

func (lkq *LocalKeyQuery) Clone() *LocalKeyQuery

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

func (*LocalKeyQuery) Count

func (lkq *LocalKeyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LocalKeyQuery) CountX

func (lkq *LocalKeyQuery) CountX(ctx context.Context) int

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

func (*LocalKeyQuery) Exist

func (lkq *LocalKeyQuery) Exist(ctx context.Context) (bool, error)

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

func (*LocalKeyQuery) ExistX

func (lkq *LocalKeyQuery) ExistX(ctx context.Context) bool

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

func (*LocalKeyQuery) First

func (lkq *LocalKeyQuery) First(ctx context.Context) (*LocalKey, error)

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

func (*LocalKeyQuery) FirstID

func (lkq *LocalKeyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*LocalKeyQuery) FirstIDX

func (lkq *LocalKeyQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*LocalKeyQuery) FirstX

func (lkq *LocalKeyQuery) FirstX(ctx context.Context) *LocalKey

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

func (*LocalKeyQuery) GroupBy

func (lkq *LocalKeyQuery) GroupBy(field string, fields ...string) *LocalKeyGroupBy

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 {
	LocalKey *key.LocalKey `json:"local_key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.LocalKey.Query().
	GroupBy(localkey.FieldLocalKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LocalKeyQuery) IDs

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

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

func (*LocalKeyQuery) IDsX

func (lkq *LocalKeyQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*LocalKeyQuery) Limit

func (lkq *LocalKeyQuery) Limit(limit int) *LocalKeyQuery

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

func (*LocalKeyQuery) Offset

func (lkq *LocalKeyQuery) Offset(offset int) *LocalKeyQuery

Offset to start from.

func (*LocalKeyQuery) Only

func (lkq *LocalKeyQuery) Only(ctx context.Context) (*LocalKey, error)

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

func (*LocalKeyQuery) OnlyID

func (lkq *LocalKeyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*LocalKeyQuery) OnlyIDX

func (lkq *LocalKeyQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*LocalKeyQuery) OnlyX

func (lkq *LocalKeyQuery) OnlyX(ctx context.Context) *LocalKey

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

func (*LocalKeyQuery) Order

func (lkq *LocalKeyQuery) Order(o ...localkey.OrderOption) *LocalKeyQuery

Order specifies how the records should be ordered.

func (*LocalKeyQuery) Select

func (lkq *LocalKeyQuery) Select(fields ...string) *LocalKeySelect

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 {
	LocalKey *key.LocalKey `json:"local_key,omitempty"`
}

client.LocalKey.Query().
	Select(localkey.FieldLocalKey).
	Scan(ctx, &v)

func (*LocalKeyQuery) Unique

func (lkq *LocalKeyQuery) Unique(unique bool) *LocalKeyQuery

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

func (lkq *LocalKeyQuery) Where(ps ...predicate.LocalKey) *LocalKeyQuery

Where adds a new predicate for the LocalKeyQuery builder.

type LocalKeySelect

type LocalKeySelect struct {
	*LocalKeyQuery
	// contains filtered or unexported fields
}

LocalKeySelect is the builder for selecting fields of LocalKey entities.

func (*LocalKeySelect) Aggregate

func (lks *LocalKeySelect) Aggregate(fns ...AggregateFunc) *LocalKeySelect

Aggregate adds the given aggregation functions to the selector query.

func (*LocalKeySelect) Bool

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

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

func (*LocalKeySelect) BoolX

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

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

func (*LocalKeySelect) Bools

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

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

func (*LocalKeySelect) BoolsX

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

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

func (*LocalKeySelect) Float64

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

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

func (*LocalKeySelect) Float64X

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

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

func (*LocalKeySelect) Float64s

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

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

func (*LocalKeySelect) Float64sX

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

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

func (*LocalKeySelect) Int

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

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

func (*LocalKeySelect) IntX

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

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

func (*LocalKeySelect) Ints

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

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

func (*LocalKeySelect) IntsX

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

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

func (*LocalKeySelect) Scan

func (lks *LocalKeySelect) Scan(ctx context.Context, v any) error

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

func (*LocalKeySelect) ScanX

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

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

func (*LocalKeySelect) String

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

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

func (*LocalKeySelect) StringX

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

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

func (*LocalKeySelect) Strings

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

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

func (*LocalKeySelect) StringsX

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

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

type LocalKeyUpdate

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

LocalKeyUpdate is the builder for updating LocalKey entities.

func (*LocalKeyUpdate) Exec

func (lku *LocalKeyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocalKeyUpdate) ExecX

func (lku *LocalKeyUpdate) ExecX(ctx context.Context)

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

func (*LocalKeyUpdate) Mutation

func (lku *LocalKeyUpdate) Mutation() *LocalKeyMutation

Mutation returns the LocalKeyMutation object of the builder.

func (*LocalKeyUpdate) Save

func (lku *LocalKeyUpdate) Save(ctx context.Context) (int, error)

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

func (*LocalKeyUpdate) SaveX

func (lku *LocalKeyUpdate) SaveX(ctx context.Context) int

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

func (*LocalKeyUpdate) SetKeyType

func (lku *LocalKeyUpdate) SetKeyType(s string) *LocalKeyUpdate

SetKeyType sets the "key_type" field.

func (*LocalKeyUpdate) SetLocalKey

func (lku *LocalKeyUpdate) SetLocalKey(kk *key.LocalKey) *LocalKeyUpdate

SetLocalKey sets the "local_key" field.

func (*LocalKeyUpdate) Where

func (lku *LocalKeyUpdate) Where(ps ...predicate.LocalKey) *LocalKeyUpdate

Where appends a list predicates to the LocalKeyUpdate builder.

type LocalKeyUpdateOne

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

LocalKeyUpdateOne is the builder for updating a single LocalKey entity.

func (*LocalKeyUpdateOne) Exec

func (lkuo *LocalKeyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LocalKeyUpdateOne) ExecX

func (lkuo *LocalKeyUpdateOne) ExecX(ctx context.Context)

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

func (*LocalKeyUpdateOne) Mutation

func (lkuo *LocalKeyUpdateOne) Mutation() *LocalKeyMutation

Mutation returns the LocalKeyMutation object of the builder.

func (*LocalKeyUpdateOne) Save

func (lkuo *LocalKeyUpdateOne) Save(ctx context.Context) (*LocalKey, error)

Save executes the query and returns the updated LocalKey entity.

func (*LocalKeyUpdateOne) SaveX

func (lkuo *LocalKeyUpdateOne) SaveX(ctx context.Context) *LocalKey

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

func (*LocalKeyUpdateOne) Select

func (lkuo *LocalKeyUpdateOne) Select(field string, fields ...string) *LocalKeyUpdateOne

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

func (*LocalKeyUpdateOne) SetKeyType

func (lkuo *LocalKeyUpdateOne) SetKeyType(s string) *LocalKeyUpdateOne

SetKeyType sets the "key_type" field.

func (*LocalKeyUpdateOne) SetLocalKey

func (lkuo *LocalKeyUpdateOne) SetLocalKey(kk *key.LocalKey) *LocalKeyUpdateOne

SetLocalKey sets the "local_key" field.

func (*LocalKeyUpdateOne) Where

Where appends a list predicates to the LocalKeyUpdate builder.

type LocalKeys

type LocalKeys []*LocalKey

LocalKeys is a parsable slice of LocalKey.

type Message added in v1.3.0

type Message struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Message holds the value of the "message" field.
	Message string `json:"message,omitempty"`
	// Root holds the value of the "root" field.
	Root string `json:"root,omitempty"`
	// AnchorID holds the value of the "anchor_id" field.
	AnchorID int `json:"anchor_id,omitempty"`
	// Proof holds the value of the "proof" field.
	Proof json.RawMessage `json:"proof,omitempty"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) String added in v1.3.0

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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

MessageClient is a client for the Message schema.

func NewMessageClient added in v1.3.0

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create added in v1.3.0

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk added in v1.3.0

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

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

func (*MessageClient) Delete added in v1.3.0

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne added in v1.3.0

func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID added in v1.3.0

func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne

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

func (*MessageClient) Get added in v1.3.0

func (c *MessageClient) Get(ctx context.Context, id uuid.UUID) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX added in v1.3.0

func (c *MessageClient) GetX(ctx context.Context, id uuid.UUID) *Message

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

func (*MessageClient) Hooks added in v1.3.0

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

Hooks returns the client hooks.

func (*MessageClient) Intercept added in v1.3.0

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 added in v1.3.0

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

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk added in v1.3.0

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 added in v1.3.0

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) Update added in v1.3.0

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne added in v1.3.0

func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID added in v1.3.0

func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use added in v1.3.0

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 added in v1.3.0

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

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec added in v1.3.0

func (mc *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX added in v1.3.0

func (mc *MessageCreate) ExecX(ctx context.Context)

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

func (*MessageCreate) Mutation added in v1.3.0

func (mc *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save added in v1.3.0

func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX added in v1.3.0

func (mc *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetAnchorID added in v1.3.0

func (mc *MessageCreate) SetAnchorID(i int) *MessageCreate

SetAnchorID sets the "anchor_id" field.

func (*MessageCreate) SetID added in v1.3.0

func (mc *MessageCreate) SetID(u uuid.UUID) *MessageCreate

SetID sets the "id" field.

func (*MessageCreate) SetMessage added in v1.3.0

func (mc *MessageCreate) SetMessage(s string) *MessageCreate

SetMessage sets the "message" field.

func (*MessageCreate) SetNillableAnchorID added in v1.3.0

func (mc *MessageCreate) SetNillableAnchorID(i *int) *MessageCreate

SetNillableAnchorID sets the "anchor_id" field if the given value is not nil.

func (*MessageCreate) SetNillableID added in v1.3.0

func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate

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

func (*MessageCreate) SetNillableRoot added in v1.3.0

func (mc *MessageCreate) SetNillableRoot(s *string) *MessageCreate

SetNillableRoot sets the "root" field if the given value is not nil.

func (*MessageCreate) SetProof added in v1.3.0

func (mc *MessageCreate) SetProof(jm json.RawMessage) *MessageCreate

SetProof sets the "proof" field.

func (*MessageCreate) SetRoot added in v1.3.0

func (mc *MessageCreate) SetRoot(s string) *MessageCreate

SetRoot sets the "root" field.

type MessageCreateBulk added in v1.3.0

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

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec added in v1.3.0

func (mcb *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX added in v1.3.0

func (mcb *MessageCreateBulk) ExecX(ctx context.Context)

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

func (*MessageCreateBulk) Save added in v1.3.0

func (mcb *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX added in v1.3.0

func (mcb *MessageCreateBulk) SaveX(ctx context.Context) []*Message

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

type MessageDelete added in v1.3.0

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

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec added in v1.3.0

func (md *MessageDelete) Exec(ctx context.Context) (int, error)

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

func (*MessageDelete) ExecX added in v1.3.0

func (md *MessageDelete) ExecX(ctx context.Context) int

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

func (*MessageDelete) Where added in v1.3.0

func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne added in v1.3.0

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

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec added in v1.3.0

func (mdo *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX added in v1.3.0

func (mdo *MessageDeleteOne) ExecX(ctx context.Context)

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

func (*MessageDeleteOne) Where added in v1.3.0

Where appends a list predicates to the MessageDelete builder.

type MessageGroupBy added in v1.3.0

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

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate added in v1.3.0

func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

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

func (*MessageGroupBy) Bool added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageGroupBy) Bools added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageGroupBy) Float64 added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageGroupBy) Float64s added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageGroupBy) Int added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageGroupBy) Ints added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageGroupBy) Scan added in v1.3.0

func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error

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

func (*MessageGroupBy) ScanX added in v1.3.0

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

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

func (*MessageGroupBy) String added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageGroupBy) Strings added in v1.3.0

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 added in v1.3.0

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

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

type MessageMutation added in v1.3.0

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

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddAnchorID added in v1.3.0

func (m *MessageMutation) AddAnchorID(i int)

AddAnchorID adds i to the "anchor_id" field.

func (*MessageMutation) AddField added in v1.3.0

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) AddedAnchorID added in v1.3.0

func (m *MessageMutation) AddedAnchorID() (r int, exists bool)

AddedAnchorID returns the value that was added to the "anchor_id" field in this mutation.

func (*MessageMutation) AddedEdges added in v1.3.0

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

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

func (*MessageMutation) AddedField added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageMutation) AddedIDs added in v1.3.0

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) AnchorID added in v1.3.0

func (m *MessageMutation) AnchorID() (r int, exists bool)

AnchorID returns the value of the "anchor_id" field in the mutation.

func (*MessageMutation) AppendProof added in v1.3.0

func (m *MessageMutation) AppendProof(jm json.RawMessage)

AppendProof adds jm to the "proof" field.

func (*MessageMutation) AppendedProof added in v1.3.0

func (m *MessageMutation) AppendedProof() (json.RawMessage, bool)

AppendedProof returns the list of values that were appended to the "proof" field in this mutation.

func (*MessageMutation) ClearEdge added in v1.3.0

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 added in v1.3.0

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) ClearProof added in v1.3.0

func (m *MessageMutation) ClearProof()

ClearProof clears the value of the "proof" field.

func (*MessageMutation) ClearedEdges added in v1.3.0

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

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

func (*MessageMutation) ClearedFields added in v1.3.0

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

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

func (MessageMutation) Client added in v1.3.0

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) EdgeCleared added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

func (m *MessageMutation) 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 (*MessageMutation) IDs added in v1.3.0

func (m *MessageMutation) 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 (*MessageMutation) Message added in v1.3.0

func (m *MessageMutation) Message() (r string, exists bool)

Message returns the value of the "message" field in the mutation.

func (*MessageMutation) OldAnchorID added in v1.3.0

func (m *MessageMutation) OldAnchorID(ctx context.Context) (v int, err error)

OldAnchorID returns the old "anchor_id" 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 added in v1.3.0

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) OldMessage added in v1.3.0

func (m *MessageMutation) OldMessage(ctx context.Context) (v string, err error)

OldMessage returns the old "message" 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) OldProof added in v1.3.0

func (m *MessageMutation) OldProof(ctx context.Context) (v json.RawMessage, err error)

OldProof returns the old "proof" 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) OldRoot added in v1.3.0

func (m *MessageMutation) OldRoot(ctx context.Context) (v string, err error)

OldRoot returns the old "root" 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 added in v1.3.0

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) Proof added in v1.3.0

func (m *MessageMutation) Proof() (r json.RawMessage, exists bool)

Proof returns the value of the "proof" field in the mutation.

func (*MessageMutation) ProofCleared added in v1.3.0

func (m *MessageMutation) ProofCleared() bool

ProofCleared returns if the "proof" field was cleared in this mutation.

func (*MessageMutation) RemovedEdges added in v1.3.0

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

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

func (*MessageMutation) RemovedIDs added in v1.3.0

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) ResetAnchorID added in v1.3.0

func (m *MessageMutation) ResetAnchorID()

ResetAnchorID resets all changes to the "anchor_id" field.

func (*MessageMutation) ResetEdge added in v1.3.0

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 added in v1.3.0

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) ResetMessage added in v1.3.0

func (m *MessageMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*MessageMutation) ResetProof added in v1.3.0

func (m *MessageMutation) ResetProof()

ResetProof resets all changes to the "proof" field.

func (*MessageMutation) ResetRoot added in v1.3.0

func (m *MessageMutation) ResetRoot()

ResetRoot resets all changes to the "root" field.

func (*MessageMutation) Root added in v1.3.0

func (m *MessageMutation) Root() (r string, exists bool)

Root returns the value of the "root" field in the mutation.

func (*MessageMutation) SetAnchorID added in v1.3.0

func (m *MessageMutation) SetAnchorID(i int)

SetAnchorID sets the "anchor_id" field.

func (*MessageMutation) SetField added in v1.3.0

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) SetID added in v1.3.0

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

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

func (*MessageMutation) SetMessage added in v1.3.0

func (m *MessageMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*MessageMutation) SetOp added in v1.3.0

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetProof added in v1.3.0

func (m *MessageMutation) SetProof(jm json.RawMessage)

SetProof sets the "proof" field.

func (*MessageMutation) SetRoot added in v1.3.0

func (m *MessageMutation) SetRoot(s string)

SetRoot sets the "root" field.

func (MessageMutation) Tx added in v1.3.0

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 added in v1.3.0

func (m *MessageMutation) Type() string

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

func (*MessageMutation) Where added in v1.3.0

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP added in v1.3.0

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 added in v1.3.0

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

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate added in v1.3.0

func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All added in v1.3.0

func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX added in v1.3.0

func (mq *MessageQuery) AllX(ctx context.Context) []*Message

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

func (*MessageQuery) Clone added in v1.3.0

func (mq *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 added in v1.3.0

func (mq *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX added in v1.3.0

func (mq *MessageQuery) CountX(ctx context.Context) int

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

func (*MessageQuery) Exist added in v1.3.0

func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)

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

func (*MessageQuery) ExistX added in v1.3.0

func (mq *MessageQuery) ExistX(ctx context.Context) bool

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

func (*MessageQuery) First added in v1.3.0

func (mq *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 added in v1.3.0

func (mq *MessageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*MessageQuery) FirstIDX added in v1.3.0

func (mq *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*MessageQuery) FirstX added in v1.3.0

func (mq *MessageQuery) FirstX(ctx context.Context) *Message

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

func (*MessageQuery) GroupBy added in v1.3.0

func (mq *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 {
	Message string `json:"message,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldMessage).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs added in v1.3.0

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

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

func (*MessageQuery) IDsX added in v1.3.0

func (mq *MessageQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*MessageQuery) Limit added in v1.3.0

func (mq *MessageQuery) Limit(limit int) *MessageQuery

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

func (*MessageQuery) Offset added in v1.3.0

func (mq *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only added in v1.3.0

func (mq *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 added in v1.3.0

func (mq *MessageQuery) OnlyID(ctx context.Context) (id uuid.UUID, 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 added in v1.3.0

func (mq *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*MessageQuery) OnlyX added in v1.3.0

func (mq *MessageQuery) OnlyX(ctx context.Context) *Message

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

func (*MessageQuery) Order added in v1.3.0

func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) Select added in v1.3.0

func (mq *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 {
	Message string `json:"message,omitempty"`
}

client.Message.Query().
	Select(message.FieldMessage).
	Scan(ctx, &v)

func (*MessageQuery) Unique added in v1.3.0

func (mq *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 added in v1.3.0

func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

type MessageSelect added in v1.3.0

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate added in v1.3.0

func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageSelect) Bools added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageSelect) Float64 added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageSelect) Float64s added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageSelect) Int added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageSelect) Ints added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageSelect) Scan added in v1.3.0

func (ms *MessageSelect) Scan(ctx context.Context, v any) error

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

func (*MessageSelect) ScanX added in v1.3.0

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

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

func (*MessageSelect) String added in v1.3.0

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 added in v1.3.0

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

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

func (*MessageSelect) Strings added in v1.3.0

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 added in v1.3.0

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

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

type MessageUpdate added in v1.3.0

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

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) AddAnchorID added in v1.3.0

func (mu *MessageUpdate) AddAnchorID(i int) *MessageUpdate

AddAnchorID adds i to the "anchor_id" field.

func (*MessageUpdate) AppendProof added in v1.3.0

func (mu *MessageUpdate) AppendProof(jm json.RawMessage) *MessageUpdate

AppendProof appends jm to the "proof" field.

func (*MessageUpdate) ClearProof added in v1.3.0

func (mu *MessageUpdate) ClearProof() *MessageUpdate

ClearProof clears the value of the "proof" field.

func (*MessageUpdate) Exec added in v1.3.0

func (mu *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX added in v1.3.0

func (mu *MessageUpdate) ExecX(ctx context.Context)

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

func (*MessageUpdate) Mutation added in v1.3.0

func (mu *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) Save added in v1.3.0

func (mu *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 added in v1.3.0

func (mu *MessageUpdate) SaveX(ctx context.Context) int

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

func (*MessageUpdate) SetAnchorID added in v1.3.0

func (mu *MessageUpdate) SetAnchorID(i int) *MessageUpdate

SetAnchorID sets the "anchor_id" field.

func (*MessageUpdate) SetMessage added in v1.3.0

func (mu *MessageUpdate) SetMessage(s string) *MessageUpdate

SetMessage sets the "message" field.

func (*MessageUpdate) SetNillableAnchorID added in v1.3.0

func (mu *MessageUpdate) SetNillableAnchorID(i *int) *MessageUpdate

SetNillableAnchorID sets the "anchor_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableRoot added in v1.3.0

func (mu *MessageUpdate) SetNillableRoot(s *string) *MessageUpdate

SetNillableRoot sets the "root" field if the given value is not nil.

func (*MessageUpdate) SetProof added in v1.3.0

func (mu *MessageUpdate) SetProof(jm json.RawMessage) *MessageUpdate

SetProof sets the "proof" field.

func (*MessageUpdate) SetRoot added in v1.3.0

func (mu *MessageUpdate) SetRoot(s string) *MessageUpdate

SetRoot sets the "root" field.

func (*MessageUpdate) Where added in v1.3.0

func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne added in v1.3.0

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

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) AddAnchorID added in v1.3.0

func (muo *MessageUpdateOne) AddAnchorID(i int) *MessageUpdateOne

AddAnchorID adds i to the "anchor_id" field.

func (*MessageUpdateOne) AppendProof added in v1.3.0

func (muo *MessageUpdateOne) AppendProof(jm json.RawMessage) *MessageUpdateOne

AppendProof appends jm to the "proof" field.

func (*MessageUpdateOne) ClearProof added in v1.3.0

func (muo *MessageUpdateOne) ClearProof() *MessageUpdateOne

ClearProof clears the value of the "proof" field.

func (*MessageUpdateOne) Exec added in v1.3.0

func (muo *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX added in v1.3.0

func (muo *MessageUpdateOne) ExecX(ctx context.Context)

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

func (*MessageUpdateOne) Mutation added in v1.3.0

func (muo *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) Save added in v1.3.0

func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX added in v1.3.0

func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message

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

func (*MessageUpdateOne) Select added in v1.3.0

func (muo *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) SetAnchorID added in v1.3.0

func (muo *MessageUpdateOne) SetAnchorID(i int) *MessageUpdateOne

SetAnchorID sets the "anchor_id" field.

func (*MessageUpdateOne) SetMessage added in v1.3.0

func (muo *MessageUpdateOne) SetMessage(s string) *MessageUpdateOne

SetMessage sets the "message" field.

func (*MessageUpdateOne) SetNillableAnchorID added in v1.3.0

func (muo *MessageUpdateOne) SetNillableAnchorID(i *int) *MessageUpdateOne

SetNillableAnchorID sets the "anchor_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableRoot added in v1.3.0

func (muo *MessageUpdateOne) SetNillableRoot(s *string) *MessageUpdateOne

SetNillableRoot sets the "root" field if the given value is not nil.

func (*MessageUpdateOne) SetProof added in v1.3.0

func (muo *MessageUpdateOne) SetProof(jm json.RawMessage) *MessageUpdateOne

SetProof sets the "proof" field.

func (*MessageUpdateOne) SetRoot added in v1.3.0

func (muo *MessageUpdateOne) SetRoot(s string) *MessageUpdateOne

SetRoot sets the "root" field.

func (*MessageUpdateOne) Where added in v1.3.0

Where appends a list predicates to the MessageUpdate builder.

type Messages added in v1.3.0

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 Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Process added in v1.3.0

type Process struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Filename holds the value of the "filename" field.
	Filename string `json:"filename,omitempty"`
	// Status holds the value of the "status" field.
	Status bool `json:"status,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash string `json:"hash,omitempty"`
	// ProcessResponse holds the value of the "process_response" field.
	ProcessResponse json.RawMessage `json:"process_response,omitempty"`
	// AnchorID holds the value of the "anchor_id" field.
	AnchorID int `json:"anchor_id,omitempty"`
	// IsAggregated holds the value of the "is_aggregated" field.
	IsAggregated bool `json:"is_aggregated,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Process is the model entity for the Process schema.

func (*Process) String added in v1.3.0

func (pr *Process) String() string

String implements the fmt.Stringer.

func (*Process) Unwrap added in v1.3.0

func (pr *Process) Unwrap() *Process

Unwrap unwraps the Process 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 (*Process) Update added in v1.3.0

func (pr *Process) Update() *ProcessUpdateOne

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

func (*Process) Value added in v1.3.0

func (pr *Process) Value(name string) (ent.Value, error)

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

type ProcessClient added in v1.3.0

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

ProcessClient is a client for the Process schema.

func NewProcessClient added in v1.3.0

func NewProcessClient(c config) *ProcessClient

NewProcessClient returns a client for the Process from the given config.

func (*ProcessClient) Create added in v1.3.0

func (c *ProcessClient) Create() *ProcessCreate

Create returns a builder for creating a Process entity.

func (*ProcessClient) CreateBulk added in v1.3.0

func (c *ProcessClient) CreateBulk(builders ...*ProcessCreate) *ProcessCreateBulk

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

func (*ProcessClient) Delete added in v1.3.0

func (c *ProcessClient) Delete() *ProcessDelete

Delete returns a delete builder for Process.

func (*ProcessClient) DeleteOne added in v1.3.0

func (c *ProcessClient) DeleteOne(pr *Process) *ProcessDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProcessClient) DeleteOneID added in v1.3.0

func (c *ProcessClient) DeleteOneID(id uuid.UUID) *ProcessDeleteOne

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

func (*ProcessClient) Get added in v1.3.0

func (c *ProcessClient) Get(ctx context.Context, id uuid.UUID) (*Process, error)

Get returns a Process entity by its id.

func (*ProcessClient) GetX added in v1.3.0

func (c *ProcessClient) GetX(ctx context.Context, id uuid.UUID) *Process

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

func (*ProcessClient) Hooks added in v1.3.0

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

Hooks returns the client hooks.

func (*ProcessClient) Intercept added in v1.3.0

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

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

func (*ProcessClient) Interceptors added in v1.3.0

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

Interceptors returns the client interceptors.

func (*ProcessClient) MapCreateBulk added in v1.3.0

func (c *ProcessClient) MapCreateBulk(slice any, setFunc func(*ProcessCreate, int)) *ProcessCreateBulk

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 (*ProcessClient) Query added in v1.3.0

func (c *ProcessClient) Query() *ProcessQuery

Query returns a query builder for Process.

func (*ProcessClient) Update added in v1.3.0

func (c *ProcessClient) Update() *ProcessUpdate

Update returns an update builder for Process.

func (*ProcessClient) UpdateOne added in v1.3.0

func (c *ProcessClient) UpdateOne(pr *Process) *ProcessUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProcessClient) UpdateOneID added in v1.3.0

func (c *ProcessClient) UpdateOneID(id uuid.UUID) *ProcessUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProcessClient) Use added in v1.3.0

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

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

type ProcessCreate added in v1.3.0

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

ProcessCreate is the builder for creating a Process entity.

func (*ProcessCreate) Exec added in v1.3.0

func (pc *ProcessCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessCreate) ExecX added in v1.3.0

func (pc *ProcessCreate) ExecX(ctx context.Context)

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

func (*ProcessCreate) Mutation added in v1.3.0

func (pc *ProcessCreate) Mutation() *ProcessMutation

Mutation returns the ProcessMutation object of the builder.

func (*ProcessCreate) Save added in v1.3.0

func (pc *ProcessCreate) Save(ctx context.Context) (*Process, error)

Save creates the Process in the database.

func (*ProcessCreate) SaveX added in v1.3.0

func (pc *ProcessCreate) SaveX(ctx context.Context) *Process

SaveX calls Save and panics if Save returns an error.

func (*ProcessCreate) SetAnchorID added in v1.3.0

func (pc *ProcessCreate) SetAnchorID(i int) *ProcessCreate

SetAnchorID sets the "anchor_id" field.

func (*ProcessCreate) SetCreatedAt added in v1.3.0

func (pc *ProcessCreate) SetCreatedAt(t time.Time) *ProcessCreate

SetCreatedAt sets the "created_at" field.

func (*ProcessCreate) SetFilename added in v1.3.0

func (pc *ProcessCreate) SetFilename(s string) *ProcessCreate

SetFilename sets the "filename" field.

func (*ProcessCreate) SetHash added in v1.3.0

func (pc *ProcessCreate) SetHash(s string) *ProcessCreate

SetHash sets the "hash" field.

func (*ProcessCreate) SetID added in v1.3.0

func (pc *ProcessCreate) SetID(u uuid.UUID) *ProcessCreate

SetID sets the "id" field.

func (*ProcessCreate) SetIsAggregated added in v1.3.0

func (pc *ProcessCreate) SetIsAggregated(b bool) *ProcessCreate

SetIsAggregated sets the "is_aggregated" field.

func (*ProcessCreate) SetNillableAnchorID added in v1.3.0

func (pc *ProcessCreate) SetNillableAnchorID(i *int) *ProcessCreate

SetNillableAnchorID sets the "anchor_id" field if the given value is not nil.

func (*ProcessCreate) SetNillableCreatedAt added in v1.3.0

func (pc *ProcessCreate) SetNillableCreatedAt(t *time.Time) *ProcessCreate

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

func (*ProcessCreate) SetNillableID added in v1.3.0

func (pc *ProcessCreate) SetNillableID(u *uuid.UUID) *ProcessCreate

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

func (*ProcessCreate) SetNillableIsAggregated added in v1.3.0

func (pc *ProcessCreate) SetNillableIsAggregated(b *bool) *ProcessCreate

SetNillableIsAggregated sets the "is_aggregated" field if the given value is not nil.

func (*ProcessCreate) SetNillableStatus added in v1.3.0

func (pc *ProcessCreate) SetNillableStatus(b *bool) *ProcessCreate

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

func (*ProcessCreate) SetProcessResponse added in v1.3.0

func (pc *ProcessCreate) SetProcessResponse(jm json.RawMessage) *ProcessCreate

SetProcessResponse sets the "process_response" field.

func (*ProcessCreate) SetStatus added in v1.3.0

func (pc *ProcessCreate) SetStatus(b bool) *ProcessCreate

SetStatus sets the "status" field.

type ProcessCreateBulk added in v1.3.0

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

ProcessCreateBulk is the builder for creating many Process entities in bulk.

func (*ProcessCreateBulk) Exec added in v1.3.0

func (pcb *ProcessCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessCreateBulk) ExecX added in v1.3.0

func (pcb *ProcessCreateBulk) ExecX(ctx context.Context)

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

func (*ProcessCreateBulk) Save added in v1.3.0

func (pcb *ProcessCreateBulk) Save(ctx context.Context) ([]*Process, error)

Save creates the Process entities in the database.

func (*ProcessCreateBulk) SaveX added in v1.3.0

func (pcb *ProcessCreateBulk) SaveX(ctx context.Context) []*Process

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

type ProcessDelete added in v1.3.0

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

ProcessDelete is the builder for deleting a Process entity.

func (*ProcessDelete) Exec added in v1.3.0

func (pd *ProcessDelete) Exec(ctx context.Context) (int, error)

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

func (*ProcessDelete) ExecX added in v1.3.0

func (pd *ProcessDelete) ExecX(ctx context.Context) int

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

func (*ProcessDelete) Where added in v1.3.0

func (pd *ProcessDelete) Where(ps ...predicate.Process) *ProcessDelete

Where appends a list predicates to the ProcessDelete builder.

type ProcessDeleteOne added in v1.3.0

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

ProcessDeleteOne is the builder for deleting a single Process entity.

func (*ProcessDeleteOne) Exec added in v1.3.0

func (pdo *ProcessDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProcessDeleteOne) ExecX added in v1.3.0

func (pdo *ProcessDeleteOne) ExecX(ctx context.Context)

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

func (*ProcessDeleteOne) Where added in v1.3.0

Where appends a list predicates to the ProcessDelete builder.

type ProcessGroupBy added in v1.3.0

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

ProcessGroupBy is the group-by builder for Process entities.

func (*ProcessGroupBy) Aggregate added in v1.3.0

func (pgb *ProcessGroupBy) Aggregate(fns ...AggregateFunc) *ProcessGroupBy

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

func (*ProcessGroupBy) Bool added in v1.3.0

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

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

func (*ProcessGroupBy) BoolX added in v1.3.0

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

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

func (*ProcessGroupBy) Bools added in v1.3.0

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

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

func (*ProcessGroupBy) BoolsX added in v1.3.0

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

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

func (*ProcessGroupBy) Float64 added in v1.3.0

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

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

func (*ProcessGroupBy) Float64X added in v1.3.0

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

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

func (*ProcessGroupBy) Float64s added in v1.3.0

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

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

func (*ProcessGroupBy) Float64sX added in v1.3.0

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

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

func (*ProcessGroupBy) Int added in v1.3.0

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

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

func (*ProcessGroupBy) IntX added in v1.3.0

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

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

func (*ProcessGroupBy) Ints added in v1.3.0

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

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

func (*ProcessGroupBy) IntsX added in v1.3.0

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

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

func (*ProcessGroupBy) Scan added in v1.3.0

func (pgb *ProcessGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProcessGroupBy) ScanX added in v1.3.0

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

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

func (*ProcessGroupBy) String added in v1.3.0

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

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

func (*ProcessGroupBy) StringX added in v1.3.0

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

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

func (*ProcessGroupBy) Strings added in v1.3.0

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

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

func (*ProcessGroupBy) StringsX added in v1.3.0

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

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

type ProcessMutation added in v1.3.0

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

ProcessMutation represents an operation that mutates the Process nodes in the graph.

func (*ProcessMutation) AddAnchorID added in v1.3.0

func (m *ProcessMutation) AddAnchorID(i int)

AddAnchorID adds i to the "anchor_id" field.

func (*ProcessMutation) AddField added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) AddedAnchorID added in v1.3.0

func (m *ProcessMutation) AddedAnchorID() (r int, exists bool)

AddedAnchorID returns the value that was added to the "anchor_id" field in this mutation.

func (*ProcessMutation) AddedEdges added in v1.3.0

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

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

func (*ProcessMutation) AddedField added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) AddedFields added in v1.3.0

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

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

func (*ProcessMutation) AddedIDs added in v1.3.0

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

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

func (*ProcessMutation) AnchorID added in v1.3.0

func (m *ProcessMutation) AnchorID() (r int, exists bool)

AnchorID returns the value of the "anchor_id" field in the mutation.

func (*ProcessMutation) AnchorIDCleared added in v1.3.0

func (m *ProcessMutation) AnchorIDCleared() bool

AnchorIDCleared returns if the "anchor_id" field was cleared in this mutation.

func (*ProcessMutation) AppendProcessResponse added in v1.3.0

func (m *ProcessMutation) AppendProcessResponse(jm json.RawMessage)

AppendProcessResponse adds jm to the "process_response" field.

func (*ProcessMutation) AppendedProcessResponse added in v1.3.0

func (m *ProcessMutation) AppendedProcessResponse() (json.RawMessage, bool)

AppendedProcessResponse returns the list of values that were appended to the "process_response" field in this mutation.

func (*ProcessMutation) ClearAnchorID added in v1.3.0

func (m *ProcessMutation) ClearAnchorID()

ClearAnchorID clears the value of the "anchor_id" field.

func (*ProcessMutation) ClearEdge added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) ClearField added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) ClearProcessResponse added in v1.3.0

func (m *ProcessMutation) ClearProcessResponse()

ClearProcessResponse clears the value of the "process_response" field.

func (*ProcessMutation) ClearedEdges added in v1.3.0

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

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

func (*ProcessMutation) ClearedFields added in v1.3.0

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

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

func (ProcessMutation) Client added in v1.3.0

func (m ProcessMutation) 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 (*ProcessMutation) CreatedAt added in v1.3.0

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

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

func (*ProcessMutation) EdgeCleared added in v1.3.0

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

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

func (*ProcessMutation) Field added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) FieldCleared added in v1.3.0

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

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

func (*ProcessMutation) Fields added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) Filename added in v1.3.0

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

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

func (*ProcessMutation) Hash added in v1.3.0

func (m *ProcessMutation) Hash() (r string, exists bool)

Hash returns the value of the "hash" field in the mutation.

func (*ProcessMutation) ID added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) IDs added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) IsAggregated added in v1.3.0

func (m *ProcessMutation) IsAggregated() (r bool, exists bool)

IsAggregated returns the value of the "is_aggregated" field in the mutation.

func (*ProcessMutation) OldAnchorID added in v1.3.0

func (m *ProcessMutation) OldAnchorID(ctx context.Context) (v int, err error)

OldAnchorID returns the old "anchor_id" field's value of the Process entity. If the Process object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProcessMutation) OldCreatedAt added in v1.3.0

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

OldCreatedAt returns the old "created_at" field's value of the Process entity. If the Process object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProcessMutation) OldField added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) OldFilename added in v1.3.0

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

OldFilename returns the old "filename" field's value of the Process entity. If the Process object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProcessMutation) OldHash added in v1.3.0

func (m *ProcessMutation) OldHash(ctx context.Context) (v string, err error)

OldHash returns the old "hash" field's value of the Process entity. If the Process object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProcessMutation) OldIsAggregated added in v1.3.0

func (m *ProcessMutation) OldIsAggregated(ctx context.Context) (v bool, err error)

OldIsAggregated returns the old "is_aggregated" field's value of the Process entity. If the Process object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProcessMutation) OldProcessResponse added in v1.3.0

func (m *ProcessMutation) OldProcessResponse(ctx context.Context) (v json.RawMessage, err error)

OldProcessResponse returns the old "process_response" field's value of the Process entity. If the Process object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProcessMutation) OldStatus added in v1.3.0

func (m *ProcessMutation) OldStatus(ctx context.Context) (v bool, err error)

OldStatus returns the old "status" field's value of the Process entity. If the Process object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProcessMutation) Op added in v1.3.0

func (m *ProcessMutation) Op() Op

Op returns the operation name.

func (*ProcessMutation) ProcessResponse added in v1.3.0

func (m *ProcessMutation) ProcessResponse() (r json.RawMessage, exists bool)

ProcessResponse returns the value of the "process_response" field in the mutation.

func (*ProcessMutation) ProcessResponseCleared added in v1.3.0

func (m *ProcessMutation) ProcessResponseCleared() bool

ProcessResponseCleared returns if the "process_response" field was cleared in this mutation.

func (*ProcessMutation) RemovedEdges added in v1.3.0

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

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

func (*ProcessMutation) RemovedIDs added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) ResetAnchorID added in v1.3.0

func (m *ProcessMutation) ResetAnchorID()

ResetAnchorID resets all changes to the "anchor_id" field.

func (*ProcessMutation) ResetCreatedAt added in v1.3.0

func (m *ProcessMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProcessMutation) ResetEdge added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) ResetField added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) ResetFilename added in v1.3.0

func (m *ProcessMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*ProcessMutation) ResetHash added in v1.3.0

func (m *ProcessMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*ProcessMutation) ResetIsAggregated added in v1.3.0

func (m *ProcessMutation) ResetIsAggregated()

ResetIsAggregated resets all changes to the "is_aggregated" field.

func (*ProcessMutation) ResetProcessResponse added in v1.3.0

func (m *ProcessMutation) ResetProcessResponse()

ResetProcessResponse resets all changes to the "process_response" field.

func (*ProcessMutation) ResetStatus added in v1.3.0

func (m *ProcessMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*ProcessMutation) SetAnchorID added in v1.3.0

func (m *ProcessMutation) SetAnchorID(i int)

SetAnchorID sets the "anchor_id" field.

func (*ProcessMutation) SetCreatedAt added in v1.3.0

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

SetCreatedAt sets the "created_at" field.

func (*ProcessMutation) SetField added in v1.3.0

func (m *ProcessMutation) 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 (*ProcessMutation) SetFilename added in v1.3.0

func (m *ProcessMutation) SetFilename(s string)

SetFilename sets the "filename" field.

func (*ProcessMutation) SetHash added in v1.3.0

func (m *ProcessMutation) SetHash(s string)

SetHash sets the "hash" field.

func (*ProcessMutation) SetID added in v1.3.0

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

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

func (*ProcessMutation) SetIsAggregated added in v1.3.0

func (m *ProcessMutation) SetIsAggregated(b bool)

SetIsAggregated sets the "is_aggregated" field.

func (*ProcessMutation) SetOp added in v1.3.0

func (m *ProcessMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProcessMutation) SetProcessResponse added in v1.3.0

func (m *ProcessMutation) SetProcessResponse(jm json.RawMessage)

SetProcessResponse sets the "process_response" field.

func (*ProcessMutation) SetStatus added in v1.3.0

func (m *ProcessMutation) SetStatus(b bool)

SetStatus sets the "status" field.

func (*ProcessMutation) Status added in v1.3.0

func (m *ProcessMutation) Status() (r bool, exists bool)

Status returns the value of the "status" field in the mutation.

func (ProcessMutation) Tx added in v1.3.0

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

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

func (*ProcessMutation) Type added in v1.3.0

func (m *ProcessMutation) Type() string

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

func (*ProcessMutation) Where added in v1.3.0

func (m *ProcessMutation) Where(ps ...predicate.Process)

Where appends a list predicates to the ProcessMutation builder.

func (*ProcessMutation) WhereP added in v1.3.0

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

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

type ProcessQuery added in v1.3.0

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

ProcessQuery is the builder for querying Process entities.

func (*ProcessQuery) Aggregate added in v1.3.0

func (pq *ProcessQuery) Aggregate(fns ...AggregateFunc) *ProcessSelect

Aggregate returns a ProcessSelect configured with the given aggregations.

func (*ProcessQuery) All added in v1.3.0

func (pq *ProcessQuery) All(ctx context.Context) ([]*Process, error)

All executes the query and returns a list of Processes.

func (*ProcessQuery) AllX added in v1.3.0

func (pq *ProcessQuery) AllX(ctx context.Context) []*Process

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

func (*ProcessQuery) Clone added in v1.3.0

func (pq *ProcessQuery) Clone() *ProcessQuery

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

func (*ProcessQuery) Count added in v1.3.0

func (pq *ProcessQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProcessQuery) CountX added in v1.3.0

func (pq *ProcessQuery) CountX(ctx context.Context) int

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

func (*ProcessQuery) Exist added in v1.3.0

func (pq *ProcessQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProcessQuery) ExistX added in v1.3.0

func (pq *ProcessQuery) ExistX(ctx context.Context) bool

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

func (*ProcessQuery) First added in v1.3.0

func (pq *ProcessQuery) First(ctx context.Context) (*Process, error)

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

func (*ProcessQuery) FirstID added in v1.3.0

func (pq *ProcessQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ProcessQuery) FirstIDX added in v1.3.0

func (pq *ProcessQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ProcessQuery) FirstX added in v1.3.0

func (pq *ProcessQuery) FirstX(ctx context.Context) *Process

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

func (*ProcessQuery) GroupBy added in v1.3.0

func (pq *ProcessQuery) GroupBy(field string, fields ...string) *ProcessGroupBy

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

client.Process.Query().
	GroupBy(process.FieldFilename).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProcessQuery) IDs added in v1.3.0

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

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

func (*ProcessQuery) IDsX added in v1.3.0

func (pq *ProcessQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ProcessQuery) Limit added in v1.3.0

func (pq *ProcessQuery) Limit(limit int) *ProcessQuery

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

func (*ProcessQuery) Offset added in v1.3.0

func (pq *ProcessQuery) Offset(offset int) *ProcessQuery

Offset to start from.

func (*ProcessQuery) Only added in v1.3.0

func (pq *ProcessQuery) Only(ctx context.Context) (*Process, error)

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

func (*ProcessQuery) OnlyID added in v1.3.0

func (pq *ProcessQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ProcessQuery) OnlyIDX added in v1.3.0

func (pq *ProcessQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ProcessQuery) OnlyX added in v1.3.0

func (pq *ProcessQuery) OnlyX(ctx context.Context) *Process

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

func (*ProcessQuery) Order added in v1.3.0

func (pq *ProcessQuery) Order(o ...process.OrderOption) *ProcessQuery

Order specifies how the records should be ordered.

func (*ProcessQuery) Select added in v1.3.0

func (pq *ProcessQuery) Select(fields ...string) *ProcessSelect

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

client.Process.Query().
	Select(process.FieldFilename).
	Scan(ctx, &v)

func (*ProcessQuery) Unique added in v1.3.0

func (pq *ProcessQuery) Unique(unique bool) *ProcessQuery

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 (*ProcessQuery) Where added in v1.3.0

func (pq *ProcessQuery) Where(ps ...predicate.Process) *ProcessQuery

Where adds a new predicate for the ProcessQuery builder.

type ProcessSelect added in v1.3.0

type ProcessSelect struct {
	*ProcessQuery
	// contains filtered or unexported fields
}

ProcessSelect is the builder for selecting fields of Process entities.

func (*ProcessSelect) Aggregate added in v1.3.0

func (ps *ProcessSelect) Aggregate(fns ...AggregateFunc) *ProcessSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProcessSelect) Bool added in v1.3.0

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

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

func (*ProcessSelect) BoolX added in v1.3.0

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

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

func (*ProcessSelect) Bools added in v1.3.0

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

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

func (*ProcessSelect) BoolsX added in v1.3.0

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

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

func (*ProcessSelect) Float64 added in v1.3.0

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

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

func (*ProcessSelect) Float64X added in v1.3.0

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

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

func (*ProcessSelect) Float64s added in v1.3.0

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

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

func (*ProcessSelect) Float64sX added in v1.3.0

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

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

func (*ProcessSelect) Int added in v1.3.0

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

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

func (*ProcessSelect) IntX added in v1.3.0

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

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

func (*ProcessSelect) Ints added in v1.3.0

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

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

func (*ProcessSelect) IntsX added in v1.3.0

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

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

func (*ProcessSelect) Scan added in v1.3.0

func (ps *ProcessSelect) Scan(ctx context.Context, v any) error

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

func (*ProcessSelect) ScanX added in v1.3.0

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

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

func (*ProcessSelect) String added in v1.3.0

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

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

func (*ProcessSelect) StringX added in v1.3.0

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

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

func (*ProcessSelect) Strings added in v1.3.0

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

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

func (*ProcessSelect) StringsX added in v1.3.0

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

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

type ProcessUpdate added in v1.3.0

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

ProcessUpdate is the builder for updating Process entities.

func (*ProcessUpdate) AddAnchorID added in v1.3.0

func (pu *ProcessUpdate) AddAnchorID(i int) *ProcessUpdate

AddAnchorID adds i to the "anchor_id" field.

func (*ProcessUpdate) AppendProcessResponse added in v1.3.0

func (pu *ProcessUpdate) AppendProcessResponse(jm json.RawMessage) *ProcessUpdate

AppendProcessResponse appends jm to the "process_response" field.

func (*ProcessUpdate) ClearAnchorID added in v1.3.0

func (pu *ProcessUpdate) ClearAnchorID() *ProcessUpdate

ClearAnchorID clears the value of the "anchor_id" field.

func (*ProcessUpdate) ClearProcessResponse added in v1.3.0

func (pu *ProcessUpdate) ClearProcessResponse() *ProcessUpdate

ClearProcessResponse clears the value of the "process_response" field.

func (*ProcessUpdate) Exec added in v1.3.0

func (pu *ProcessUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProcessUpdate) ExecX added in v1.3.0

func (pu *ProcessUpdate) ExecX(ctx context.Context)

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

func (*ProcessUpdate) Mutation added in v1.3.0

func (pu *ProcessUpdate) Mutation() *ProcessMutation

Mutation returns the ProcessMutation object of the builder.

func (*ProcessUpdate) Save added in v1.3.0

func (pu *ProcessUpdate) Save(ctx context.Context) (int, error)

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

func (*ProcessUpdate) SaveX added in v1.3.0

func (pu *ProcessUpdate) SaveX(ctx context.Context) int

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

func (*ProcessUpdate) SetAnchorID added in v1.3.0

func (pu *ProcessUpdate) SetAnchorID(i int) *ProcessUpdate

SetAnchorID sets the "anchor_id" field.

func (*ProcessUpdate) SetCreatedAt added in v1.3.0

func (pu *ProcessUpdate) SetCreatedAt(t time.Time) *ProcessUpdate

SetCreatedAt sets the "created_at" field.

func (*ProcessUpdate) SetFilename added in v1.3.0

func (pu *ProcessUpdate) SetFilename(s string) *ProcessUpdate

SetFilename sets the "filename" field.

func (*ProcessUpdate) SetHash added in v1.3.0

func (pu *ProcessUpdate) SetHash(s string) *ProcessUpdate

SetHash sets the "hash" field.

func (*ProcessUpdate) SetIsAggregated added in v1.3.0

func (pu *ProcessUpdate) SetIsAggregated(b bool) *ProcessUpdate

SetIsAggregated sets the "is_aggregated" field.

func (*ProcessUpdate) SetNillableAnchorID added in v1.3.0

func (pu *ProcessUpdate) SetNillableAnchorID(i *int) *ProcessUpdate

SetNillableAnchorID sets the "anchor_id" field if the given value is not nil.

func (*ProcessUpdate) SetNillableCreatedAt added in v1.3.0

func (pu *ProcessUpdate) SetNillableCreatedAt(t *time.Time) *ProcessUpdate

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

func (*ProcessUpdate) SetNillableIsAggregated added in v1.3.0

func (pu *ProcessUpdate) SetNillableIsAggregated(b *bool) *ProcessUpdate

SetNillableIsAggregated sets the "is_aggregated" field if the given value is not nil.

func (*ProcessUpdate) SetNillableStatus added in v1.3.0

func (pu *ProcessUpdate) SetNillableStatus(b *bool) *ProcessUpdate

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

func (*ProcessUpdate) SetProcessResponse added in v1.3.0

func (pu *ProcessUpdate) SetProcessResponse(jm json.RawMessage) *ProcessUpdate

SetProcessResponse sets the "process_response" field.

func (*ProcessUpdate) SetStatus added in v1.3.0

func (pu *ProcessUpdate) SetStatus(b bool) *ProcessUpdate

SetStatus sets the "status" field.

func (*ProcessUpdate) Where added in v1.3.0

func (pu *ProcessUpdate) Where(ps ...predicate.Process) *ProcessUpdate

Where appends a list predicates to the ProcessUpdate builder.

type ProcessUpdateOne added in v1.3.0

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

ProcessUpdateOne is the builder for updating a single Process entity.

func (*ProcessUpdateOne) AddAnchorID added in v1.3.0

func (puo *ProcessUpdateOne) AddAnchorID(i int) *ProcessUpdateOne

AddAnchorID adds i to the "anchor_id" field.

func (*ProcessUpdateOne) AppendProcessResponse added in v1.3.0

func (puo *ProcessUpdateOne) AppendProcessResponse(jm json.RawMessage) *ProcessUpdateOne

AppendProcessResponse appends jm to the "process_response" field.

func (*ProcessUpdateOne) ClearAnchorID added in v1.3.0

func (puo *ProcessUpdateOne) ClearAnchorID() *ProcessUpdateOne

ClearAnchorID clears the value of the "anchor_id" field.

func (*ProcessUpdateOne) ClearProcessResponse added in v1.3.0

func (puo *ProcessUpdateOne) ClearProcessResponse() *ProcessUpdateOne

ClearProcessResponse clears the value of the "process_response" field.

func (*ProcessUpdateOne) Exec added in v1.3.0

func (puo *ProcessUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProcessUpdateOne) ExecX added in v1.3.0

func (puo *ProcessUpdateOne) ExecX(ctx context.Context)

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

func (*ProcessUpdateOne) Mutation added in v1.3.0

func (puo *ProcessUpdateOne) Mutation() *ProcessMutation

Mutation returns the ProcessMutation object of the builder.

func (*ProcessUpdateOne) Save added in v1.3.0

func (puo *ProcessUpdateOne) Save(ctx context.Context) (*Process, error)

Save executes the query and returns the updated Process entity.

func (*ProcessUpdateOne) SaveX added in v1.3.0

func (puo *ProcessUpdateOne) SaveX(ctx context.Context) *Process

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

func (*ProcessUpdateOne) Select added in v1.3.0

func (puo *ProcessUpdateOne) Select(field string, fields ...string) *ProcessUpdateOne

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

func (*ProcessUpdateOne) SetAnchorID added in v1.3.0

func (puo *ProcessUpdateOne) SetAnchorID(i int) *ProcessUpdateOne

SetAnchorID sets the "anchor_id" field.

func (*ProcessUpdateOne) SetCreatedAt added in v1.3.0

func (puo *ProcessUpdateOne) SetCreatedAt(t time.Time) *ProcessUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ProcessUpdateOne) SetFilename added in v1.3.0

func (puo *ProcessUpdateOne) SetFilename(s string) *ProcessUpdateOne

SetFilename sets the "filename" field.

func (*ProcessUpdateOne) SetHash added in v1.3.0

func (puo *ProcessUpdateOne) SetHash(s string) *ProcessUpdateOne

SetHash sets the "hash" field.

func (*ProcessUpdateOne) SetIsAggregated added in v1.3.0

func (puo *ProcessUpdateOne) SetIsAggregated(b bool) *ProcessUpdateOne

SetIsAggregated sets the "is_aggregated" field.

func (*ProcessUpdateOne) SetNillableAnchorID added in v1.3.0

func (puo *ProcessUpdateOne) SetNillableAnchorID(i *int) *ProcessUpdateOne

SetNillableAnchorID sets the "anchor_id" field if the given value is not nil.

func (*ProcessUpdateOne) SetNillableCreatedAt added in v1.3.0

func (puo *ProcessUpdateOne) SetNillableCreatedAt(t *time.Time) *ProcessUpdateOne

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

func (*ProcessUpdateOne) SetNillableIsAggregated added in v1.3.0

func (puo *ProcessUpdateOne) SetNillableIsAggregated(b *bool) *ProcessUpdateOne

SetNillableIsAggregated sets the "is_aggregated" field if the given value is not nil.

func (*ProcessUpdateOne) SetNillableStatus added in v1.3.0

func (puo *ProcessUpdateOne) SetNillableStatus(b *bool) *ProcessUpdateOne

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

func (*ProcessUpdateOne) SetProcessResponse added in v1.3.0

func (puo *ProcessUpdateOne) SetProcessResponse(jm json.RawMessage) *ProcessUpdateOne

SetProcessResponse sets the "process_response" field.

func (*ProcessUpdateOne) SetStatus added in v1.3.0

func (puo *ProcessUpdateOne) SetStatus(b bool) *ProcessUpdateOne

SetStatus sets the "status" field.

func (*ProcessUpdateOne) Where added in v1.3.0

Where appends a list predicates to the ProcessUpdate builder.

type Processes added in v1.3.0

type Processes []*Process

Processes is a parsable slice of Process.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Certification is the client for interacting with the Certification builders.
	Certification *CertificationClient
	// LocalKey is the client for interacting with the LocalKey builders.
	LocalKey *LocalKeyClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Process is the client for interacting with the Process builders.
	Process *ProcessClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL