ent

package
v0.0.0-...-f0d3e45 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeAuditEvent   = "AuditEvent"
	TypeResourceKind = "ResourceKind"
	TypeView         = "View"
)

Variables

View Source
var DefaultAuditEventOrder = &AuditEventOrder{
	Direction: OrderDirectionAsc,
	Field: &AuditEventOrderField{
		field: auditevent.FieldID,
		toCursor: func(ae *AuditEvent) Cursor {
			return Cursor{ID: ae.ID}
		},
	},
}

DefaultAuditEventOrder is the default ordering of AuditEvent.

View Source
var DefaultResourceKindOrder = &ResourceKindOrder{
	Direction: OrderDirectionAsc,
	Field: &ResourceKindOrderField{
		field: resourcekind.FieldID,
		toCursor: func(rk *ResourceKind) Cursor {
			return Cursor{ID: rk.ID}
		},
	},
}

DefaultResourceKindOrder is the default ordering of ResourceKind.

View Source
var DefaultViewOrder = &ViewOrder{
	Direction: OrderDirectionAsc,
	Field: &ViewOrderField{
		field: view.FieldID,
		toCursor: func(v *View) Cursor {
			return Cursor{ID: v.ID}
		},
	},
}

DefaultViewOrder is the default ordering of View.

Functions

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.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

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 AuditEvent

type AuditEvent struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Raw holds the value of the "raw" field.
	Raw string `json:"raw,omitempty"`
	// Level holds the value of the "level" field.
	Level string `json:"level,omitempty"`
	// AuditID holds the value of the "auditID" field.
	AuditID string `json:"auditID,omitempty"`
	// Verb holds the value of the "verb" field.
	Verb string `json:"verb,omitempty"`
	// UserAgent holds the value of the "userAgent" field.
	UserAgent string `json:"userAgent,omitempty"`
	// RequestTimestamp holds the value of the "requestTimestamp" field.
	RequestTimestamp time.Time `json:"requestTimestamp,omitempty"`
	// StageTimestamp holds the value of the "stageTimestamp" field.
	StageTimestamp time.Time `json:"stageTimestamp,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// ApiVersion holds the value of the "apiVersion" field.
	ApiVersion string `json:"apiVersion,omitempty"`
	// ApiGroup holds the value of the "apiGroup" field.
	ApiGroup string `json:"apiGroup,omitempty"`
	// Resource holds the value of the "resource" field.
	Resource string `json:"resource,omitempty"`
	// SubResource holds the value of the "subResource" field.
	SubResource string `json:"subResource,omitempty"`
	// Stage holds the value of the "stage" field.
	Stage string `json:"stage,omitempty"`
	// contains filtered or unexported fields
}

AuditEvent is the model entity for the AuditEvent schema.

func (*AuditEvent) IsNode

func (n *AuditEvent) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*AuditEvent) String

func (ae *AuditEvent) String() string

String implements the fmt.Stringer.

func (*AuditEvent) ToEdge

func (ae *AuditEvent) ToEdge(order *AuditEventOrder) *AuditEventEdge

ToEdge converts AuditEvent into AuditEventEdge.

func (*AuditEvent) Unwrap

func (ae *AuditEvent) Unwrap() *AuditEvent

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

func (ae *AuditEvent) Update() *AuditEventUpdateOne

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

type AuditEventClient

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

AuditEventClient is a client for the AuditEvent schema.

func NewAuditEventClient

func NewAuditEventClient(c config) *AuditEventClient

NewAuditEventClient returns a client for the AuditEvent from the given config.

func (*AuditEventClient) Create

func (c *AuditEventClient) Create() *AuditEventCreate

Create returns a builder for creating a AuditEvent entity.

func (*AuditEventClient) CreateBulk

func (c *AuditEventClient) CreateBulk(builders ...*AuditEventCreate) *AuditEventCreateBulk

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

func (*AuditEventClient) Delete

func (c *AuditEventClient) Delete() *AuditEventDelete

Delete returns a delete builder for AuditEvent.

func (*AuditEventClient) DeleteOne

func (c *AuditEventClient) DeleteOne(ae *AuditEvent) *AuditEventDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuditEventClient) DeleteOneID

func (c *AuditEventClient) DeleteOneID(id int) *AuditEventDeleteOne

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

func (*AuditEventClient) Get

func (c *AuditEventClient) Get(ctx context.Context, id int) (*AuditEvent, error)

Get returns a AuditEvent entity by its id.

func (*AuditEventClient) GetX

func (c *AuditEventClient) GetX(ctx context.Context, id int) *AuditEvent

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

func (*AuditEventClient) Hooks

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

Hooks returns the client hooks.

func (*AuditEventClient) Intercept

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

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

func (*AuditEventClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuditEventClient) Query

func (c *AuditEventClient) Query() *AuditEventQuery

Query returns a query builder for AuditEvent.

func (*AuditEventClient) Update

func (c *AuditEventClient) Update() *AuditEventUpdate

Update returns an update builder for AuditEvent.

func (*AuditEventClient) UpdateOne

func (c *AuditEventClient) UpdateOne(ae *AuditEvent) *AuditEventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuditEventClient) UpdateOneID

func (c *AuditEventClient) UpdateOneID(id int) *AuditEventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuditEventClient) Use

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

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

type AuditEventConnection

type AuditEventConnection struct {
	Edges      []*AuditEventEdge `json:"edges"`
	PageInfo   PageInfo          `json:"pageInfo"`
	TotalCount int               `json:"totalCount"`
}

AuditEventConnection is the connection containing edges to AuditEvent.

type AuditEventCreate

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

AuditEventCreate is the builder for creating a AuditEvent entity.

func (*AuditEventCreate) Exec

func (aec *AuditEventCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuditEventCreate) ExecX

func (aec *AuditEventCreate) ExecX(ctx context.Context)

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

func (*AuditEventCreate) Mutation

func (aec *AuditEventCreate) Mutation() *AuditEventMutation

Mutation returns the AuditEventMutation object of the builder.

func (*AuditEventCreate) Save

func (aec *AuditEventCreate) Save(ctx context.Context) (*AuditEvent, error)

Save creates the AuditEvent in the database.

func (*AuditEventCreate) SaveX

func (aec *AuditEventCreate) SaveX(ctx context.Context) *AuditEvent

SaveX calls Save and panics if Save returns an error.

func (*AuditEventCreate) SetApiGroup

func (aec *AuditEventCreate) SetApiGroup(s string) *AuditEventCreate

SetApiGroup sets the "apiGroup" field.

func (*AuditEventCreate) SetApiVersion

func (aec *AuditEventCreate) SetApiVersion(s string) *AuditEventCreate

SetApiVersion sets the "apiVersion" field.

func (*AuditEventCreate) SetAuditID

func (aec *AuditEventCreate) SetAuditID(s string) *AuditEventCreate

SetAuditID sets the "auditID" field.

func (*AuditEventCreate) SetLevel

func (aec *AuditEventCreate) SetLevel(s string) *AuditEventCreate

SetLevel sets the "level" field.

func (*AuditEventCreate) SetName

func (aec *AuditEventCreate) SetName(s string) *AuditEventCreate

SetName sets the "name" field.

func (*AuditEventCreate) SetNamespace

func (aec *AuditEventCreate) SetNamespace(s string) *AuditEventCreate

SetNamespace sets the "namespace" field.

func (*AuditEventCreate) SetNillableApiGroup

func (aec *AuditEventCreate) SetNillableApiGroup(s *string) *AuditEventCreate

SetNillableApiGroup sets the "apiGroup" field if the given value is not nil.

func (*AuditEventCreate) SetNillableApiVersion

func (aec *AuditEventCreate) SetNillableApiVersion(s *string) *AuditEventCreate

SetNillableApiVersion sets the "apiVersion" field if the given value is not nil.

func (*AuditEventCreate) SetNillableName

func (aec *AuditEventCreate) SetNillableName(s *string) *AuditEventCreate

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

func (*AuditEventCreate) SetNillableNamespace

func (aec *AuditEventCreate) SetNillableNamespace(s *string) *AuditEventCreate

SetNillableNamespace sets the "namespace" field if the given value is not nil.

func (*AuditEventCreate) SetNillableResource

func (aec *AuditEventCreate) SetNillableResource(s *string) *AuditEventCreate

SetNillableResource sets the "resource" field if the given value is not nil.

func (*AuditEventCreate) SetNillableSubResource

func (aec *AuditEventCreate) SetNillableSubResource(s *string) *AuditEventCreate

SetNillableSubResource sets the "subResource" field if the given value is not nil.

func (*AuditEventCreate) SetRaw

func (aec *AuditEventCreate) SetRaw(s string) *AuditEventCreate

SetRaw sets the "raw" field.

func (*AuditEventCreate) SetRequestTimestamp

func (aec *AuditEventCreate) SetRequestTimestamp(t time.Time) *AuditEventCreate

SetRequestTimestamp sets the "requestTimestamp" field.

func (*AuditEventCreate) SetResource

func (aec *AuditEventCreate) SetResource(s string) *AuditEventCreate

SetResource sets the "resource" field.

func (*AuditEventCreate) SetStage

func (aec *AuditEventCreate) SetStage(s string) *AuditEventCreate

SetStage sets the "stage" field.

func (*AuditEventCreate) SetStageTimestamp

func (aec *AuditEventCreate) SetStageTimestamp(t time.Time) *AuditEventCreate

SetStageTimestamp sets the "stageTimestamp" field.

func (*AuditEventCreate) SetSubResource

func (aec *AuditEventCreate) SetSubResource(s string) *AuditEventCreate

SetSubResource sets the "subResource" field.

func (*AuditEventCreate) SetUserAgent

func (aec *AuditEventCreate) SetUserAgent(s string) *AuditEventCreate

SetUserAgent sets the "userAgent" field.

func (*AuditEventCreate) SetVerb

func (aec *AuditEventCreate) SetVerb(s string) *AuditEventCreate

SetVerb sets the "verb" field.

type AuditEventCreateBulk

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

AuditEventCreateBulk is the builder for creating many AuditEvent entities in bulk.

func (*AuditEventCreateBulk) Exec

func (aecb *AuditEventCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AuditEventCreateBulk) ExecX

func (aecb *AuditEventCreateBulk) ExecX(ctx context.Context)

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

func (*AuditEventCreateBulk) Save

func (aecb *AuditEventCreateBulk) Save(ctx context.Context) ([]*AuditEvent, error)

Save creates the AuditEvent entities in the database.

func (*AuditEventCreateBulk) SaveX

func (aecb *AuditEventCreateBulk) SaveX(ctx context.Context) []*AuditEvent

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

type AuditEventDelete

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

AuditEventDelete is the builder for deleting a AuditEvent entity.

func (*AuditEventDelete) Exec

func (aed *AuditEventDelete) Exec(ctx context.Context) (int, error)

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

func (*AuditEventDelete) ExecX

func (aed *AuditEventDelete) ExecX(ctx context.Context) int

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

func (*AuditEventDelete) Where

Where appends a list predicates to the AuditEventDelete builder.

type AuditEventDeleteOne

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

AuditEventDeleteOne is the builder for deleting a single AuditEvent entity.

func (*AuditEventDeleteOne) Exec

func (aedo *AuditEventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AuditEventDeleteOne) ExecX

func (aedo *AuditEventDeleteOne) ExecX(ctx context.Context)

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

func (*AuditEventDeleteOne) Where

Where appends a list predicates to the AuditEventDelete builder.

type AuditEventEdge

type AuditEventEdge struct {
	Node   *AuditEvent `json:"node"`
	Cursor Cursor      `json:"cursor"`
}

AuditEventEdge is the edge representation of AuditEvent.

type AuditEventGroupBy

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

AuditEventGroupBy is the group-by builder for AuditEvent entities.

func (*AuditEventGroupBy) Aggregate

func (aegb *AuditEventGroupBy) Aggregate(fns ...AggregateFunc) *AuditEventGroupBy

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

func (*AuditEventGroupBy) Bool

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

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

func (*AuditEventGroupBy) BoolX

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

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

func (*AuditEventGroupBy) Bools

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

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

func (*AuditEventGroupBy) BoolsX

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

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

func (*AuditEventGroupBy) Float64

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

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

func (*AuditEventGroupBy) Float64X

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

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

func (*AuditEventGroupBy) Float64s

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

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

func (*AuditEventGroupBy) Float64sX

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

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

func (*AuditEventGroupBy) Int

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

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

func (*AuditEventGroupBy) IntX

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

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

func (*AuditEventGroupBy) Ints

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

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

func (*AuditEventGroupBy) IntsX

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

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

func (*AuditEventGroupBy) Scan

func (aegb *AuditEventGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuditEventGroupBy) ScanX

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

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

func (*AuditEventGroupBy) String

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

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

func (*AuditEventGroupBy) StringX

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

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

func (*AuditEventGroupBy) Strings

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

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

func (*AuditEventGroupBy) StringsX

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

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

type AuditEventMutation

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

AuditEventMutation represents an operation that mutates the AuditEvent nodes in the graph.

func (*AuditEventMutation) AddField

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

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

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

func (*AuditEventMutation) AddedField

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

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

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

func (*AuditEventMutation) AddedIDs

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

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

func (*AuditEventMutation) ApiGroup

func (m *AuditEventMutation) ApiGroup() (r string, exists bool)

ApiGroup returns the value of the "apiGroup" field in the mutation.

func (*AuditEventMutation) ApiVersion

func (m *AuditEventMutation) ApiVersion() (r string, exists bool)

ApiVersion returns the value of the "apiVersion" field in the mutation.

func (*AuditEventMutation) AuditID

func (m *AuditEventMutation) AuditID() (r string, exists bool)

AuditID returns the value of the "auditID" field in the mutation.

func (*AuditEventMutation) ClearEdge

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

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

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

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

func (*AuditEventMutation) ClearedFields

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

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

func (AuditEventMutation) Client

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

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

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

func (*AuditEventMutation) Field

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

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

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

func (*AuditEventMutation) Fields

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

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

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

func (*AuditEventMutation) IDs

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

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

func (*AuditEventMutation) Level

func (m *AuditEventMutation) Level() (r string, exists bool)

Level returns the value of the "level" field in the mutation.

func (*AuditEventMutation) Name

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

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

func (*AuditEventMutation) Namespace

func (m *AuditEventMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*AuditEventMutation) OldApiGroup

func (m *AuditEventMutation) OldApiGroup(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldApiVersion

func (m *AuditEventMutation) OldApiVersion(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldAuditID

func (m *AuditEventMutation) OldAuditID(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldField

func (m *AuditEventMutation) 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 (*AuditEventMutation) OldLevel

func (m *AuditEventMutation) OldLevel(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldName

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

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

func (*AuditEventMutation) OldNamespace

func (m *AuditEventMutation) OldNamespace(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldRaw

func (m *AuditEventMutation) OldRaw(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldRequestTimestamp

func (m *AuditEventMutation) OldRequestTimestamp(ctx context.Context) (v time.Time, err error)

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

func (*AuditEventMutation) OldResource

func (m *AuditEventMutation) OldResource(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldStage

func (m *AuditEventMutation) OldStage(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldStageTimestamp

func (m *AuditEventMutation) OldStageTimestamp(ctx context.Context) (v time.Time, err error)

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

func (*AuditEventMutation) OldSubResource

func (m *AuditEventMutation) OldSubResource(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldUserAgent

func (m *AuditEventMutation) OldUserAgent(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldVerb

func (m *AuditEventMutation) OldVerb(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) Op

func (m *AuditEventMutation) Op() Op

Op returns the operation name.

func (*AuditEventMutation) Raw

func (m *AuditEventMutation) Raw() (r string, exists bool)

Raw returns the value of the "raw" field in the mutation.

func (*AuditEventMutation) RemovedEdges

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

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

func (*AuditEventMutation) RemovedIDs

func (m *AuditEventMutation) 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 (*AuditEventMutation) RequestTimestamp

func (m *AuditEventMutation) RequestTimestamp() (r time.Time, exists bool)

RequestTimestamp returns the value of the "requestTimestamp" field in the mutation.

func (*AuditEventMutation) ResetApiGroup

func (m *AuditEventMutation) ResetApiGroup()

ResetApiGroup resets all changes to the "apiGroup" field.

func (*AuditEventMutation) ResetApiVersion

func (m *AuditEventMutation) ResetApiVersion()

ResetApiVersion resets all changes to the "apiVersion" field.

func (*AuditEventMutation) ResetAuditID

func (m *AuditEventMutation) ResetAuditID()

ResetAuditID resets all changes to the "auditID" field.

func (*AuditEventMutation) ResetEdge

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

func (m *AuditEventMutation) 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 (*AuditEventMutation) ResetLevel

func (m *AuditEventMutation) ResetLevel()

ResetLevel resets all changes to the "level" field.

func (*AuditEventMutation) ResetName

func (m *AuditEventMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AuditEventMutation) ResetNamespace

func (m *AuditEventMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*AuditEventMutation) ResetRaw

func (m *AuditEventMutation) ResetRaw()

ResetRaw resets all changes to the "raw" field.

func (*AuditEventMutation) ResetRequestTimestamp

func (m *AuditEventMutation) ResetRequestTimestamp()

ResetRequestTimestamp resets all changes to the "requestTimestamp" field.

func (*AuditEventMutation) ResetResource

func (m *AuditEventMutation) ResetResource()

ResetResource resets all changes to the "resource" field.

func (*AuditEventMutation) ResetStage

func (m *AuditEventMutation) ResetStage()

ResetStage resets all changes to the "stage" field.

func (*AuditEventMutation) ResetStageTimestamp

func (m *AuditEventMutation) ResetStageTimestamp()

ResetStageTimestamp resets all changes to the "stageTimestamp" field.

func (*AuditEventMutation) ResetSubResource

func (m *AuditEventMutation) ResetSubResource()

ResetSubResource resets all changes to the "subResource" field.

func (*AuditEventMutation) ResetUserAgent

func (m *AuditEventMutation) ResetUserAgent()

ResetUserAgent resets all changes to the "userAgent" field.

func (*AuditEventMutation) ResetVerb

func (m *AuditEventMutation) ResetVerb()

ResetVerb resets all changes to the "verb" field.

func (*AuditEventMutation) Resource

func (m *AuditEventMutation) Resource() (r string, exists bool)

Resource returns the value of the "resource" field in the mutation.

func (*AuditEventMutation) SetApiGroup

func (m *AuditEventMutation) SetApiGroup(s string)

SetApiGroup sets the "apiGroup" field.

func (*AuditEventMutation) SetApiVersion

func (m *AuditEventMutation) SetApiVersion(s string)

SetApiVersion sets the "apiVersion" field.

func (*AuditEventMutation) SetAuditID

func (m *AuditEventMutation) SetAuditID(s string)

SetAuditID sets the "auditID" field.

func (*AuditEventMutation) SetField

func (m *AuditEventMutation) 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 (*AuditEventMutation) SetLevel

func (m *AuditEventMutation) SetLevel(s string)

SetLevel sets the "level" field.

func (*AuditEventMutation) SetName

func (m *AuditEventMutation) SetName(s string)

SetName sets the "name" field.

func (*AuditEventMutation) SetNamespace

func (m *AuditEventMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*AuditEventMutation) SetOp

func (m *AuditEventMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuditEventMutation) SetRaw

func (m *AuditEventMutation) SetRaw(s string)

SetRaw sets the "raw" field.

func (*AuditEventMutation) SetRequestTimestamp

func (m *AuditEventMutation) SetRequestTimestamp(t time.Time)

SetRequestTimestamp sets the "requestTimestamp" field.

func (*AuditEventMutation) SetResource

func (m *AuditEventMutation) SetResource(s string)

SetResource sets the "resource" field.

func (*AuditEventMutation) SetStage

func (m *AuditEventMutation) SetStage(s string)

SetStage sets the "stage" field.

func (*AuditEventMutation) SetStageTimestamp

func (m *AuditEventMutation) SetStageTimestamp(t time.Time)

SetStageTimestamp sets the "stageTimestamp" field.

func (*AuditEventMutation) SetSubResource

func (m *AuditEventMutation) SetSubResource(s string)

SetSubResource sets the "subResource" field.

func (*AuditEventMutation) SetUserAgent

func (m *AuditEventMutation) SetUserAgent(s string)

SetUserAgent sets the "userAgent" field.

func (*AuditEventMutation) SetVerb

func (m *AuditEventMutation) SetVerb(s string)

SetVerb sets the "verb" field.

func (*AuditEventMutation) Stage

func (m *AuditEventMutation) Stage() (r string, exists bool)

Stage returns the value of the "stage" field in the mutation.

func (*AuditEventMutation) StageTimestamp

func (m *AuditEventMutation) StageTimestamp() (r time.Time, exists bool)

StageTimestamp returns the value of the "stageTimestamp" field in the mutation.

func (*AuditEventMutation) SubResource

func (m *AuditEventMutation) SubResource() (r string, exists bool)

SubResource returns the value of the "subResource" field in the mutation.

func (AuditEventMutation) Tx

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

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

func (*AuditEventMutation) Type

func (m *AuditEventMutation) Type() string

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

func (*AuditEventMutation) UserAgent

func (m *AuditEventMutation) UserAgent() (r string, exists bool)

UserAgent returns the value of the "userAgent" field in the mutation.

func (*AuditEventMutation) Verb

func (m *AuditEventMutation) Verb() (r string, exists bool)

Verb returns the value of the "verb" field in the mutation.

func (*AuditEventMutation) Where

func (m *AuditEventMutation) Where(ps ...predicate.AuditEvent)

Where appends a list predicates to the AuditEventMutation builder.

func (*AuditEventMutation) WhereP

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

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

type AuditEventOrder

type AuditEventOrder struct {
	Direction OrderDirection        `json:"direction"`
	Field     *AuditEventOrderField `json:"field"`
}

AuditEventOrder defines the ordering of AuditEvent.

type AuditEventOrderField

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

AuditEventOrderField defines the ordering field of AuditEvent.

type AuditEventPaginateOption

type AuditEventPaginateOption func(*auditeventPager) error

AuditEventPaginateOption enables pagination customization.

func WithAuditEventFilter

func WithAuditEventFilter(filter func(*AuditEventQuery) (*AuditEventQuery, error)) AuditEventPaginateOption

WithAuditEventFilter configures pagination filter.

func WithAuditEventOrder

func WithAuditEventOrder(order *AuditEventOrder) AuditEventPaginateOption

WithAuditEventOrder configures pagination ordering.

type AuditEventQuery

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

AuditEventQuery is the builder for querying AuditEvent entities.

func (*AuditEventQuery) Aggregate

func (aeq *AuditEventQuery) Aggregate(fns ...AggregateFunc) *AuditEventSelect

Aggregate returns a AuditEventSelect configured with the given aggregations.

func (*AuditEventQuery) All

func (aeq *AuditEventQuery) All(ctx context.Context) ([]*AuditEvent, error)

All executes the query and returns a list of AuditEvents.

func (*AuditEventQuery) AllX

func (aeq *AuditEventQuery) AllX(ctx context.Context) []*AuditEvent

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

func (*AuditEventQuery) Clone

func (aeq *AuditEventQuery) Clone() *AuditEventQuery

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

func (*AuditEventQuery) CollectFields

func (ae *AuditEventQuery) CollectFields(ctx context.Context, satisfies ...string) (*AuditEventQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*AuditEventQuery) Count

func (aeq *AuditEventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuditEventQuery) CountX

func (aeq *AuditEventQuery) CountX(ctx context.Context) int

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

func (*AuditEventQuery) Exist

func (aeq *AuditEventQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuditEventQuery) ExistX

func (aeq *AuditEventQuery) ExistX(ctx context.Context) bool

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

func (*AuditEventQuery) First

func (aeq *AuditEventQuery) First(ctx context.Context) (*AuditEvent, error)

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

func (*AuditEventQuery) FirstID

func (aeq *AuditEventQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AuditEventQuery) FirstIDX

func (aeq *AuditEventQuery) FirstIDX(ctx context.Context) int

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

func (*AuditEventQuery) FirstX

func (aeq *AuditEventQuery) FirstX(ctx context.Context) *AuditEvent

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

func (*AuditEventQuery) GroupBy

func (aeq *AuditEventQuery) GroupBy(field string, fields ...string) *AuditEventGroupBy

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

client.AuditEvent.Query().
	GroupBy(auditevent.FieldRaw).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuditEventQuery) IDs

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

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

func (*AuditEventQuery) IDsX

func (aeq *AuditEventQuery) IDsX(ctx context.Context) []int

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

func (*AuditEventQuery) Limit

func (aeq *AuditEventQuery) Limit(limit int) *AuditEventQuery

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

func (*AuditEventQuery) Offset

func (aeq *AuditEventQuery) Offset(offset int) *AuditEventQuery

Offset to start from.

func (*AuditEventQuery) Only

func (aeq *AuditEventQuery) Only(ctx context.Context) (*AuditEvent, error)

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

func (*AuditEventQuery) OnlyID

func (aeq *AuditEventQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AuditEventQuery) OnlyIDX

func (aeq *AuditEventQuery) OnlyIDX(ctx context.Context) int

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

func (*AuditEventQuery) OnlyX

func (aeq *AuditEventQuery) OnlyX(ctx context.Context) *AuditEvent

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

func (*AuditEventQuery) Order

func (aeq *AuditEventQuery) Order(o ...OrderFunc) *AuditEventQuery

Order specifies how the records should be ordered.

func (*AuditEventQuery) Paginate

func (ae *AuditEventQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...AuditEventPaginateOption,
) (*AuditEventConnection, error)

Paginate executes the query and returns a relay based cursor connection to AuditEvent.

func (*AuditEventQuery) Select

func (aeq *AuditEventQuery) Select(fields ...string) *AuditEventSelect

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

client.AuditEvent.Query().
	Select(auditevent.FieldRaw).
	Scan(ctx, &v)

func (*AuditEventQuery) Unique

func (aeq *AuditEventQuery) Unique(unique bool) *AuditEventQuery

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

Where adds a new predicate for the AuditEventQuery builder.

type AuditEventSelect

type AuditEventSelect struct {
	*AuditEventQuery
	// contains filtered or unexported fields
}

AuditEventSelect is the builder for selecting fields of AuditEvent entities.

func (*AuditEventSelect) Aggregate

func (aes *AuditEventSelect) Aggregate(fns ...AggregateFunc) *AuditEventSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuditEventSelect) Bool

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

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

func (*AuditEventSelect) BoolX

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

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

func (*AuditEventSelect) Bools

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

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

func (*AuditEventSelect) BoolsX

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

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

func (*AuditEventSelect) Float64

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

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

func (*AuditEventSelect) Float64X

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

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

func (*AuditEventSelect) Float64s

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

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

func (*AuditEventSelect) Float64sX

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

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

func (*AuditEventSelect) Int

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

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

func (*AuditEventSelect) IntX

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

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

func (*AuditEventSelect) Ints

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

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

func (*AuditEventSelect) IntsX

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

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

func (*AuditEventSelect) Scan

func (aes *AuditEventSelect) Scan(ctx context.Context, v any) error

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

func (*AuditEventSelect) ScanX

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

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

func (*AuditEventSelect) String

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

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

func (*AuditEventSelect) StringX

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

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

func (*AuditEventSelect) Strings

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

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

func (*AuditEventSelect) StringsX

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

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

type AuditEventUpdate

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

AuditEventUpdate is the builder for updating AuditEvent entities.

func (*AuditEventUpdate) Exec

func (aeu *AuditEventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuditEventUpdate) ExecX

func (aeu *AuditEventUpdate) ExecX(ctx context.Context)

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

func (*AuditEventUpdate) Mutation

func (aeu *AuditEventUpdate) Mutation() *AuditEventMutation

Mutation returns the AuditEventMutation object of the builder.

func (*AuditEventUpdate) Save

func (aeu *AuditEventUpdate) Save(ctx context.Context) (int, error)

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

func (*AuditEventUpdate) SaveX

func (aeu *AuditEventUpdate) SaveX(ctx context.Context) int

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

func (*AuditEventUpdate) Where

Where appends a list predicates to the AuditEventUpdate builder.

type AuditEventUpdateOne

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

AuditEventUpdateOne is the builder for updating a single AuditEvent entity.

func (*AuditEventUpdateOne) Exec

func (aeuo *AuditEventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AuditEventUpdateOne) ExecX

func (aeuo *AuditEventUpdateOne) ExecX(ctx context.Context)

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

func (*AuditEventUpdateOne) Mutation

func (aeuo *AuditEventUpdateOne) Mutation() *AuditEventMutation

Mutation returns the AuditEventMutation object of the builder.

func (*AuditEventUpdateOne) Save

func (aeuo *AuditEventUpdateOne) Save(ctx context.Context) (*AuditEvent, error)

Save executes the query and returns the updated AuditEvent entity.

func (*AuditEventUpdateOne) SaveX

func (aeuo *AuditEventUpdateOne) SaveX(ctx context.Context) *AuditEvent

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

func (*AuditEventUpdateOne) Select

func (aeuo *AuditEventUpdateOne) Select(field string, fields ...string) *AuditEventUpdateOne

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

func (*AuditEventUpdateOne) Where

Where appends a list predicates to the AuditEventUpdate builder.

type AuditEvents

type AuditEvents []*AuditEvent

AuditEvents is a parsable slice of AuditEvent.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AuditEvent is the client for interacting with the AuditEvent builders.
	AuditEvent *AuditEventClient
	// ResourceKind is the client for interacting with the ResourceKind builders.
	ResourceKind *ResourceKindClient
	// View is the client for interacting with the View builders.
	View *ViewClient
	// 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().
	AuditEvent.
	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) Noder

func (c *Client) Noder(ctx context.Context, id int, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []int, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

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 Cursor

type Cursor struct {
	ID    int   `msgpack:"i"`
	Value Value `msgpack:"v,omitempty"`
}

Cursor of an edge type.

func (Cursor) MarshalGQL

func (c Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

func (c *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, int) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

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 OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

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 ResourceKind

type ResourceKind struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// ApiVersion holds the value of the "apiVersion" field.
	ApiVersion string `json:"apiVersion,omitempty"`
	// Namespaced holds the value of the "namespaced" field.
	Namespaced bool `json:"namespaced,omitempty"`
	// Kind holds the value of the "kind" field.
	Kind string `json:"kind,omitempty"`
	// contains filtered or unexported fields
}

ResourceKind is the model entity for the ResourceKind schema.

func (*ResourceKind) IsNode

func (n *ResourceKind) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*ResourceKind) String

func (rk *ResourceKind) String() string

String implements the fmt.Stringer.

func (*ResourceKind) ToEdge

func (rk *ResourceKind) ToEdge(order *ResourceKindOrder) *ResourceKindEdge

ToEdge converts ResourceKind into ResourceKindEdge.

func (*ResourceKind) Unwrap

func (rk *ResourceKind) Unwrap() *ResourceKind

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

func (rk *ResourceKind) Update() *ResourceKindUpdateOne

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

type ResourceKindClient

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

ResourceKindClient is a client for the ResourceKind schema.

func NewResourceKindClient

func NewResourceKindClient(c config) *ResourceKindClient

NewResourceKindClient returns a client for the ResourceKind from the given config.

func (*ResourceKindClient) Create

Create returns a builder for creating a ResourceKind entity.

func (*ResourceKindClient) CreateBulk

func (c *ResourceKindClient) CreateBulk(builders ...*ResourceKindCreate) *ResourceKindCreateBulk

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

func (*ResourceKindClient) Delete

Delete returns a delete builder for ResourceKind.

func (*ResourceKindClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ResourceKindClient) DeleteOneID

func (c *ResourceKindClient) DeleteOneID(id int) *ResourceKindDeleteOne

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

func (*ResourceKindClient) Get

Get returns a ResourceKind entity by its id.

func (*ResourceKindClient) GetX

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

func (*ResourceKindClient) Hooks

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

Hooks returns the client hooks.

func (*ResourceKindClient) Intercept

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

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

func (*ResourceKindClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ResourceKindClient) Query

Query returns a query builder for ResourceKind.

func (*ResourceKindClient) Update

Update returns an update builder for ResourceKind.

func (*ResourceKindClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ResourceKindClient) UpdateOneID

func (c *ResourceKindClient) UpdateOneID(id int) *ResourceKindUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ResourceKindClient) Use

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

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

type ResourceKindConnection

type ResourceKindConnection struct {
	Edges      []*ResourceKindEdge `json:"edges"`
	PageInfo   PageInfo            `json:"pageInfo"`
	TotalCount int                 `json:"totalCount"`
}

ResourceKindConnection is the connection containing edges to ResourceKind.

type ResourceKindCreate

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

ResourceKindCreate is the builder for creating a ResourceKind entity.

func (*ResourceKindCreate) Exec

func (rkc *ResourceKindCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceKindCreate) ExecX

func (rkc *ResourceKindCreate) ExecX(ctx context.Context)

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

func (*ResourceKindCreate) Mutation

func (rkc *ResourceKindCreate) Mutation() *ResourceKindMutation

Mutation returns the ResourceKindMutation object of the builder.

func (*ResourceKindCreate) Save

Save creates the ResourceKind in the database.

func (*ResourceKindCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ResourceKindCreate) SetApiVersion

func (rkc *ResourceKindCreate) SetApiVersion(s string) *ResourceKindCreate

SetApiVersion sets the "apiVersion" field.

func (*ResourceKindCreate) SetKind

func (rkc *ResourceKindCreate) SetKind(s string) *ResourceKindCreate

SetKind sets the "kind" field.

func (*ResourceKindCreate) SetName

func (rkc *ResourceKindCreate) SetName(s string) *ResourceKindCreate

SetName sets the "name" field.

func (*ResourceKindCreate) SetNamespaced

func (rkc *ResourceKindCreate) SetNamespaced(b bool) *ResourceKindCreate

SetNamespaced sets the "namespaced" field.

func (*ResourceKindCreate) SetNillableNamespaced

func (rkc *ResourceKindCreate) SetNillableNamespaced(b *bool) *ResourceKindCreate

SetNillableNamespaced sets the "namespaced" field if the given value is not nil.

type ResourceKindCreateBulk

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

ResourceKindCreateBulk is the builder for creating many ResourceKind entities in bulk.

func (*ResourceKindCreateBulk) Exec

func (rkcb *ResourceKindCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceKindCreateBulk) ExecX

func (rkcb *ResourceKindCreateBulk) ExecX(ctx context.Context)

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

func (*ResourceKindCreateBulk) Save

Save creates the ResourceKind entities in the database.

func (*ResourceKindCreateBulk) SaveX

func (rkcb *ResourceKindCreateBulk) SaveX(ctx context.Context) []*ResourceKind

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

type ResourceKindDelete

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

ResourceKindDelete is the builder for deleting a ResourceKind entity.

func (*ResourceKindDelete) Exec

func (rkd *ResourceKindDelete) Exec(ctx context.Context) (int, error)

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

func (*ResourceKindDelete) ExecX

func (rkd *ResourceKindDelete) ExecX(ctx context.Context) int

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

func (*ResourceKindDelete) Where

Where appends a list predicates to the ResourceKindDelete builder.

type ResourceKindDeleteOne

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

ResourceKindDeleteOne is the builder for deleting a single ResourceKind entity.

func (*ResourceKindDeleteOne) Exec

func (rkdo *ResourceKindDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ResourceKindDeleteOne) ExecX

func (rkdo *ResourceKindDeleteOne) ExecX(ctx context.Context)

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

func (*ResourceKindDeleteOne) Where

Where appends a list predicates to the ResourceKindDelete builder.

type ResourceKindEdge

type ResourceKindEdge struct {
	Node   *ResourceKind `json:"node"`
	Cursor Cursor        `json:"cursor"`
}

ResourceKindEdge is the edge representation of ResourceKind.

type ResourceKindGroupBy

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

ResourceKindGroupBy is the group-by builder for ResourceKind entities.

func (*ResourceKindGroupBy) Aggregate

func (rkgb *ResourceKindGroupBy) Aggregate(fns ...AggregateFunc) *ResourceKindGroupBy

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

func (*ResourceKindGroupBy) Bool

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

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

func (*ResourceKindGroupBy) BoolX

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

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

func (*ResourceKindGroupBy) Bools

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

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

func (*ResourceKindGroupBy) BoolsX

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

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

func (*ResourceKindGroupBy) Float64

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

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

func (*ResourceKindGroupBy) Float64X

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

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

func (*ResourceKindGroupBy) Float64s

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

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

func (*ResourceKindGroupBy) Float64sX

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

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

func (*ResourceKindGroupBy) Int

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

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

func (*ResourceKindGroupBy) IntX

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

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

func (*ResourceKindGroupBy) Ints

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

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

func (*ResourceKindGroupBy) IntsX

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

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

func (*ResourceKindGroupBy) Scan

func (rkgb *ResourceKindGroupBy) Scan(ctx context.Context, v any) error

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

func (*ResourceKindGroupBy) ScanX

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

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

func (*ResourceKindGroupBy) String

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

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

func (*ResourceKindGroupBy) StringX

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

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

func (*ResourceKindGroupBy) Strings

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

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

func (*ResourceKindGroupBy) StringsX

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

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

type ResourceKindMutation

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

ResourceKindMutation represents an operation that mutates the ResourceKind nodes in the graph.

func (*ResourceKindMutation) AddField

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

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

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

func (*ResourceKindMutation) AddedField

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

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

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

func (*ResourceKindMutation) AddedIDs

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

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

func (*ResourceKindMutation) ApiVersion

func (m *ResourceKindMutation) ApiVersion() (r string, exists bool)

ApiVersion returns the value of the "apiVersion" field in the mutation.

func (*ResourceKindMutation) ClearEdge

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

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

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

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

func (*ResourceKindMutation) ClearedFields

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

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

func (ResourceKindMutation) Client

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

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

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

func (*ResourceKindMutation) Field

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

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

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

func (*ResourceKindMutation) Fields

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

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

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

func (*ResourceKindMutation) IDs

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

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

func (*ResourceKindMutation) Kind

func (m *ResourceKindMutation) Kind() (r string, exists bool)

Kind returns the value of the "kind" field in the mutation.

func (*ResourceKindMutation) Name

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

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

func (*ResourceKindMutation) Namespaced

func (m *ResourceKindMutation) Namespaced() (r bool, exists bool)

Namespaced returns the value of the "namespaced" field in the mutation.

func (*ResourceKindMutation) OldApiVersion

func (m *ResourceKindMutation) OldApiVersion(ctx context.Context) (v string, err error)

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

func (*ResourceKindMutation) OldField

func (m *ResourceKindMutation) 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 (*ResourceKindMutation) OldKind

func (m *ResourceKindMutation) OldKind(ctx context.Context) (v string, err error)

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

func (*ResourceKindMutation) OldName

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

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

func (*ResourceKindMutation) OldNamespaced

func (m *ResourceKindMutation) OldNamespaced(ctx context.Context) (v bool, err error)

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

func (*ResourceKindMutation) Op

func (m *ResourceKindMutation) Op() Op

Op returns the operation name.

func (*ResourceKindMutation) RemovedEdges

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

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

func (*ResourceKindMutation) RemovedIDs

func (m *ResourceKindMutation) 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 (*ResourceKindMutation) ResetApiVersion

func (m *ResourceKindMutation) ResetApiVersion()

ResetApiVersion resets all changes to the "apiVersion" field.

func (*ResourceKindMutation) ResetEdge

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

func (m *ResourceKindMutation) 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 (*ResourceKindMutation) ResetKind

func (m *ResourceKindMutation) ResetKind()

ResetKind resets all changes to the "kind" field.

func (*ResourceKindMutation) ResetName

func (m *ResourceKindMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ResourceKindMutation) ResetNamespaced

func (m *ResourceKindMutation) ResetNamespaced()

ResetNamespaced resets all changes to the "namespaced" field.

func (*ResourceKindMutation) SetApiVersion

func (m *ResourceKindMutation) SetApiVersion(s string)

SetApiVersion sets the "apiVersion" field.

func (*ResourceKindMutation) SetField

func (m *ResourceKindMutation) 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 (*ResourceKindMutation) SetKind

func (m *ResourceKindMutation) SetKind(s string)

SetKind sets the "kind" field.

func (*ResourceKindMutation) SetName

func (m *ResourceKindMutation) SetName(s string)

SetName sets the "name" field.

func (*ResourceKindMutation) SetNamespaced

func (m *ResourceKindMutation) SetNamespaced(b bool)

SetNamespaced sets the "namespaced" field.

func (*ResourceKindMutation) SetOp

func (m *ResourceKindMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ResourceKindMutation) Tx

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

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

func (*ResourceKindMutation) Type

func (m *ResourceKindMutation) Type() string

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

func (*ResourceKindMutation) Where

Where appends a list predicates to the ResourceKindMutation builder.

func (*ResourceKindMutation) WhereP

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

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

type ResourceKindOrder

type ResourceKindOrder struct {
	Direction OrderDirection          `json:"direction"`
	Field     *ResourceKindOrderField `json:"field"`
}

ResourceKindOrder defines the ordering of ResourceKind.

type ResourceKindOrderField

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

ResourceKindOrderField defines the ordering field of ResourceKind.

type ResourceKindPaginateOption

type ResourceKindPaginateOption func(*resourcekindPager) error

ResourceKindPaginateOption enables pagination customization.

func WithResourceKindFilter

func WithResourceKindFilter(filter func(*ResourceKindQuery) (*ResourceKindQuery, error)) ResourceKindPaginateOption

WithResourceKindFilter configures pagination filter.

func WithResourceKindOrder

func WithResourceKindOrder(order *ResourceKindOrder) ResourceKindPaginateOption

WithResourceKindOrder configures pagination ordering.

type ResourceKindQuery

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

ResourceKindQuery is the builder for querying ResourceKind entities.

func (*ResourceKindQuery) Aggregate

func (rkq *ResourceKindQuery) Aggregate(fns ...AggregateFunc) *ResourceKindSelect

Aggregate returns a ResourceKindSelect configured with the given aggregations.

func (*ResourceKindQuery) All

func (rkq *ResourceKindQuery) All(ctx context.Context) ([]*ResourceKind, error)

All executes the query and returns a list of ResourceKinds.

func (*ResourceKindQuery) AllX

func (rkq *ResourceKindQuery) AllX(ctx context.Context) []*ResourceKind

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

func (*ResourceKindQuery) Clone

func (rkq *ResourceKindQuery) Clone() *ResourceKindQuery

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

func (*ResourceKindQuery) CollectFields

func (rk *ResourceKindQuery) CollectFields(ctx context.Context, satisfies ...string) (*ResourceKindQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ResourceKindQuery) Count

func (rkq *ResourceKindQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ResourceKindQuery) CountX

func (rkq *ResourceKindQuery) CountX(ctx context.Context) int

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

func (*ResourceKindQuery) Exist

func (rkq *ResourceKindQuery) Exist(ctx context.Context) (bool, error)

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

func (*ResourceKindQuery) ExistX

func (rkq *ResourceKindQuery) ExistX(ctx context.Context) bool

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

func (*ResourceKindQuery) First

func (rkq *ResourceKindQuery) First(ctx context.Context) (*ResourceKind, error)

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

func (*ResourceKindQuery) FirstID

func (rkq *ResourceKindQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ResourceKindQuery) FirstIDX

func (rkq *ResourceKindQuery) FirstIDX(ctx context.Context) int

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

func (*ResourceKindQuery) FirstX

func (rkq *ResourceKindQuery) FirstX(ctx context.Context) *ResourceKind

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

func (*ResourceKindQuery) GroupBy

func (rkq *ResourceKindQuery) GroupBy(field string, fields ...string) *ResourceKindGroupBy

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.ResourceKind.Query().
	GroupBy(resourcekind.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ResourceKindQuery) IDs

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

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

func (*ResourceKindQuery) IDsX

func (rkq *ResourceKindQuery) IDsX(ctx context.Context) []int

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

func (*ResourceKindQuery) Limit

func (rkq *ResourceKindQuery) Limit(limit int) *ResourceKindQuery

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

func (*ResourceKindQuery) Offset

func (rkq *ResourceKindQuery) Offset(offset int) *ResourceKindQuery

Offset to start from.

func (*ResourceKindQuery) Only

func (rkq *ResourceKindQuery) Only(ctx context.Context) (*ResourceKind, error)

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

func (*ResourceKindQuery) OnlyID

func (rkq *ResourceKindQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ResourceKindQuery) OnlyIDX

func (rkq *ResourceKindQuery) OnlyIDX(ctx context.Context) int

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

func (*ResourceKindQuery) OnlyX

func (rkq *ResourceKindQuery) OnlyX(ctx context.Context) *ResourceKind

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

func (*ResourceKindQuery) Order

func (rkq *ResourceKindQuery) Order(o ...OrderFunc) *ResourceKindQuery

Order specifies how the records should be ordered.

func (*ResourceKindQuery) Paginate

func (rk *ResourceKindQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ResourceKindPaginateOption,
) (*ResourceKindConnection, error)

Paginate executes the query and returns a relay based cursor connection to ResourceKind.

func (*ResourceKindQuery) Select

func (rkq *ResourceKindQuery) Select(fields ...string) *ResourceKindSelect

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.ResourceKind.Query().
	Select(resourcekind.FieldName).
	Scan(ctx, &v)

func (*ResourceKindQuery) Unique

func (rkq *ResourceKindQuery) Unique(unique bool) *ResourceKindQuery

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

Where adds a new predicate for the ResourceKindQuery builder.

type ResourceKindSelect

type ResourceKindSelect struct {
	*ResourceKindQuery
	// contains filtered or unexported fields
}

ResourceKindSelect is the builder for selecting fields of ResourceKind entities.

func (*ResourceKindSelect) Aggregate

func (rks *ResourceKindSelect) Aggregate(fns ...AggregateFunc) *ResourceKindSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ResourceKindSelect) Bool

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

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

func (*ResourceKindSelect) BoolX

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

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

func (*ResourceKindSelect) Bools

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

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

func (*ResourceKindSelect) BoolsX

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

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

func (*ResourceKindSelect) Float64

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

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

func (*ResourceKindSelect) Float64X

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

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

func (*ResourceKindSelect) Float64s

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

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

func (*ResourceKindSelect) Float64sX

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

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

func (*ResourceKindSelect) Int

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

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

func (*ResourceKindSelect) IntX

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

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

func (*ResourceKindSelect) Ints

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

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

func (*ResourceKindSelect) IntsX

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

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

func (*ResourceKindSelect) Scan

func (rks *ResourceKindSelect) Scan(ctx context.Context, v any) error

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

func (*ResourceKindSelect) ScanX

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

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

func (*ResourceKindSelect) String

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

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

func (*ResourceKindSelect) StringX

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

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

func (*ResourceKindSelect) Strings

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

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

func (*ResourceKindSelect) StringsX

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

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

type ResourceKindUpdate

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

ResourceKindUpdate is the builder for updating ResourceKind entities.

func (*ResourceKindUpdate) Exec

func (rku *ResourceKindUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceKindUpdate) ExecX

func (rku *ResourceKindUpdate) ExecX(ctx context.Context)

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

func (*ResourceKindUpdate) Mutation

func (rku *ResourceKindUpdate) Mutation() *ResourceKindMutation

Mutation returns the ResourceKindMutation object of the builder.

func (*ResourceKindUpdate) Save

func (rku *ResourceKindUpdate) Save(ctx context.Context) (int, error)

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

func (*ResourceKindUpdate) SaveX

func (rku *ResourceKindUpdate) SaveX(ctx context.Context) int

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

func (*ResourceKindUpdate) SetApiVersion

func (rku *ResourceKindUpdate) SetApiVersion(s string) *ResourceKindUpdate

SetApiVersion sets the "apiVersion" field.

func (*ResourceKindUpdate) SetKind

func (rku *ResourceKindUpdate) SetKind(s string) *ResourceKindUpdate

SetKind sets the "kind" field.

func (*ResourceKindUpdate) SetName

func (rku *ResourceKindUpdate) SetName(s string) *ResourceKindUpdate

SetName sets the "name" field.

func (*ResourceKindUpdate) SetNamespaced

func (rku *ResourceKindUpdate) SetNamespaced(b bool) *ResourceKindUpdate

SetNamespaced sets the "namespaced" field.

func (*ResourceKindUpdate) SetNillableNamespaced

func (rku *ResourceKindUpdate) SetNillableNamespaced(b *bool) *ResourceKindUpdate

SetNillableNamespaced sets the "namespaced" field if the given value is not nil.

func (*ResourceKindUpdate) Where

Where appends a list predicates to the ResourceKindUpdate builder.

type ResourceKindUpdateOne

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

ResourceKindUpdateOne is the builder for updating a single ResourceKind entity.

func (*ResourceKindUpdateOne) Exec

func (rkuo *ResourceKindUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ResourceKindUpdateOne) ExecX

func (rkuo *ResourceKindUpdateOne) ExecX(ctx context.Context)

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

func (*ResourceKindUpdateOne) Mutation

func (rkuo *ResourceKindUpdateOne) Mutation() *ResourceKindMutation

Mutation returns the ResourceKindMutation object of the builder.

func (*ResourceKindUpdateOne) Save

Save executes the query and returns the updated ResourceKind entity.

func (*ResourceKindUpdateOne) SaveX

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

func (*ResourceKindUpdateOne) Select

func (rkuo *ResourceKindUpdateOne) Select(field string, fields ...string) *ResourceKindUpdateOne

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

func (*ResourceKindUpdateOne) SetApiVersion

func (rkuo *ResourceKindUpdateOne) SetApiVersion(s string) *ResourceKindUpdateOne

SetApiVersion sets the "apiVersion" field.

func (*ResourceKindUpdateOne) SetKind

SetKind sets the "kind" field.

func (*ResourceKindUpdateOne) SetName

SetName sets the "name" field.

func (*ResourceKindUpdateOne) SetNamespaced

func (rkuo *ResourceKindUpdateOne) SetNamespaced(b bool) *ResourceKindUpdateOne

SetNamespaced sets the "namespaced" field.

func (*ResourceKindUpdateOne) SetNillableNamespaced

func (rkuo *ResourceKindUpdateOne) SetNillableNamespaced(b *bool) *ResourceKindUpdateOne

SetNillableNamespaced sets the "namespaced" field if the given value is not nil.

func (*ResourceKindUpdateOne) Where

Where appends a list predicates to the ResourceKindUpdate builder.

type ResourceKinds

type ResourceKinds []*ResourceKind

ResourceKinds is a parsable slice of ResourceKind.

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 {

	// AuditEvent is the client for interacting with the AuditEvent builders.
	AuditEvent *AuditEventClient
	// ResourceKind is the client for interacting with the ResourceKind builders.
	ResourceKind *ResourceKindClient
	// View is the client for interacting with the View builders.
	View *ViewClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

type View

type View struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

View is the model entity for the View schema.

func (*View) IsNode

func (n *View) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*View) String

func (v *View) String() string

String implements the fmt.Stringer.

func (*View) ToEdge

func (v *View) ToEdge(order *ViewOrder) *ViewEdge

ToEdge converts View into ViewEdge.

func (*View) Unwrap

func (v *View) Unwrap() *View

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

func (v *View) Update() *ViewUpdateOne

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

type ViewClient

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

ViewClient is a client for the View schema.

func NewViewClient

func NewViewClient(c config) *ViewClient

NewViewClient returns a client for the View from the given config.

func (*ViewClient) Create

func (c *ViewClient) Create() *ViewCreate

Create returns a builder for creating a View entity.

func (*ViewClient) CreateBulk

func (c *ViewClient) CreateBulk(builders ...*ViewCreate) *ViewCreateBulk

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

func (*ViewClient) Delete

func (c *ViewClient) Delete() *ViewDelete

Delete returns a delete builder for View.

func (*ViewClient) DeleteOne

func (c *ViewClient) DeleteOne(v *View) *ViewDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ViewClient) DeleteOneID

func (c *ViewClient) DeleteOneID(id int) *ViewDeleteOne

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

func (*ViewClient) Get

func (c *ViewClient) Get(ctx context.Context, id int) (*View, error)

Get returns a View entity by its id.

func (*ViewClient) GetX

func (c *ViewClient) GetX(ctx context.Context, id int) *View

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

func (*ViewClient) Hooks

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

Hooks returns the client hooks.

func (*ViewClient) Intercept

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

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

func (*ViewClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ViewClient) Query

func (c *ViewClient) Query() *ViewQuery

Query returns a query builder for View.

func (*ViewClient) Update

func (c *ViewClient) Update() *ViewUpdate

Update returns an update builder for View.

func (*ViewClient) UpdateOne

func (c *ViewClient) UpdateOne(v *View) *ViewUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ViewClient) UpdateOneID

func (c *ViewClient) UpdateOneID(id int) *ViewUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ViewClient) Use

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

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

type ViewConnection

type ViewConnection struct {
	Edges      []*ViewEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

ViewConnection is the connection containing edges to View.

type ViewCreate

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

ViewCreate is the builder for creating a View entity.

func (*ViewCreate) Exec

func (vc *ViewCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ViewCreate) ExecX

func (vc *ViewCreate) ExecX(ctx context.Context)

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

func (*ViewCreate) Mutation

func (vc *ViewCreate) Mutation() *ViewMutation

Mutation returns the ViewMutation object of the builder.

func (*ViewCreate) Save

func (vc *ViewCreate) Save(ctx context.Context) (*View, error)

Save creates the View in the database.

func (*ViewCreate) SaveX

func (vc *ViewCreate) SaveX(ctx context.Context) *View

SaveX calls Save and panics if Save returns an error.

type ViewCreateBulk

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

ViewCreateBulk is the builder for creating many View entities in bulk.

func (*ViewCreateBulk) Exec

func (vcb *ViewCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ViewCreateBulk) ExecX

func (vcb *ViewCreateBulk) ExecX(ctx context.Context)

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

func (*ViewCreateBulk) Save

func (vcb *ViewCreateBulk) Save(ctx context.Context) ([]*View, error)

Save creates the View entities in the database.

func (*ViewCreateBulk) SaveX

func (vcb *ViewCreateBulk) SaveX(ctx context.Context) []*View

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

type ViewDelete

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

ViewDelete is the builder for deleting a View entity.

func (*ViewDelete) Exec

func (vd *ViewDelete) Exec(ctx context.Context) (int, error)

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

func (*ViewDelete) ExecX

func (vd *ViewDelete) ExecX(ctx context.Context) int

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

func (*ViewDelete) Where

func (vd *ViewDelete) Where(ps ...predicate.View) *ViewDelete

Where appends a list predicates to the ViewDelete builder.

type ViewDeleteOne

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

ViewDeleteOne is the builder for deleting a single View entity.

func (*ViewDeleteOne) Exec

func (vdo *ViewDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ViewDeleteOne) ExecX

func (vdo *ViewDeleteOne) ExecX(ctx context.Context)

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

func (*ViewDeleteOne) Where

func (vdo *ViewDeleteOne) Where(ps ...predicate.View) *ViewDeleteOne

Where appends a list predicates to the ViewDelete builder.

type ViewEdge

type ViewEdge struct {
	Node   *View  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

ViewEdge is the edge representation of View.

type ViewGroupBy

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

ViewGroupBy is the group-by builder for View entities.

func (*ViewGroupBy) Aggregate

func (vgb *ViewGroupBy) Aggregate(fns ...AggregateFunc) *ViewGroupBy

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

func (*ViewGroupBy) Bool

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

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

func (*ViewGroupBy) BoolX

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

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

func (*ViewGroupBy) Bools

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

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

func (*ViewGroupBy) BoolsX

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

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

func (*ViewGroupBy) Float64

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

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

func (*ViewGroupBy) Float64X

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

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

func (*ViewGroupBy) Float64s

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

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

func (*ViewGroupBy) Float64sX

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

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

func (*ViewGroupBy) Int

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

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

func (*ViewGroupBy) IntX

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

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

func (*ViewGroupBy) Ints

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

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

func (*ViewGroupBy) IntsX

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

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

func (*ViewGroupBy) Scan

func (vgb *ViewGroupBy) Scan(ctx context.Context, v any) error

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

func (*ViewGroupBy) ScanX

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

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

func (*ViewGroupBy) String

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

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

func (*ViewGroupBy) StringX

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

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

func (*ViewGroupBy) Strings

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

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

func (*ViewGroupBy) StringsX

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

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

type ViewMutation

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

ViewMutation represents an operation that mutates the View nodes in the graph.

func (*ViewMutation) AddField

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

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

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

func (*ViewMutation) AddedField

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

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

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

func (*ViewMutation) AddedIDs

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

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

func (*ViewMutation) ClearEdge

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

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

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

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

func (*ViewMutation) ClearedFields

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

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

func (ViewMutation) Client

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

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

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

func (*ViewMutation) Field

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

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

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

func (*ViewMutation) Fields

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

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

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

func (*ViewMutation) IDs

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

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

func (*ViewMutation) OldField

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

func (m *ViewMutation) Op() Op

Op returns the operation name.

func (*ViewMutation) RemovedEdges

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

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

func (*ViewMutation) RemovedIDs

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

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

func (m *ViewMutation) 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 (*ViewMutation) SetField

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

func (m *ViewMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ViewMutation) Tx

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

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

func (*ViewMutation) Type

func (m *ViewMutation) Type() string

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

func (*ViewMutation) Where

func (m *ViewMutation) Where(ps ...predicate.View)

Where appends a list predicates to the ViewMutation builder.

func (*ViewMutation) WhereP

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

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

type ViewOrder

type ViewOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *ViewOrderField `json:"field"`
}

ViewOrder defines the ordering of View.

type ViewOrderField

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

ViewOrderField defines the ordering field of View.

type ViewPaginateOption

type ViewPaginateOption func(*viewPager) error

ViewPaginateOption enables pagination customization.

func WithViewFilter

func WithViewFilter(filter func(*ViewQuery) (*ViewQuery, error)) ViewPaginateOption

WithViewFilter configures pagination filter.

func WithViewOrder

func WithViewOrder(order *ViewOrder) ViewPaginateOption

WithViewOrder configures pagination ordering.

type ViewQuery

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

ViewQuery is the builder for querying View entities.

func (*ViewQuery) Aggregate

func (vq *ViewQuery) Aggregate(fns ...AggregateFunc) *ViewSelect

Aggregate returns a ViewSelect configured with the given aggregations.

func (*ViewQuery) All

func (vq *ViewQuery) All(ctx context.Context) ([]*View, error)

All executes the query and returns a list of Views.

func (*ViewQuery) AllX

func (vq *ViewQuery) AllX(ctx context.Context) []*View

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

func (*ViewQuery) Clone

func (vq *ViewQuery) Clone() *ViewQuery

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

func (*ViewQuery) CollectFields

func (v *ViewQuery) CollectFields(ctx context.Context, satisfies ...string) (*ViewQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ViewQuery) Count

func (vq *ViewQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ViewQuery) CountX

func (vq *ViewQuery) CountX(ctx context.Context) int

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

func (*ViewQuery) Exist

func (vq *ViewQuery) Exist(ctx context.Context) (bool, error)

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

func (*ViewQuery) ExistX

func (vq *ViewQuery) ExistX(ctx context.Context) bool

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

func (*ViewQuery) First

func (vq *ViewQuery) First(ctx context.Context) (*View, error)

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

func (*ViewQuery) FirstID

func (vq *ViewQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ViewQuery) FirstIDX

func (vq *ViewQuery) FirstIDX(ctx context.Context) int

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

func (*ViewQuery) FirstX

func (vq *ViewQuery) FirstX(ctx context.Context) *View

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

func (*ViewQuery) GroupBy

func (vq *ViewQuery) GroupBy(field string, fields ...string) *ViewGroupBy

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.

func (*ViewQuery) IDs

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

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

func (*ViewQuery) IDsX

func (vq *ViewQuery) IDsX(ctx context.Context) []int

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

func (*ViewQuery) Limit

func (vq *ViewQuery) Limit(limit int) *ViewQuery

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

func (*ViewQuery) Offset

func (vq *ViewQuery) Offset(offset int) *ViewQuery

Offset to start from.

func (*ViewQuery) Only

func (vq *ViewQuery) Only(ctx context.Context) (*View, error)

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

func (*ViewQuery) OnlyID

func (vq *ViewQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ViewQuery) OnlyIDX

func (vq *ViewQuery) OnlyIDX(ctx context.Context) int

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

func (*ViewQuery) OnlyX

func (vq *ViewQuery) OnlyX(ctx context.Context) *View

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

func (*ViewQuery) Order

func (vq *ViewQuery) Order(o ...OrderFunc) *ViewQuery

Order specifies how the records should be ordered.

func (*ViewQuery) Paginate

func (v *ViewQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ViewPaginateOption,
) (*ViewConnection, error)

Paginate executes the query and returns a relay based cursor connection to View.

func (*ViewQuery) Select

func (vq *ViewQuery) Select(fields ...string) *ViewSelect

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

func (*ViewQuery) Unique

func (vq *ViewQuery) Unique(unique bool) *ViewQuery

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

func (vq *ViewQuery) Where(ps ...predicate.View) *ViewQuery

Where adds a new predicate for the ViewQuery builder.

type ViewSelect

type ViewSelect struct {
	*ViewQuery
	// contains filtered or unexported fields
}

ViewSelect is the builder for selecting fields of View entities.

func (*ViewSelect) Aggregate

func (vs *ViewSelect) Aggregate(fns ...AggregateFunc) *ViewSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ViewSelect) Bool

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

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

func (*ViewSelect) BoolX

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

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

func (*ViewSelect) Bools

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

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

func (*ViewSelect) BoolsX

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

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

func (*ViewSelect) Float64

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

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

func (*ViewSelect) Float64X

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

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

func (*ViewSelect) Float64s

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

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

func (*ViewSelect) Float64sX

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

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

func (*ViewSelect) Int

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

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

func (*ViewSelect) IntX

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

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

func (*ViewSelect) Ints

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

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

func (*ViewSelect) IntsX

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

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

func (*ViewSelect) Scan

func (vs *ViewSelect) Scan(ctx context.Context, v any) error

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

func (*ViewSelect) ScanX

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

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

func (*ViewSelect) String

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

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

func (*ViewSelect) StringX

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

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

func (*ViewSelect) Strings

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

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

func (*ViewSelect) StringsX

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

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

type ViewUpdate

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

ViewUpdate is the builder for updating View entities.

func (*ViewUpdate) Exec

func (vu *ViewUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ViewUpdate) ExecX

func (vu *ViewUpdate) ExecX(ctx context.Context)

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

func (*ViewUpdate) Mutation

func (vu *ViewUpdate) Mutation() *ViewMutation

Mutation returns the ViewMutation object of the builder.

func (*ViewUpdate) Save

func (vu *ViewUpdate) Save(ctx context.Context) (int, error)

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

func (*ViewUpdate) SaveX

func (vu *ViewUpdate) SaveX(ctx context.Context) int

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

func (*ViewUpdate) Where

func (vu *ViewUpdate) Where(ps ...predicate.View) *ViewUpdate

Where appends a list predicates to the ViewUpdate builder.

type ViewUpdateOne

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

ViewUpdateOne is the builder for updating a single View entity.

func (*ViewUpdateOne) Exec

func (vuo *ViewUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ViewUpdateOne) ExecX

func (vuo *ViewUpdateOne) ExecX(ctx context.Context)

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

func (*ViewUpdateOne) Mutation

func (vuo *ViewUpdateOne) Mutation() *ViewMutation

Mutation returns the ViewMutation object of the builder.

func (*ViewUpdateOne) Save

func (vuo *ViewUpdateOne) Save(ctx context.Context) (*View, error)

Save executes the query and returns the updated View entity.

func (*ViewUpdateOne) SaveX

func (vuo *ViewUpdateOne) SaveX(ctx context.Context) *View

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

func (*ViewUpdateOne) Select

func (vuo *ViewUpdateOne) Select(field string, fields ...string) *ViewUpdateOne

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

func (*ViewUpdateOne) Where

func (vuo *ViewUpdateOne) Where(ps ...predicate.View) *ViewUpdateOne

Where appends a list predicates to the ViewUpdate builder.

type Views

type Views []*View

Views is a parsable slice of View.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL