ent

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.
	TypeDiff     = "Diff"
	TypeGate     = "Gate"
	TypeRequest  = "Request"
	TypeResponse = "Response"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Diff is the client for interacting with the Diff builders.
	Diff *DiffClient
	// Gate is the client for interacting with the Gate builders.
	Gate *GateClient
	// Request is the client for interacting with the Request builders.
	Request *RequestClient
	// Response is the client for interacting with the Response builders.
	Response *ResponseClient
	// 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().
	Diff.
	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 Diff

type Diff struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// RequestID holds the value of the "request_id" field.
	RequestID uuid.UUID `json:"request_id,omitempty"`
	// FromResponseID holds the value of the "from_response_id" field.
	FromResponseID uuid.UUID `json:"from_response_id,omitempty"`
	// ToResponseID holds the value of the "to_response_id" field.
	ToResponseID uuid.UUID `json:"to_response_id,omitempty"`
	// Content holds the value of the "content" field.
	Content []diff.PatchOp `json:"content,omitempty"`
	// Config holds the value of the "config" field.
	Config schema.DiffConfigSnapshot `json:"config,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DiffQuery when eager-loading is set.
	Edges DiffEdges `json:"edges"`
	// contains filtered or unexported fields
}

Diff is the model entity for the Diff schema.

func (*Diff) QueryFromResponse

func (_m *Diff) QueryFromResponse() *ResponseQuery

QueryFromResponse queries the "from_response" edge of the Diff entity.

func (*Diff) QueryRequest

func (_m *Diff) QueryRequest() *RequestQuery

QueryRequest queries the "request" edge of the Diff entity.

func (*Diff) QueryToResponse

func (_m *Diff) QueryToResponse() *ResponseQuery

QueryToResponse queries the "to_response" edge of the Diff entity.

func (*Diff) String

func (_m *Diff) String() string

String implements the fmt.Stringer.

func (*Diff) Unwrap

func (_m *Diff) Unwrap() *Diff

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

func (_m *Diff) Update() *DiffUpdateOne

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

func (*Diff) Value

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

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

type DiffClient

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

DiffClient is a client for the Diff schema.

func NewDiffClient

func NewDiffClient(c config) *DiffClient

NewDiffClient returns a client for the Diff from the given config.

func (*DiffClient) Create

func (c *DiffClient) Create() *DiffCreate

Create returns a builder for creating a Diff entity.

func (*DiffClient) CreateBulk

func (c *DiffClient) CreateBulk(builders ...*DiffCreate) *DiffCreateBulk

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

func (*DiffClient) Delete

func (c *DiffClient) Delete() *DiffDelete

Delete returns a delete builder for Diff.

func (*DiffClient) DeleteOne

func (c *DiffClient) DeleteOne(_m *Diff) *DiffDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DiffClient) DeleteOneID

func (c *DiffClient) DeleteOneID(id uuid.UUID) *DiffDeleteOne

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

func (*DiffClient) Get

func (c *DiffClient) Get(ctx context.Context, id uuid.UUID) (*Diff, error)

Get returns a Diff entity by its id.

func (*DiffClient) GetX

func (c *DiffClient) GetX(ctx context.Context, id uuid.UUID) *Diff

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

func (*DiffClient) Hooks

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

Hooks returns the client hooks.

func (*DiffClient) Intercept

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

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

func (*DiffClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DiffClient) MapCreateBulk

func (c *DiffClient) MapCreateBulk(slice any, setFunc func(*DiffCreate, int)) *DiffCreateBulk

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

func (c *DiffClient) Query() *DiffQuery

Query returns a query builder for Diff.

func (*DiffClient) QueryFromResponse

func (c *DiffClient) QueryFromResponse(_m *Diff) *ResponseQuery

QueryFromResponse queries the from_response edge of a Diff.

func (*DiffClient) QueryRequest

func (c *DiffClient) QueryRequest(_m *Diff) *RequestQuery

QueryRequest queries the request edge of a Diff.

func (*DiffClient) QueryToResponse

func (c *DiffClient) QueryToResponse(_m *Diff) *ResponseQuery

QueryToResponse queries the to_response edge of a Diff.

func (*DiffClient) Update

func (c *DiffClient) Update() *DiffUpdate

Update returns an update builder for Diff.

func (*DiffClient) UpdateOne

func (c *DiffClient) UpdateOne(_m *Diff) *DiffUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DiffClient) UpdateOneID

func (c *DiffClient) UpdateOneID(id uuid.UUID) *DiffUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DiffClient) Use

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

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

type DiffCreate

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

DiffCreate is the builder for creating a Diff entity.

func (*DiffCreate) Exec

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

Exec executes the query.

func (*DiffCreate) ExecX

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

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

func (*DiffCreate) Mutation

func (_c *DiffCreate) Mutation() *DiffMutation

Mutation returns the DiffMutation object of the builder.

func (*DiffCreate) Save

func (_c *DiffCreate) Save(ctx context.Context) (*Diff, error)

Save creates the Diff in the database.

func (*DiffCreate) SaveX

func (_c *DiffCreate) SaveX(ctx context.Context) *Diff

SaveX calls Save and panics if Save returns an error.

func (*DiffCreate) SetConfig added in v1.4.0

func (_c *DiffCreate) SetConfig(v schema.DiffConfigSnapshot) *DiffCreate

SetConfig sets the "config" field.

func (*DiffCreate) SetContent

func (_c *DiffCreate) SetContent(v []diff.PatchOp) *DiffCreate

SetContent sets the "content" field.

func (*DiffCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DiffCreate) SetFromResponse

func (_c *DiffCreate) SetFromResponse(v *Response) *DiffCreate

SetFromResponse sets the "from_response" edge to the Response entity.

func (*DiffCreate) SetFromResponseID

func (_c *DiffCreate) SetFromResponseID(v uuid.UUID) *DiffCreate

SetFromResponseID sets the "from_response_id" field.

func (*DiffCreate) SetID

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

SetID sets the "id" field.

func (*DiffCreate) SetNillableConfig added in v1.4.0

func (_c *DiffCreate) SetNillableConfig(v *schema.DiffConfigSnapshot) *DiffCreate

SetNillableConfig sets the "config" field if the given value is not nil.

func (*DiffCreate) SetNillableCreatedAt

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

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

func (*DiffCreate) SetNillableID

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

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

func (*DiffCreate) SetRequest

func (_c *DiffCreate) SetRequest(v *Request) *DiffCreate

SetRequest sets the "request" edge to the Request entity.

func (*DiffCreate) SetRequestID

func (_c *DiffCreate) SetRequestID(v uuid.UUID) *DiffCreate

SetRequestID sets the "request_id" field.

func (*DiffCreate) SetToResponse

func (_c *DiffCreate) SetToResponse(v *Response) *DiffCreate

SetToResponse sets the "to_response" edge to the Response entity.

func (*DiffCreate) SetToResponseID

func (_c *DiffCreate) SetToResponseID(v uuid.UUID) *DiffCreate

SetToResponseID sets the "to_response_id" field.

type DiffCreateBulk

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

DiffCreateBulk is the builder for creating many Diff entities in bulk.

func (*DiffCreateBulk) Exec

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

Exec executes the query.

func (*DiffCreateBulk) ExecX

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

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

func (*DiffCreateBulk) Save

func (_c *DiffCreateBulk) Save(ctx context.Context) ([]*Diff, error)

Save creates the Diff entities in the database.

func (*DiffCreateBulk) SaveX

func (_c *DiffCreateBulk) SaveX(ctx context.Context) []*Diff

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

type DiffDelete

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

DiffDelete is the builder for deleting a Diff entity.

func (*DiffDelete) Exec

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

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

func (*DiffDelete) ExecX

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

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

func (*DiffDelete) Where

func (_d *DiffDelete) Where(ps ...predicate.Diff) *DiffDelete

Where appends a list predicates to the DiffDelete builder.

type DiffDeleteOne

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

DiffDeleteOne is the builder for deleting a single Diff entity.

func (*DiffDeleteOne) Exec

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

Exec executes the deletion query.

func (*DiffDeleteOne) ExecX

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

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

func (*DiffDeleteOne) Where

func (_d *DiffDeleteOne) Where(ps ...predicate.Diff) *DiffDeleteOne

Where appends a list predicates to the DiffDelete builder.

type DiffEdges

type DiffEdges struct {
	// Request holds the value of the request edge.
	Request *Request `json:"request,omitempty"`
	// FromResponse holds the value of the from_response edge.
	FromResponse *Response `json:"from_response,omitempty"`
	// ToResponse holds the value of the to_response edge.
	ToResponse *Response `json:"to_response,omitempty"`
	// contains filtered or unexported fields
}

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

func (DiffEdges) FromResponseOrErr

func (e DiffEdges) FromResponseOrErr() (*Response, error)

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

func (DiffEdges) RequestOrErr

func (e DiffEdges) RequestOrErr() (*Request, error)

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

func (DiffEdges) ToResponseOrErr

func (e DiffEdges) ToResponseOrErr() (*Response, error)

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

type DiffGroupBy

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

DiffGroupBy is the group-by builder for Diff entities.

func (*DiffGroupBy) Aggregate

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

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

func (*DiffGroupBy) Bool

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

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

func (*DiffGroupBy) BoolX

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

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

func (*DiffGroupBy) Bools

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

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

func (*DiffGroupBy) BoolsX

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

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

func (*DiffGroupBy) Float64

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

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

func (*DiffGroupBy) Float64X

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

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

func (*DiffGroupBy) Float64s

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

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

func (*DiffGroupBy) Float64sX

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

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

func (*DiffGroupBy) Int

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

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

func (*DiffGroupBy) IntX

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

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

func (*DiffGroupBy) Ints

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

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

func (*DiffGroupBy) IntsX

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

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

func (*DiffGroupBy) Scan

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

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

func (*DiffGroupBy) ScanX

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

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

func (*DiffGroupBy) String

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

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

func (*DiffGroupBy) StringX

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

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

func (*DiffGroupBy) Strings

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

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

func (*DiffGroupBy) StringsX

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

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

type DiffMutation

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

DiffMutation represents an operation that mutates the Diff nodes in the graph.

func (*DiffMutation) AddField

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

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

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

func (*DiffMutation) AddedField

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

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

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

func (*DiffMutation) AddedIDs

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

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

func (*DiffMutation) AppendContent

func (m *DiffMutation) AppendContent(do []diff.PatchOp)

AppendContent adds do to the "content" field.

func (*DiffMutation) AppendedContent

func (m *DiffMutation) AppendedContent() ([]diff.PatchOp, bool)

AppendedContent returns the list of values that were appended to the "content" field in this mutation.

func (*DiffMutation) ClearConfig added in v1.4.0

func (m *DiffMutation) ClearConfig()

ClearConfig clears the value of the "config" field.

func (*DiffMutation) ClearEdge

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

func (m *DiffMutation) 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 (*DiffMutation) ClearFromResponse

func (m *DiffMutation) ClearFromResponse()

ClearFromResponse clears the "from_response" edge to the Response entity.

func (*DiffMutation) ClearRequest

func (m *DiffMutation) ClearRequest()

ClearRequest clears the "request" edge to the Request entity.

func (*DiffMutation) ClearToResponse

func (m *DiffMutation) ClearToResponse()

ClearToResponse clears the "to_response" edge to the Response entity.

func (*DiffMutation) ClearedEdges

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

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

func (*DiffMutation) ClearedFields

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

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

func (DiffMutation) Client

func (m DiffMutation) 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 (*DiffMutation) Config added in v1.4.0

func (m *DiffMutation) Config() (r schema.DiffConfigSnapshot, exists bool)

Config returns the value of the "config" field in the mutation.

func (*DiffMutation) ConfigCleared added in v1.4.0

func (m *DiffMutation) ConfigCleared() bool

ConfigCleared returns if the "config" field was cleared in this mutation.

func (*DiffMutation) Content

func (m *DiffMutation) Content() (r []diff.PatchOp, exists bool)

Content returns the value of the "content" field in the mutation.

func (*DiffMutation) CreatedAt

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

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

func (*DiffMutation) EdgeCleared

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

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

func (*DiffMutation) Field

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

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

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

func (*DiffMutation) Fields

func (m *DiffMutation) 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 (*DiffMutation) FromResponseCleared

func (m *DiffMutation) FromResponseCleared() bool

FromResponseCleared reports if the "from_response" edge to the Response entity was cleared.

func (*DiffMutation) FromResponseID

func (m *DiffMutation) FromResponseID() (r uuid.UUID, exists bool)

FromResponseID returns the value of the "from_response_id" field in the mutation.

func (*DiffMutation) FromResponseIDs

func (m *DiffMutation) FromResponseIDs() (ids []uuid.UUID)

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

func (*DiffMutation) ID

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

func (m *DiffMutation) 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 (*DiffMutation) OldConfig added in v1.4.0

func (m *DiffMutation) OldConfig(ctx context.Context) (v schema.DiffConfigSnapshot, err error)

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

func (*DiffMutation) OldContent

func (m *DiffMutation) OldContent(ctx context.Context) (v []diff.PatchOp, err error)

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

func (*DiffMutation) OldCreatedAt

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

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

func (*DiffMutation) OldField

func (m *DiffMutation) 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 (*DiffMutation) OldFromResponseID

func (m *DiffMutation) OldFromResponseID(ctx context.Context) (v uuid.UUID, err error)

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

func (*DiffMutation) OldRequestID

func (m *DiffMutation) OldRequestID(ctx context.Context) (v uuid.UUID, err error)

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

func (*DiffMutation) OldToResponseID

func (m *DiffMutation) OldToResponseID(ctx context.Context) (v uuid.UUID, err error)

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

func (*DiffMutation) Op

func (m *DiffMutation) Op() Op

Op returns the operation name.

func (*DiffMutation) RemovedEdges

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

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

func (*DiffMutation) RemovedIDs

func (m *DiffMutation) 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 (*DiffMutation) RequestCleared

func (m *DiffMutation) RequestCleared() bool

RequestCleared reports if the "request" edge to the Request entity was cleared.

func (*DiffMutation) RequestID

func (m *DiffMutation) RequestID() (r uuid.UUID, exists bool)

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

func (*DiffMutation) RequestIDs

func (m *DiffMutation) RequestIDs() (ids []uuid.UUID)

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

func (*DiffMutation) ResetConfig added in v1.4.0

func (m *DiffMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*DiffMutation) ResetContent

func (m *DiffMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*DiffMutation) ResetCreatedAt

func (m *DiffMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DiffMutation) ResetEdge

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

func (m *DiffMutation) 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 (*DiffMutation) ResetFromResponse

func (m *DiffMutation) ResetFromResponse()

ResetFromResponse resets all changes to the "from_response" edge.

func (*DiffMutation) ResetFromResponseID

func (m *DiffMutation) ResetFromResponseID()

ResetFromResponseID resets all changes to the "from_response_id" field.

func (*DiffMutation) ResetRequest

func (m *DiffMutation) ResetRequest()

ResetRequest resets all changes to the "request" edge.

func (*DiffMutation) ResetRequestID

func (m *DiffMutation) ResetRequestID()

ResetRequestID resets all changes to the "request_id" field.

func (*DiffMutation) ResetToResponse

func (m *DiffMutation) ResetToResponse()

ResetToResponse resets all changes to the "to_response" edge.

func (*DiffMutation) ResetToResponseID

func (m *DiffMutation) ResetToResponseID()

ResetToResponseID resets all changes to the "to_response_id" field.

func (*DiffMutation) SetConfig added in v1.4.0

func (m *DiffMutation) SetConfig(scs schema.DiffConfigSnapshot)

SetConfig sets the "config" field.

func (*DiffMutation) SetContent

func (m *DiffMutation) SetContent(do []diff.PatchOp)

SetContent sets the "content" field.

func (*DiffMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DiffMutation) SetField

func (m *DiffMutation) 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 (*DiffMutation) SetFromResponseID

func (m *DiffMutation) SetFromResponseID(u uuid.UUID)

SetFromResponseID sets the "from_response_id" field.

func (*DiffMutation) SetID

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

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

func (*DiffMutation) SetOp

func (m *DiffMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DiffMutation) SetRequestID

func (m *DiffMutation) SetRequestID(u uuid.UUID)

SetRequestID sets the "request_id" field.

func (*DiffMutation) SetToResponseID

func (m *DiffMutation) SetToResponseID(u uuid.UUID)

SetToResponseID sets the "to_response_id" field.

func (*DiffMutation) ToResponseCleared

func (m *DiffMutation) ToResponseCleared() bool

ToResponseCleared reports if the "to_response" edge to the Response entity was cleared.

func (*DiffMutation) ToResponseID

func (m *DiffMutation) ToResponseID() (r uuid.UUID, exists bool)

ToResponseID returns the value of the "to_response_id" field in the mutation.

func (*DiffMutation) ToResponseIDs

func (m *DiffMutation) ToResponseIDs() (ids []uuid.UUID)

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

func (DiffMutation) Tx

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

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

func (*DiffMutation) Type

func (m *DiffMutation) Type() string

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

func (*DiffMutation) Where

func (m *DiffMutation) Where(ps ...predicate.Diff)

Where appends a list predicates to the DiffMutation builder.

func (*DiffMutation) WhereP

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

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

type DiffQuery

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

DiffQuery is the builder for querying Diff entities.

func (*DiffQuery) Aggregate

func (_q *DiffQuery) Aggregate(fns ...AggregateFunc) *DiffSelect

Aggregate returns a DiffSelect configured with the given aggregations.

func (*DiffQuery) All

func (_q *DiffQuery) All(ctx context.Context) ([]*Diff, error)

All executes the query and returns a list of Diffs.

func (*DiffQuery) AllX

func (_q *DiffQuery) AllX(ctx context.Context) []*Diff

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

func (*DiffQuery) Clone

func (_q *DiffQuery) Clone() *DiffQuery

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

func (*DiffQuery) Count

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

Count returns the count of the given query.

func (*DiffQuery) CountX

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

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

func (*DiffQuery) Exist

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

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

func (*DiffQuery) ExistX

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

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

func (*DiffQuery) First

func (_q *DiffQuery) First(ctx context.Context) (*Diff, error)

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

func (*DiffQuery) FirstID

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

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

func (*DiffQuery) FirstIDX

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

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

func (*DiffQuery) FirstX

func (_q *DiffQuery) FirstX(ctx context.Context) *Diff

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

func (*DiffQuery) GroupBy

func (_q *DiffQuery) GroupBy(field string, fields ...string) *DiffGroupBy

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 {
	RequestID uuid.UUID `json:"request_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Diff.Query().
	GroupBy(entdiff.FieldRequestID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DiffQuery) IDs

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

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

func (*DiffQuery) IDsX

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

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

func (*DiffQuery) Limit

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

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

func (*DiffQuery) Offset

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

Offset to start from.

func (*DiffQuery) Only

func (_q *DiffQuery) Only(ctx context.Context) (*Diff, error)

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

func (*DiffQuery) OnlyID

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

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

func (*DiffQuery) OnlyIDX

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

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

func (*DiffQuery) OnlyX

func (_q *DiffQuery) OnlyX(ctx context.Context) *Diff

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

func (*DiffQuery) Order

func (_q *DiffQuery) Order(o ...entdiff.OrderOption) *DiffQuery

Order specifies how the records should be ordered.

func (*DiffQuery) QueryFromResponse

func (_q *DiffQuery) QueryFromResponse() *ResponseQuery

QueryFromResponse chains the current query on the "from_response" edge.

func (*DiffQuery) QueryRequest

func (_q *DiffQuery) QueryRequest() *RequestQuery

QueryRequest chains the current query on the "request" edge.

func (*DiffQuery) QueryToResponse

func (_q *DiffQuery) QueryToResponse() *ResponseQuery

QueryToResponse chains the current query on the "to_response" edge.

func (*DiffQuery) Select

func (_q *DiffQuery) Select(fields ...string) *DiffSelect

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 {
	RequestID uuid.UUID `json:"request_id,omitempty"`
}

client.Diff.Query().
	Select(entdiff.FieldRequestID).
	Scan(ctx, &v)

func (*DiffQuery) Unique

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

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

func (_q *DiffQuery) Where(ps ...predicate.Diff) *DiffQuery

Where adds a new predicate for the DiffQuery builder.

func (*DiffQuery) WithFromResponse

func (_q *DiffQuery) WithFromResponse(opts ...func(*ResponseQuery)) *DiffQuery

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

func (*DiffQuery) WithRequest

func (_q *DiffQuery) WithRequest(opts ...func(*RequestQuery)) *DiffQuery

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

func (*DiffQuery) WithToResponse

func (_q *DiffQuery) WithToResponse(opts ...func(*ResponseQuery)) *DiffQuery

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

type DiffSelect

type DiffSelect struct {
	*DiffQuery
	// contains filtered or unexported fields
}

DiffSelect is the builder for selecting fields of Diff entities.

func (*DiffSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*DiffSelect) Bool

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

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

func (*DiffSelect) BoolX

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

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

func (*DiffSelect) Bools

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

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

func (*DiffSelect) BoolsX

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

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

func (*DiffSelect) Float64

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

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

func (*DiffSelect) Float64X

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

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

func (*DiffSelect) Float64s

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

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

func (*DiffSelect) Float64sX

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

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

func (*DiffSelect) Int

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

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

func (*DiffSelect) IntX

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

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

func (*DiffSelect) Ints

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

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

func (*DiffSelect) IntsX

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

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

func (*DiffSelect) Scan

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

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

func (*DiffSelect) ScanX

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

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

func (*DiffSelect) String

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

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

func (*DiffSelect) StringX

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

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

func (*DiffSelect) Strings

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

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

func (*DiffSelect) StringsX

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

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

type DiffUpdate

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

DiffUpdate is the builder for updating Diff entities.

func (*DiffUpdate) AppendContent

func (_u *DiffUpdate) AppendContent(v []diff.PatchOp) *DiffUpdate

AppendContent appends value to the "content" field.

func (*DiffUpdate) ClearConfig added in v1.4.0

func (_u *DiffUpdate) ClearConfig() *DiffUpdate

ClearConfig clears the value of the "config" field.

func (*DiffUpdate) ClearFromResponse

func (_u *DiffUpdate) ClearFromResponse() *DiffUpdate

ClearFromResponse clears the "from_response" edge to the Response entity.

func (*DiffUpdate) ClearRequest

func (_u *DiffUpdate) ClearRequest() *DiffUpdate

ClearRequest clears the "request" edge to the Request entity.

func (*DiffUpdate) ClearToResponse

func (_u *DiffUpdate) ClearToResponse() *DiffUpdate

ClearToResponse clears the "to_response" edge to the Response entity.

func (*DiffUpdate) Exec

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

Exec executes the query.

func (*DiffUpdate) ExecX

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

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

func (*DiffUpdate) Mutation

func (_u *DiffUpdate) Mutation() *DiffMutation

Mutation returns the DiffMutation object of the builder.

func (*DiffUpdate) Save

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

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

func (*DiffUpdate) SaveX

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

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

func (*DiffUpdate) SetConfig added in v1.4.0

func (_u *DiffUpdate) SetConfig(v schema.DiffConfigSnapshot) *DiffUpdate

SetConfig sets the "config" field.

func (*DiffUpdate) SetContent

func (_u *DiffUpdate) SetContent(v []diff.PatchOp) *DiffUpdate

SetContent sets the "content" field.

func (*DiffUpdate) SetFromResponse

func (_u *DiffUpdate) SetFromResponse(v *Response) *DiffUpdate

SetFromResponse sets the "from_response" edge to the Response entity.

func (*DiffUpdate) SetFromResponseID

func (_u *DiffUpdate) SetFromResponseID(v uuid.UUID) *DiffUpdate

SetFromResponseID sets the "from_response_id" field.

func (*DiffUpdate) SetNillableConfig added in v1.4.0

func (_u *DiffUpdate) SetNillableConfig(v *schema.DiffConfigSnapshot) *DiffUpdate

SetNillableConfig sets the "config" field if the given value is not nil.

func (*DiffUpdate) SetNillableFromResponseID

func (_u *DiffUpdate) SetNillableFromResponseID(v *uuid.UUID) *DiffUpdate

SetNillableFromResponseID sets the "from_response_id" field if the given value is not nil.

func (*DiffUpdate) SetNillableRequestID

func (_u *DiffUpdate) SetNillableRequestID(v *uuid.UUID) *DiffUpdate

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

func (*DiffUpdate) SetNillableToResponseID

func (_u *DiffUpdate) SetNillableToResponseID(v *uuid.UUID) *DiffUpdate

SetNillableToResponseID sets the "to_response_id" field if the given value is not nil.

func (*DiffUpdate) SetRequest

func (_u *DiffUpdate) SetRequest(v *Request) *DiffUpdate

SetRequest sets the "request" edge to the Request entity.

func (*DiffUpdate) SetRequestID

func (_u *DiffUpdate) SetRequestID(v uuid.UUID) *DiffUpdate

SetRequestID sets the "request_id" field.

func (*DiffUpdate) SetToResponse

func (_u *DiffUpdate) SetToResponse(v *Response) *DiffUpdate

SetToResponse sets the "to_response" edge to the Response entity.

func (*DiffUpdate) SetToResponseID

func (_u *DiffUpdate) SetToResponseID(v uuid.UUID) *DiffUpdate

SetToResponseID sets the "to_response_id" field.

func (*DiffUpdate) Where

func (_u *DiffUpdate) Where(ps ...predicate.Diff) *DiffUpdate

Where appends a list predicates to the DiffUpdate builder.

type DiffUpdateOne

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

DiffUpdateOne is the builder for updating a single Diff entity.

func (*DiffUpdateOne) AppendContent

func (_u *DiffUpdateOne) AppendContent(v []diff.PatchOp) *DiffUpdateOne

AppendContent appends value to the "content" field.

func (*DiffUpdateOne) ClearConfig added in v1.4.0

func (_u *DiffUpdateOne) ClearConfig() *DiffUpdateOne

ClearConfig clears the value of the "config" field.

func (*DiffUpdateOne) ClearFromResponse

func (_u *DiffUpdateOne) ClearFromResponse() *DiffUpdateOne

ClearFromResponse clears the "from_response" edge to the Response entity.

func (*DiffUpdateOne) ClearRequest

func (_u *DiffUpdateOne) ClearRequest() *DiffUpdateOne

ClearRequest clears the "request" edge to the Request entity.

func (*DiffUpdateOne) ClearToResponse

func (_u *DiffUpdateOne) ClearToResponse() *DiffUpdateOne

ClearToResponse clears the "to_response" edge to the Response entity.

func (*DiffUpdateOne) Exec

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

Exec executes the query on the entity.

func (*DiffUpdateOne) ExecX

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

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

func (*DiffUpdateOne) Mutation

func (_u *DiffUpdateOne) Mutation() *DiffMutation

Mutation returns the DiffMutation object of the builder.

func (*DiffUpdateOne) Save

func (_u *DiffUpdateOne) Save(ctx context.Context) (*Diff, error)

Save executes the query and returns the updated Diff entity.

func (*DiffUpdateOne) SaveX

func (_u *DiffUpdateOne) SaveX(ctx context.Context) *Diff

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

func (*DiffUpdateOne) Select

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

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

func (*DiffUpdateOne) SetConfig added in v1.4.0

SetConfig sets the "config" field.

func (*DiffUpdateOne) SetContent

func (_u *DiffUpdateOne) SetContent(v []diff.PatchOp) *DiffUpdateOne

SetContent sets the "content" field.

func (*DiffUpdateOne) SetFromResponse

func (_u *DiffUpdateOne) SetFromResponse(v *Response) *DiffUpdateOne

SetFromResponse sets the "from_response" edge to the Response entity.

func (*DiffUpdateOne) SetFromResponseID

func (_u *DiffUpdateOne) SetFromResponseID(v uuid.UUID) *DiffUpdateOne

SetFromResponseID sets the "from_response_id" field.

func (*DiffUpdateOne) SetNillableConfig added in v1.4.0

func (_u *DiffUpdateOne) SetNillableConfig(v *schema.DiffConfigSnapshot) *DiffUpdateOne

SetNillableConfig sets the "config" field if the given value is not nil.

func (*DiffUpdateOne) SetNillableFromResponseID

func (_u *DiffUpdateOne) SetNillableFromResponseID(v *uuid.UUID) *DiffUpdateOne

SetNillableFromResponseID sets the "from_response_id" field if the given value is not nil.

func (*DiffUpdateOne) SetNillableRequestID

func (_u *DiffUpdateOne) SetNillableRequestID(v *uuid.UUID) *DiffUpdateOne

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

func (*DiffUpdateOne) SetNillableToResponseID

func (_u *DiffUpdateOne) SetNillableToResponseID(v *uuid.UUID) *DiffUpdateOne

SetNillableToResponseID sets the "to_response_id" field if the given value is not nil.

func (*DiffUpdateOne) SetRequest

func (_u *DiffUpdateOne) SetRequest(v *Request) *DiffUpdateOne

SetRequest sets the "request" edge to the Request entity.

func (*DiffUpdateOne) SetRequestID

func (_u *DiffUpdateOne) SetRequestID(v uuid.UUID) *DiffUpdateOne

SetRequestID sets the "request_id" field.

func (*DiffUpdateOne) SetToResponse

func (_u *DiffUpdateOne) SetToResponse(v *Response) *DiffUpdateOne

SetToResponse sets the "to_response" edge to the Response entity.

func (*DiffUpdateOne) SetToResponseID

func (_u *DiffUpdateOne) SetToResponseID(v uuid.UUID) *DiffUpdateOne

SetToResponseID sets the "to_response_id" field.

func (*DiffUpdateOne) Where

func (_u *DiffUpdateOne) Where(ps ...predicate.Diff) *DiffUpdateOne

Where appends a list predicates to the DiffUpdate builder.

type Diffs

type Diffs []*Diff

Diffs is a parsable slice of Diff.

type Gate

type Gate struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// LiveURL holds the value of the "live_url" field.
	LiveURL string `json:"live_url,omitempty"`
	// ShadowURL holds the value of the "shadow_url" field.
	ShadowURL string `json:"shadow_url,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// DiffIgnoredFields holds the value of the "diff_ignored_fields" field.
	DiffIgnoredFields []string `json:"diff_ignored_fields,omitempty"`
	// DiffIncludedFields holds the value of the "diff_included_fields" field.
	DiffIncludedFields []string `json:"diff_included_fields,omitempty"`
	// DiffFloatTolerance holds the value of the "diff_float_tolerance" field.
	DiffFloatTolerance float64 `json:"diff_float_tolerance,omitempty"`
	// DiffSortArrays holds the value of the "diff_sort_arrays" field.
	DiffSortArrays bool `json:"diff_sort_arrays,omitempty"`
	// RedactedFields holds the value of the "redacted_fields" field.
	RedactedFields []string `json:"redacted_fields,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GateQuery when eager-loading is set.
	Edges GateEdges `json:"edges"`
	// contains filtered or unexported fields
}

Gate is the model entity for the Gate schema.

func (*Gate) QueryRequests

func (_m *Gate) QueryRequests() *RequestQuery

QueryRequests queries the "requests" edge of the Gate entity.

func (*Gate) String

func (_m *Gate) String() string

String implements the fmt.Stringer.

func (*Gate) Unwrap

func (_m *Gate) Unwrap() *Gate

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

func (_m *Gate) Update() *GateUpdateOne

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

func (*Gate) Value

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

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

type GateClient

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

GateClient is a client for the Gate schema.

func NewGateClient

func NewGateClient(c config) *GateClient

NewGateClient returns a client for the Gate from the given config.

func (*GateClient) Create

func (c *GateClient) Create() *GateCreate

Create returns a builder for creating a Gate entity.

func (*GateClient) CreateBulk

func (c *GateClient) CreateBulk(builders ...*GateCreate) *GateCreateBulk

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

func (*GateClient) Delete

func (c *GateClient) Delete() *GateDelete

Delete returns a delete builder for Gate.

func (*GateClient) DeleteOne

func (c *GateClient) DeleteOne(_m *Gate) *GateDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GateClient) DeleteOneID

func (c *GateClient) DeleteOneID(id uuid.UUID) *GateDeleteOne

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

func (*GateClient) Get

func (c *GateClient) Get(ctx context.Context, id uuid.UUID) (*Gate, error)

Get returns a Gate entity by its id.

func (*GateClient) GetX

func (c *GateClient) GetX(ctx context.Context, id uuid.UUID) *Gate

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

func (*GateClient) Hooks

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

Hooks returns the client hooks.

func (*GateClient) Intercept

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

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

func (*GateClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GateClient) MapCreateBulk

func (c *GateClient) MapCreateBulk(slice any, setFunc func(*GateCreate, int)) *GateCreateBulk

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

func (c *GateClient) Query() *GateQuery

Query returns a query builder for Gate.

func (*GateClient) QueryRequests

func (c *GateClient) QueryRequests(_m *Gate) *RequestQuery

QueryRequests queries the requests edge of a Gate.

func (*GateClient) Update

func (c *GateClient) Update() *GateUpdate

Update returns an update builder for Gate.

func (*GateClient) UpdateOne

func (c *GateClient) UpdateOne(_m *Gate) *GateUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GateClient) UpdateOneID

func (c *GateClient) UpdateOneID(id uuid.UUID) *GateUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GateClient) Use

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

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

type GateCreate

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

GateCreate is the builder for creating a Gate entity.

func (*GateCreate) AddRequestIDs

func (_c *GateCreate) AddRequestIDs(ids ...uuid.UUID) *GateCreate

AddRequestIDs adds the "requests" edge to the Request entity by IDs.

func (*GateCreate) AddRequests

func (_c *GateCreate) AddRequests(v ...*Request) *GateCreate

AddRequests adds the "requests" edges to the Request entity.

func (*GateCreate) Exec

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

Exec executes the query.

func (*GateCreate) ExecX

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

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

func (*GateCreate) Mutation

func (_c *GateCreate) Mutation() *GateMutation

Mutation returns the GateMutation object of the builder.

func (*GateCreate) Save

func (_c *GateCreate) Save(ctx context.Context) (*Gate, error)

Save creates the Gate in the database.

func (*GateCreate) SaveX

func (_c *GateCreate) SaveX(ctx context.Context) *Gate

SaveX calls Save and panics if Save returns an error.

func (*GateCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GateCreate) SetDiffFloatTolerance

func (_c *GateCreate) SetDiffFloatTolerance(v float64) *GateCreate

SetDiffFloatTolerance sets the "diff_float_tolerance" field.

func (*GateCreate) SetDiffIgnoredFields

func (_c *GateCreate) SetDiffIgnoredFields(v []string) *GateCreate

SetDiffIgnoredFields sets the "diff_ignored_fields" field.

func (*GateCreate) SetDiffIncludedFields

func (_c *GateCreate) SetDiffIncludedFields(v []string) *GateCreate

SetDiffIncludedFields sets the "diff_included_fields" field.

func (*GateCreate) SetDiffSortArrays added in v1.4.0

func (_c *GateCreate) SetDiffSortArrays(v bool) *GateCreate

SetDiffSortArrays sets the "diff_sort_arrays" field.

func (*GateCreate) SetID

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

SetID sets the "id" field.

func (*GateCreate) SetLiveURL

func (_c *GateCreate) SetLiveURL(v string) *GateCreate

SetLiveURL sets the "live_url" field.

func (*GateCreate) SetName

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

SetName sets the "name" field.

func (*GateCreate) SetNillableCreatedAt

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

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

func (*GateCreate) SetNillableDiffFloatTolerance

func (_c *GateCreate) SetNillableDiffFloatTolerance(v *float64) *GateCreate

SetNillableDiffFloatTolerance sets the "diff_float_tolerance" field if the given value is not nil.

func (*GateCreate) SetNillableDiffSortArrays added in v1.4.0

func (_c *GateCreate) SetNillableDiffSortArrays(v *bool) *GateCreate

SetNillableDiffSortArrays sets the "diff_sort_arrays" field if the given value is not nil.

func (*GateCreate) SetNillableID

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

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

func (*GateCreate) SetRedactedFields added in v1.1.0

func (_c *GateCreate) SetRedactedFields(v []string) *GateCreate

SetRedactedFields sets the "redacted_fields" field.

func (*GateCreate) SetShadowURL

func (_c *GateCreate) SetShadowURL(v string) *GateCreate

SetShadowURL sets the "shadow_url" field.

type GateCreateBulk

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

GateCreateBulk is the builder for creating many Gate entities in bulk.

func (*GateCreateBulk) Exec

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

Exec executes the query.

func (*GateCreateBulk) ExecX

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

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

func (*GateCreateBulk) Save

func (_c *GateCreateBulk) Save(ctx context.Context) ([]*Gate, error)

Save creates the Gate entities in the database.

func (*GateCreateBulk) SaveX

func (_c *GateCreateBulk) SaveX(ctx context.Context) []*Gate

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

type GateDelete

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

GateDelete is the builder for deleting a Gate entity.

func (*GateDelete) Exec

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

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

func (*GateDelete) ExecX

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

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

func (*GateDelete) Where

func (_d *GateDelete) Where(ps ...predicate.Gate) *GateDelete

Where appends a list predicates to the GateDelete builder.

type GateDeleteOne

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

GateDeleteOne is the builder for deleting a single Gate entity.

func (*GateDeleteOne) Exec

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

Exec executes the deletion query.

func (*GateDeleteOne) ExecX

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

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

func (*GateDeleteOne) Where

func (_d *GateDeleteOne) Where(ps ...predicate.Gate) *GateDeleteOne

Where appends a list predicates to the GateDelete builder.

type GateEdges

type GateEdges struct {
	// Requests holds the value of the requests edge.
	Requests []*Request `json:"requests,omitempty"`
	// contains filtered or unexported fields
}

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

func (GateEdges) RequestsOrErr

func (e GateEdges) RequestsOrErr() ([]*Request, error)

RequestsOrErr returns the Requests value or an error if the edge was not loaded in eager-loading.

type GateGroupBy

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

GateGroupBy is the group-by builder for Gate entities.

func (*GateGroupBy) Aggregate

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

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

func (*GateGroupBy) Bool

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

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

func (*GateGroupBy) BoolX

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

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

func (*GateGroupBy) Bools

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

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

func (*GateGroupBy) BoolsX

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

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

func (*GateGroupBy) Float64

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

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

func (*GateGroupBy) Float64X

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

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

func (*GateGroupBy) Float64s

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

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

func (*GateGroupBy) Float64sX

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

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

func (*GateGroupBy) Int

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

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

func (*GateGroupBy) IntX

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

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

func (*GateGroupBy) Ints

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

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

func (*GateGroupBy) IntsX

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

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

func (*GateGroupBy) Scan

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

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

func (*GateGroupBy) ScanX

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

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

func (*GateGroupBy) String

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

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

func (*GateGroupBy) StringX

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

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

func (*GateGroupBy) Strings

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

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

func (*GateGroupBy) StringsX

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

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

type GateMutation

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

GateMutation represents an operation that mutates the Gate nodes in the graph.

func (*GateMutation) AddDiffFloatTolerance

func (m *GateMutation) AddDiffFloatTolerance(f float64)

AddDiffFloatTolerance adds f to the "diff_float_tolerance" field.

func (*GateMutation) AddField

func (m *GateMutation) 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 (*GateMutation) AddRequestIDs

func (m *GateMutation) AddRequestIDs(ids ...uuid.UUID)

AddRequestIDs adds the "requests" edge to the Request entity by ids.

func (*GateMutation) AddedDiffFloatTolerance

func (m *GateMutation) AddedDiffFloatTolerance() (r float64, exists bool)

AddedDiffFloatTolerance returns the value that was added to the "diff_float_tolerance" field in this mutation.

func (*GateMutation) AddedEdges

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

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

func (*GateMutation) AddedField

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

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

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

func (*GateMutation) AddedIDs

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

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

func (*GateMutation) AppendDiffIgnoredFields

func (m *GateMutation) AppendDiffIgnoredFields(s []string)

AppendDiffIgnoredFields adds s to the "diff_ignored_fields" field.

func (*GateMutation) AppendDiffIncludedFields

func (m *GateMutation) AppendDiffIncludedFields(s []string)

AppendDiffIncludedFields adds s to the "diff_included_fields" field.

func (*GateMutation) AppendRedactedFields added in v1.1.0

func (m *GateMutation) AppendRedactedFields(s []string)

AppendRedactedFields adds s to the "redacted_fields" field.

func (*GateMutation) AppendedDiffIgnoredFields

func (m *GateMutation) AppendedDiffIgnoredFields() ([]string, bool)

AppendedDiffIgnoredFields returns the list of values that were appended to the "diff_ignored_fields" field in this mutation.

func (*GateMutation) AppendedDiffIncludedFields

func (m *GateMutation) AppendedDiffIncludedFields() ([]string, bool)

AppendedDiffIncludedFields returns the list of values that were appended to the "diff_included_fields" field in this mutation.

func (*GateMutation) AppendedRedactedFields added in v1.1.0

func (m *GateMutation) AppendedRedactedFields() ([]string, bool)

AppendedRedactedFields returns the list of values that were appended to the "redacted_fields" field in this mutation.

func (*GateMutation) ClearDiffFloatTolerance

func (m *GateMutation) ClearDiffFloatTolerance()

ClearDiffFloatTolerance clears the value of the "diff_float_tolerance" field.

func (*GateMutation) ClearDiffIgnoredFields

func (m *GateMutation) ClearDiffIgnoredFields()

ClearDiffIgnoredFields clears the value of the "diff_ignored_fields" field.

func (*GateMutation) ClearDiffIncludedFields

func (m *GateMutation) ClearDiffIncludedFields()

ClearDiffIncludedFields clears the value of the "diff_included_fields" field.

func (*GateMutation) ClearDiffSortArrays added in v1.4.0

func (m *GateMutation) ClearDiffSortArrays()

ClearDiffSortArrays clears the value of the "diff_sort_arrays" field.

func (*GateMutation) ClearEdge

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

func (m *GateMutation) 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 (*GateMutation) ClearRedactedFields added in v1.1.0

func (m *GateMutation) ClearRedactedFields()

ClearRedactedFields clears the value of the "redacted_fields" field.

func (*GateMutation) ClearRequests

func (m *GateMutation) ClearRequests()

ClearRequests clears the "requests" edge to the Request entity.

func (*GateMutation) ClearedEdges

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

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

func (*GateMutation) ClearedFields

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

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

func (GateMutation) Client

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

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

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

func (*GateMutation) DiffFloatTolerance

func (m *GateMutation) DiffFloatTolerance() (r float64, exists bool)

DiffFloatTolerance returns the value of the "diff_float_tolerance" field in the mutation.

func (*GateMutation) DiffFloatToleranceCleared

func (m *GateMutation) DiffFloatToleranceCleared() bool

DiffFloatToleranceCleared returns if the "diff_float_tolerance" field was cleared in this mutation.

func (*GateMutation) DiffIgnoredFields

func (m *GateMutation) DiffIgnoredFields() (r []string, exists bool)

DiffIgnoredFields returns the value of the "diff_ignored_fields" field in the mutation.

func (*GateMutation) DiffIgnoredFieldsCleared

func (m *GateMutation) DiffIgnoredFieldsCleared() bool

DiffIgnoredFieldsCleared returns if the "diff_ignored_fields" field was cleared in this mutation.

func (*GateMutation) DiffIncludedFields

func (m *GateMutation) DiffIncludedFields() (r []string, exists bool)

DiffIncludedFields returns the value of the "diff_included_fields" field in the mutation.

func (*GateMutation) DiffIncludedFieldsCleared

func (m *GateMutation) DiffIncludedFieldsCleared() bool

DiffIncludedFieldsCleared returns if the "diff_included_fields" field was cleared in this mutation.

func (*GateMutation) DiffSortArrays added in v1.4.0

func (m *GateMutation) DiffSortArrays() (r bool, exists bool)

DiffSortArrays returns the value of the "diff_sort_arrays" field in the mutation.

func (*GateMutation) DiffSortArraysCleared added in v1.4.0

func (m *GateMutation) DiffSortArraysCleared() bool

DiffSortArraysCleared returns if the "diff_sort_arrays" field was cleared in this mutation.

func (*GateMutation) EdgeCleared

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

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

func (*GateMutation) Field

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

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

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

func (*GateMutation) Fields

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

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

func (m *GateMutation) 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 (*GateMutation) LiveURL

func (m *GateMutation) LiveURL() (r string, exists bool)

LiveURL returns the value of the "live_url" field in the mutation.

func (*GateMutation) Name

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

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

func (*GateMutation) OldCreatedAt

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

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

func (*GateMutation) OldDiffFloatTolerance

func (m *GateMutation) OldDiffFloatTolerance(ctx context.Context) (v float64, err error)

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

func (*GateMutation) OldDiffIgnoredFields

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

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

func (*GateMutation) OldDiffIncludedFields

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

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

func (*GateMutation) OldDiffSortArrays added in v1.4.0

func (m *GateMutation) OldDiffSortArrays(ctx context.Context) (v bool, err error)

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

func (*GateMutation) OldField

func (m *GateMutation) 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 (*GateMutation) OldLiveURL

func (m *GateMutation) OldLiveURL(ctx context.Context) (v string, err error)

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

func (*GateMutation) OldName

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

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

func (*GateMutation) OldRedactedFields added in v1.1.0

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

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

func (*GateMutation) OldShadowURL

func (m *GateMutation) OldShadowURL(ctx context.Context) (v string, err error)

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

func (*GateMutation) Op

func (m *GateMutation) Op() Op

Op returns the operation name.

func (*GateMutation) RedactedFields added in v1.1.0

func (m *GateMutation) RedactedFields() (r []string, exists bool)

RedactedFields returns the value of the "redacted_fields" field in the mutation.

func (*GateMutation) RedactedFieldsCleared added in v1.1.0

func (m *GateMutation) RedactedFieldsCleared() bool

RedactedFieldsCleared returns if the "redacted_fields" field was cleared in this mutation.

func (*GateMutation) RemoveRequestIDs

func (m *GateMutation) RemoveRequestIDs(ids ...uuid.UUID)

RemoveRequestIDs removes the "requests" edge to the Request entity by IDs.

func (*GateMutation) RemovedEdges

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

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

func (*GateMutation) RemovedIDs

func (m *GateMutation) 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 (*GateMutation) RemovedRequestsIDs

func (m *GateMutation) RemovedRequestsIDs() (ids []uuid.UUID)

RemovedRequests returns the removed IDs of the "requests" edge to the Request entity.

func (*GateMutation) RequestsCleared

func (m *GateMutation) RequestsCleared() bool

RequestsCleared reports if the "requests" edge to the Request entity was cleared.

func (*GateMutation) RequestsIDs

func (m *GateMutation) RequestsIDs() (ids []uuid.UUID)

RequestsIDs returns the "requests" edge IDs in the mutation.

func (*GateMutation) ResetCreatedAt

func (m *GateMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GateMutation) ResetDiffFloatTolerance

func (m *GateMutation) ResetDiffFloatTolerance()

ResetDiffFloatTolerance resets all changes to the "diff_float_tolerance" field.

func (*GateMutation) ResetDiffIgnoredFields

func (m *GateMutation) ResetDiffIgnoredFields()

ResetDiffIgnoredFields resets all changes to the "diff_ignored_fields" field.

func (*GateMutation) ResetDiffIncludedFields

func (m *GateMutation) ResetDiffIncludedFields()

ResetDiffIncludedFields resets all changes to the "diff_included_fields" field.

func (*GateMutation) ResetDiffSortArrays added in v1.4.0

func (m *GateMutation) ResetDiffSortArrays()

ResetDiffSortArrays resets all changes to the "diff_sort_arrays" field.

func (*GateMutation) ResetEdge

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

func (m *GateMutation) 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 (*GateMutation) ResetLiveURL

func (m *GateMutation) ResetLiveURL()

ResetLiveURL resets all changes to the "live_url" field.

func (*GateMutation) ResetName

func (m *GateMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GateMutation) ResetRedactedFields added in v1.1.0

func (m *GateMutation) ResetRedactedFields()

ResetRedactedFields resets all changes to the "redacted_fields" field.

func (*GateMutation) ResetRequests

func (m *GateMutation) ResetRequests()

ResetRequests resets all changes to the "requests" edge.

func (*GateMutation) ResetShadowURL

func (m *GateMutation) ResetShadowURL()

ResetShadowURL resets all changes to the "shadow_url" field.

func (*GateMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GateMutation) SetDiffFloatTolerance

func (m *GateMutation) SetDiffFloatTolerance(f float64)

SetDiffFloatTolerance sets the "diff_float_tolerance" field.

func (*GateMutation) SetDiffIgnoredFields

func (m *GateMutation) SetDiffIgnoredFields(s []string)

SetDiffIgnoredFields sets the "diff_ignored_fields" field.

func (*GateMutation) SetDiffIncludedFields

func (m *GateMutation) SetDiffIncludedFields(s []string)

SetDiffIncludedFields sets the "diff_included_fields" field.

func (*GateMutation) SetDiffSortArrays added in v1.4.0

func (m *GateMutation) SetDiffSortArrays(b bool)

SetDiffSortArrays sets the "diff_sort_arrays" field.

func (*GateMutation) SetField

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

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

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

func (*GateMutation) SetLiveURL

func (m *GateMutation) SetLiveURL(s string)

SetLiveURL sets the "live_url" field.

func (*GateMutation) SetName

func (m *GateMutation) SetName(s string)

SetName sets the "name" field.

func (*GateMutation) SetOp

func (m *GateMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GateMutation) SetRedactedFields added in v1.1.0

func (m *GateMutation) SetRedactedFields(s []string)

SetRedactedFields sets the "redacted_fields" field.

func (*GateMutation) SetShadowURL

func (m *GateMutation) SetShadowURL(s string)

SetShadowURL sets the "shadow_url" field.

func (*GateMutation) ShadowURL

func (m *GateMutation) ShadowURL() (r string, exists bool)

ShadowURL returns the value of the "shadow_url" field in the mutation.

func (GateMutation) Tx

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

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

func (*GateMutation) Type

func (m *GateMutation) Type() string

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

func (*GateMutation) Where

func (m *GateMutation) Where(ps ...predicate.Gate)

Where appends a list predicates to the GateMutation builder.

func (*GateMutation) WhereP

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

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

type GateQuery

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

GateQuery is the builder for querying Gate entities.

func (*GateQuery) Aggregate

func (_q *GateQuery) Aggregate(fns ...AggregateFunc) *GateSelect

Aggregate returns a GateSelect configured with the given aggregations.

func (*GateQuery) All

func (_q *GateQuery) All(ctx context.Context) ([]*Gate, error)

All executes the query and returns a list of Gates.

func (*GateQuery) AllX

func (_q *GateQuery) AllX(ctx context.Context) []*Gate

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

func (*GateQuery) Clone

func (_q *GateQuery) Clone() *GateQuery

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

func (*GateQuery) Count

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

Count returns the count of the given query.

func (*GateQuery) CountX

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

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

func (*GateQuery) Exist

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

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

func (*GateQuery) ExistX

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

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

func (*GateQuery) First

func (_q *GateQuery) First(ctx context.Context) (*Gate, error)

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

func (*GateQuery) FirstID

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

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

func (*GateQuery) FirstIDX

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

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

func (*GateQuery) FirstX

func (_q *GateQuery) FirstX(ctx context.Context) *Gate

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

func (*GateQuery) GroupBy

func (_q *GateQuery) GroupBy(field string, fields ...string) *GateGroupBy

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

Example:

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

client.Gate.Query().
	GroupBy(gate.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GateQuery) IDs

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

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

func (*GateQuery) IDsX

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

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

func (*GateQuery) Limit

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

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

func (*GateQuery) Offset

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

Offset to start from.

func (*GateQuery) Only

func (_q *GateQuery) Only(ctx context.Context) (*Gate, error)

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

func (*GateQuery) OnlyID

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

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

func (*GateQuery) OnlyIDX

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

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

func (*GateQuery) OnlyX

func (_q *GateQuery) OnlyX(ctx context.Context) *Gate

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

func (*GateQuery) Order

func (_q *GateQuery) Order(o ...gate.OrderOption) *GateQuery

Order specifies how the records should be ordered.

func (*GateQuery) QueryRequests

func (_q *GateQuery) QueryRequests() *RequestQuery

QueryRequests chains the current query on the "requests" edge.

func (*GateQuery) Select

func (_q *GateQuery) Select(fields ...string) *GateSelect

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

Example:

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

client.Gate.Query().
	Select(gate.FieldName).
	Scan(ctx, &v)

func (*GateQuery) Unique

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

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

func (_q *GateQuery) Where(ps ...predicate.Gate) *GateQuery

Where adds a new predicate for the GateQuery builder.

func (*GateQuery) WithRequests

func (_q *GateQuery) WithRequests(opts ...func(*RequestQuery)) *GateQuery

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

type GateSelect

type GateSelect struct {
	*GateQuery
	// contains filtered or unexported fields
}

GateSelect is the builder for selecting fields of Gate entities.

func (*GateSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*GateSelect) Bool

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

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

func (*GateSelect) BoolX

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

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

func (*GateSelect) Bools

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

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

func (*GateSelect) BoolsX

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

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

func (*GateSelect) Float64

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

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

func (*GateSelect) Float64X

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

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

func (*GateSelect) Float64s

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

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

func (*GateSelect) Float64sX

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

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

func (*GateSelect) Int

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

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

func (*GateSelect) IntX

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

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

func (*GateSelect) Ints

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

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

func (*GateSelect) IntsX

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

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

func (*GateSelect) Scan

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

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

func (*GateSelect) ScanX

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

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

func (*GateSelect) String

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

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

func (*GateSelect) StringX

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

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

func (*GateSelect) Strings

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

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

func (*GateSelect) StringsX

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

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

type GateUpdate

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

GateUpdate is the builder for updating Gate entities.

func (*GateUpdate) AddDiffFloatTolerance

func (_u *GateUpdate) AddDiffFloatTolerance(v float64) *GateUpdate

AddDiffFloatTolerance adds value to the "diff_float_tolerance" field.

func (*GateUpdate) AddRequestIDs

func (_u *GateUpdate) AddRequestIDs(ids ...uuid.UUID) *GateUpdate

AddRequestIDs adds the "requests" edge to the Request entity by IDs.

func (*GateUpdate) AddRequests

func (_u *GateUpdate) AddRequests(v ...*Request) *GateUpdate

AddRequests adds the "requests" edges to the Request entity.

func (*GateUpdate) AppendDiffIgnoredFields

func (_u *GateUpdate) AppendDiffIgnoredFields(v []string) *GateUpdate

AppendDiffIgnoredFields appends value to the "diff_ignored_fields" field.

func (*GateUpdate) AppendDiffIncludedFields

func (_u *GateUpdate) AppendDiffIncludedFields(v []string) *GateUpdate

AppendDiffIncludedFields appends value to the "diff_included_fields" field.

func (*GateUpdate) AppendRedactedFields added in v1.1.0

func (_u *GateUpdate) AppendRedactedFields(v []string) *GateUpdate

AppendRedactedFields appends value to the "redacted_fields" field.

func (*GateUpdate) ClearDiffFloatTolerance

func (_u *GateUpdate) ClearDiffFloatTolerance() *GateUpdate

ClearDiffFloatTolerance clears the value of the "diff_float_tolerance" field.

func (*GateUpdate) ClearDiffIgnoredFields

func (_u *GateUpdate) ClearDiffIgnoredFields() *GateUpdate

ClearDiffIgnoredFields clears the value of the "diff_ignored_fields" field.

func (*GateUpdate) ClearDiffIncludedFields

func (_u *GateUpdate) ClearDiffIncludedFields() *GateUpdate

ClearDiffIncludedFields clears the value of the "diff_included_fields" field.

func (*GateUpdate) ClearDiffSortArrays added in v1.4.0

func (_u *GateUpdate) ClearDiffSortArrays() *GateUpdate

ClearDiffSortArrays clears the value of the "diff_sort_arrays" field.

func (*GateUpdate) ClearRedactedFields added in v1.1.0

func (_u *GateUpdate) ClearRedactedFields() *GateUpdate

ClearRedactedFields clears the value of the "redacted_fields" field.

func (*GateUpdate) ClearRequests

func (_u *GateUpdate) ClearRequests() *GateUpdate

ClearRequests clears all "requests" edges to the Request entity.

func (*GateUpdate) Exec

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

Exec executes the query.

func (*GateUpdate) ExecX

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

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

func (*GateUpdate) Mutation

func (_u *GateUpdate) Mutation() *GateMutation

Mutation returns the GateMutation object of the builder.

func (*GateUpdate) RemoveRequestIDs

func (_u *GateUpdate) RemoveRequestIDs(ids ...uuid.UUID) *GateUpdate

RemoveRequestIDs removes the "requests" edge to Request entities by IDs.

func (*GateUpdate) RemoveRequests

func (_u *GateUpdate) RemoveRequests(v ...*Request) *GateUpdate

RemoveRequests removes "requests" edges to Request entities.

func (*GateUpdate) Save

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

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

func (*GateUpdate) SaveX

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

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

func (*GateUpdate) SetDiffFloatTolerance

func (_u *GateUpdate) SetDiffFloatTolerance(v float64) *GateUpdate

SetDiffFloatTolerance sets the "diff_float_tolerance" field.

func (*GateUpdate) SetDiffIgnoredFields

func (_u *GateUpdate) SetDiffIgnoredFields(v []string) *GateUpdate

SetDiffIgnoredFields sets the "diff_ignored_fields" field.

func (*GateUpdate) SetDiffIncludedFields

func (_u *GateUpdate) SetDiffIncludedFields(v []string) *GateUpdate

SetDiffIncludedFields sets the "diff_included_fields" field.

func (*GateUpdate) SetDiffSortArrays added in v1.4.0

func (_u *GateUpdate) SetDiffSortArrays(v bool) *GateUpdate

SetDiffSortArrays sets the "diff_sort_arrays" field.

func (*GateUpdate) SetName

func (_u *GateUpdate) SetName(v string) *GateUpdate

SetName sets the "name" field.

func (*GateUpdate) SetNillableDiffFloatTolerance

func (_u *GateUpdate) SetNillableDiffFloatTolerance(v *float64) *GateUpdate

SetNillableDiffFloatTolerance sets the "diff_float_tolerance" field if the given value is not nil.

func (*GateUpdate) SetNillableDiffSortArrays added in v1.4.0

func (_u *GateUpdate) SetNillableDiffSortArrays(v *bool) *GateUpdate

SetNillableDiffSortArrays sets the "diff_sort_arrays" field if the given value is not nil.

func (*GateUpdate) SetNillableName

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

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

func (*GateUpdate) SetRedactedFields added in v1.1.0

func (_u *GateUpdate) SetRedactedFields(v []string) *GateUpdate

SetRedactedFields sets the "redacted_fields" field.

func (*GateUpdate) Where

func (_u *GateUpdate) Where(ps ...predicate.Gate) *GateUpdate

Where appends a list predicates to the GateUpdate builder.

type GateUpdateOne

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

GateUpdateOne is the builder for updating a single Gate entity.

func (*GateUpdateOne) AddDiffFloatTolerance

func (_u *GateUpdateOne) AddDiffFloatTolerance(v float64) *GateUpdateOne

AddDiffFloatTolerance adds value to the "diff_float_tolerance" field.

func (*GateUpdateOne) AddRequestIDs

func (_u *GateUpdateOne) AddRequestIDs(ids ...uuid.UUID) *GateUpdateOne

AddRequestIDs adds the "requests" edge to the Request entity by IDs.

func (*GateUpdateOne) AddRequests

func (_u *GateUpdateOne) AddRequests(v ...*Request) *GateUpdateOne

AddRequests adds the "requests" edges to the Request entity.

func (*GateUpdateOne) AppendDiffIgnoredFields

func (_u *GateUpdateOne) AppendDiffIgnoredFields(v []string) *GateUpdateOne

AppendDiffIgnoredFields appends value to the "diff_ignored_fields" field.

func (*GateUpdateOne) AppendDiffIncludedFields

func (_u *GateUpdateOne) AppendDiffIncludedFields(v []string) *GateUpdateOne

AppendDiffIncludedFields appends value to the "diff_included_fields" field.

func (*GateUpdateOne) AppendRedactedFields added in v1.1.0

func (_u *GateUpdateOne) AppendRedactedFields(v []string) *GateUpdateOne

AppendRedactedFields appends value to the "redacted_fields" field.

func (*GateUpdateOne) ClearDiffFloatTolerance

func (_u *GateUpdateOne) ClearDiffFloatTolerance() *GateUpdateOne

ClearDiffFloatTolerance clears the value of the "diff_float_tolerance" field.

func (*GateUpdateOne) ClearDiffIgnoredFields

func (_u *GateUpdateOne) ClearDiffIgnoredFields() *GateUpdateOne

ClearDiffIgnoredFields clears the value of the "diff_ignored_fields" field.

func (*GateUpdateOne) ClearDiffIncludedFields

func (_u *GateUpdateOne) ClearDiffIncludedFields() *GateUpdateOne

ClearDiffIncludedFields clears the value of the "diff_included_fields" field.

func (*GateUpdateOne) ClearDiffSortArrays added in v1.4.0

func (_u *GateUpdateOne) ClearDiffSortArrays() *GateUpdateOne

ClearDiffSortArrays clears the value of the "diff_sort_arrays" field.

func (*GateUpdateOne) ClearRedactedFields added in v1.1.0

func (_u *GateUpdateOne) ClearRedactedFields() *GateUpdateOne

ClearRedactedFields clears the value of the "redacted_fields" field.

func (*GateUpdateOne) ClearRequests

func (_u *GateUpdateOne) ClearRequests() *GateUpdateOne

ClearRequests clears all "requests" edges to the Request entity.

func (*GateUpdateOne) Exec

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

Exec executes the query on the entity.

func (*GateUpdateOne) ExecX

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

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

func (*GateUpdateOne) Mutation

func (_u *GateUpdateOne) Mutation() *GateMutation

Mutation returns the GateMutation object of the builder.

func (*GateUpdateOne) RemoveRequestIDs

func (_u *GateUpdateOne) RemoveRequestIDs(ids ...uuid.UUID) *GateUpdateOne

RemoveRequestIDs removes the "requests" edge to Request entities by IDs.

func (*GateUpdateOne) RemoveRequests

func (_u *GateUpdateOne) RemoveRequests(v ...*Request) *GateUpdateOne

RemoveRequests removes "requests" edges to Request entities.

func (*GateUpdateOne) Save

func (_u *GateUpdateOne) Save(ctx context.Context) (*Gate, error)

Save executes the query and returns the updated Gate entity.

func (*GateUpdateOne) SaveX

func (_u *GateUpdateOne) SaveX(ctx context.Context) *Gate

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

func (*GateUpdateOne) Select

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

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

func (*GateUpdateOne) SetDiffFloatTolerance

func (_u *GateUpdateOne) SetDiffFloatTolerance(v float64) *GateUpdateOne

SetDiffFloatTolerance sets the "diff_float_tolerance" field.

func (*GateUpdateOne) SetDiffIgnoredFields

func (_u *GateUpdateOne) SetDiffIgnoredFields(v []string) *GateUpdateOne

SetDiffIgnoredFields sets the "diff_ignored_fields" field.

func (*GateUpdateOne) SetDiffIncludedFields

func (_u *GateUpdateOne) SetDiffIncludedFields(v []string) *GateUpdateOne

SetDiffIncludedFields sets the "diff_included_fields" field.

func (*GateUpdateOne) SetDiffSortArrays added in v1.4.0

func (_u *GateUpdateOne) SetDiffSortArrays(v bool) *GateUpdateOne

SetDiffSortArrays sets the "diff_sort_arrays" field.

func (*GateUpdateOne) SetName

func (_u *GateUpdateOne) SetName(v string) *GateUpdateOne

SetName sets the "name" field.

func (*GateUpdateOne) SetNillableDiffFloatTolerance

func (_u *GateUpdateOne) SetNillableDiffFloatTolerance(v *float64) *GateUpdateOne

SetNillableDiffFloatTolerance sets the "diff_float_tolerance" field if the given value is not nil.

func (*GateUpdateOne) SetNillableDiffSortArrays added in v1.4.0

func (_u *GateUpdateOne) SetNillableDiffSortArrays(v *bool) *GateUpdateOne

SetNillableDiffSortArrays sets the "diff_sort_arrays" field if the given value is not nil.

func (*GateUpdateOne) SetNillableName

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

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

func (*GateUpdateOne) SetRedactedFields added in v1.1.0

func (_u *GateUpdateOne) SetRedactedFields(v []string) *GateUpdateOne

SetRedactedFields sets the "redacted_fields" field.

func (*GateUpdateOne) Where

func (_u *GateUpdateOne) Where(ps ...predicate.Gate) *GateUpdateOne

Where appends a list predicates to the GateUpdate builder.

type Gates

type Gates []*Gate

Gates is a parsable slice of Gate.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type Request

type Request struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// GateID holds the value of the "gate_id" field.
	GateID uuid.UUID `json:"gate_id,omitempty"`
	// Method holds the value of the "method" field.
	Method string `json:"method,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// RawQuery holds the value of the "raw_query" field.
	RawQuery string `json:"raw_query,omitempty"`
	// Headers holds the value of the "headers" field.
	Headers map[string][]string `json:"headers,omitempty"`
	// Body holds the value of the "body" field.
	Body json.RawMessage `json:"body,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RequestQuery when eager-loading is set.
	Edges RequestEdges `json:"edges"`
	// contains filtered or unexported fields
}

Request is the model entity for the Request schema.

func (*Request) QueryDiff

func (_m *Request) QueryDiff() *DiffQuery

QueryDiff queries the "diff" edge of the Request entity.

func (*Request) QueryGate

func (_m *Request) QueryGate() *GateQuery

QueryGate queries the "gate" edge of the Request entity.

func (*Request) QueryResponses

func (_m *Request) QueryResponses() *ResponseQuery

QueryResponses queries the "responses" edge of the Request entity.

func (*Request) String

func (_m *Request) String() string

String implements the fmt.Stringer.

func (*Request) Unwrap

func (_m *Request) Unwrap() *Request

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

func (_m *Request) Update() *RequestUpdateOne

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

func (*Request) Value

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

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

type RequestClient

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

RequestClient is a client for the Request schema.

func NewRequestClient

func NewRequestClient(c config) *RequestClient

NewRequestClient returns a client for the Request from the given config.

func (*RequestClient) Create

func (c *RequestClient) Create() *RequestCreate

Create returns a builder for creating a Request entity.

func (*RequestClient) CreateBulk

func (c *RequestClient) CreateBulk(builders ...*RequestCreate) *RequestCreateBulk

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

func (*RequestClient) Delete

func (c *RequestClient) Delete() *RequestDelete

Delete returns a delete builder for Request.

func (*RequestClient) DeleteOne

func (c *RequestClient) DeleteOne(_m *Request) *RequestDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RequestClient) DeleteOneID

func (c *RequestClient) DeleteOneID(id uuid.UUID) *RequestDeleteOne

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

func (*RequestClient) Get

func (c *RequestClient) Get(ctx context.Context, id uuid.UUID) (*Request, error)

Get returns a Request entity by its id.

func (*RequestClient) GetX

func (c *RequestClient) GetX(ctx context.Context, id uuid.UUID) *Request

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

func (*RequestClient) Hooks

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

Hooks returns the client hooks.

func (*RequestClient) Intercept

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

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

func (*RequestClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RequestClient) MapCreateBulk

func (c *RequestClient) MapCreateBulk(slice any, setFunc func(*RequestCreate, int)) *RequestCreateBulk

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

func (c *RequestClient) Query() *RequestQuery

Query returns a query builder for Request.

func (*RequestClient) QueryDiff

func (c *RequestClient) QueryDiff(_m *Request) *DiffQuery

QueryDiff queries the diff edge of a Request.

func (*RequestClient) QueryGate

func (c *RequestClient) QueryGate(_m *Request) *GateQuery

QueryGate queries the gate edge of a Request.

func (*RequestClient) QueryResponses

func (c *RequestClient) QueryResponses(_m *Request) *ResponseQuery

QueryResponses queries the responses edge of a Request.

func (*RequestClient) Update

func (c *RequestClient) Update() *RequestUpdate

Update returns an update builder for Request.

func (*RequestClient) UpdateOne

func (c *RequestClient) UpdateOne(_m *Request) *RequestUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RequestClient) UpdateOneID

func (c *RequestClient) UpdateOneID(id uuid.UUID) *RequestUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RequestClient) Use

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

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

type RequestCreate

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

RequestCreate is the builder for creating a Request entity.

func (*RequestCreate) AddResponseIDs

func (_c *RequestCreate) AddResponseIDs(ids ...uuid.UUID) *RequestCreate

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*RequestCreate) AddResponses

func (_c *RequestCreate) AddResponses(v ...*Response) *RequestCreate

AddResponses adds the "responses" edges to the Response entity.

func (*RequestCreate) Exec

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

Exec executes the query.

func (*RequestCreate) ExecX

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

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

func (*RequestCreate) Mutation

func (_c *RequestCreate) Mutation() *RequestMutation

Mutation returns the RequestMutation object of the builder.

func (*RequestCreate) Save

func (_c *RequestCreate) Save(ctx context.Context) (*Request, error)

Save creates the Request in the database.

func (*RequestCreate) SaveX

func (_c *RequestCreate) SaveX(ctx context.Context) *Request

SaveX calls Save and panics if Save returns an error.

func (*RequestCreate) SetBody

func (_c *RequestCreate) SetBody(v json.RawMessage) *RequestCreate

SetBody sets the "body" field.

func (*RequestCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*RequestCreate) SetDiff

func (_c *RequestCreate) SetDiff(v *Diff) *RequestCreate

SetDiff sets the "diff" edge to the Diff entity.

func (*RequestCreate) SetDiffID

func (_c *RequestCreate) SetDiffID(id uuid.UUID) *RequestCreate

SetDiffID sets the "diff" edge to the Diff entity by ID.

func (*RequestCreate) SetGate

func (_c *RequestCreate) SetGate(v *Gate) *RequestCreate

SetGate sets the "gate" edge to the Gate entity.

func (*RequestCreate) SetGateID

func (_c *RequestCreate) SetGateID(v uuid.UUID) *RequestCreate

SetGateID sets the "gate_id" field.

func (*RequestCreate) SetHeaders

func (_c *RequestCreate) SetHeaders(v map[string][]string) *RequestCreate

SetHeaders sets the "headers" field.

func (*RequestCreate) SetID

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

SetID sets the "id" field.

func (*RequestCreate) SetMethod

func (_c *RequestCreate) SetMethod(v string) *RequestCreate

SetMethod sets the "method" field.

func (*RequestCreate) SetNillableDiffID

func (_c *RequestCreate) SetNillableDiffID(id *uuid.UUID) *RequestCreate

SetNillableDiffID sets the "diff" edge to the Diff entity by ID if the given value is not nil.

func (*RequestCreate) SetNillableID

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

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

func (*RequestCreate) SetNillableRawQuery added in v1.2.0

func (_c *RequestCreate) SetNillableRawQuery(v *string) *RequestCreate

SetNillableRawQuery sets the "raw_query" field if the given value is not nil.

func (*RequestCreate) SetPath

func (_c *RequestCreate) SetPath(v string) *RequestCreate

SetPath sets the "path" field.

func (*RequestCreate) SetRawQuery added in v1.2.0

func (_c *RequestCreate) SetRawQuery(v string) *RequestCreate

SetRawQuery sets the "raw_query" field.

type RequestCreateBulk

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

RequestCreateBulk is the builder for creating many Request entities in bulk.

func (*RequestCreateBulk) Exec

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

Exec executes the query.

func (*RequestCreateBulk) ExecX

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

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

func (*RequestCreateBulk) Save

func (_c *RequestCreateBulk) Save(ctx context.Context) ([]*Request, error)

Save creates the Request entities in the database.

func (*RequestCreateBulk) SaveX

func (_c *RequestCreateBulk) SaveX(ctx context.Context) []*Request

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

type RequestDelete

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

RequestDelete is the builder for deleting a Request entity.

func (*RequestDelete) Exec

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

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

func (*RequestDelete) ExecX

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

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

func (*RequestDelete) Where

func (_d *RequestDelete) Where(ps ...predicate.Request) *RequestDelete

Where appends a list predicates to the RequestDelete builder.

type RequestDeleteOne

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

RequestDeleteOne is the builder for deleting a single Request entity.

func (*RequestDeleteOne) Exec

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

Exec executes the deletion query.

func (*RequestDeleteOne) ExecX

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

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

func (*RequestDeleteOne) Where

Where appends a list predicates to the RequestDelete builder.

type RequestEdges

type RequestEdges struct {
	// Gate holds the value of the gate edge.
	Gate *Gate `json:"gate,omitempty"`
	// Responses holds the value of the responses edge.
	Responses []*Response `json:"responses,omitempty"`
	// Diff holds the value of the diff edge.
	Diff *Diff `json:"diff,omitempty"`
	// contains filtered or unexported fields
}

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

func (RequestEdges) DiffOrErr

func (e RequestEdges) DiffOrErr() (*Diff, error)

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

func (RequestEdges) GateOrErr

func (e RequestEdges) GateOrErr() (*Gate, error)

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

func (RequestEdges) ResponsesOrErr

func (e RequestEdges) ResponsesOrErr() ([]*Response, error)

ResponsesOrErr returns the Responses value or an error if the edge was not loaded in eager-loading.

type RequestGroupBy

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

RequestGroupBy is the group-by builder for Request entities.

func (*RequestGroupBy) Aggregate

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

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

func (*RequestGroupBy) Bool

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

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

func (*RequestGroupBy) BoolX

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

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

func (*RequestGroupBy) Bools

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

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

func (*RequestGroupBy) BoolsX

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

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

func (*RequestGroupBy) Float64

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

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

func (*RequestGroupBy) Float64X

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

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

func (*RequestGroupBy) Float64s

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

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

func (*RequestGroupBy) Float64sX

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

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

func (*RequestGroupBy) Int

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

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

func (*RequestGroupBy) IntX

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

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

func (*RequestGroupBy) Ints

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

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

func (*RequestGroupBy) IntsX

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

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

func (*RequestGroupBy) Scan

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

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

func (*RequestGroupBy) ScanX

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

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

func (*RequestGroupBy) String

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

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

func (*RequestGroupBy) StringX

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

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

func (*RequestGroupBy) Strings

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

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

func (*RequestGroupBy) StringsX

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

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

type RequestMutation

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

RequestMutation represents an operation that mutates the Request nodes in the graph.

func (*RequestMutation) AddField

func (m *RequestMutation) 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 (*RequestMutation) AddResponseIDs

func (m *RequestMutation) AddResponseIDs(ids ...uuid.UUID)

AddResponseIDs adds the "responses" edge to the Response entity by ids.

func (*RequestMutation) AddedEdges

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

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

func (*RequestMutation) AddedField

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

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

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

func (*RequestMutation) AddedIDs

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

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

func (*RequestMutation) AppendBody added in v1.1.0

func (m *RequestMutation) AppendBody(jm json.RawMessage)

AppendBody adds jm to the "body" field.

func (*RequestMutation) AppendedBody added in v1.1.0

func (m *RequestMutation) AppendedBody() (json.RawMessage, bool)

AppendedBody returns the list of values that were appended to the "body" field in this mutation.

func (*RequestMutation) Body

func (m *RequestMutation) Body() (r json.RawMessage, exists bool)

Body returns the value of the "body" field in the mutation.

func (*RequestMutation) BodyCleared

func (m *RequestMutation) BodyCleared() bool

BodyCleared returns if the "body" field was cleared in this mutation.

func (*RequestMutation) ClearBody

func (m *RequestMutation) ClearBody()

ClearBody clears the value of the "body" field.

func (*RequestMutation) ClearDiff

func (m *RequestMutation) ClearDiff()

ClearDiff clears the "diff" edge to the Diff entity.

func (*RequestMutation) ClearEdge

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

func (m *RequestMutation) 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 (*RequestMutation) ClearGate

func (m *RequestMutation) ClearGate()

ClearGate clears the "gate" edge to the Gate entity.

func (*RequestMutation) ClearHeaders

func (m *RequestMutation) ClearHeaders()

ClearHeaders clears the value of the "headers" field.

func (*RequestMutation) ClearRawQuery added in v1.2.0

func (m *RequestMutation) ClearRawQuery()

ClearRawQuery clears the value of the "raw_query" field.

func (*RequestMutation) ClearResponses

func (m *RequestMutation) ClearResponses()

ClearResponses clears the "responses" edge to the Response entity.

func (*RequestMutation) ClearedEdges

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

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

func (*RequestMutation) ClearedFields

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

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

func (RequestMutation) Client

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

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

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

func (*RequestMutation) DiffCleared

func (m *RequestMutation) DiffCleared() bool

DiffCleared reports if the "diff" edge to the Diff entity was cleared.

func (*RequestMutation) DiffID

func (m *RequestMutation) DiffID() (id uuid.UUID, exists bool)

DiffID returns the "diff" edge ID in the mutation.

func (*RequestMutation) DiffIDs

func (m *RequestMutation) DiffIDs() (ids []uuid.UUID)

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

func (*RequestMutation) EdgeCleared

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

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

func (*RequestMutation) Field

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

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

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

func (*RequestMutation) Fields

func (m *RequestMutation) 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 (*RequestMutation) GateCleared

func (m *RequestMutation) GateCleared() bool

GateCleared reports if the "gate" edge to the Gate entity was cleared.

func (*RequestMutation) GateID

func (m *RequestMutation) GateID() (r uuid.UUID, exists bool)

GateID returns the value of the "gate_id" field in the mutation.

func (*RequestMutation) GateIDs

func (m *RequestMutation) GateIDs() (ids []uuid.UUID)

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

func (*RequestMutation) Headers

func (m *RequestMutation) Headers() (r map[string][]string, exists bool)

Headers returns the value of the "headers" field in the mutation.

func (*RequestMutation) HeadersCleared

func (m *RequestMutation) HeadersCleared() bool

HeadersCleared returns if the "headers" field was cleared in this mutation.

func (*RequestMutation) ID

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

func (m *RequestMutation) 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 (*RequestMutation) Method

func (m *RequestMutation) Method() (r string, exists bool)

Method returns the value of the "method" field in the mutation.

func (*RequestMutation) OldBody

func (m *RequestMutation) OldBody(ctx context.Context) (v json.RawMessage, err error)

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

func (*RequestMutation) OldCreatedAt

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

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

func (*RequestMutation) OldField

func (m *RequestMutation) 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 (*RequestMutation) OldGateID

func (m *RequestMutation) OldGateID(ctx context.Context) (v uuid.UUID, err error)

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

func (*RequestMutation) OldHeaders

func (m *RequestMutation) OldHeaders(ctx context.Context) (v map[string][]string, err error)

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

func (*RequestMutation) OldMethod

func (m *RequestMutation) OldMethod(ctx context.Context) (v string, err error)

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

func (*RequestMutation) OldPath

func (m *RequestMutation) OldPath(ctx context.Context) (v string, err error)

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

func (*RequestMutation) OldRawQuery added in v1.2.0

func (m *RequestMutation) OldRawQuery(ctx context.Context) (v string, err error)

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

func (*RequestMutation) Op

func (m *RequestMutation) Op() Op

Op returns the operation name.

func (*RequestMutation) Path

func (m *RequestMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*RequestMutation) RawQuery added in v1.2.0

func (m *RequestMutation) RawQuery() (r string, exists bool)

RawQuery returns the value of the "raw_query" field in the mutation.

func (*RequestMutation) RawQueryCleared added in v1.2.0

func (m *RequestMutation) RawQueryCleared() bool

RawQueryCleared returns if the "raw_query" field was cleared in this mutation.

func (*RequestMutation) RemoveResponseIDs

func (m *RequestMutation) RemoveResponseIDs(ids ...uuid.UUID)

RemoveResponseIDs removes the "responses" edge to the Response entity by IDs.

func (*RequestMutation) RemovedEdges

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

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

func (*RequestMutation) RemovedIDs

func (m *RequestMutation) 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 (*RequestMutation) RemovedResponsesIDs

func (m *RequestMutation) RemovedResponsesIDs() (ids []uuid.UUID)

RemovedResponses returns the removed IDs of the "responses" edge to the Response entity.

func (*RequestMutation) ResetBody

func (m *RequestMutation) ResetBody()

ResetBody resets all changes to the "body" field.

func (*RequestMutation) ResetCreatedAt

func (m *RequestMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RequestMutation) ResetDiff

func (m *RequestMutation) ResetDiff()

ResetDiff resets all changes to the "diff" edge.

func (*RequestMutation) ResetEdge

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

func (m *RequestMutation) 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 (*RequestMutation) ResetGate

func (m *RequestMutation) ResetGate()

ResetGate resets all changes to the "gate" edge.

func (*RequestMutation) ResetGateID

func (m *RequestMutation) ResetGateID()

ResetGateID resets all changes to the "gate_id" field.

func (*RequestMutation) ResetHeaders

func (m *RequestMutation) ResetHeaders()

ResetHeaders resets all changes to the "headers" field.

func (*RequestMutation) ResetMethod

func (m *RequestMutation) ResetMethod()

ResetMethod resets all changes to the "method" field.

func (*RequestMutation) ResetPath

func (m *RequestMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*RequestMutation) ResetRawQuery added in v1.2.0

func (m *RequestMutation) ResetRawQuery()

ResetRawQuery resets all changes to the "raw_query" field.

func (*RequestMutation) ResetResponses

func (m *RequestMutation) ResetResponses()

ResetResponses resets all changes to the "responses" edge.

func (*RequestMutation) ResponsesCleared

func (m *RequestMutation) ResponsesCleared() bool

ResponsesCleared reports if the "responses" edge to the Response entity was cleared.

func (*RequestMutation) ResponsesIDs

func (m *RequestMutation) ResponsesIDs() (ids []uuid.UUID)

ResponsesIDs returns the "responses" edge IDs in the mutation.

func (*RequestMutation) SetBody

func (m *RequestMutation) SetBody(jm json.RawMessage)

SetBody sets the "body" field.

func (*RequestMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*RequestMutation) SetDiffID

func (m *RequestMutation) SetDiffID(id uuid.UUID)

SetDiffID sets the "diff" edge to the Diff entity by id.

func (*RequestMutation) SetField

func (m *RequestMutation) 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 (*RequestMutation) SetGateID

func (m *RequestMutation) SetGateID(u uuid.UUID)

SetGateID sets the "gate_id" field.

func (*RequestMutation) SetHeaders

func (m *RequestMutation) SetHeaders(value map[string][]string)

SetHeaders sets the "headers" field.

func (*RequestMutation) SetID

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

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

func (*RequestMutation) SetMethod

func (m *RequestMutation) SetMethod(s string)

SetMethod sets the "method" field.

func (*RequestMutation) SetOp

func (m *RequestMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RequestMutation) SetPath

func (m *RequestMutation) SetPath(s string)

SetPath sets the "path" field.

func (*RequestMutation) SetRawQuery added in v1.2.0

func (m *RequestMutation) SetRawQuery(s string)

SetRawQuery sets the "raw_query" field.

func (RequestMutation) Tx

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

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

func (*RequestMutation) Type

func (m *RequestMutation) Type() string

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

func (*RequestMutation) Where

func (m *RequestMutation) Where(ps ...predicate.Request)

Where appends a list predicates to the RequestMutation builder.

func (*RequestMutation) WhereP

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

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

type RequestQuery

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

RequestQuery is the builder for querying Request entities.

func (*RequestQuery) Aggregate

func (_q *RequestQuery) Aggregate(fns ...AggregateFunc) *RequestSelect

Aggregate returns a RequestSelect configured with the given aggregations.

func (*RequestQuery) All

func (_q *RequestQuery) All(ctx context.Context) ([]*Request, error)

All executes the query and returns a list of Requests.

func (*RequestQuery) AllX

func (_q *RequestQuery) AllX(ctx context.Context) []*Request

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

func (*RequestQuery) Clone

func (_q *RequestQuery) Clone() *RequestQuery

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

func (*RequestQuery) Count

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

Count returns the count of the given query.

func (*RequestQuery) CountX

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

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

func (*RequestQuery) Exist

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

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

func (*RequestQuery) ExistX

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

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

func (*RequestQuery) First

func (_q *RequestQuery) First(ctx context.Context) (*Request, error)

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

func (*RequestQuery) FirstID

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

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

func (*RequestQuery) FirstIDX

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

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

func (*RequestQuery) FirstX

func (_q *RequestQuery) FirstX(ctx context.Context) *Request

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

func (*RequestQuery) GroupBy

func (_q *RequestQuery) GroupBy(field string, fields ...string) *RequestGroupBy

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 {
	GateID uuid.UUID `json:"gate_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Request.Query().
	GroupBy(request.FieldGateID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RequestQuery) IDs

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

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

func (*RequestQuery) IDsX

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

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

func (*RequestQuery) Limit

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

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

func (*RequestQuery) Offset

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

Offset to start from.

func (*RequestQuery) Only

func (_q *RequestQuery) Only(ctx context.Context) (*Request, error)

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

func (*RequestQuery) OnlyID

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

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

func (*RequestQuery) OnlyIDX

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

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

func (*RequestQuery) OnlyX

func (_q *RequestQuery) OnlyX(ctx context.Context) *Request

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

func (*RequestQuery) Order

func (_q *RequestQuery) Order(o ...request.OrderOption) *RequestQuery

Order specifies how the records should be ordered.

func (*RequestQuery) QueryDiff

func (_q *RequestQuery) QueryDiff() *DiffQuery

QueryDiff chains the current query on the "diff" edge.

func (*RequestQuery) QueryGate

func (_q *RequestQuery) QueryGate() *GateQuery

QueryGate chains the current query on the "gate" edge.

func (*RequestQuery) QueryResponses

func (_q *RequestQuery) QueryResponses() *ResponseQuery

QueryResponses chains the current query on the "responses" edge.

func (*RequestQuery) Select

func (_q *RequestQuery) Select(fields ...string) *RequestSelect

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 {
	GateID uuid.UUID `json:"gate_id,omitempty"`
}

client.Request.Query().
	Select(request.FieldGateID).
	Scan(ctx, &v)

func (*RequestQuery) Unique

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

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

func (_q *RequestQuery) Where(ps ...predicate.Request) *RequestQuery

Where adds a new predicate for the RequestQuery builder.

func (*RequestQuery) WithDiff

func (_q *RequestQuery) WithDiff(opts ...func(*DiffQuery)) *RequestQuery

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

func (*RequestQuery) WithGate

func (_q *RequestQuery) WithGate(opts ...func(*GateQuery)) *RequestQuery

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

func (*RequestQuery) WithResponses

func (_q *RequestQuery) WithResponses(opts ...func(*ResponseQuery)) *RequestQuery

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

type RequestSelect

type RequestSelect struct {
	*RequestQuery
	// contains filtered or unexported fields
}

RequestSelect is the builder for selecting fields of Request entities.

func (*RequestSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*RequestSelect) Bool

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

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

func (*RequestSelect) BoolX

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

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

func (*RequestSelect) Bools

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

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

func (*RequestSelect) BoolsX

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

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

func (*RequestSelect) Float64

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

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

func (*RequestSelect) Float64X

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

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

func (*RequestSelect) Float64s

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

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

func (*RequestSelect) Float64sX

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

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

func (*RequestSelect) Int

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

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

func (*RequestSelect) IntX

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

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

func (*RequestSelect) Ints

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

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

func (*RequestSelect) IntsX

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

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

func (*RequestSelect) Scan

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

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

func (*RequestSelect) ScanX

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

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

func (*RequestSelect) String

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

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

func (*RequestSelect) StringX

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

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

func (*RequestSelect) Strings

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

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

func (*RequestSelect) StringsX

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

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

type RequestUpdate

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

RequestUpdate is the builder for updating Request entities.

func (*RequestUpdate) AddResponseIDs

func (_u *RequestUpdate) AddResponseIDs(ids ...uuid.UUID) *RequestUpdate

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*RequestUpdate) AddResponses

func (_u *RequestUpdate) AddResponses(v ...*Response) *RequestUpdate

AddResponses adds the "responses" edges to the Response entity.

func (*RequestUpdate) AppendBody added in v1.1.0

func (_u *RequestUpdate) AppendBody(v json.RawMessage) *RequestUpdate

AppendBody appends value to the "body" field.

func (*RequestUpdate) ClearBody

func (_u *RequestUpdate) ClearBody() *RequestUpdate

ClearBody clears the value of the "body" field.

func (*RequestUpdate) ClearDiff

func (_u *RequestUpdate) ClearDiff() *RequestUpdate

ClearDiff clears the "diff" edge to the Diff entity.

func (*RequestUpdate) ClearGate

func (_u *RequestUpdate) ClearGate() *RequestUpdate

ClearGate clears the "gate" edge to the Gate entity.

func (*RequestUpdate) ClearHeaders

func (_u *RequestUpdate) ClearHeaders() *RequestUpdate

ClearHeaders clears the value of the "headers" field.

func (*RequestUpdate) ClearRawQuery added in v1.2.0

func (_u *RequestUpdate) ClearRawQuery() *RequestUpdate

ClearRawQuery clears the value of the "raw_query" field.

func (*RequestUpdate) ClearResponses

func (_u *RequestUpdate) ClearResponses() *RequestUpdate

ClearResponses clears all "responses" edges to the Response entity.

func (*RequestUpdate) Exec

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

Exec executes the query.

func (*RequestUpdate) ExecX

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

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

func (*RequestUpdate) Mutation

func (_u *RequestUpdate) Mutation() *RequestMutation

Mutation returns the RequestMutation object of the builder.

func (*RequestUpdate) RemoveResponseIDs

func (_u *RequestUpdate) RemoveResponseIDs(ids ...uuid.UUID) *RequestUpdate

RemoveResponseIDs removes the "responses" edge to Response entities by IDs.

func (*RequestUpdate) RemoveResponses

func (_u *RequestUpdate) RemoveResponses(v ...*Response) *RequestUpdate

RemoveResponses removes "responses" edges to Response entities.

func (*RequestUpdate) Save

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

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

func (*RequestUpdate) SaveX

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

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

func (*RequestUpdate) SetBody

func (_u *RequestUpdate) SetBody(v json.RawMessage) *RequestUpdate

SetBody sets the "body" field.

func (*RequestUpdate) SetCreatedAt

func (_u *RequestUpdate) SetCreatedAt(v time.Time) *RequestUpdate

SetCreatedAt sets the "created_at" field.

func (*RequestUpdate) SetDiff

func (_u *RequestUpdate) SetDiff(v *Diff) *RequestUpdate

SetDiff sets the "diff" edge to the Diff entity.

func (*RequestUpdate) SetDiffID

func (_u *RequestUpdate) SetDiffID(id uuid.UUID) *RequestUpdate

SetDiffID sets the "diff" edge to the Diff entity by ID.

func (*RequestUpdate) SetGate

func (_u *RequestUpdate) SetGate(v *Gate) *RequestUpdate

SetGate sets the "gate" edge to the Gate entity.

func (*RequestUpdate) SetGateID

func (_u *RequestUpdate) SetGateID(v uuid.UUID) *RequestUpdate

SetGateID sets the "gate_id" field.

func (*RequestUpdate) SetHeaders

func (_u *RequestUpdate) SetHeaders(v map[string][]string) *RequestUpdate

SetHeaders sets the "headers" field.

func (*RequestUpdate) SetMethod

func (_u *RequestUpdate) SetMethod(v string) *RequestUpdate

SetMethod sets the "method" field.

func (*RequestUpdate) SetNillableCreatedAt

func (_u *RequestUpdate) SetNillableCreatedAt(v *time.Time) *RequestUpdate

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

func (*RequestUpdate) SetNillableDiffID

func (_u *RequestUpdate) SetNillableDiffID(id *uuid.UUID) *RequestUpdate

SetNillableDiffID sets the "diff" edge to the Diff entity by ID if the given value is not nil.

func (*RequestUpdate) SetNillableGateID

func (_u *RequestUpdate) SetNillableGateID(v *uuid.UUID) *RequestUpdate

SetNillableGateID sets the "gate_id" field if the given value is not nil.

func (*RequestUpdate) SetNillableMethod

func (_u *RequestUpdate) SetNillableMethod(v *string) *RequestUpdate

SetNillableMethod sets the "method" field if the given value is not nil.

func (*RequestUpdate) SetNillablePath

func (_u *RequestUpdate) SetNillablePath(v *string) *RequestUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*RequestUpdate) SetNillableRawQuery added in v1.2.0

func (_u *RequestUpdate) SetNillableRawQuery(v *string) *RequestUpdate

SetNillableRawQuery sets the "raw_query" field if the given value is not nil.

func (*RequestUpdate) SetPath

func (_u *RequestUpdate) SetPath(v string) *RequestUpdate

SetPath sets the "path" field.

func (*RequestUpdate) SetRawQuery added in v1.2.0

func (_u *RequestUpdate) SetRawQuery(v string) *RequestUpdate

SetRawQuery sets the "raw_query" field.

func (*RequestUpdate) Where

func (_u *RequestUpdate) Where(ps ...predicate.Request) *RequestUpdate

Where appends a list predicates to the RequestUpdate builder.

type RequestUpdateOne

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

RequestUpdateOne is the builder for updating a single Request entity.

func (*RequestUpdateOne) AddResponseIDs

func (_u *RequestUpdateOne) AddResponseIDs(ids ...uuid.UUID) *RequestUpdateOne

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*RequestUpdateOne) AddResponses

func (_u *RequestUpdateOne) AddResponses(v ...*Response) *RequestUpdateOne

AddResponses adds the "responses" edges to the Response entity.

func (*RequestUpdateOne) AppendBody added in v1.1.0

func (_u *RequestUpdateOne) AppendBody(v json.RawMessage) *RequestUpdateOne

AppendBody appends value to the "body" field.

func (*RequestUpdateOne) ClearBody

func (_u *RequestUpdateOne) ClearBody() *RequestUpdateOne

ClearBody clears the value of the "body" field.

func (*RequestUpdateOne) ClearDiff

func (_u *RequestUpdateOne) ClearDiff() *RequestUpdateOne

ClearDiff clears the "diff" edge to the Diff entity.

func (*RequestUpdateOne) ClearGate

func (_u *RequestUpdateOne) ClearGate() *RequestUpdateOne

ClearGate clears the "gate" edge to the Gate entity.

func (*RequestUpdateOne) ClearHeaders

func (_u *RequestUpdateOne) ClearHeaders() *RequestUpdateOne

ClearHeaders clears the value of the "headers" field.

func (*RequestUpdateOne) ClearRawQuery added in v1.2.0

func (_u *RequestUpdateOne) ClearRawQuery() *RequestUpdateOne

ClearRawQuery clears the value of the "raw_query" field.

func (*RequestUpdateOne) ClearResponses

func (_u *RequestUpdateOne) ClearResponses() *RequestUpdateOne

ClearResponses clears all "responses" edges to the Response entity.

func (*RequestUpdateOne) Exec

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

Exec executes the query on the entity.

func (*RequestUpdateOne) ExecX

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

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

func (*RequestUpdateOne) Mutation

func (_u *RequestUpdateOne) Mutation() *RequestMutation

Mutation returns the RequestMutation object of the builder.

func (*RequestUpdateOne) RemoveResponseIDs

func (_u *RequestUpdateOne) RemoveResponseIDs(ids ...uuid.UUID) *RequestUpdateOne

RemoveResponseIDs removes the "responses" edge to Response entities by IDs.

func (*RequestUpdateOne) RemoveResponses

func (_u *RequestUpdateOne) RemoveResponses(v ...*Response) *RequestUpdateOne

RemoveResponses removes "responses" edges to Response entities.

func (*RequestUpdateOne) Save

func (_u *RequestUpdateOne) Save(ctx context.Context) (*Request, error)

Save executes the query and returns the updated Request entity.

func (*RequestUpdateOne) SaveX

func (_u *RequestUpdateOne) SaveX(ctx context.Context) *Request

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

func (*RequestUpdateOne) Select

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

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

func (*RequestUpdateOne) SetBody

SetBody sets the "body" field.

func (*RequestUpdateOne) SetCreatedAt

func (_u *RequestUpdateOne) SetCreatedAt(v time.Time) *RequestUpdateOne

SetCreatedAt sets the "created_at" field.

func (*RequestUpdateOne) SetDiff

func (_u *RequestUpdateOne) SetDiff(v *Diff) *RequestUpdateOne

SetDiff sets the "diff" edge to the Diff entity.

func (*RequestUpdateOne) SetDiffID

func (_u *RequestUpdateOne) SetDiffID(id uuid.UUID) *RequestUpdateOne

SetDiffID sets the "diff" edge to the Diff entity by ID.

func (*RequestUpdateOne) SetGate

func (_u *RequestUpdateOne) SetGate(v *Gate) *RequestUpdateOne

SetGate sets the "gate" edge to the Gate entity.

func (*RequestUpdateOne) SetGateID

func (_u *RequestUpdateOne) SetGateID(v uuid.UUID) *RequestUpdateOne

SetGateID sets the "gate_id" field.

func (*RequestUpdateOne) SetHeaders

func (_u *RequestUpdateOne) SetHeaders(v map[string][]string) *RequestUpdateOne

SetHeaders sets the "headers" field.

func (*RequestUpdateOne) SetMethod

func (_u *RequestUpdateOne) SetMethod(v string) *RequestUpdateOne

SetMethod sets the "method" field.

func (*RequestUpdateOne) SetNillableCreatedAt

func (_u *RequestUpdateOne) SetNillableCreatedAt(v *time.Time) *RequestUpdateOne

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

func (*RequestUpdateOne) SetNillableDiffID

func (_u *RequestUpdateOne) SetNillableDiffID(id *uuid.UUID) *RequestUpdateOne

SetNillableDiffID sets the "diff" edge to the Diff entity by ID if the given value is not nil.

func (*RequestUpdateOne) SetNillableGateID

func (_u *RequestUpdateOne) SetNillableGateID(v *uuid.UUID) *RequestUpdateOne

SetNillableGateID sets the "gate_id" field if the given value is not nil.

func (*RequestUpdateOne) SetNillableMethod

func (_u *RequestUpdateOne) SetNillableMethod(v *string) *RequestUpdateOne

SetNillableMethod sets the "method" field if the given value is not nil.

func (*RequestUpdateOne) SetNillablePath

func (_u *RequestUpdateOne) SetNillablePath(v *string) *RequestUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*RequestUpdateOne) SetNillableRawQuery added in v1.2.0

func (_u *RequestUpdateOne) SetNillableRawQuery(v *string) *RequestUpdateOne

SetNillableRawQuery sets the "raw_query" field if the given value is not nil.

func (*RequestUpdateOne) SetPath

func (_u *RequestUpdateOne) SetPath(v string) *RequestUpdateOne

SetPath sets the "path" field.

func (*RequestUpdateOne) SetRawQuery added in v1.2.0

func (_u *RequestUpdateOne) SetRawQuery(v string) *RequestUpdateOne

SetRawQuery sets the "raw_query" field.

func (*RequestUpdateOne) Where

Where appends a list predicates to the RequestUpdate builder.

type Requests

type Requests []*Request

Requests is a parsable slice of Request.

type Response

type Response struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// RequestID holds the value of the "request_id" field.
	RequestID uuid.UUID `json:"request_id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// StatusCode holds the value of the "status_code" field.
	StatusCode int32 `json:"status_code,omitempty"`
	// Headers holds the value of the "headers" field.
	Headers map[string][]string `json:"headers,omitempty"`
	// Body holds the value of the "body" field.
	Body json.RawMessage `json:"body,omitempty"`
	// LatencyMs holds the value of the "latency_ms" field.
	LatencyMs int64 `json:"latency_ms,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ResponseQuery when eager-loading is set.
	Edges ResponseEdges `json:"edges"`
	// contains filtered or unexported fields
}

Response is the model entity for the Response schema.

func (*Response) QueryDiffsFrom

func (_m *Response) QueryDiffsFrom() *DiffQuery

QueryDiffsFrom queries the "diffs_from" edge of the Response entity.

func (*Response) QueryDiffsTo

func (_m *Response) QueryDiffsTo() *DiffQuery

QueryDiffsTo queries the "diffs_to" edge of the Response entity.

func (*Response) QueryRequest

func (_m *Response) QueryRequest() *RequestQuery

QueryRequest queries the "request" edge of the Response entity.

func (*Response) String

func (_m *Response) String() string

String implements the fmt.Stringer.

func (*Response) Unwrap

func (_m *Response) Unwrap() *Response

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

func (_m *Response) Update() *ResponseUpdateOne

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

func (*Response) Value

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

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

type ResponseClient

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

ResponseClient is a client for the Response schema.

func NewResponseClient

func NewResponseClient(c config) *ResponseClient

NewResponseClient returns a client for the Response from the given config.

func (*ResponseClient) Create

func (c *ResponseClient) Create() *ResponseCreate

Create returns a builder for creating a Response entity.

func (*ResponseClient) CreateBulk

func (c *ResponseClient) CreateBulk(builders ...*ResponseCreate) *ResponseCreateBulk

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

func (*ResponseClient) Delete

func (c *ResponseClient) Delete() *ResponseDelete

Delete returns a delete builder for Response.

func (*ResponseClient) DeleteOne

func (c *ResponseClient) DeleteOne(_m *Response) *ResponseDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ResponseClient) DeleteOneID

func (c *ResponseClient) DeleteOneID(id uuid.UUID) *ResponseDeleteOne

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

func (*ResponseClient) Get

func (c *ResponseClient) Get(ctx context.Context, id uuid.UUID) (*Response, error)

Get returns a Response entity by its id.

func (*ResponseClient) GetX

func (c *ResponseClient) GetX(ctx context.Context, id uuid.UUID) *Response

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

func (*ResponseClient) Hooks

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

Hooks returns the client hooks.

func (*ResponseClient) Intercept

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

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

func (*ResponseClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ResponseClient) MapCreateBulk

func (c *ResponseClient) MapCreateBulk(slice any, setFunc func(*ResponseCreate, int)) *ResponseCreateBulk

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

func (c *ResponseClient) Query() *ResponseQuery

Query returns a query builder for Response.

func (*ResponseClient) QueryDiffsFrom

func (c *ResponseClient) QueryDiffsFrom(_m *Response) *DiffQuery

QueryDiffsFrom queries the diffs_from edge of a Response.

func (*ResponseClient) QueryDiffsTo

func (c *ResponseClient) QueryDiffsTo(_m *Response) *DiffQuery

QueryDiffsTo queries the diffs_to edge of a Response.

func (*ResponseClient) QueryRequest

func (c *ResponseClient) QueryRequest(_m *Response) *RequestQuery

QueryRequest queries the request edge of a Response.

func (*ResponseClient) Update

func (c *ResponseClient) Update() *ResponseUpdate

Update returns an update builder for Response.

func (*ResponseClient) UpdateOne

func (c *ResponseClient) UpdateOne(_m *Response) *ResponseUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ResponseClient) UpdateOneID

func (c *ResponseClient) UpdateOneID(id uuid.UUID) *ResponseUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ResponseClient) Use

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

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

type ResponseCreate

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

ResponseCreate is the builder for creating a Response entity.

func (*ResponseCreate) AddDiffsFrom

func (_c *ResponseCreate) AddDiffsFrom(v ...*Diff) *ResponseCreate

AddDiffsFrom adds the "diffs_from" edges to the Diff entity.

func (*ResponseCreate) AddDiffsFromIDs

func (_c *ResponseCreate) AddDiffsFromIDs(ids ...uuid.UUID) *ResponseCreate

AddDiffsFromIDs adds the "diffs_from" edge to the Diff entity by IDs.

func (*ResponseCreate) AddDiffsTo

func (_c *ResponseCreate) AddDiffsTo(v ...*Diff) *ResponseCreate

AddDiffsTo adds the "diffs_to" edges to the Diff entity.

func (*ResponseCreate) AddDiffsToIDs

func (_c *ResponseCreate) AddDiffsToIDs(ids ...uuid.UUID) *ResponseCreate

AddDiffsToIDs adds the "diffs_to" edge to the Diff entity by IDs.

func (*ResponseCreate) Exec

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

Exec executes the query.

func (*ResponseCreate) ExecX

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

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

func (*ResponseCreate) Mutation

func (_c *ResponseCreate) Mutation() *ResponseMutation

Mutation returns the ResponseMutation object of the builder.

func (*ResponseCreate) Save

func (_c *ResponseCreate) Save(ctx context.Context) (*Response, error)

Save creates the Response in the database.

func (*ResponseCreate) SaveX

func (_c *ResponseCreate) SaveX(ctx context.Context) *Response

SaveX calls Save and panics if Save returns an error.

func (*ResponseCreate) SetBody

func (_c *ResponseCreate) SetBody(v json.RawMessage) *ResponseCreate

SetBody sets the "body" field.

func (*ResponseCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ResponseCreate) SetHeaders

func (_c *ResponseCreate) SetHeaders(v map[string][]string) *ResponseCreate

SetHeaders sets the "headers" field.

func (*ResponseCreate) SetID

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

SetID sets the "id" field.

func (*ResponseCreate) SetLatencyMs

func (_c *ResponseCreate) SetLatencyMs(v int64) *ResponseCreate

SetLatencyMs sets the "latency_ms" field.

func (*ResponseCreate) SetNillableID

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

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

func (*ResponseCreate) SetRequest

func (_c *ResponseCreate) SetRequest(v *Request) *ResponseCreate

SetRequest sets the "request" edge to the Request entity.

func (*ResponseCreate) SetRequestID

func (_c *ResponseCreate) SetRequestID(v uuid.UUID) *ResponseCreate

SetRequestID sets the "request_id" field.

func (*ResponseCreate) SetStatusCode

func (_c *ResponseCreate) SetStatusCode(v int32) *ResponseCreate

SetStatusCode sets the "status_code" field.

func (*ResponseCreate) SetType

func (_c *ResponseCreate) SetType(v string) *ResponseCreate

SetType sets the "type" field.

type ResponseCreateBulk

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

ResponseCreateBulk is the builder for creating many Response entities in bulk.

func (*ResponseCreateBulk) Exec

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

Exec executes the query.

func (*ResponseCreateBulk) ExecX

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

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

func (*ResponseCreateBulk) Save

func (_c *ResponseCreateBulk) Save(ctx context.Context) ([]*Response, error)

Save creates the Response entities in the database.

func (*ResponseCreateBulk) SaveX

func (_c *ResponseCreateBulk) SaveX(ctx context.Context) []*Response

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

type ResponseDelete

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

ResponseDelete is the builder for deleting a Response entity.

func (*ResponseDelete) Exec

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

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

func (*ResponseDelete) ExecX

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

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

func (*ResponseDelete) Where

func (_d *ResponseDelete) Where(ps ...predicate.Response) *ResponseDelete

Where appends a list predicates to the ResponseDelete builder.

type ResponseDeleteOne

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

ResponseDeleteOne is the builder for deleting a single Response entity.

func (*ResponseDeleteOne) Exec

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

Exec executes the deletion query.

func (*ResponseDeleteOne) ExecX

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

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

func (*ResponseDeleteOne) Where

Where appends a list predicates to the ResponseDelete builder.

type ResponseEdges

type ResponseEdges struct {
	// Request holds the value of the request edge.
	Request *Request `json:"request,omitempty"`
	// DiffsFrom holds the value of the diffs_from edge.
	DiffsFrom []*Diff `json:"diffs_from,omitempty"`
	// DiffsTo holds the value of the diffs_to edge.
	DiffsTo []*Diff `json:"diffs_to,omitempty"`
	// contains filtered or unexported fields
}

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

func (ResponseEdges) DiffsFromOrErr

func (e ResponseEdges) DiffsFromOrErr() ([]*Diff, error)

DiffsFromOrErr returns the DiffsFrom value or an error if the edge was not loaded in eager-loading.

func (ResponseEdges) DiffsToOrErr

func (e ResponseEdges) DiffsToOrErr() ([]*Diff, error)

DiffsToOrErr returns the DiffsTo value or an error if the edge was not loaded in eager-loading.

func (ResponseEdges) RequestOrErr

func (e ResponseEdges) RequestOrErr() (*Request, error)

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

type ResponseGroupBy

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

ResponseGroupBy is the group-by builder for Response entities.

func (*ResponseGroupBy) Aggregate

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

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

func (*ResponseGroupBy) Bool

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

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

func (*ResponseGroupBy) BoolX

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

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

func (*ResponseGroupBy) Bools

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

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

func (*ResponseGroupBy) BoolsX

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

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

func (*ResponseGroupBy) Float64

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

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

func (*ResponseGroupBy) Float64X

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

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

func (*ResponseGroupBy) Float64s

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

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

func (*ResponseGroupBy) Float64sX

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

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

func (*ResponseGroupBy) Int

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

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

func (*ResponseGroupBy) IntX

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

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

func (*ResponseGroupBy) Ints

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

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

func (*ResponseGroupBy) IntsX

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

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

func (*ResponseGroupBy) Scan

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

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

func (*ResponseGroupBy) ScanX

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

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

func (*ResponseGroupBy) String

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

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

func (*ResponseGroupBy) StringX

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

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

func (*ResponseGroupBy) Strings

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

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

func (*ResponseGroupBy) StringsX

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

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

type ResponseMutation

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

ResponseMutation represents an operation that mutates the Response nodes in the graph.

func (*ResponseMutation) AddDiffsFromIDs

func (m *ResponseMutation) AddDiffsFromIDs(ids ...uuid.UUID)

AddDiffsFromIDs adds the "diffs_from" edge to the Diff entity by ids.

func (*ResponseMutation) AddDiffsToIDs

func (m *ResponseMutation) AddDiffsToIDs(ids ...uuid.UUID)

AddDiffsToIDs adds the "diffs_to" edge to the Diff entity by ids.

func (*ResponseMutation) AddField

func (m *ResponseMutation) 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 (*ResponseMutation) AddLatencyMs

func (m *ResponseMutation) AddLatencyMs(i int64)

AddLatencyMs adds i to the "latency_ms" field.

func (*ResponseMutation) AddStatusCode

func (m *ResponseMutation) AddStatusCode(i int32)

AddStatusCode adds i to the "status_code" field.

func (*ResponseMutation) AddedEdges

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

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

func (*ResponseMutation) AddedField

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

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

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

func (*ResponseMutation) AddedIDs

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

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

func (*ResponseMutation) AddedLatencyMs

func (m *ResponseMutation) AddedLatencyMs() (r int64, exists bool)

AddedLatencyMs returns the value that was added to the "latency_ms" field in this mutation.

func (*ResponseMutation) AddedStatusCode

func (m *ResponseMutation) AddedStatusCode() (r int32, exists bool)

AddedStatusCode returns the value that was added to the "status_code" field in this mutation.

func (*ResponseMutation) AppendBody added in v1.1.0

func (m *ResponseMutation) AppendBody(jm json.RawMessage)

AppendBody adds jm to the "body" field.

func (*ResponseMutation) AppendedBody added in v1.1.0

func (m *ResponseMutation) AppendedBody() (json.RawMessage, bool)

AppendedBody returns the list of values that were appended to the "body" field in this mutation.

func (*ResponseMutation) Body

func (m *ResponseMutation) Body() (r json.RawMessage, exists bool)

Body returns the value of the "body" field in the mutation.

func (*ResponseMutation) BodyCleared

func (m *ResponseMutation) BodyCleared() bool

BodyCleared returns if the "body" field was cleared in this mutation.

func (*ResponseMutation) ClearBody

func (m *ResponseMutation) ClearBody()

ClearBody clears the value of the "body" field.

func (*ResponseMutation) ClearDiffsFrom

func (m *ResponseMutation) ClearDiffsFrom()

ClearDiffsFrom clears the "diffs_from" edge to the Diff entity.

func (*ResponseMutation) ClearDiffsTo

func (m *ResponseMutation) ClearDiffsTo()

ClearDiffsTo clears the "diffs_to" edge to the Diff entity.

func (*ResponseMutation) ClearEdge

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

func (m *ResponseMutation) 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 (*ResponseMutation) ClearHeaders

func (m *ResponseMutation) ClearHeaders()

ClearHeaders clears the value of the "headers" field.

func (*ResponseMutation) ClearRequest

func (m *ResponseMutation) ClearRequest()

ClearRequest clears the "request" edge to the Request entity.

func (*ResponseMutation) ClearedEdges

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

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

func (*ResponseMutation) ClearedFields

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

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

func (ResponseMutation) Client

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

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

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

func (*ResponseMutation) DiffsFromCleared

func (m *ResponseMutation) DiffsFromCleared() bool

DiffsFromCleared reports if the "diffs_from" edge to the Diff entity was cleared.

func (*ResponseMutation) DiffsFromIDs

func (m *ResponseMutation) DiffsFromIDs() (ids []uuid.UUID)

DiffsFromIDs returns the "diffs_from" edge IDs in the mutation.

func (*ResponseMutation) DiffsToCleared

func (m *ResponseMutation) DiffsToCleared() bool

DiffsToCleared reports if the "diffs_to" edge to the Diff entity was cleared.

func (*ResponseMutation) DiffsToIDs

func (m *ResponseMutation) DiffsToIDs() (ids []uuid.UUID)

DiffsToIDs returns the "diffs_to" edge IDs in the mutation.

func (*ResponseMutation) EdgeCleared

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

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

func (*ResponseMutation) Field

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

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

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

func (*ResponseMutation) Fields

func (m *ResponseMutation) 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 (*ResponseMutation) GetType

func (m *ResponseMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ResponseMutation) Headers

func (m *ResponseMutation) Headers() (r map[string][]string, exists bool)

Headers returns the value of the "headers" field in the mutation.

func (*ResponseMutation) HeadersCleared

func (m *ResponseMutation) HeadersCleared() bool

HeadersCleared returns if the "headers" field was cleared in this mutation.

func (*ResponseMutation) ID

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

func (m *ResponseMutation) 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 (*ResponseMutation) LatencyMs

func (m *ResponseMutation) LatencyMs() (r int64, exists bool)

LatencyMs returns the value of the "latency_ms" field in the mutation.

func (*ResponseMutation) OldBody

func (m *ResponseMutation) OldBody(ctx context.Context) (v json.RawMessage, err error)

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

func (*ResponseMutation) OldCreatedAt

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

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

func (*ResponseMutation) OldField

func (m *ResponseMutation) 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 (*ResponseMutation) OldHeaders

func (m *ResponseMutation) OldHeaders(ctx context.Context) (v map[string][]string, err error)

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

func (*ResponseMutation) OldLatencyMs

func (m *ResponseMutation) OldLatencyMs(ctx context.Context) (v int64, err error)

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

func (*ResponseMutation) OldRequestID

func (m *ResponseMutation) OldRequestID(ctx context.Context) (v uuid.UUID, err error)

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

func (*ResponseMutation) OldStatusCode

func (m *ResponseMutation) OldStatusCode(ctx context.Context) (v int32, err error)

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

func (*ResponseMutation) OldType

func (m *ResponseMutation) OldType(ctx context.Context) (v string, err error)

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

func (*ResponseMutation) Op

func (m *ResponseMutation) Op() Op

Op returns the operation name.

func (*ResponseMutation) RemoveDiffsFromIDs

func (m *ResponseMutation) RemoveDiffsFromIDs(ids ...uuid.UUID)

RemoveDiffsFromIDs removes the "diffs_from" edge to the Diff entity by IDs.

func (*ResponseMutation) RemoveDiffsToIDs

func (m *ResponseMutation) RemoveDiffsToIDs(ids ...uuid.UUID)

RemoveDiffsToIDs removes the "diffs_to" edge to the Diff entity by IDs.

func (*ResponseMutation) RemovedDiffsFromIDs

func (m *ResponseMutation) RemovedDiffsFromIDs() (ids []uuid.UUID)

RemovedDiffsFrom returns the removed IDs of the "diffs_from" edge to the Diff entity.

func (*ResponseMutation) RemovedDiffsToIDs

func (m *ResponseMutation) RemovedDiffsToIDs() (ids []uuid.UUID)

RemovedDiffsTo returns the removed IDs of the "diffs_to" edge to the Diff entity.

func (*ResponseMutation) RemovedEdges

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

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

func (*ResponseMutation) RemovedIDs

func (m *ResponseMutation) 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 (*ResponseMutation) RequestCleared

func (m *ResponseMutation) RequestCleared() bool

RequestCleared reports if the "request" edge to the Request entity was cleared.

func (*ResponseMutation) RequestID

func (m *ResponseMutation) RequestID() (r uuid.UUID, exists bool)

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

func (*ResponseMutation) RequestIDs

func (m *ResponseMutation) RequestIDs() (ids []uuid.UUID)

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

func (*ResponseMutation) ResetBody

func (m *ResponseMutation) ResetBody()

ResetBody resets all changes to the "body" field.

func (*ResponseMutation) ResetCreatedAt

func (m *ResponseMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ResponseMutation) ResetDiffsFrom

func (m *ResponseMutation) ResetDiffsFrom()

ResetDiffsFrom resets all changes to the "diffs_from" edge.

func (*ResponseMutation) ResetDiffsTo

func (m *ResponseMutation) ResetDiffsTo()

ResetDiffsTo resets all changes to the "diffs_to" edge.

func (*ResponseMutation) ResetEdge

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

func (m *ResponseMutation) 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 (*ResponseMutation) ResetHeaders

func (m *ResponseMutation) ResetHeaders()

ResetHeaders resets all changes to the "headers" field.

func (*ResponseMutation) ResetLatencyMs

func (m *ResponseMutation) ResetLatencyMs()

ResetLatencyMs resets all changes to the "latency_ms" field.

func (*ResponseMutation) ResetRequest

func (m *ResponseMutation) ResetRequest()

ResetRequest resets all changes to the "request" edge.

func (*ResponseMutation) ResetRequestID

func (m *ResponseMutation) ResetRequestID()

ResetRequestID resets all changes to the "request_id" field.

func (*ResponseMutation) ResetStatusCode

func (m *ResponseMutation) ResetStatusCode()

ResetStatusCode resets all changes to the "status_code" field.

func (*ResponseMutation) ResetType

func (m *ResponseMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ResponseMutation) SetBody

func (m *ResponseMutation) SetBody(jm json.RawMessage)

SetBody sets the "body" field.

func (*ResponseMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ResponseMutation) SetField

func (m *ResponseMutation) 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 (*ResponseMutation) SetHeaders

func (m *ResponseMutation) SetHeaders(value map[string][]string)

SetHeaders sets the "headers" field.

func (*ResponseMutation) SetID

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

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

func (*ResponseMutation) SetLatencyMs

func (m *ResponseMutation) SetLatencyMs(i int64)

SetLatencyMs sets the "latency_ms" field.

func (*ResponseMutation) SetOp

func (m *ResponseMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ResponseMutation) SetRequestID

func (m *ResponseMutation) SetRequestID(u uuid.UUID)

SetRequestID sets the "request_id" field.

func (*ResponseMutation) SetStatusCode

func (m *ResponseMutation) SetStatusCode(i int32)

SetStatusCode sets the "status_code" field.

func (*ResponseMutation) SetType

func (m *ResponseMutation) SetType(s string)

SetType sets the "type" field.

func (*ResponseMutation) StatusCode

func (m *ResponseMutation) StatusCode() (r int32, exists bool)

StatusCode returns the value of the "status_code" field in the mutation.

func (ResponseMutation) Tx

func (m ResponseMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ResponseMutation) Type

func (m *ResponseMutation) Type() string

Type returns the node type of this mutation (Response).

func (*ResponseMutation) Where

func (m *ResponseMutation) Where(ps ...predicate.Response)

Where appends a list predicates to the ResponseMutation builder.

func (*ResponseMutation) WhereP

func (m *ResponseMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ResponseMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ResponseQuery

type ResponseQuery struct {
	// contains filtered or unexported fields
}

ResponseQuery is the builder for querying Response entities.

func (*ResponseQuery) Aggregate

func (_q *ResponseQuery) Aggregate(fns ...AggregateFunc) *ResponseSelect

Aggregate returns a ResponseSelect configured with the given aggregations.

func (*ResponseQuery) All

func (_q *ResponseQuery) All(ctx context.Context) ([]*Response, error)

All executes the query and returns a list of Responses.

func (*ResponseQuery) AllX

func (_q *ResponseQuery) AllX(ctx context.Context) []*Response

AllX is like All, but panics if an error occurs.

func (*ResponseQuery) Clone

func (_q *ResponseQuery) Clone() *ResponseQuery

Clone returns a duplicate of the ResponseQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ResponseQuery) Count

func (_q *ResponseQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ResponseQuery) CountX

func (_q *ResponseQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ResponseQuery) Exist

func (_q *ResponseQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ResponseQuery) ExistX

func (_q *ResponseQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ResponseQuery) First

func (_q *ResponseQuery) First(ctx context.Context) (*Response, error)

First returns the first Response entity from the query. Returns a *NotFoundError when no Response was found.

func (*ResponseQuery) FirstID

func (_q *ResponseQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Response ID from the query. Returns a *NotFoundError when no Response ID was found.

func (*ResponseQuery) FirstIDX

func (_q *ResponseQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ResponseQuery) FirstX

func (_q *ResponseQuery) FirstX(ctx context.Context) *Response

FirstX is like First, but panics if an error occurs.

func (*ResponseQuery) GroupBy

func (_q *ResponseQuery) GroupBy(field string, fields ...string) *ResponseGroupBy

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 {
	RequestID uuid.UUID `json:"request_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Response.Query().
	GroupBy(response.FieldRequestID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ResponseQuery) IDs

func (_q *ResponseQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Response IDs.

func (*ResponseQuery) IDsX

func (_q *ResponseQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ResponseQuery) Limit

func (_q *ResponseQuery) Limit(limit int) *ResponseQuery

Limit the number of records to be returned by this query.

func (*ResponseQuery) Offset

func (_q *ResponseQuery) Offset(offset int) *ResponseQuery

Offset to start from.

func (*ResponseQuery) Only

func (_q *ResponseQuery) Only(ctx context.Context) (*Response, error)

Only returns a single Response entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Response entity is found. Returns a *NotFoundError when no Response entities are found.

func (*ResponseQuery) OnlyID

func (_q *ResponseQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Response ID in the query. Returns a *NotSingularError when more than one Response ID is found. Returns a *NotFoundError when no entities are found.

func (*ResponseQuery) OnlyIDX

func (_q *ResponseQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ResponseQuery) OnlyX

func (_q *ResponseQuery) OnlyX(ctx context.Context) *Response

OnlyX is like Only, but panics if an error occurs.

func (*ResponseQuery) Order

Order specifies how the records should be ordered.

func (*ResponseQuery) QueryDiffsFrom

func (_q *ResponseQuery) QueryDiffsFrom() *DiffQuery

QueryDiffsFrom chains the current query on the "diffs_from" edge.

func (*ResponseQuery) QueryDiffsTo

func (_q *ResponseQuery) QueryDiffsTo() *DiffQuery

QueryDiffsTo chains the current query on the "diffs_to" edge.

func (*ResponseQuery) QueryRequest

func (_q *ResponseQuery) QueryRequest() *RequestQuery

QueryRequest chains the current query on the "request" edge.

func (*ResponseQuery) Select

func (_q *ResponseQuery) Select(fields ...string) *ResponseSelect

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 {
	RequestID uuid.UUID `json:"request_id,omitempty"`
}

client.Response.Query().
	Select(response.FieldRequestID).
	Scan(ctx, &v)

func (*ResponseQuery) Unique

func (_q *ResponseQuery) Unique(unique bool) *ResponseQuery

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 (*ResponseQuery) Where

func (_q *ResponseQuery) Where(ps ...predicate.Response) *ResponseQuery

Where adds a new predicate for the ResponseQuery builder.

func (*ResponseQuery) WithDiffsFrom

func (_q *ResponseQuery) WithDiffsFrom(opts ...func(*DiffQuery)) *ResponseQuery

WithDiffsFrom tells the query-builder to eager-load the nodes that are connected to the "diffs_from" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResponseQuery) WithDiffsTo

func (_q *ResponseQuery) WithDiffsTo(opts ...func(*DiffQuery)) *ResponseQuery

WithDiffsTo tells the query-builder to eager-load the nodes that are connected to the "diffs_to" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResponseQuery) WithRequest

func (_q *ResponseQuery) WithRequest(opts ...func(*RequestQuery)) *ResponseQuery

WithRequest tells the query-builder to eager-load the nodes that are connected to the "request" edge. The optional arguments are used to configure the query builder of the edge.

type ResponseSelect

type ResponseSelect struct {
	*ResponseQuery
	// contains filtered or unexported fields
}

ResponseSelect is the builder for selecting fields of Response entities.

func (*ResponseSelect) Aggregate

func (_s *ResponseSelect) Aggregate(fns ...AggregateFunc) *ResponseSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ResponseSelect) Bool

func (s *ResponseSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) BoolX

func (s *ResponseSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResponseSelect) Bools

func (s *ResponseSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) BoolsX

func (s *ResponseSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResponseSelect) Float64

func (s *ResponseSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) Float64X

func (s *ResponseSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResponseSelect) Float64s

func (s *ResponseSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) Float64sX

func (s *ResponseSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResponseSelect) Int

func (s *ResponseSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) IntX

func (s *ResponseSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResponseSelect) Ints

func (s *ResponseSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) IntsX

func (s *ResponseSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResponseSelect) Scan

func (_s *ResponseSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ResponseSelect) ScanX

func (s *ResponseSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ResponseSelect) String

func (s *ResponseSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) StringX

func (s *ResponseSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResponseSelect) Strings

func (s *ResponseSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) StringsX

func (s *ResponseSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResponseUpdate

type ResponseUpdate struct {
	// contains filtered or unexported fields
}

ResponseUpdate is the builder for updating Response entities.

func (*ResponseUpdate) AddDiffsFrom

func (_u *ResponseUpdate) AddDiffsFrom(v ...*Diff) *ResponseUpdate

AddDiffsFrom adds the "diffs_from" edges to the Diff entity.

func (*ResponseUpdate) AddDiffsFromIDs

func (_u *ResponseUpdate) AddDiffsFromIDs(ids ...uuid.UUID) *ResponseUpdate

AddDiffsFromIDs adds the "diffs_from" edge to the Diff entity by IDs.

func (*ResponseUpdate) AddDiffsTo

func (_u *ResponseUpdate) AddDiffsTo(v ...*Diff) *ResponseUpdate

AddDiffsTo adds the "diffs_to" edges to the Diff entity.

func (*ResponseUpdate) AddDiffsToIDs

func (_u *ResponseUpdate) AddDiffsToIDs(ids ...uuid.UUID) *ResponseUpdate

AddDiffsToIDs adds the "diffs_to" edge to the Diff entity by IDs.

func (*ResponseUpdate) AddLatencyMs

func (_u *ResponseUpdate) AddLatencyMs(v int64) *ResponseUpdate

AddLatencyMs adds value to the "latency_ms" field.

func (*ResponseUpdate) AddStatusCode

func (_u *ResponseUpdate) AddStatusCode(v int32) *ResponseUpdate

AddStatusCode adds value to the "status_code" field.

func (*ResponseUpdate) AppendBody added in v1.1.0

func (_u *ResponseUpdate) AppendBody(v json.RawMessage) *ResponseUpdate

AppendBody appends value to the "body" field.

func (*ResponseUpdate) ClearBody

func (_u *ResponseUpdate) ClearBody() *ResponseUpdate

ClearBody clears the value of the "body" field.

func (*ResponseUpdate) ClearDiffsFrom

func (_u *ResponseUpdate) ClearDiffsFrom() *ResponseUpdate

ClearDiffsFrom clears all "diffs_from" edges to the Diff entity.

func (*ResponseUpdate) ClearDiffsTo

func (_u *ResponseUpdate) ClearDiffsTo() *ResponseUpdate

ClearDiffsTo clears all "diffs_to" edges to the Diff entity.

func (*ResponseUpdate) ClearHeaders

func (_u *ResponseUpdate) ClearHeaders() *ResponseUpdate

ClearHeaders clears the value of the "headers" field.

func (*ResponseUpdate) ClearRequest

func (_u *ResponseUpdate) ClearRequest() *ResponseUpdate

ClearRequest clears the "request" edge to the Request entity.

func (*ResponseUpdate) Exec

func (_u *ResponseUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResponseUpdate) ExecX

func (_u *ResponseUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResponseUpdate) Mutation

func (_u *ResponseUpdate) Mutation() *ResponseMutation

Mutation returns the ResponseMutation object of the builder.

func (*ResponseUpdate) RemoveDiffsFrom

func (_u *ResponseUpdate) RemoveDiffsFrom(v ...*Diff) *ResponseUpdate

RemoveDiffsFrom removes "diffs_from" edges to Diff entities.

func (*ResponseUpdate) RemoveDiffsFromIDs

func (_u *ResponseUpdate) RemoveDiffsFromIDs(ids ...uuid.UUID) *ResponseUpdate

RemoveDiffsFromIDs removes the "diffs_from" edge to Diff entities by IDs.

func (*ResponseUpdate) RemoveDiffsTo

func (_u *ResponseUpdate) RemoveDiffsTo(v ...*Diff) *ResponseUpdate

RemoveDiffsTo removes "diffs_to" edges to Diff entities.

func (*ResponseUpdate) RemoveDiffsToIDs

func (_u *ResponseUpdate) RemoveDiffsToIDs(ids ...uuid.UUID) *ResponseUpdate

RemoveDiffsToIDs removes the "diffs_to" edge to Diff entities by IDs.

func (*ResponseUpdate) Save

func (_u *ResponseUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ResponseUpdate) SaveX

func (_u *ResponseUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ResponseUpdate) SetBody

func (_u *ResponseUpdate) SetBody(v json.RawMessage) *ResponseUpdate

SetBody sets the "body" field.

func (*ResponseUpdate) SetCreatedAt

func (_u *ResponseUpdate) SetCreatedAt(v time.Time) *ResponseUpdate

SetCreatedAt sets the "created_at" field.

func (*ResponseUpdate) SetHeaders

func (_u *ResponseUpdate) SetHeaders(v map[string][]string) *ResponseUpdate

SetHeaders sets the "headers" field.

func (*ResponseUpdate) SetLatencyMs

func (_u *ResponseUpdate) SetLatencyMs(v int64) *ResponseUpdate

SetLatencyMs sets the "latency_ms" field.

func (*ResponseUpdate) SetNillableCreatedAt

func (_u *ResponseUpdate) SetNillableCreatedAt(v *time.Time) *ResponseUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ResponseUpdate) SetNillableLatencyMs

func (_u *ResponseUpdate) SetNillableLatencyMs(v *int64) *ResponseUpdate

SetNillableLatencyMs sets the "latency_ms" field if the given value is not nil.

func (*ResponseUpdate) SetNillableRequestID

func (_u *ResponseUpdate) SetNillableRequestID(v *uuid.UUID) *ResponseUpdate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*ResponseUpdate) SetNillableStatusCode

func (_u *ResponseUpdate) SetNillableStatusCode(v *int32) *ResponseUpdate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*ResponseUpdate) SetNillableType

func (_u *ResponseUpdate) SetNillableType(v *string) *ResponseUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ResponseUpdate) SetRequest

func (_u *ResponseUpdate) SetRequest(v *Request) *ResponseUpdate

SetRequest sets the "request" edge to the Request entity.

func (*ResponseUpdate) SetRequestID

func (_u *ResponseUpdate) SetRequestID(v uuid.UUID) *ResponseUpdate

SetRequestID sets the "request_id" field.

func (*ResponseUpdate) SetStatusCode

func (_u *ResponseUpdate) SetStatusCode(v int32) *ResponseUpdate

SetStatusCode sets the "status_code" field.

func (*ResponseUpdate) SetType

func (_u *ResponseUpdate) SetType(v string) *ResponseUpdate

SetType sets the "type" field.

func (*ResponseUpdate) Where

func (_u *ResponseUpdate) Where(ps ...predicate.Response) *ResponseUpdate

Where appends a list predicates to the ResponseUpdate builder.

type ResponseUpdateOne

type ResponseUpdateOne struct {
	// contains filtered or unexported fields
}

ResponseUpdateOne is the builder for updating a single Response entity.

func (*ResponseUpdateOne) AddDiffsFrom

func (_u *ResponseUpdateOne) AddDiffsFrom(v ...*Diff) *ResponseUpdateOne

AddDiffsFrom adds the "diffs_from" edges to the Diff entity.

func (*ResponseUpdateOne) AddDiffsFromIDs

func (_u *ResponseUpdateOne) AddDiffsFromIDs(ids ...uuid.UUID) *ResponseUpdateOne

AddDiffsFromIDs adds the "diffs_from" edge to the Diff entity by IDs.

func (*ResponseUpdateOne) AddDiffsTo

func (_u *ResponseUpdateOne) AddDiffsTo(v ...*Diff) *ResponseUpdateOne

AddDiffsTo adds the "diffs_to" edges to the Diff entity.

func (*ResponseUpdateOne) AddDiffsToIDs

func (_u *ResponseUpdateOne) AddDiffsToIDs(ids ...uuid.UUID) *ResponseUpdateOne

AddDiffsToIDs adds the "diffs_to" edge to the Diff entity by IDs.

func (*ResponseUpdateOne) AddLatencyMs

func (_u *ResponseUpdateOne) AddLatencyMs(v int64) *ResponseUpdateOne

AddLatencyMs adds value to the "latency_ms" field.

func (*ResponseUpdateOne) AddStatusCode

func (_u *ResponseUpdateOne) AddStatusCode(v int32) *ResponseUpdateOne

AddStatusCode adds value to the "status_code" field.

func (*ResponseUpdateOne) AppendBody added in v1.1.0

AppendBody appends value to the "body" field.

func (*ResponseUpdateOne) ClearBody

func (_u *ResponseUpdateOne) ClearBody() *ResponseUpdateOne

ClearBody clears the value of the "body" field.

func (*ResponseUpdateOne) ClearDiffsFrom

func (_u *ResponseUpdateOne) ClearDiffsFrom() *ResponseUpdateOne

ClearDiffsFrom clears all "diffs_from" edges to the Diff entity.

func (*ResponseUpdateOne) ClearDiffsTo

func (_u *ResponseUpdateOne) ClearDiffsTo() *ResponseUpdateOne

ClearDiffsTo clears all "diffs_to" edges to the Diff entity.

func (*ResponseUpdateOne) ClearHeaders

func (_u *ResponseUpdateOne) ClearHeaders() *ResponseUpdateOne

ClearHeaders clears the value of the "headers" field.

func (*ResponseUpdateOne) ClearRequest

func (_u *ResponseUpdateOne) ClearRequest() *ResponseUpdateOne

ClearRequest clears the "request" edge to the Request entity.

func (*ResponseUpdateOne) Exec

func (_u *ResponseUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ResponseUpdateOne) ExecX

func (_u *ResponseUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResponseUpdateOne) Mutation

func (_u *ResponseUpdateOne) Mutation() *ResponseMutation

Mutation returns the ResponseMutation object of the builder.

func (*ResponseUpdateOne) RemoveDiffsFrom

func (_u *ResponseUpdateOne) RemoveDiffsFrom(v ...*Diff) *ResponseUpdateOne

RemoveDiffsFrom removes "diffs_from" edges to Diff entities.

func (*ResponseUpdateOne) RemoveDiffsFromIDs

func (_u *ResponseUpdateOne) RemoveDiffsFromIDs(ids ...uuid.UUID) *ResponseUpdateOne

RemoveDiffsFromIDs removes the "diffs_from" edge to Diff entities by IDs.

func (*ResponseUpdateOne) RemoveDiffsTo

func (_u *ResponseUpdateOne) RemoveDiffsTo(v ...*Diff) *ResponseUpdateOne

RemoveDiffsTo removes "diffs_to" edges to Diff entities.

func (*ResponseUpdateOne) RemoveDiffsToIDs

func (_u *ResponseUpdateOne) RemoveDiffsToIDs(ids ...uuid.UUID) *ResponseUpdateOne

RemoveDiffsToIDs removes the "diffs_to" edge to Diff entities by IDs.

func (*ResponseUpdateOne) Save

func (_u *ResponseUpdateOne) Save(ctx context.Context) (*Response, error)

Save executes the query and returns the updated Response entity.

func (*ResponseUpdateOne) SaveX

func (_u *ResponseUpdateOne) SaveX(ctx context.Context) *Response

SaveX is like Save, but panics if an error occurs.

func (*ResponseUpdateOne) Select

func (_u *ResponseUpdateOne) Select(field string, fields ...string) *ResponseUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ResponseUpdateOne) SetBody

SetBody sets the "body" field.

func (*ResponseUpdateOne) SetCreatedAt

func (_u *ResponseUpdateOne) SetCreatedAt(v time.Time) *ResponseUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ResponseUpdateOne) SetHeaders

func (_u *ResponseUpdateOne) SetHeaders(v map[string][]string) *ResponseUpdateOne

SetHeaders sets the "headers" field.

func (*ResponseUpdateOne) SetLatencyMs

func (_u *ResponseUpdateOne) SetLatencyMs(v int64) *ResponseUpdateOne

SetLatencyMs sets the "latency_ms" field.

func (*ResponseUpdateOne) SetNillableCreatedAt

func (_u *ResponseUpdateOne) SetNillableCreatedAt(v *time.Time) *ResponseUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ResponseUpdateOne) SetNillableLatencyMs

func (_u *ResponseUpdateOne) SetNillableLatencyMs(v *int64) *ResponseUpdateOne

SetNillableLatencyMs sets the "latency_ms" field if the given value is not nil.

func (*ResponseUpdateOne) SetNillableRequestID

func (_u *ResponseUpdateOne) SetNillableRequestID(v *uuid.UUID) *ResponseUpdateOne

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*ResponseUpdateOne) SetNillableStatusCode

func (_u *ResponseUpdateOne) SetNillableStatusCode(v *int32) *ResponseUpdateOne

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*ResponseUpdateOne) SetNillableType

func (_u *ResponseUpdateOne) SetNillableType(v *string) *ResponseUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ResponseUpdateOne) SetRequest

func (_u *ResponseUpdateOne) SetRequest(v *Request) *ResponseUpdateOne

SetRequest sets the "request" edge to the Request entity.

func (*ResponseUpdateOne) SetRequestID

func (_u *ResponseUpdateOne) SetRequestID(v uuid.UUID) *ResponseUpdateOne

SetRequestID sets the "request_id" field.

func (*ResponseUpdateOne) SetStatusCode

func (_u *ResponseUpdateOne) SetStatusCode(v int32) *ResponseUpdateOne

SetStatusCode sets the "status_code" field.

func (*ResponseUpdateOne) SetType

func (_u *ResponseUpdateOne) SetType(v string) *ResponseUpdateOne

SetType sets the "type" field.

func (*ResponseUpdateOne) Where

Where appends a list predicates to the ResponseUpdate builder.

type Responses

type Responses []*Response

Responses is a parsable slice of Response.

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 {

	// Diff is the client for interacting with the Diff builders.
	Diff *DiffClient
	// Gate is the client for interacting with the Gate builders.
	Gate *GateClient
	// Request is the client for interacting with the Request builders.
	Request *RequestClient
	// Response is the client for interacting with the Response builders.
	Response *ResponseClient
	// 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