ent

package
v0.0.0-...-3be0946 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: GPL-3.0 Imports: 21 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.
	TypeAgent      = "Agent"
	TypeOIDCConfig = "OIDCConfig"
	TypeTag        = "Tag"
)

Variables

This section is empty.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Agent

type Agent struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Hostname holds the value of the "hostname" field.
	Hostname string `json:"hostname,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AgentQuery when eager-loading is set.
	Edges AgentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Agent is the model entity for the Agent schema.

func (*Agent) QueryTags

func (a *Agent) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Agent entity.

func (*Agent) String

func (a *Agent) String() string

String implements the fmt.Stringer.

func (*Agent) Unwrap

func (a *Agent) Unwrap() *Agent

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

func (a *Agent) Update() *AgentUpdateOne

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

func (*Agent) Value

func (a *Agent) Value(name string) (ent.Value, error)

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

type AgentClient

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

AgentClient is a client for the Agent schema.

func NewAgentClient

func NewAgentClient(c config) *AgentClient

NewAgentClient returns a client for the Agent from the given config.

func (*AgentClient) Create

func (c *AgentClient) Create() *AgentCreate

Create returns a builder for creating a Agent entity.

func (*AgentClient) CreateBulk

func (c *AgentClient) CreateBulk(builders ...*AgentCreate) *AgentCreateBulk

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

func (*AgentClient) Delete

func (c *AgentClient) Delete() *AgentDelete

Delete returns a delete builder for Agent.

func (*AgentClient) DeleteOne

func (c *AgentClient) DeleteOne(a *Agent) *AgentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AgentClient) DeleteOneID

func (c *AgentClient) DeleteOneID(id int) *AgentDeleteOne

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

func (*AgentClient) Get

func (c *AgentClient) Get(ctx context.Context, id int) (*Agent, error)

Get returns a Agent entity by its id.

func (*AgentClient) GetX

func (c *AgentClient) GetX(ctx context.Context, id int) *Agent

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

func (*AgentClient) Hooks

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

Hooks returns the client hooks.

func (*AgentClient) Intercept

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

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

func (*AgentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AgentClient) Query

func (c *AgentClient) Query() *AgentQuery

Query returns a query builder for Agent.

func (*AgentClient) QueryTags

func (c *AgentClient) QueryTags(a *Agent) *TagQuery

QueryTags queries the tags edge of a Agent.

func (*AgentClient) Update

func (c *AgentClient) Update() *AgentUpdate

Update returns an update builder for Agent.

func (*AgentClient) UpdateOne

func (c *AgentClient) UpdateOne(a *Agent) *AgentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AgentClient) UpdateOneID

func (c *AgentClient) UpdateOneID(id int) *AgentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AgentClient) Use

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

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

type AgentCreate

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

AgentCreate is the builder for creating a Agent entity.

func (*AgentCreate) AddTagIDs

func (ac *AgentCreate) AddTagIDs(ids ...int) *AgentCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*AgentCreate) AddTags

func (ac *AgentCreate) AddTags(t ...*Tag) *AgentCreate

AddTags adds the "tags" edges to the Tag entity.

func (*AgentCreate) Exec

func (ac *AgentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentCreate) ExecX

func (ac *AgentCreate) ExecX(ctx context.Context)

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

func (*AgentCreate) Mutation

func (ac *AgentCreate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentCreate) Save

func (ac *AgentCreate) Save(ctx context.Context) (*Agent, error)

Save creates the Agent in the database.

func (*AgentCreate) SaveX

func (ac *AgentCreate) SaveX(ctx context.Context) *Agent

SaveX calls Save and panics if Save returns an error.

func (*AgentCreate) SetCreatedAt

func (ac *AgentCreate) SetCreatedAt(t time.Time) *AgentCreate

SetCreatedAt sets the "created_at" field.

func (*AgentCreate) SetHostname

func (ac *AgentCreate) SetHostname(s string) *AgentCreate

SetHostname sets the "hostname" field.

func (*AgentCreate) SetNillableCreatedAt

func (ac *AgentCreate) SetNillableCreatedAt(t *time.Time) *AgentCreate

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

type AgentCreateBulk

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

AgentCreateBulk is the builder for creating many Agent entities in bulk.

func (*AgentCreateBulk) Exec

func (acb *AgentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentCreateBulk) ExecX

func (acb *AgentCreateBulk) ExecX(ctx context.Context)

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

func (*AgentCreateBulk) Save

func (acb *AgentCreateBulk) Save(ctx context.Context) ([]*Agent, error)

Save creates the Agent entities in the database.

func (*AgentCreateBulk) SaveX

func (acb *AgentCreateBulk) SaveX(ctx context.Context) []*Agent

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

type AgentDelete

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

AgentDelete is the builder for deleting a Agent entity.

func (*AgentDelete) Exec

func (ad *AgentDelete) Exec(ctx context.Context) (int, error)

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

func (*AgentDelete) ExecX

func (ad *AgentDelete) ExecX(ctx context.Context) int

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

func (*AgentDelete) Where

func (ad *AgentDelete) Where(ps ...predicate.Agent) *AgentDelete

Where appends a list predicates to the AgentDelete builder.

type AgentDeleteOne

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

AgentDeleteOne is the builder for deleting a single Agent entity.

func (*AgentDeleteOne) Exec

func (ado *AgentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AgentDeleteOne) ExecX

func (ado *AgentDeleteOne) ExecX(ctx context.Context)

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

func (*AgentDeleteOne) Where

func (ado *AgentDeleteOne) Where(ps ...predicate.Agent) *AgentDeleteOne

Where appends a list predicates to the AgentDelete builder.

type AgentEdges

type AgentEdges struct {
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (AgentEdges) TagsOrErr

func (e AgentEdges) TagsOrErr() ([]*Tag, error)

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

type AgentGroupBy

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

AgentGroupBy is the group-by builder for Agent entities.

func (*AgentGroupBy) Aggregate

func (agb *AgentGroupBy) Aggregate(fns ...AggregateFunc) *AgentGroupBy

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

func (*AgentGroupBy) Bool

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

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

func (*AgentGroupBy) BoolX

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

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

func (*AgentGroupBy) Bools

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

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

func (*AgentGroupBy) BoolsX

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

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

func (*AgentGroupBy) Float64

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

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

func (*AgentGroupBy) Float64X

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

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

func (*AgentGroupBy) Float64s

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

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

func (*AgentGroupBy) Float64sX

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

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

func (*AgentGroupBy) Int

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

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

func (*AgentGroupBy) IntX

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

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

func (*AgentGroupBy) Ints

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

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

func (*AgentGroupBy) IntsX

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

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

func (*AgentGroupBy) Scan

func (agb *AgentGroupBy) Scan(ctx context.Context, v any) error

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

func (*AgentGroupBy) ScanX

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

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

func (*AgentGroupBy) String

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

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

func (*AgentGroupBy) StringX

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

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

func (*AgentGroupBy) Strings

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

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

func (*AgentGroupBy) StringsX

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

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

type AgentMutation

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

AgentMutation represents an operation that mutates the Agent nodes in the graph.

func (*AgentMutation) AddField

func (m *AgentMutation) 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 (*AgentMutation) AddTagIDs

func (m *AgentMutation) AddTagIDs(ids ...int)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*AgentMutation) AddedEdges

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

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

func (*AgentMutation) AddedField

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

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

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

func (*AgentMutation) AddedIDs

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

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

func (*AgentMutation) ClearEdge

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

func (m *AgentMutation) 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 (*AgentMutation) ClearTags

func (m *AgentMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*AgentMutation) ClearedEdges

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

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

func (*AgentMutation) ClearedFields

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

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

func (AgentMutation) Client

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

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

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

func (*AgentMutation) EdgeCleared

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

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

func (*AgentMutation) Field

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

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

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

func (*AgentMutation) Fields

func (m *AgentMutation) 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 (*AgentMutation) Hostname

func (m *AgentMutation) Hostname() (r string, exists bool)

Hostname returns the value of the "hostname" field in the mutation.

func (*AgentMutation) ID

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

func (m *AgentMutation) 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 (*AgentMutation) OldCreatedAt

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

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

func (*AgentMutation) OldField

func (m *AgentMutation) 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 (*AgentMutation) OldHostname

func (m *AgentMutation) OldHostname(ctx context.Context) (v string, err error)

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

func (*AgentMutation) Op

func (m *AgentMutation) Op() Op

Op returns the operation name.

func (*AgentMutation) RemoveTagIDs

func (m *AgentMutation) RemoveTagIDs(ids ...int)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*AgentMutation) RemovedEdges

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

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

func (*AgentMutation) RemovedIDs

func (m *AgentMutation) 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 (*AgentMutation) RemovedTagsIDs

func (m *AgentMutation) RemovedTagsIDs() (ids []int)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*AgentMutation) ResetCreatedAt

func (m *AgentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AgentMutation) ResetEdge

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

func (m *AgentMutation) 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 (*AgentMutation) ResetHostname

func (m *AgentMutation) ResetHostname()

ResetHostname resets all changes to the "hostname" field.

func (*AgentMutation) ResetTags

func (m *AgentMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*AgentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AgentMutation) SetField

func (m *AgentMutation) 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 (*AgentMutation) SetHostname

func (m *AgentMutation) SetHostname(s string)

SetHostname sets the "hostname" field.

func (*AgentMutation) SetOp

func (m *AgentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentMutation) TagsCleared

func (m *AgentMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*AgentMutation) TagsIDs

func (m *AgentMutation) TagsIDs() (ids []int)

TagsIDs returns the "tags" edge IDs in the mutation.

func (AgentMutation) Tx

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

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

func (*AgentMutation) Type

func (m *AgentMutation) Type() string

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

func (*AgentMutation) Where

func (m *AgentMutation) Where(ps ...predicate.Agent)

Where appends a list predicates to the AgentMutation builder.

func (*AgentMutation) WhereP

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

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

type AgentQuery

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

AgentQuery is the builder for querying Agent entities.

func (*AgentQuery) Aggregate

func (aq *AgentQuery) Aggregate(fns ...AggregateFunc) *AgentSelect

Aggregate returns a AgentSelect configured with the given aggregations.

func (*AgentQuery) All

func (aq *AgentQuery) All(ctx context.Context) ([]*Agent, error)

All executes the query and returns a list of Agents.

func (*AgentQuery) AllX

func (aq *AgentQuery) AllX(ctx context.Context) []*Agent

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

func (*AgentQuery) Clone

func (aq *AgentQuery) Clone() *AgentQuery

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

func (*AgentQuery) Count

func (aq *AgentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AgentQuery) CountX

func (aq *AgentQuery) CountX(ctx context.Context) int

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

func (*AgentQuery) Exist

func (aq *AgentQuery) Exist(ctx context.Context) (bool, error)

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

func (*AgentQuery) ExistX

func (aq *AgentQuery) ExistX(ctx context.Context) bool

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

func (*AgentQuery) First

func (aq *AgentQuery) First(ctx context.Context) (*Agent, error)

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

func (*AgentQuery) FirstID

func (aq *AgentQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AgentQuery) FirstIDX

func (aq *AgentQuery) FirstIDX(ctx context.Context) int

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

func (*AgentQuery) FirstX

func (aq *AgentQuery) FirstX(ctx context.Context) *Agent

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

func (*AgentQuery) GroupBy

func (aq *AgentQuery) GroupBy(field string, fields ...string) *AgentGroupBy

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

client.Agent.Query().
	GroupBy(agent.FieldHostname).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AgentQuery) IDs

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

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

func (*AgentQuery) IDsX

func (aq *AgentQuery) IDsX(ctx context.Context) []int

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

func (*AgentQuery) Limit

func (aq *AgentQuery) Limit(limit int) *AgentQuery

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

func (*AgentQuery) Offset

func (aq *AgentQuery) Offset(offset int) *AgentQuery

Offset to start from.

func (*AgentQuery) Only

func (aq *AgentQuery) Only(ctx context.Context) (*Agent, error)

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

func (*AgentQuery) OnlyID

func (aq *AgentQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AgentQuery) OnlyIDX

func (aq *AgentQuery) OnlyIDX(ctx context.Context) int

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

func (*AgentQuery) OnlyX

func (aq *AgentQuery) OnlyX(ctx context.Context) *Agent

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

func (*AgentQuery) Order

func (aq *AgentQuery) Order(o ...agent.OrderOption) *AgentQuery

Order specifies how the records should be ordered.

func (*AgentQuery) QueryTags

func (aq *AgentQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*AgentQuery) Select

func (aq *AgentQuery) Select(fields ...string) *AgentSelect

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

client.Agent.Query().
	Select(agent.FieldHostname).
	Scan(ctx, &v)

func (*AgentQuery) Unique

func (aq *AgentQuery) Unique(unique bool) *AgentQuery

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

func (aq *AgentQuery) Where(ps ...predicate.Agent) *AgentQuery

Where adds a new predicate for the AgentQuery builder.

func (*AgentQuery) WithTags

func (aq *AgentQuery) WithTags(opts ...func(*TagQuery)) *AgentQuery

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

type AgentSelect

type AgentSelect struct {
	*AgentQuery
	// contains filtered or unexported fields
}

AgentSelect is the builder for selecting fields of Agent entities.

func (*AgentSelect) Aggregate

func (as *AgentSelect) Aggregate(fns ...AggregateFunc) *AgentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AgentSelect) Bool

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

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

func (*AgentSelect) BoolX

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

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

func (*AgentSelect) Bools

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

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

func (*AgentSelect) BoolsX

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

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

func (*AgentSelect) Float64

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

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

func (*AgentSelect) Float64X

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

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

func (*AgentSelect) Float64s

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

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

func (*AgentSelect) Float64sX

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

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

func (*AgentSelect) Int

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

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

func (*AgentSelect) IntX

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

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

func (*AgentSelect) Ints

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

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

func (*AgentSelect) IntsX

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

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

func (*AgentSelect) Scan

func (as *AgentSelect) Scan(ctx context.Context, v any) error

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

func (*AgentSelect) ScanX

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

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

func (*AgentSelect) String

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

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

func (*AgentSelect) StringX

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

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

func (*AgentSelect) Strings

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

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

func (*AgentSelect) StringsX

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

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

type AgentUpdate

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

AgentUpdate is the builder for updating Agent entities.

func (*AgentUpdate) AddTagIDs

func (au *AgentUpdate) AddTagIDs(ids ...int) *AgentUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*AgentUpdate) AddTags

func (au *AgentUpdate) AddTags(t ...*Tag) *AgentUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*AgentUpdate) ClearTags

func (au *AgentUpdate) ClearTags() *AgentUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*AgentUpdate) Exec

func (au *AgentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentUpdate) ExecX

func (au *AgentUpdate) ExecX(ctx context.Context)

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

func (*AgentUpdate) Mutation

func (au *AgentUpdate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdate) RemoveTagIDs

func (au *AgentUpdate) RemoveTagIDs(ids ...int) *AgentUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*AgentUpdate) RemoveTags

func (au *AgentUpdate) RemoveTags(t ...*Tag) *AgentUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*AgentUpdate) Save

func (au *AgentUpdate) Save(ctx context.Context) (int, error)

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

func (*AgentUpdate) SaveX

func (au *AgentUpdate) SaveX(ctx context.Context) int

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

func (*AgentUpdate) SetCreatedAt

func (au *AgentUpdate) SetCreatedAt(t time.Time) *AgentUpdate

SetCreatedAt sets the "created_at" field.

func (*AgentUpdate) SetHostname

func (au *AgentUpdate) SetHostname(s string) *AgentUpdate

SetHostname sets the "hostname" field.

func (*AgentUpdate) SetNillableCreatedAt

func (au *AgentUpdate) SetNillableCreatedAt(t *time.Time) *AgentUpdate

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

func (*AgentUpdate) Where

func (au *AgentUpdate) Where(ps ...predicate.Agent) *AgentUpdate

Where appends a list predicates to the AgentUpdate builder.

type AgentUpdateOne

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

AgentUpdateOne is the builder for updating a single Agent entity.

func (*AgentUpdateOne) AddTagIDs

func (auo *AgentUpdateOne) AddTagIDs(ids ...int) *AgentUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*AgentUpdateOne) AddTags

func (auo *AgentUpdateOne) AddTags(t ...*Tag) *AgentUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*AgentUpdateOne) ClearTags

func (auo *AgentUpdateOne) ClearTags() *AgentUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*AgentUpdateOne) Exec

func (auo *AgentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AgentUpdateOne) ExecX

func (auo *AgentUpdateOne) ExecX(ctx context.Context)

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

func (*AgentUpdateOne) Mutation

func (auo *AgentUpdateOne) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdateOne) RemoveTagIDs

func (auo *AgentUpdateOne) RemoveTagIDs(ids ...int) *AgentUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*AgentUpdateOne) RemoveTags

func (auo *AgentUpdateOne) RemoveTags(t ...*Tag) *AgentUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*AgentUpdateOne) Save

func (auo *AgentUpdateOne) Save(ctx context.Context) (*Agent, error)

Save executes the query and returns the updated Agent entity.

func (*AgentUpdateOne) SaveX

func (auo *AgentUpdateOne) SaveX(ctx context.Context) *Agent

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

func (*AgentUpdateOne) Select

func (auo *AgentUpdateOne) Select(field string, fields ...string) *AgentUpdateOne

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

func (*AgentUpdateOne) SetCreatedAt

func (auo *AgentUpdateOne) SetCreatedAt(t time.Time) *AgentUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AgentUpdateOne) SetHostname

func (auo *AgentUpdateOne) SetHostname(s string) *AgentUpdateOne

SetHostname sets the "hostname" field.

func (*AgentUpdateOne) SetNillableCreatedAt

func (auo *AgentUpdateOne) SetNillableCreatedAt(t *time.Time) *AgentUpdateOne

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

func (*AgentUpdateOne) Where

func (auo *AgentUpdateOne) Where(ps ...predicate.Agent) *AgentUpdateOne

Where appends a list predicates to the AgentUpdate builder.

type Agents

type Agents []*Agent

Agents is a parsable slice of Agent.

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// OIDCConfig is the client for interacting with the OIDCConfig builders.
	OIDCConfig *OIDCConfigClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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().
	Agent.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type OIDCConfig

type OIDCConfig struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ProviderKey holds the value of the "provider_key" field.
	ProviderKey string `json:"provider_key,omitempty"`
	// ProviderName holds the value of the "provider_name" field.
	ProviderName string `json:"provider_name,omitempty"`
	// DiscoveryURI holds the value of the "discovery_uri" field.
	DiscoveryURI string `json:"discovery_uri,omitempty"`
	// ClientID holds the value of the "client_id" field.
	ClientID string `json:"client_id,omitempty"`
	// ClientSecret holds the value of the "client_secret" field.
	ClientSecret string `json:"client_secret,omitempty"`
	// RedirectURI holds the value of the "redirect_uri" field.
	RedirectURI string `json:"redirect_uri,omitempty"`
	// contains filtered or unexported fields
}

OIDCConfig is the model entity for the OIDCConfig schema.

func (*OIDCConfig) String

func (oc *OIDCConfig) String() string

String implements the fmt.Stringer.

func (*OIDCConfig) Unwrap

func (oc *OIDCConfig) Unwrap() *OIDCConfig

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

func (oc *OIDCConfig) Update() *OIDCConfigUpdateOne

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

func (*OIDCConfig) Value

func (oc *OIDCConfig) Value(name string) (ent.Value, error)

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

type OIDCConfigClient

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

OIDCConfigClient is a client for the OIDCConfig schema.

func NewOIDCConfigClient

func NewOIDCConfigClient(c config) *OIDCConfigClient

NewOIDCConfigClient returns a client for the OIDCConfig from the given config.

func (*OIDCConfigClient) Create

func (c *OIDCConfigClient) Create() *OIDCConfigCreate

Create returns a builder for creating a OIDCConfig entity.

func (*OIDCConfigClient) CreateBulk

func (c *OIDCConfigClient) CreateBulk(builders ...*OIDCConfigCreate) *OIDCConfigCreateBulk

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

func (*OIDCConfigClient) Delete

func (c *OIDCConfigClient) Delete() *OIDCConfigDelete

Delete returns a delete builder for OIDCConfig.

func (*OIDCConfigClient) DeleteOne

func (c *OIDCConfigClient) DeleteOne(oc *OIDCConfig) *OIDCConfigDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OIDCConfigClient) DeleteOneID

func (c *OIDCConfigClient) DeleteOneID(id int) *OIDCConfigDeleteOne

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

func (*OIDCConfigClient) Get

func (c *OIDCConfigClient) Get(ctx context.Context, id int) (*OIDCConfig, error)

Get returns a OIDCConfig entity by its id.

func (*OIDCConfigClient) GetX

func (c *OIDCConfigClient) GetX(ctx context.Context, id int) *OIDCConfig

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

func (*OIDCConfigClient) Hooks

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

Hooks returns the client hooks.

func (*OIDCConfigClient) Intercept

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

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

func (*OIDCConfigClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OIDCConfigClient) Query

func (c *OIDCConfigClient) Query() *OIDCConfigQuery

Query returns a query builder for OIDCConfig.

func (*OIDCConfigClient) Update

func (c *OIDCConfigClient) Update() *OIDCConfigUpdate

Update returns an update builder for OIDCConfig.

func (*OIDCConfigClient) UpdateOne

func (c *OIDCConfigClient) UpdateOne(oc *OIDCConfig) *OIDCConfigUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OIDCConfigClient) UpdateOneID

func (c *OIDCConfigClient) UpdateOneID(id int) *OIDCConfigUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OIDCConfigClient) Use

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

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

type OIDCConfigCreate

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

OIDCConfigCreate is the builder for creating a OIDCConfig entity.

func (*OIDCConfigCreate) Exec

func (occ *OIDCConfigCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OIDCConfigCreate) ExecX

func (occ *OIDCConfigCreate) ExecX(ctx context.Context)

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

func (*OIDCConfigCreate) Mutation

func (occ *OIDCConfigCreate) Mutation() *OIDCConfigMutation

Mutation returns the OIDCConfigMutation object of the builder.

func (*OIDCConfigCreate) Save

func (occ *OIDCConfigCreate) Save(ctx context.Context) (*OIDCConfig, error)

Save creates the OIDCConfig in the database.

func (*OIDCConfigCreate) SaveX

func (occ *OIDCConfigCreate) SaveX(ctx context.Context) *OIDCConfig

SaveX calls Save and panics if Save returns an error.

func (*OIDCConfigCreate) SetClientID

func (occ *OIDCConfigCreate) SetClientID(s string) *OIDCConfigCreate

SetClientID sets the "client_id" field.

func (*OIDCConfigCreate) SetClientSecret

func (occ *OIDCConfigCreate) SetClientSecret(s string) *OIDCConfigCreate

SetClientSecret sets the "client_secret" field.

func (*OIDCConfigCreate) SetDiscoveryURI

func (occ *OIDCConfigCreate) SetDiscoveryURI(s string) *OIDCConfigCreate

SetDiscoveryURI sets the "discovery_uri" field.

func (*OIDCConfigCreate) SetProviderKey

func (occ *OIDCConfigCreate) SetProviderKey(s string) *OIDCConfigCreate

SetProviderKey sets the "provider_key" field.

func (*OIDCConfigCreate) SetProviderName

func (occ *OIDCConfigCreate) SetProviderName(s string) *OIDCConfigCreate

SetProviderName sets the "provider_name" field.

func (*OIDCConfigCreate) SetRedirectURI

func (occ *OIDCConfigCreate) SetRedirectURI(s string) *OIDCConfigCreate

SetRedirectURI sets the "redirect_uri" field.

type OIDCConfigCreateBulk

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

OIDCConfigCreateBulk is the builder for creating many OIDCConfig entities in bulk.

func (*OIDCConfigCreateBulk) Exec

func (occb *OIDCConfigCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OIDCConfigCreateBulk) ExecX

func (occb *OIDCConfigCreateBulk) ExecX(ctx context.Context)

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

func (*OIDCConfigCreateBulk) Save

func (occb *OIDCConfigCreateBulk) Save(ctx context.Context) ([]*OIDCConfig, error)

Save creates the OIDCConfig entities in the database.

func (*OIDCConfigCreateBulk) SaveX

func (occb *OIDCConfigCreateBulk) SaveX(ctx context.Context) []*OIDCConfig

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

type OIDCConfigDelete

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

OIDCConfigDelete is the builder for deleting a OIDCConfig entity.

func (*OIDCConfigDelete) Exec

func (ocd *OIDCConfigDelete) Exec(ctx context.Context) (int, error)

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

func (*OIDCConfigDelete) ExecX

func (ocd *OIDCConfigDelete) ExecX(ctx context.Context) int

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

func (*OIDCConfigDelete) Where

Where appends a list predicates to the OIDCConfigDelete builder.

type OIDCConfigDeleteOne

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

OIDCConfigDeleteOne is the builder for deleting a single OIDCConfig entity.

func (*OIDCConfigDeleteOne) Exec

func (ocdo *OIDCConfigDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OIDCConfigDeleteOne) ExecX

func (ocdo *OIDCConfigDeleteOne) ExecX(ctx context.Context)

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

func (*OIDCConfigDeleteOne) Where

Where appends a list predicates to the OIDCConfigDelete builder.

type OIDCConfigGroupBy

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

OIDCConfigGroupBy is the group-by builder for OIDCConfig entities.

func (*OIDCConfigGroupBy) Aggregate

func (ocgb *OIDCConfigGroupBy) Aggregate(fns ...AggregateFunc) *OIDCConfigGroupBy

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

func (*OIDCConfigGroupBy) Bool

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

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

func (*OIDCConfigGroupBy) BoolX

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

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

func (*OIDCConfigGroupBy) Bools

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

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

func (*OIDCConfigGroupBy) BoolsX

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

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

func (*OIDCConfigGroupBy) Float64

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

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

func (*OIDCConfigGroupBy) Float64X

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

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

func (*OIDCConfigGroupBy) Float64s

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

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

func (*OIDCConfigGroupBy) Float64sX

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

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

func (*OIDCConfigGroupBy) Int

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

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

func (*OIDCConfigGroupBy) IntX

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

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

func (*OIDCConfigGroupBy) Ints

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

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

func (*OIDCConfigGroupBy) IntsX

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

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

func (*OIDCConfigGroupBy) Scan

func (ocgb *OIDCConfigGroupBy) Scan(ctx context.Context, v any) error

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

func (*OIDCConfigGroupBy) ScanX

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

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

func (*OIDCConfigGroupBy) String

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

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

func (*OIDCConfigGroupBy) StringX

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

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

func (*OIDCConfigGroupBy) Strings

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

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

func (*OIDCConfigGroupBy) StringsX

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

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

type OIDCConfigMutation

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

OIDCConfigMutation represents an operation that mutates the OIDCConfig nodes in the graph.

func (*OIDCConfigMutation) AddField

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

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

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

func (*OIDCConfigMutation) AddedField

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

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

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

func (*OIDCConfigMutation) AddedIDs

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

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

func (*OIDCConfigMutation) ClearEdge

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

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

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

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

func (*OIDCConfigMutation) ClearedFields

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

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

func (OIDCConfigMutation) Client

func (m OIDCConfigMutation) 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 (*OIDCConfigMutation) ClientID

func (m *OIDCConfigMutation) ClientID() (r string, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*OIDCConfigMutation) ClientSecret

func (m *OIDCConfigMutation) ClientSecret() (r string, exists bool)

ClientSecret returns the value of the "client_secret" field in the mutation.

func (*OIDCConfigMutation) DiscoveryURI

func (m *OIDCConfigMutation) DiscoveryURI() (r string, exists bool)

DiscoveryURI returns the value of the "discovery_uri" field in the mutation.

func (*OIDCConfigMutation) EdgeCleared

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

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

func (*OIDCConfigMutation) Field

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

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

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

func (*OIDCConfigMutation) Fields

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

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

func (m *OIDCConfigMutation) 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 (*OIDCConfigMutation) OldClientID

func (m *OIDCConfigMutation) OldClientID(ctx context.Context) (v string, err error)

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

func (*OIDCConfigMutation) OldClientSecret

func (m *OIDCConfigMutation) OldClientSecret(ctx context.Context) (v string, err error)

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

func (*OIDCConfigMutation) OldDiscoveryURI

func (m *OIDCConfigMutation) OldDiscoveryURI(ctx context.Context) (v string, err error)

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

func (*OIDCConfigMutation) OldField

func (m *OIDCConfigMutation) 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 (*OIDCConfigMutation) OldProviderKey

func (m *OIDCConfigMutation) OldProviderKey(ctx context.Context) (v string, err error)

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

func (*OIDCConfigMutation) OldProviderName

func (m *OIDCConfigMutation) OldProviderName(ctx context.Context) (v string, err error)

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

func (*OIDCConfigMutation) OldRedirectURI

func (m *OIDCConfigMutation) OldRedirectURI(ctx context.Context) (v string, err error)

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

func (*OIDCConfigMutation) Op

func (m *OIDCConfigMutation) Op() Op

Op returns the operation name.

func (*OIDCConfigMutation) ProviderKey

func (m *OIDCConfigMutation) ProviderKey() (r string, exists bool)

ProviderKey returns the value of the "provider_key" field in the mutation.

func (*OIDCConfigMutation) ProviderName

func (m *OIDCConfigMutation) ProviderName() (r string, exists bool)

ProviderName returns the value of the "provider_name" field in the mutation.

func (*OIDCConfigMutation) RedirectURI

func (m *OIDCConfigMutation) RedirectURI() (r string, exists bool)

RedirectURI returns the value of the "redirect_uri" field in the mutation.

func (*OIDCConfigMutation) RemovedEdges

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

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

func (*OIDCConfigMutation) RemovedIDs

func (m *OIDCConfigMutation) 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 (*OIDCConfigMutation) ResetClientID

func (m *OIDCConfigMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OIDCConfigMutation) ResetClientSecret

func (m *OIDCConfigMutation) ResetClientSecret()

ResetClientSecret resets all changes to the "client_secret" field.

func (*OIDCConfigMutation) ResetDiscoveryURI

func (m *OIDCConfigMutation) ResetDiscoveryURI()

ResetDiscoveryURI resets all changes to the "discovery_uri" field.

func (*OIDCConfigMutation) ResetEdge

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

func (m *OIDCConfigMutation) 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 (*OIDCConfigMutation) ResetProviderKey

func (m *OIDCConfigMutation) ResetProviderKey()

ResetProviderKey resets all changes to the "provider_key" field.

func (*OIDCConfigMutation) ResetProviderName

func (m *OIDCConfigMutation) ResetProviderName()

ResetProviderName resets all changes to the "provider_name" field.

func (*OIDCConfigMutation) ResetRedirectURI

func (m *OIDCConfigMutation) ResetRedirectURI()

ResetRedirectURI resets all changes to the "redirect_uri" field.

func (*OIDCConfigMutation) SetClientID

func (m *OIDCConfigMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OIDCConfigMutation) SetClientSecret

func (m *OIDCConfigMutation) SetClientSecret(s string)

SetClientSecret sets the "client_secret" field.

func (*OIDCConfigMutation) SetDiscoveryURI

func (m *OIDCConfigMutation) SetDiscoveryURI(s string)

SetDiscoveryURI sets the "discovery_uri" field.

func (*OIDCConfigMutation) SetField

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

func (m *OIDCConfigMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OIDCConfigMutation) SetProviderKey

func (m *OIDCConfigMutation) SetProviderKey(s string)

SetProviderKey sets the "provider_key" field.

func (*OIDCConfigMutation) SetProviderName

func (m *OIDCConfigMutation) SetProviderName(s string)

SetProviderName sets the "provider_name" field.

func (*OIDCConfigMutation) SetRedirectURI

func (m *OIDCConfigMutation) SetRedirectURI(s string)

SetRedirectURI sets the "redirect_uri" field.

func (OIDCConfigMutation) Tx

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

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

func (*OIDCConfigMutation) Type

func (m *OIDCConfigMutation) Type() string

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

func (*OIDCConfigMutation) Where

func (m *OIDCConfigMutation) Where(ps ...predicate.OIDCConfig)

Where appends a list predicates to the OIDCConfigMutation builder.

func (*OIDCConfigMutation) WhereP

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

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

type OIDCConfigQuery

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

OIDCConfigQuery is the builder for querying OIDCConfig entities.

func (*OIDCConfigQuery) Aggregate

func (ocq *OIDCConfigQuery) Aggregate(fns ...AggregateFunc) *OIDCConfigSelect

Aggregate returns a OIDCConfigSelect configured with the given aggregations.

func (*OIDCConfigQuery) All

func (ocq *OIDCConfigQuery) All(ctx context.Context) ([]*OIDCConfig, error)

All executes the query and returns a list of OIDCConfigs.

func (*OIDCConfigQuery) AllX

func (ocq *OIDCConfigQuery) AllX(ctx context.Context) []*OIDCConfig

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

func (*OIDCConfigQuery) Clone

func (ocq *OIDCConfigQuery) Clone() *OIDCConfigQuery

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

func (*OIDCConfigQuery) Count

func (ocq *OIDCConfigQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OIDCConfigQuery) CountX

func (ocq *OIDCConfigQuery) CountX(ctx context.Context) int

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

func (*OIDCConfigQuery) Exist

func (ocq *OIDCConfigQuery) Exist(ctx context.Context) (bool, error)

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

func (*OIDCConfigQuery) ExistX

func (ocq *OIDCConfigQuery) ExistX(ctx context.Context) bool

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

func (*OIDCConfigQuery) First

func (ocq *OIDCConfigQuery) First(ctx context.Context) (*OIDCConfig, error)

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

func (*OIDCConfigQuery) FirstID

func (ocq *OIDCConfigQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OIDCConfigQuery) FirstIDX

func (ocq *OIDCConfigQuery) FirstIDX(ctx context.Context) int

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

func (*OIDCConfigQuery) FirstX

func (ocq *OIDCConfigQuery) FirstX(ctx context.Context) *OIDCConfig

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

func (*OIDCConfigQuery) GroupBy

func (ocq *OIDCConfigQuery) GroupBy(field string, fields ...string) *OIDCConfigGroupBy

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

client.OIDCConfig.Query().
	GroupBy(oidcconfig.FieldProviderKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OIDCConfigQuery) IDs

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

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

func (*OIDCConfigQuery) IDsX

func (ocq *OIDCConfigQuery) IDsX(ctx context.Context) []int

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

func (*OIDCConfigQuery) Limit

func (ocq *OIDCConfigQuery) Limit(limit int) *OIDCConfigQuery

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

func (*OIDCConfigQuery) Offset

func (ocq *OIDCConfigQuery) Offset(offset int) *OIDCConfigQuery

Offset to start from.

func (*OIDCConfigQuery) Only

func (ocq *OIDCConfigQuery) Only(ctx context.Context) (*OIDCConfig, error)

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

func (*OIDCConfigQuery) OnlyID

func (ocq *OIDCConfigQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OIDCConfigQuery) OnlyIDX

func (ocq *OIDCConfigQuery) OnlyIDX(ctx context.Context) int

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

func (*OIDCConfigQuery) OnlyX

func (ocq *OIDCConfigQuery) OnlyX(ctx context.Context) *OIDCConfig

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

func (*OIDCConfigQuery) Order

Order specifies how the records should be ordered.

func (*OIDCConfigQuery) Select

func (ocq *OIDCConfigQuery) Select(fields ...string) *OIDCConfigSelect

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

client.OIDCConfig.Query().
	Select(oidcconfig.FieldProviderKey).
	Scan(ctx, &v)

func (*OIDCConfigQuery) Unique

func (ocq *OIDCConfigQuery) Unique(unique bool) *OIDCConfigQuery

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

Where adds a new predicate for the OIDCConfigQuery builder.

type OIDCConfigSelect

type OIDCConfigSelect struct {
	*OIDCConfigQuery
	// contains filtered or unexported fields
}

OIDCConfigSelect is the builder for selecting fields of OIDCConfig entities.

func (*OIDCConfigSelect) Aggregate

func (ocs *OIDCConfigSelect) Aggregate(fns ...AggregateFunc) *OIDCConfigSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OIDCConfigSelect) Bool

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

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

func (*OIDCConfigSelect) BoolX

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

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

func (*OIDCConfigSelect) Bools

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

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

func (*OIDCConfigSelect) BoolsX

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

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

func (*OIDCConfigSelect) Float64

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

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

func (*OIDCConfigSelect) Float64X

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

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

func (*OIDCConfigSelect) Float64s

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

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

func (*OIDCConfigSelect) Float64sX

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

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

func (*OIDCConfigSelect) Int

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

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

func (*OIDCConfigSelect) IntX

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

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

func (*OIDCConfigSelect) Ints

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

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

func (*OIDCConfigSelect) IntsX

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

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

func (*OIDCConfigSelect) Scan

func (ocs *OIDCConfigSelect) Scan(ctx context.Context, v any) error

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

func (*OIDCConfigSelect) ScanX

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

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

func (*OIDCConfigSelect) String

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

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

func (*OIDCConfigSelect) StringX

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

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

func (*OIDCConfigSelect) Strings

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

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

func (*OIDCConfigSelect) StringsX

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

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

type OIDCConfigUpdate

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

OIDCConfigUpdate is the builder for updating OIDCConfig entities.

func (*OIDCConfigUpdate) Exec

func (ocu *OIDCConfigUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OIDCConfigUpdate) ExecX

func (ocu *OIDCConfigUpdate) ExecX(ctx context.Context)

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

func (*OIDCConfigUpdate) Mutation

func (ocu *OIDCConfigUpdate) Mutation() *OIDCConfigMutation

Mutation returns the OIDCConfigMutation object of the builder.

func (*OIDCConfigUpdate) Save

func (ocu *OIDCConfigUpdate) Save(ctx context.Context) (int, error)

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

func (*OIDCConfigUpdate) SaveX

func (ocu *OIDCConfigUpdate) SaveX(ctx context.Context) int

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

func (*OIDCConfigUpdate) SetClientID

func (ocu *OIDCConfigUpdate) SetClientID(s string) *OIDCConfigUpdate

SetClientID sets the "client_id" field.

func (*OIDCConfigUpdate) SetClientSecret

func (ocu *OIDCConfigUpdate) SetClientSecret(s string) *OIDCConfigUpdate

SetClientSecret sets the "client_secret" field.

func (*OIDCConfigUpdate) SetDiscoveryURI

func (ocu *OIDCConfigUpdate) SetDiscoveryURI(s string) *OIDCConfigUpdate

SetDiscoveryURI sets the "discovery_uri" field.

func (*OIDCConfigUpdate) SetProviderKey

func (ocu *OIDCConfigUpdate) SetProviderKey(s string) *OIDCConfigUpdate

SetProviderKey sets the "provider_key" field.

func (*OIDCConfigUpdate) SetProviderName

func (ocu *OIDCConfigUpdate) SetProviderName(s string) *OIDCConfigUpdate

SetProviderName sets the "provider_name" field.

func (*OIDCConfigUpdate) SetRedirectURI

func (ocu *OIDCConfigUpdate) SetRedirectURI(s string) *OIDCConfigUpdate

SetRedirectURI sets the "redirect_uri" field.

func (*OIDCConfigUpdate) Where

Where appends a list predicates to the OIDCConfigUpdate builder.

type OIDCConfigUpdateOne

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

OIDCConfigUpdateOne is the builder for updating a single OIDCConfig entity.

func (*OIDCConfigUpdateOne) Exec

func (ocuo *OIDCConfigUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OIDCConfigUpdateOne) ExecX

func (ocuo *OIDCConfigUpdateOne) ExecX(ctx context.Context)

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

func (*OIDCConfigUpdateOne) Mutation

func (ocuo *OIDCConfigUpdateOne) Mutation() *OIDCConfigMutation

Mutation returns the OIDCConfigMutation object of the builder.

func (*OIDCConfigUpdateOne) Save

func (ocuo *OIDCConfigUpdateOne) Save(ctx context.Context) (*OIDCConfig, error)

Save executes the query and returns the updated OIDCConfig entity.

func (*OIDCConfigUpdateOne) SaveX

func (ocuo *OIDCConfigUpdateOne) SaveX(ctx context.Context) *OIDCConfig

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

func (*OIDCConfigUpdateOne) Select

func (ocuo *OIDCConfigUpdateOne) Select(field string, fields ...string) *OIDCConfigUpdateOne

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

func (*OIDCConfigUpdateOne) SetClientID

func (ocuo *OIDCConfigUpdateOne) SetClientID(s string) *OIDCConfigUpdateOne

SetClientID sets the "client_id" field.

func (*OIDCConfigUpdateOne) SetClientSecret

func (ocuo *OIDCConfigUpdateOne) SetClientSecret(s string) *OIDCConfigUpdateOne

SetClientSecret sets the "client_secret" field.

func (*OIDCConfigUpdateOne) SetDiscoveryURI

func (ocuo *OIDCConfigUpdateOne) SetDiscoveryURI(s string) *OIDCConfigUpdateOne

SetDiscoveryURI sets the "discovery_uri" field.

func (*OIDCConfigUpdateOne) SetProviderKey

func (ocuo *OIDCConfigUpdateOne) SetProviderKey(s string) *OIDCConfigUpdateOne

SetProviderKey sets the "provider_key" field.

func (*OIDCConfigUpdateOne) SetProviderName

func (ocuo *OIDCConfigUpdateOne) SetProviderName(s string) *OIDCConfigUpdateOne

SetProviderName sets the "provider_name" field.

func (*OIDCConfigUpdateOne) SetRedirectURI

func (ocuo *OIDCConfigUpdateOne) SetRedirectURI(s string) *OIDCConfigUpdateOne

SetRedirectURI sets the "redirect_uri" field.

func (*OIDCConfigUpdateOne) Where

Where appends a list predicates to the OIDCConfigUpdate builder.

type OIDCConfigs

type OIDCConfigs []*OIDCConfig

OIDCConfigs is a parsable slice of OIDCConfig.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Tag

type Tag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) GetValue

func (t *Tag) GetValue(name string) (ent.Value, error)

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

func (*Tag) QueryAgents

func (t *Tag) QueryAgents() *AgentQuery

QueryAgents queries the "agents" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

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

func (t *Tag) Update() *TagUpdateOne

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

type TagClient

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

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

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

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id int) *TagDeleteOne

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

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int) *Tag

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

func (*TagClient) Hooks

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

Hooks returns the client hooks.

func (*TagClient) Intercept

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

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

func (*TagClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryAgents

func (c *TagClient) QueryAgents(t *Tag) *AgentQuery

QueryAgents queries the agents edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id int) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

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

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

type TagCreate

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

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddAgentIDs

func (tc *TagCreate) AddAgentIDs(ids ...int) *TagCreate

AddAgentIDs adds the "agents" edge to the Agent entity by IDs.

func (*TagCreate) AddAgents

func (tc *TagCreate) AddAgents(a ...*Agent) *TagCreate

AddAgents adds the "agents" edges to the Agent entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

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

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetName

func (tc *TagCreate) SetName(s string) *TagCreate

SetName sets the "name" field.

func (*TagCreate) SetValue

func (tc *TagCreate) SetValue(s string) *TagCreate

SetValue sets the "value" field.

type TagCreateBulk

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

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

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

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

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

type TagDelete

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

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

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

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

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

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

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

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

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

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Agents holds the value of the agents edge.
	Agents []*Agent `json:"agents,omitempty"`
	// contains filtered or unexported fields
}

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

func (TagEdges) AgentsOrErr

func (e TagEdges) AgentsOrErr() ([]*Agent, error)

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

type TagGroupBy

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

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

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

func (*TagGroupBy) Bool

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

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

func (*TagGroupBy) BoolX

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

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

func (*TagGroupBy) Bools

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

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

func (*TagGroupBy) BoolsX

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

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

func (*TagGroupBy) Float64

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

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

func (*TagGroupBy) Float64X

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

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

func (*TagGroupBy) Float64s

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

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

func (*TagGroupBy) Float64sX

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

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

func (*TagGroupBy) Int

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

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

func (*TagGroupBy) IntX

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

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

func (*TagGroupBy) Ints

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

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

func (*TagGroupBy) IntsX

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

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

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error

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

func (*TagGroupBy) ScanX

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

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

func (*TagGroupBy) String

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

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

func (*TagGroupBy) StringX

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

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

func (*TagGroupBy) Strings

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

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

func (*TagGroupBy) StringsX

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

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

type TagMutation

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

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddAgentIDs

func (m *TagMutation) AddAgentIDs(ids ...int)

AddAgentIDs adds the "agents" edge to the Agent entity by ids.

func (*TagMutation) AddField

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

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

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

func (*TagMutation) AddedField

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

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

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

func (*TagMutation) AddedIDs

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

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

func (*TagMutation) AgentsCleared

func (m *TagMutation) AgentsCleared() bool

AgentsCleared reports if the "agents" edge to the Agent entity was cleared.

func (*TagMutation) AgentsIDs

func (m *TagMutation) AgentsIDs() (ids []int)

AgentsIDs returns the "agents" edge IDs in the mutation.

func (*TagMutation) ClearAgents

func (m *TagMutation) ClearAgents()

ClearAgents clears the "agents" edge to the Agent entity.

func (*TagMutation) ClearEdge

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

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

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

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

func (*TagMutation) ClearedFields

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

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

func (TagMutation) Client

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

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

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

func (*TagMutation) Field

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

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

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

func (*TagMutation) Fields

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

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

func (m *TagMutation) 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 (*TagMutation) Name

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

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

func (*TagMutation) OldField

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

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

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

func (*TagMutation) OldValue

func (m *TagMutation) OldValue(ctx context.Context) (v string, err error)

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

func (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) RemoveAgentIDs

func (m *TagMutation) RemoveAgentIDs(ids ...int)

RemoveAgentIDs removes the "agents" edge to the Agent entity by IDs.

func (*TagMutation) RemovedAgentsIDs

func (m *TagMutation) RemovedAgentsIDs() (ids []int)

RemovedAgents returns the removed IDs of the "agents" edge to the Agent entity.

func (*TagMutation) RemovedEdges

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

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

func (*TagMutation) RemovedIDs

func (m *TagMutation) 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 (*TagMutation) ResetAgents

func (m *TagMutation) ResetAgents()

ResetAgents resets all changes to the "agents" edge.

func (*TagMutation) ResetEdge

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

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

func (m *TagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TagMutation) ResetValue

func (m *TagMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*TagMutation) SetField

func (m *TagMutation) 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 (*TagMutation) SetName

func (m *TagMutation) SetName(s string)

SetName sets the "name" field.

func (*TagMutation) SetOp

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetValue

func (m *TagMutation) SetValue(s string)

SetValue sets the "value" field.

func (TagMutation) Tx

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

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

func (*TagMutation) Type

func (m *TagMutation) Type() string

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

func (*TagMutation) Value

func (m *TagMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

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

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

type TagQuery

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

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

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

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

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

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

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

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

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

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

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

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

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

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) int

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

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

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

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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

func (*TagQuery) IDs

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

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

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []int

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

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

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

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

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

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) int

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

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

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

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryAgents

func (tq *TagQuery) QueryAgents() *AgentQuery

QueryAgents chains the current query on the "agents" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithAgents

func (tq *TagQuery) WithAgents(opts ...func(*AgentQuery)) *TagQuery

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

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

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

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

func (*TagSelect) BoolX

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

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

func (*TagSelect) Bools

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

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

func (*TagSelect) BoolsX

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

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

func (*TagSelect) Float64

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

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

func (*TagSelect) Float64X

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

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

func (*TagSelect) Float64s

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

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

func (*TagSelect) Float64sX

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

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

func (*TagSelect) Int

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

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

func (*TagSelect) IntX

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

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

func (*TagSelect) Ints

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

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

func (*TagSelect) IntsX

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

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

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

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

func (*TagSelect) ScanX

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

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

func (*TagSelect) String

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

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

func (*TagSelect) StringX

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

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

func (*TagSelect) Strings

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

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

func (*TagSelect) StringsX

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

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

type TagUpdate

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

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddAgentIDs

func (tu *TagUpdate) AddAgentIDs(ids ...int) *TagUpdate

AddAgentIDs adds the "agents" edge to the Agent entity by IDs.

func (*TagUpdate) AddAgents

func (tu *TagUpdate) AddAgents(a ...*Agent) *TagUpdate

AddAgents adds the "agents" edges to the Agent entity.

func (*TagUpdate) ClearAgents

func (tu *TagUpdate) ClearAgents() *TagUpdate

ClearAgents clears all "agents" edges to the Agent entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

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

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveAgentIDs

func (tu *TagUpdate) RemoveAgentIDs(ids ...int) *TagUpdate

RemoveAgentIDs removes the "agents" edge to Agent entities by IDs.

func (*TagUpdate) RemoveAgents

func (tu *TagUpdate) RemoveAgents(a ...*Agent) *TagUpdate

RemoveAgents removes "agents" edges to Agent entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

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

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

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

func (*TagUpdate) SetName

func (tu *TagUpdate) SetName(s string) *TagUpdate

SetName sets the "name" field.

func (*TagUpdate) SetValue

func (tu *TagUpdate) SetValue(s string) *TagUpdate

SetValue sets the "value" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

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

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddAgentIDs

func (tuo *TagUpdateOne) AddAgentIDs(ids ...int) *TagUpdateOne

AddAgentIDs adds the "agents" edge to the Agent entity by IDs.

func (*TagUpdateOne) AddAgents

func (tuo *TagUpdateOne) AddAgents(a ...*Agent) *TagUpdateOne

AddAgents adds the "agents" edges to the Agent entity.

func (*TagUpdateOne) ClearAgents

func (tuo *TagUpdateOne) ClearAgents() *TagUpdateOne

ClearAgents clears all "agents" edges to the Agent entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

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

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveAgentIDs

func (tuo *TagUpdateOne) RemoveAgentIDs(ids ...int) *TagUpdateOne

RemoveAgentIDs removes the "agents" edge to Agent entities by IDs.

func (*TagUpdateOne) RemoveAgents

func (tuo *TagUpdateOne) RemoveAgents(a ...*Agent) *TagUpdateOne

RemoveAgents removes "agents" edges to Agent entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

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

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

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

func (*TagUpdateOne) SetName

func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne

SetName sets the "name" field.

func (*TagUpdateOne) SetValue

func (tuo *TagUpdateOne) SetValue(s string) *TagUpdateOne

SetValue sets the "value" field.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

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 {

	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// OIDCConfig is the client for interacting with the OIDCConfig builders.
	OIDCConfig *OIDCConfigClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

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

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

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

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL