ent

package
v0.0.0-...-52fa7fc Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: GPL-3.0 Imports: 29 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"
	TypeBlobber    = "Blobber"
	TypeChat       = "Chat"
	TypeCommand    = "Command"
	TypeCredential = "Credential"
	TypeListener   = "Listener"
	TypeMessage    = "Message"
	TypeOperator   = "Operator"
	TypePki        = "Pki"
	TypeTask       = "Task"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Agent

type Agent struct {

	// ID of the ent.
	// agent ID
	ID uint32 `json:"id,omitempty"`
	// Time when entity was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Time when entity was updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Time when entity was soft-deleted
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// linked listener ID
	ListenerID int64 `json:"listener_id,omitempty"`
	// external IP address of agent
	ExtIP types.Inet `json:"ext_ip,omitempty"`
	// internal IP address of agent
	IntIP types.Inet `json:"int_ip,omitempty"`
	// type of operating system
	Os shared.AgentOs `json:"os,omitempty"`
	// metadata of operating system
	OsMeta string `json:"os_meta,omitempty"`
	// hostname of machine, on which agent deployed
	Hostname string `json:"hostname,omitempty"`
	// username of agent's process
	Username string `json:"username,omitempty"`
	// domain of machine, on which agent deployed
	Domain string `json:"domain,omitempty"`
	// is agent process is privileged
	Privileged bool `json:"privileged,omitempty"`
	// name of agent process
	ProcessName string `json:"process_name,omitempty"`
	// process ID of agent
	Pid int64 `json:"pid,omitempty"`
	// architecture of agent process
	Arch shared.AgentArch `json:"arch,omitempty"`
	// sleep value of agent
	Sleep uint32 `json:"sleep,omitempty"`
	// jitter value of sleep
	Jitter uint8 `json:"jitter,omitempty"`
	// first checkout timestamp
	First time.Time `json:"first,omitempty"`
	// last activity of listener
	Last time.Time `json:"last,omitempty"`
	// capabilities of agent
	Caps uint32 `json:"caps,omitempty"`
	// note of agent
	Note string `json:"note,omitempty"`
	// color of entity
	Color uint32 `json:"color,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) QueryCommand

func (a *Agent) QueryCommand() *CommandQuery

QueryCommand queries the "command" edge of the Agent entity.

func (*Agent) QueryListener

func (a *Agent) QueryListener() *ListenerQuery

QueryListener queries the "listener" edge of the Agent entity.

func (*Agent) QueryTask

func (a *Agent) QueryTask() *TaskQuery

QueryTask queries the "task" 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 uint32) *AgentDeleteOne

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

func (*AgentClient) Get

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

Get returns a Agent entity by its id.

func (*AgentClient) GetX

func (c *AgentClient) GetX(ctx context.Context, id uint32) *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) MapCreateBulk

func (c *AgentClient) MapCreateBulk(slice any, setFunc func(*AgentCreate, int)) *AgentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AgentClient) Query

func (c *AgentClient) Query() *AgentQuery

Query returns a query builder for Agent.

func (*AgentClient) QueryCommand

func (c *AgentClient) QueryCommand(a *Agent) *CommandQuery

QueryCommand queries the command edge of a Agent.

func (*AgentClient) QueryListener

func (c *AgentClient) QueryListener(a *Agent) *ListenerQuery

QueryListener queries the listener edge of a Agent.

func (*AgentClient) QueryTask

func (c *AgentClient) QueryTask(a *Agent) *TaskQuery

QueryTask queries the task 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 uint32) *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) AddCommand

func (ac *AgentCreate) AddCommand(c ...*Command) *AgentCreate

AddCommand adds the "command" edges to the Command entity.

func (*AgentCreate) AddCommandIDs

func (ac *AgentCreate) AddCommandIDs(ids ...int64) *AgentCreate

AddCommandIDs adds the "command" edge to the Command entity by IDs.

func (*AgentCreate) AddTask

func (ac *AgentCreate) AddTask(t ...*Task) *AgentCreate

AddTask adds the "task" edges to the Task entity.

func (*AgentCreate) AddTaskIDs

func (ac *AgentCreate) AddTaskIDs(ids ...int64) *AgentCreate

AddTaskIDs adds the "task" edge to the Task entity by IDs.

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) SetArch

func (ac *AgentCreate) SetArch(sa shared.AgentArch) *AgentCreate

SetArch sets the "arch" field.

func (*AgentCreate) SetCaps

func (ac *AgentCreate) SetCaps(u uint32) *AgentCreate

SetCaps sets the "caps" field.

func (*AgentCreate) SetColor

func (ac *AgentCreate) SetColor(u uint32) *AgentCreate

SetColor sets the "color" field.

func (*AgentCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AgentCreate) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AgentCreate) SetDomain

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

SetDomain sets the "domain" field.

func (*AgentCreate) SetExtIP

func (ac *AgentCreate) SetExtIP(t types.Inet) *AgentCreate

SetExtIP sets the "ext_ip" field.

func (*AgentCreate) SetFirst

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

SetFirst sets the "first" field.

func (*AgentCreate) SetHostname

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

SetHostname sets the "hostname" field.

func (*AgentCreate) SetID

func (ac *AgentCreate) SetID(u uint32) *AgentCreate

SetID sets the "id" field.

func (*AgentCreate) SetIntIP

func (ac *AgentCreate) SetIntIP(t types.Inet) *AgentCreate

SetIntIP sets the "int_ip" field.

func (*AgentCreate) SetJitter

func (ac *AgentCreate) SetJitter(u uint8) *AgentCreate

SetJitter sets the "jitter" field.

func (*AgentCreate) SetLast

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

SetLast sets the "last" field.

func (*AgentCreate) SetListener

func (ac *AgentCreate) SetListener(l *Listener) *AgentCreate

SetListener sets the "listener" edge to the Listener entity.

func (*AgentCreate) SetListenerID

func (ac *AgentCreate) SetListenerID(i int64) *AgentCreate

SetListenerID sets the "listener_id" field.

func (*AgentCreate) SetNillableColor

func (ac *AgentCreate) SetNillableColor(u *uint32) *AgentCreate

SetNillableColor sets the "color" field if the given value is not nil.

func (*AgentCreate) SetNillableCreatedAt

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

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

func (*AgentCreate) SetNillableDeletedAt

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

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*AgentCreate) SetNillableDomain

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

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*AgentCreate) SetNillableExtIP

func (ac *AgentCreate) SetNillableExtIP(t *types.Inet) *AgentCreate

SetNillableExtIP sets the "ext_ip" field if the given value is not nil.

func (*AgentCreate) SetNillableFirst

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

SetNillableFirst sets the "first" field if the given value is not nil.

func (*AgentCreate) SetNillableHostname

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

SetNillableHostname sets the "hostname" field if the given value is not nil.

func (*AgentCreate) SetNillableIntIP

func (ac *AgentCreate) SetNillableIntIP(t *types.Inet) *AgentCreate

SetNillableIntIP sets the "int_ip" field if the given value is not nil.

func (*AgentCreate) SetNillableLast

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

SetNillableLast sets the "last" field if the given value is not nil.

func (*AgentCreate) SetNillableNote

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

SetNillableNote sets the "note" field if the given value is not nil.

func (*AgentCreate) SetNillableOsMeta

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

SetNillableOsMeta sets the "os_meta" field if the given value is not nil.

func (*AgentCreate) SetNillablePid

func (ac *AgentCreate) SetNillablePid(i *int64) *AgentCreate

SetNillablePid sets the "pid" field if the given value is not nil.

func (*AgentCreate) SetNillablePrivileged

func (ac *AgentCreate) SetNillablePrivileged(b *bool) *AgentCreate

SetNillablePrivileged sets the "privileged" field if the given value is not nil.

func (*AgentCreate) SetNillableProcessName

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

SetNillableProcessName sets the "process_name" field if the given value is not nil.

func (*AgentCreate) SetNillableUpdatedAt

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

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

func (*AgentCreate) SetNillableUsername

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

SetNillableUsername sets the "username" field if the given value is not nil.

func (*AgentCreate) SetNote

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

SetNote sets the "note" field.

func (*AgentCreate) SetOs

func (ac *AgentCreate) SetOs(so shared.AgentOs) *AgentCreate

SetOs sets the "os" field.

func (*AgentCreate) SetOsMeta

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

SetOsMeta sets the "os_meta" field.

func (*AgentCreate) SetPid

func (ac *AgentCreate) SetPid(i int64) *AgentCreate

SetPid sets the "pid" field.

func (*AgentCreate) SetPrivileged

func (ac *AgentCreate) SetPrivileged(b bool) *AgentCreate

SetPrivileged sets the "privileged" field.

func (*AgentCreate) SetProcessName

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

SetProcessName sets the "process_name" field.

func (*AgentCreate) SetSleep

func (ac *AgentCreate) SetSleep(u uint32) *AgentCreate

SetSleep sets the "sleep" field.

func (*AgentCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AgentCreate) SetUsername

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

SetUsername sets the "username" field.

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 {
	// Listener holds the value of the listener edge.
	Listener *Listener `json:"listener,omitempty"`
	// Command holds the value of the command edge.
	Command []*Command `json:"command,omitempty"`
	// Task holds the value of the task edge.
	Task []*Task `json:"task,omitempty"`
	// contains filtered or unexported fields
}

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

func (AgentEdges) CommandOrErr

func (e AgentEdges) CommandOrErr() ([]*Command, error)

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

func (AgentEdges) ListenerOrErr

func (e AgentEdges) ListenerOrErr() (*Listener, error)

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

func (AgentEdges) TaskOrErr

func (e AgentEdges) TaskOrErr() ([]*Task, error)

TaskOrErr returns the Task 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) AddCaps

func (m *AgentMutation) AddCaps(u int32)

AddCaps adds u to the "caps" field.

func (*AgentMutation) AddColor

func (m *AgentMutation) AddColor(u int32)

AddColor adds u to the "color" field.

func (*AgentMutation) AddCommandIDs

func (m *AgentMutation) AddCommandIDs(ids ...int64)

AddCommandIDs adds the "command" edge to the Command entity by ids.

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) AddJitter

func (m *AgentMutation) AddJitter(u int8)

AddJitter adds u to the "jitter" field.

func (*AgentMutation) AddPid

func (m *AgentMutation) AddPid(i int64)

AddPid adds i to the "pid" field.

func (*AgentMutation) AddSleep

func (m *AgentMutation) AddSleep(u int32)

AddSleep adds u to the "sleep" field.

func (*AgentMutation) AddTaskIDs

func (m *AgentMutation) AddTaskIDs(ids ...int64)

AddTaskIDs adds the "task" edge to the Task entity by ids.

func (*AgentMutation) AddedCaps

func (m *AgentMutation) AddedCaps() (r int32, exists bool)

AddedCaps returns the value that was added to the "caps" field in this mutation.

func (*AgentMutation) AddedColor

func (m *AgentMutation) AddedColor() (r int32, exists bool)

AddedColor returns the value that was added to the "color" field in this mutation.

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) AddedJitter

func (m *AgentMutation) AddedJitter() (r int8, exists bool)

AddedJitter returns the value that was added to the "jitter" field in this mutation.

func (*AgentMutation) AddedPid

func (m *AgentMutation) AddedPid() (r int64, exists bool)

AddedPid returns the value that was added to the "pid" field in this mutation.

func (*AgentMutation) AddedSleep

func (m *AgentMutation) AddedSleep() (r int32, exists bool)

AddedSleep returns the value that was added to the "sleep" field in this mutation.

func (*AgentMutation) Arch

func (m *AgentMutation) Arch() (r shared.AgentArch, exists bool)

Arch returns the value of the "arch" field in the mutation.

func (*AgentMutation) Caps

func (m *AgentMutation) Caps() (r uint32, exists bool)

Caps returns the value of the "caps" field in the mutation.

func (*AgentMutation) ClearCommand

func (m *AgentMutation) ClearCommand()

ClearCommand clears the "command" edge to the Command entity.

func (*AgentMutation) ClearDeletedAt

func (m *AgentMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AgentMutation) ClearDomain

func (m *AgentMutation) ClearDomain()

ClearDomain clears the value of the "domain" field.

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) ClearExtIP

func (m *AgentMutation) ClearExtIP()

ClearExtIP clears the value of the "ext_ip" field.

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) ClearHostname

func (m *AgentMutation) ClearHostname()

ClearHostname clears the value of the "hostname" field.

func (*AgentMutation) ClearIntIP

func (m *AgentMutation) ClearIntIP()

ClearIntIP clears the value of the "int_ip" field.

func (*AgentMutation) ClearListener

func (m *AgentMutation) ClearListener()

ClearListener clears the "listener" edge to the Listener entity.

func (*AgentMutation) ClearNote

func (m *AgentMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*AgentMutation) ClearOsMeta

func (m *AgentMutation) ClearOsMeta()

ClearOsMeta clears the value of the "os_meta" field.

func (*AgentMutation) ClearPid

func (m *AgentMutation) ClearPid()

ClearPid clears the value of the "pid" field.

func (*AgentMutation) ClearPrivileged

func (m *AgentMutation) ClearPrivileged()

ClearPrivileged clears the value of the "privileged" field.

func (*AgentMutation) ClearProcessName

func (m *AgentMutation) ClearProcessName()

ClearProcessName clears the value of the "process_name" field.

func (*AgentMutation) ClearTask

func (m *AgentMutation) ClearTask()

ClearTask clears the "task" edge to the Task entity.

func (*AgentMutation) ClearUsername

func (m *AgentMutation) ClearUsername()

ClearUsername clears the value of the "username" field.

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) Color

func (m *AgentMutation) Color() (r uint32, exists bool)

Color returns the value of the "color" field in the mutation.

func (*AgentMutation) CommandCleared

func (m *AgentMutation) CommandCleared() bool

CommandCleared reports if the "command" edge to the Command entity was cleared.

func (*AgentMutation) CommandIDs

func (m *AgentMutation) CommandIDs() (ids []int64)

CommandIDs returns the "command" edge IDs in the mutation.

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) DeletedAt

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

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*AgentMutation) DeletedAtCleared

func (m *AgentMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*AgentMutation) Domain

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

Domain returns the value of the "domain" field in the mutation.

func (*AgentMutation) DomainCleared

func (m *AgentMutation) DomainCleared() bool

DomainCleared returns if the "domain" field was cleared in this 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) ExtIP

func (m *AgentMutation) ExtIP() (r types.Inet, exists bool)

ExtIP returns the value of the "ext_ip" field in the mutation.

func (*AgentMutation) ExtIPCleared

func (m *AgentMutation) ExtIPCleared() bool

ExtIPCleared returns if the "ext_ip" field 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) First

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

First returns the value of the "first" field in the mutation.

func (*AgentMutation) Hostname

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

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

func (*AgentMutation) HostnameCleared

func (m *AgentMutation) HostnameCleared() bool

HostnameCleared returns if the "hostname" field was cleared in this mutation.

func (*AgentMutation) ID

func (m *AgentMutation) ID() (id uint32, 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) ([]uint32, 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) IntIP

func (m *AgentMutation) IntIP() (r types.Inet, exists bool)

IntIP returns the value of the "int_ip" field in the mutation.

func (*AgentMutation) IntIPCleared

func (m *AgentMutation) IntIPCleared() bool

IntIPCleared returns if the "int_ip" field was cleared in this mutation.

func (*AgentMutation) Jitter

func (m *AgentMutation) Jitter() (r uint8, exists bool)

Jitter returns the value of the "jitter" field in the mutation.

func (*AgentMutation) Last

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

Last returns the value of the "last" field in the mutation.

func (*AgentMutation) ListenerCleared

func (m *AgentMutation) ListenerCleared() bool

ListenerCleared reports if the "listener" edge to the Listener entity was cleared.

func (*AgentMutation) ListenerID

func (m *AgentMutation) ListenerID() (r int64, exists bool)

ListenerID returns the value of the "listener_id" field in the mutation.

func (*AgentMutation) ListenerIDs

func (m *AgentMutation) ListenerIDs() (ids []int64)

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

func (*AgentMutation) Note

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

Note returns the value of the "note" field in the mutation.

func (*AgentMutation) NoteCleared

func (m *AgentMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*AgentMutation) OldArch

func (m *AgentMutation) OldArch(ctx context.Context) (v shared.AgentArch, err error)

OldArch returns the old "arch" 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) OldCaps

func (m *AgentMutation) OldCaps(ctx context.Context) (v uint32, err error)

OldCaps returns the old "caps" 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) OldColor

func (m *AgentMutation) OldColor(ctx context.Context) (v uint32, err error)

OldColor returns the old "color" 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) 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) OldDeletedAt

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

OldDeletedAt returns the old "deleted_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) OldDomain

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

OldDomain returns the old "domain" 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) OldExtIP

func (m *AgentMutation) OldExtIP(ctx context.Context) (v types.Inet, err error)

OldExtIP returns the old "ext_ip" 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) OldFirst

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

OldFirst returns the old "first" 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) 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) OldIntIP

func (m *AgentMutation) OldIntIP(ctx context.Context) (v types.Inet, err error)

OldIntIP returns the old "int_ip" 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) OldJitter

func (m *AgentMutation) OldJitter(ctx context.Context) (v uint8, err error)

OldJitter returns the old "jitter" 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) OldLast

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

OldLast returns the old "last" 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) OldListenerID

func (m *AgentMutation) OldListenerID(ctx context.Context) (v int64, err error)

OldListenerID returns the old "listener_id" 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) OldNote

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

OldNote returns the old "note" 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) OldOs

func (m *AgentMutation) OldOs(ctx context.Context) (v shared.AgentOs, err error)

OldOs returns the old "os" 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) OldOsMeta

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

OldOsMeta returns the old "os_meta" 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) OldPid

func (m *AgentMutation) OldPid(ctx context.Context) (v int64, err error)

OldPid returns the old "pid" 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) OldPrivileged

func (m *AgentMutation) OldPrivileged(ctx context.Context) (v bool, err error)

OldPrivileged returns the old "privileged" 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) OldProcessName

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

OldProcessName returns the old "process_name" 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) OldSleep

func (m *AgentMutation) OldSleep(ctx context.Context) (v uint32, err error)

OldSleep returns the old "sleep" 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) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_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) OldUsername

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

OldUsername returns the old "username" 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) Os

func (m *AgentMutation) Os() (r shared.AgentOs, exists bool)

Os returns the value of the "os" field in the mutation.

func (*AgentMutation) OsMeta

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

OsMeta returns the value of the "os_meta" field in the mutation.

func (*AgentMutation) OsMetaCleared

func (m *AgentMutation) OsMetaCleared() bool

OsMetaCleared returns if the "os_meta" field was cleared in this mutation.

func (*AgentMutation) Pid

func (m *AgentMutation) Pid() (r int64, exists bool)

Pid returns the value of the "pid" field in the mutation.

func (*AgentMutation) PidCleared

func (m *AgentMutation) PidCleared() bool

PidCleared returns if the "pid" field was cleared in this mutation.

func (*AgentMutation) Privileged

func (m *AgentMutation) Privileged() (r bool, exists bool)

Privileged returns the value of the "privileged" field in the mutation.

func (*AgentMutation) PrivilegedCleared

func (m *AgentMutation) PrivilegedCleared() bool

PrivilegedCleared returns if the "privileged" field was cleared in this mutation.

func (*AgentMutation) ProcessName

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

ProcessName returns the value of the "process_name" field in the mutation.

func (*AgentMutation) ProcessNameCleared

func (m *AgentMutation) ProcessNameCleared() bool

ProcessNameCleared returns if the "process_name" field was cleared in this mutation.

func (*AgentMutation) RemoveCommandIDs

func (m *AgentMutation) RemoveCommandIDs(ids ...int64)

RemoveCommandIDs removes the "command" edge to the Command entity by IDs.

func (*AgentMutation) RemoveTaskIDs

func (m *AgentMutation) RemoveTaskIDs(ids ...int64)

RemoveTaskIDs removes the "task" edge to the Task entity by IDs.

func (*AgentMutation) RemovedCommandIDs

func (m *AgentMutation) RemovedCommandIDs() (ids []int64)

RemovedCommand returns the removed IDs of the "command" edge to the Command entity.

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) RemovedTaskIDs

func (m *AgentMutation) RemovedTaskIDs() (ids []int64)

RemovedTask returns the removed IDs of the "task" edge to the Task entity.

func (*AgentMutation) ResetArch

func (m *AgentMutation) ResetArch()

ResetArch resets all changes to the "arch" field.

func (*AgentMutation) ResetCaps

func (m *AgentMutation) ResetCaps()

ResetCaps resets all changes to the "caps" field.

func (*AgentMutation) ResetColor

func (m *AgentMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*AgentMutation) ResetCommand

func (m *AgentMutation) ResetCommand()

ResetCommand resets all changes to the "command" edge.

func (*AgentMutation) ResetCreatedAt

func (m *AgentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AgentMutation) ResetDeletedAt

func (m *AgentMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*AgentMutation) ResetDomain

func (m *AgentMutation) ResetDomain()

ResetDomain resets all changes to the "domain" 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) ResetExtIP

func (m *AgentMutation) ResetExtIP()

ResetExtIP resets all changes to the "ext_ip" field.

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) ResetFirst

func (m *AgentMutation) ResetFirst()

ResetFirst resets all changes to the "first" field.

func (*AgentMutation) ResetHostname

func (m *AgentMutation) ResetHostname()

ResetHostname resets all changes to the "hostname" field.

func (*AgentMutation) ResetIntIP

func (m *AgentMutation) ResetIntIP()

ResetIntIP resets all changes to the "int_ip" field.

func (*AgentMutation) ResetJitter

func (m *AgentMutation) ResetJitter()

ResetJitter resets all changes to the "jitter" field.

func (*AgentMutation) ResetLast

func (m *AgentMutation) ResetLast()

ResetLast resets all changes to the "last" field.

func (*AgentMutation) ResetListener

func (m *AgentMutation) ResetListener()

ResetListener resets all changes to the "listener" edge.

func (*AgentMutation) ResetListenerID

func (m *AgentMutation) ResetListenerID()

ResetListenerID resets all changes to the "listener_id" field.

func (*AgentMutation) ResetNote

func (m *AgentMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*AgentMutation) ResetOs

func (m *AgentMutation) ResetOs()

ResetOs resets all changes to the "os" field.

func (*AgentMutation) ResetOsMeta

func (m *AgentMutation) ResetOsMeta()

ResetOsMeta resets all changes to the "os_meta" field.

func (*AgentMutation) ResetPid

func (m *AgentMutation) ResetPid()

ResetPid resets all changes to the "pid" field.

func (*AgentMutation) ResetPrivileged

func (m *AgentMutation) ResetPrivileged()

ResetPrivileged resets all changes to the "privileged" field.

func (*AgentMutation) ResetProcessName

func (m *AgentMutation) ResetProcessName()

ResetProcessName resets all changes to the "process_name" field.

func (*AgentMutation) ResetSleep

func (m *AgentMutation) ResetSleep()

ResetSleep resets all changes to the "sleep" field.

func (*AgentMutation) ResetTask

func (m *AgentMutation) ResetTask()

ResetTask resets all changes to the "task" edge.

func (*AgentMutation) ResetUpdatedAt

func (m *AgentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AgentMutation) ResetUsername

func (m *AgentMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*AgentMutation) SetArch

func (m *AgentMutation) SetArch(sa shared.AgentArch)

SetArch sets the "arch" field.

func (*AgentMutation) SetCaps

func (m *AgentMutation) SetCaps(u uint32)

SetCaps sets the "caps" field.

func (*AgentMutation) SetColor

func (m *AgentMutation) SetColor(u uint32)

SetColor sets the "color" field.

func (*AgentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AgentMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AgentMutation) SetDomain

func (m *AgentMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*AgentMutation) SetExtIP

func (m *AgentMutation) SetExtIP(t types.Inet)

SetExtIP sets the "ext_ip" 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) SetFirst

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

SetFirst sets the "first" field.

func (*AgentMutation) SetHostname

func (m *AgentMutation) SetHostname(s string)

SetHostname sets the "hostname" field.

func (*AgentMutation) SetID

func (m *AgentMutation) SetID(id uint32)

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

func (*AgentMutation) SetIntIP

func (m *AgentMutation) SetIntIP(t types.Inet)

SetIntIP sets the "int_ip" field.

func (*AgentMutation) SetJitter

func (m *AgentMutation) SetJitter(u uint8)

SetJitter sets the "jitter" field.

func (*AgentMutation) SetLast

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

SetLast sets the "last" field.

func (*AgentMutation) SetListenerID

func (m *AgentMutation) SetListenerID(i int64)

SetListenerID sets the "listener_id" field.

func (*AgentMutation) SetNote

func (m *AgentMutation) SetNote(s string)

SetNote sets the "note" field.

func (*AgentMutation) SetOp

func (m *AgentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentMutation) SetOs

func (m *AgentMutation) SetOs(so shared.AgentOs)

SetOs sets the "os" field.

func (*AgentMutation) SetOsMeta

func (m *AgentMutation) SetOsMeta(s string)

SetOsMeta sets the "os_meta" field.

func (*AgentMutation) SetPid

func (m *AgentMutation) SetPid(i int64)

SetPid sets the "pid" field.

func (*AgentMutation) SetPrivileged

func (m *AgentMutation) SetPrivileged(b bool)

SetPrivileged sets the "privileged" field.

func (*AgentMutation) SetProcessName

func (m *AgentMutation) SetProcessName(s string)

SetProcessName sets the "process_name" field.

func (*AgentMutation) SetSleep

func (m *AgentMutation) SetSleep(u uint32)

SetSleep sets the "sleep" field.

func (*AgentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AgentMutation) SetUsername

func (m *AgentMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*AgentMutation) Sleep

func (m *AgentMutation) Sleep() (r uint32, exists bool)

Sleep returns the value of the "sleep" field in the mutation.

func (*AgentMutation) TaskCleared

func (m *AgentMutation) TaskCleared() bool

TaskCleared reports if the "task" edge to the Task entity was cleared.

func (*AgentMutation) TaskIDs

func (m *AgentMutation) TaskIDs() (ids []int64)

TaskIDs returns the "task" 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) UpdatedAt

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

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

func (*AgentMutation) Username

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

Username returns the value of the "username" field in the mutation.

func (*AgentMutation) UsernameCleared

func (m *AgentMutation) UsernameCleared() bool

UsernameCleared returns if the "username" field was cleared in this mutation.

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 uint32, 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) uint32

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) ForShare

func (aq *AgentQuery) ForShare(opts ...sql.LockOption) *AgentQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*AgentQuery) ForUpdate

func (aq *AgentQuery) ForUpdate(opts ...sql.LockOption) *AgentQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

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

func (*AgentQuery) IDs

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

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

func (*AgentQuery) IDsX

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

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 uint32, 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) uint32

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) QueryCommand

func (aq *AgentQuery) QueryCommand() *CommandQuery

QueryCommand chains the current query on the "command" edge.

func (*AgentQuery) QueryListener

func (aq *AgentQuery) QueryListener() *ListenerQuery

QueryListener chains the current query on the "listener" edge.

func (*AgentQuery) QueryTask

func (aq *AgentQuery) QueryTask() *TaskQuery

QueryTask chains the current query on the "task" 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Agent.Query().
	Select(agent.FieldCreatedAt).
	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) WithCommand

func (aq *AgentQuery) WithCommand(opts ...func(*CommandQuery)) *AgentQuery

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

func (*AgentQuery) WithListener

func (aq *AgentQuery) WithListener(opts ...func(*ListenerQuery)) *AgentQuery

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

func (*AgentQuery) WithTask

func (aq *AgentQuery) WithTask(opts ...func(*TaskQuery)) *AgentQuery

WithTask tells the query-builder to eager-load the nodes that are connected to the "task" 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) AddCaps

func (au *AgentUpdate) AddCaps(u int32) *AgentUpdate

AddCaps adds u to the "caps" field.

func (*AgentUpdate) AddColor

func (au *AgentUpdate) AddColor(u int32) *AgentUpdate

AddColor adds u to the "color" field.

func (*AgentUpdate) AddCommand

func (au *AgentUpdate) AddCommand(c ...*Command) *AgentUpdate

AddCommand adds the "command" edges to the Command entity.

func (*AgentUpdate) AddCommandIDs

func (au *AgentUpdate) AddCommandIDs(ids ...int64) *AgentUpdate

AddCommandIDs adds the "command" edge to the Command entity by IDs.

func (*AgentUpdate) AddJitter

func (au *AgentUpdate) AddJitter(u int8) *AgentUpdate

AddJitter adds u to the "jitter" field.

func (*AgentUpdate) AddPid

func (au *AgentUpdate) AddPid(i int64) *AgentUpdate

AddPid adds i to the "pid" field.

func (*AgentUpdate) AddSleep

func (au *AgentUpdate) AddSleep(u int32) *AgentUpdate

AddSleep adds u to the "sleep" field.

func (*AgentUpdate) AddTask

func (au *AgentUpdate) AddTask(t ...*Task) *AgentUpdate

AddTask adds the "task" edges to the Task entity.

func (*AgentUpdate) AddTaskIDs

func (au *AgentUpdate) AddTaskIDs(ids ...int64) *AgentUpdate

AddTaskIDs adds the "task" edge to the Task entity by IDs.

func (*AgentUpdate) ClearCommand

func (au *AgentUpdate) ClearCommand() *AgentUpdate

ClearCommand clears all "command" edges to the Command entity.

func (*AgentUpdate) ClearDeletedAt

func (au *AgentUpdate) ClearDeletedAt() *AgentUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AgentUpdate) ClearDomain

func (au *AgentUpdate) ClearDomain() *AgentUpdate

ClearDomain clears the value of the "domain" field.

func (*AgentUpdate) ClearExtIP

func (au *AgentUpdate) ClearExtIP() *AgentUpdate

ClearExtIP clears the value of the "ext_ip" field.

func (*AgentUpdate) ClearHostname

func (au *AgentUpdate) ClearHostname() *AgentUpdate

ClearHostname clears the value of the "hostname" field.

func (*AgentUpdate) ClearIntIP

func (au *AgentUpdate) ClearIntIP() *AgentUpdate

ClearIntIP clears the value of the "int_ip" field.

func (*AgentUpdate) ClearListener

func (au *AgentUpdate) ClearListener() *AgentUpdate

ClearListener clears the "listener" edge to the Listener entity.

func (*AgentUpdate) ClearNote

func (au *AgentUpdate) ClearNote() *AgentUpdate

ClearNote clears the value of the "note" field.

func (*AgentUpdate) ClearOsMeta

func (au *AgentUpdate) ClearOsMeta() *AgentUpdate

ClearOsMeta clears the value of the "os_meta" field.

func (*AgentUpdate) ClearPid

func (au *AgentUpdate) ClearPid() *AgentUpdate

ClearPid clears the value of the "pid" field.

func (*AgentUpdate) ClearPrivileged

func (au *AgentUpdate) ClearPrivileged() *AgentUpdate

ClearPrivileged clears the value of the "privileged" field.

func (*AgentUpdate) ClearProcessName

func (au *AgentUpdate) ClearProcessName() *AgentUpdate

ClearProcessName clears the value of the "process_name" field.

func (*AgentUpdate) ClearTask

func (au *AgentUpdate) ClearTask() *AgentUpdate

ClearTask clears all "task" edges to the Task entity.

func (*AgentUpdate) ClearUsername

func (au *AgentUpdate) ClearUsername() *AgentUpdate

ClearUsername clears the value of the "username" field.

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) RemoveCommand

func (au *AgentUpdate) RemoveCommand(c ...*Command) *AgentUpdate

RemoveCommand removes "command" edges to Command entities.

func (*AgentUpdate) RemoveCommandIDs

func (au *AgentUpdate) RemoveCommandIDs(ids ...int64) *AgentUpdate

RemoveCommandIDs removes the "command" edge to Command entities by IDs.

func (*AgentUpdate) RemoveTask

func (au *AgentUpdate) RemoveTask(t ...*Task) *AgentUpdate

RemoveTask removes "task" edges to Task entities.

func (*AgentUpdate) RemoveTaskIDs

func (au *AgentUpdate) RemoveTaskIDs(ids ...int64) *AgentUpdate

RemoveTaskIDs removes the "task" edge to Task entities by IDs.

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) SetArch

func (au *AgentUpdate) SetArch(sa shared.AgentArch) *AgentUpdate

SetArch sets the "arch" field.

func (*AgentUpdate) SetCaps

func (au *AgentUpdate) SetCaps(u uint32) *AgentUpdate

SetCaps sets the "caps" field.

func (*AgentUpdate) SetColor

func (au *AgentUpdate) SetColor(u uint32) *AgentUpdate

SetColor sets the "color" field.

func (*AgentUpdate) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AgentUpdate) SetDomain

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

SetDomain sets the "domain" field.

func (*AgentUpdate) SetExtIP

func (au *AgentUpdate) SetExtIP(t types.Inet) *AgentUpdate

SetExtIP sets the "ext_ip" field.

func (*AgentUpdate) SetFirst

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

SetFirst sets the "first" field.

func (*AgentUpdate) SetHostname

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

SetHostname sets the "hostname" field.

func (*AgentUpdate) SetIntIP

func (au *AgentUpdate) SetIntIP(t types.Inet) *AgentUpdate

SetIntIP sets the "int_ip" field.

func (*AgentUpdate) SetJitter

func (au *AgentUpdate) SetJitter(u uint8) *AgentUpdate

SetJitter sets the "jitter" field.

func (*AgentUpdate) SetLast

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

SetLast sets the "last" field.

func (*AgentUpdate) SetListener

func (au *AgentUpdate) SetListener(l *Listener) *AgentUpdate

SetListener sets the "listener" edge to the Listener entity.

func (*AgentUpdate) SetListenerID

func (au *AgentUpdate) SetListenerID(i int64) *AgentUpdate

SetListenerID sets the "listener_id" field.

func (*AgentUpdate) SetNillableArch

func (au *AgentUpdate) SetNillableArch(sa *shared.AgentArch) *AgentUpdate

SetNillableArch sets the "arch" field if the given value is not nil.

func (*AgentUpdate) SetNillableCaps

func (au *AgentUpdate) SetNillableCaps(u *uint32) *AgentUpdate

SetNillableCaps sets the "caps" field if the given value is not nil.

func (*AgentUpdate) SetNillableColor

func (au *AgentUpdate) SetNillableColor(u *uint32) *AgentUpdate

SetNillableColor sets the "color" field if the given value is not nil.

func (*AgentUpdate) SetNillableDeletedAt

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

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*AgentUpdate) SetNillableDomain

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

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*AgentUpdate) SetNillableExtIP

func (au *AgentUpdate) SetNillableExtIP(t *types.Inet) *AgentUpdate

SetNillableExtIP sets the "ext_ip" field if the given value is not nil.

func (*AgentUpdate) SetNillableFirst

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

SetNillableFirst sets the "first" field if the given value is not nil.

func (*AgentUpdate) SetNillableHostname

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

SetNillableHostname sets the "hostname" field if the given value is not nil.

func (*AgentUpdate) SetNillableIntIP

func (au *AgentUpdate) SetNillableIntIP(t *types.Inet) *AgentUpdate

SetNillableIntIP sets the "int_ip" field if the given value is not nil.

func (*AgentUpdate) SetNillableJitter

func (au *AgentUpdate) SetNillableJitter(u *uint8) *AgentUpdate

SetNillableJitter sets the "jitter" field if the given value is not nil.

func (*AgentUpdate) SetNillableLast

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

SetNillableLast sets the "last" field if the given value is not nil.

func (*AgentUpdate) SetNillableListenerID

func (au *AgentUpdate) SetNillableListenerID(i *int64) *AgentUpdate

SetNillableListenerID sets the "listener_id" field if the given value is not nil.

func (*AgentUpdate) SetNillableNote

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

SetNillableNote sets the "note" field if the given value is not nil.

func (*AgentUpdate) SetNillableOs

func (au *AgentUpdate) SetNillableOs(so *shared.AgentOs) *AgentUpdate

SetNillableOs sets the "os" field if the given value is not nil.

func (*AgentUpdate) SetNillableOsMeta

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

SetNillableOsMeta sets the "os_meta" field if the given value is not nil.

func (*AgentUpdate) SetNillablePid

func (au *AgentUpdate) SetNillablePid(i *int64) *AgentUpdate

SetNillablePid sets the "pid" field if the given value is not nil.

func (*AgentUpdate) SetNillablePrivileged

func (au *AgentUpdate) SetNillablePrivileged(b *bool) *AgentUpdate

SetNillablePrivileged sets the "privileged" field if the given value is not nil.

func (*AgentUpdate) SetNillableProcessName

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

SetNillableProcessName sets the "process_name" field if the given value is not nil.

func (*AgentUpdate) SetNillableSleep

func (au *AgentUpdate) SetNillableSleep(u *uint32) *AgentUpdate

SetNillableSleep sets the "sleep" field if the given value is not nil.

func (*AgentUpdate) SetNillableUsername

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

SetNillableUsername sets the "username" field if the given value is not nil.

func (*AgentUpdate) SetNote

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

SetNote sets the "note" field.

func (*AgentUpdate) SetOs

func (au *AgentUpdate) SetOs(so shared.AgentOs) *AgentUpdate

SetOs sets the "os" field.

func (*AgentUpdate) SetOsMeta

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

SetOsMeta sets the "os_meta" field.

func (*AgentUpdate) SetPid

func (au *AgentUpdate) SetPid(i int64) *AgentUpdate

SetPid sets the "pid" field.

func (*AgentUpdate) SetPrivileged

func (au *AgentUpdate) SetPrivileged(b bool) *AgentUpdate

SetPrivileged sets the "privileged" field.

func (*AgentUpdate) SetProcessName

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

SetProcessName sets the "process_name" field.

func (*AgentUpdate) SetSleep

func (au *AgentUpdate) SetSleep(u uint32) *AgentUpdate

SetSleep sets the "sleep" field.

func (*AgentUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AgentUpdate) SetUsername

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

SetUsername sets the "username" field.

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) AddCaps

func (auo *AgentUpdateOne) AddCaps(u int32) *AgentUpdateOne

AddCaps adds u to the "caps" field.

func (*AgentUpdateOne) AddColor

func (auo *AgentUpdateOne) AddColor(u int32) *AgentUpdateOne

AddColor adds u to the "color" field.

func (*AgentUpdateOne) AddCommand

func (auo *AgentUpdateOne) AddCommand(c ...*Command) *AgentUpdateOne

AddCommand adds the "command" edges to the Command entity.

func (*AgentUpdateOne) AddCommandIDs

func (auo *AgentUpdateOne) AddCommandIDs(ids ...int64) *AgentUpdateOne

AddCommandIDs adds the "command" edge to the Command entity by IDs.

func (*AgentUpdateOne) AddJitter

func (auo *AgentUpdateOne) AddJitter(u int8) *AgentUpdateOne

AddJitter adds u to the "jitter" field.

func (*AgentUpdateOne) AddPid

func (auo *AgentUpdateOne) AddPid(i int64) *AgentUpdateOne

AddPid adds i to the "pid" field.

func (*AgentUpdateOne) AddSleep

func (auo *AgentUpdateOne) AddSleep(u int32) *AgentUpdateOne

AddSleep adds u to the "sleep" field.

func (*AgentUpdateOne) AddTask

func (auo *AgentUpdateOne) AddTask(t ...*Task) *AgentUpdateOne

AddTask adds the "task" edges to the Task entity.

func (*AgentUpdateOne) AddTaskIDs

func (auo *AgentUpdateOne) AddTaskIDs(ids ...int64) *AgentUpdateOne

AddTaskIDs adds the "task" edge to the Task entity by IDs.

func (*AgentUpdateOne) ClearCommand

func (auo *AgentUpdateOne) ClearCommand() *AgentUpdateOne

ClearCommand clears all "command" edges to the Command entity.

func (*AgentUpdateOne) ClearDeletedAt

func (auo *AgentUpdateOne) ClearDeletedAt() *AgentUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AgentUpdateOne) ClearDomain

func (auo *AgentUpdateOne) ClearDomain() *AgentUpdateOne

ClearDomain clears the value of the "domain" field.

func (*AgentUpdateOne) ClearExtIP

func (auo *AgentUpdateOne) ClearExtIP() *AgentUpdateOne

ClearExtIP clears the value of the "ext_ip" field.

func (*AgentUpdateOne) ClearHostname

func (auo *AgentUpdateOne) ClearHostname() *AgentUpdateOne

ClearHostname clears the value of the "hostname" field.

func (*AgentUpdateOne) ClearIntIP

func (auo *AgentUpdateOne) ClearIntIP() *AgentUpdateOne

ClearIntIP clears the value of the "int_ip" field.

func (*AgentUpdateOne) ClearListener

func (auo *AgentUpdateOne) ClearListener() *AgentUpdateOne

ClearListener clears the "listener" edge to the Listener entity.

func (*AgentUpdateOne) ClearNote

func (auo *AgentUpdateOne) ClearNote() *AgentUpdateOne

ClearNote clears the value of the "note" field.

func (*AgentUpdateOne) ClearOsMeta

func (auo *AgentUpdateOne) ClearOsMeta() *AgentUpdateOne

ClearOsMeta clears the value of the "os_meta" field.

func (*AgentUpdateOne) ClearPid

func (auo *AgentUpdateOne) ClearPid() *AgentUpdateOne

ClearPid clears the value of the "pid" field.

func (*AgentUpdateOne) ClearPrivileged

func (auo *AgentUpdateOne) ClearPrivileged() *AgentUpdateOne

ClearPrivileged clears the value of the "privileged" field.

func (*AgentUpdateOne) ClearProcessName

func (auo *AgentUpdateOne) ClearProcessName() *AgentUpdateOne

ClearProcessName clears the value of the "process_name" field.

func (*AgentUpdateOne) ClearTask

func (auo *AgentUpdateOne) ClearTask() *AgentUpdateOne

ClearTask clears all "task" edges to the Task entity.

func (*AgentUpdateOne) ClearUsername

func (auo *AgentUpdateOne) ClearUsername() *AgentUpdateOne

ClearUsername clears the value of the "username" field.

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) RemoveCommand

func (auo *AgentUpdateOne) RemoveCommand(c ...*Command) *AgentUpdateOne

RemoveCommand removes "command" edges to Command entities.

func (*AgentUpdateOne) RemoveCommandIDs

func (auo *AgentUpdateOne) RemoveCommandIDs(ids ...int64) *AgentUpdateOne

RemoveCommandIDs removes the "command" edge to Command entities by IDs.

func (*AgentUpdateOne) RemoveTask

func (auo *AgentUpdateOne) RemoveTask(t ...*Task) *AgentUpdateOne

RemoveTask removes "task" edges to Task entities.

func (*AgentUpdateOne) RemoveTaskIDs

func (auo *AgentUpdateOne) RemoveTaskIDs(ids ...int64) *AgentUpdateOne

RemoveTaskIDs removes the "task" edge to Task entities by IDs.

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) SetArch

func (auo *AgentUpdateOne) SetArch(sa shared.AgentArch) *AgentUpdateOne

SetArch sets the "arch" field.

func (*AgentUpdateOne) SetCaps

func (auo *AgentUpdateOne) SetCaps(u uint32) *AgentUpdateOne

SetCaps sets the "caps" field.

func (*AgentUpdateOne) SetColor

func (auo *AgentUpdateOne) SetColor(u uint32) *AgentUpdateOne

SetColor sets the "color" field.

func (*AgentUpdateOne) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AgentUpdateOne) SetDomain

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

SetDomain sets the "domain" field.

func (*AgentUpdateOne) SetExtIP

func (auo *AgentUpdateOne) SetExtIP(t types.Inet) *AgentUpdateOne

SetExtIP sets the "ext_ip" field.

func (*AgentUpdateOne) SetFirst

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

SetFirst sets the "first" field.

func (*AgentUpdateOne) SetHostname

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

SetHostname sets the "hostname" field.

func (*AgentUpdateOne) SetIntIP

func (auo *AgentUpdateOne) SetIntIP(t types.Inet) *AgentUpdateOne

SetIntIP sets the "int_ip" field.

func (*AgentUpdateOne) SetJitter

func (auo *AgentUpdateOne) SetJitter(u uint8) *AgentUpdateOne

SetJitter sets the "jitter" field.

func (*AgentUpdateOne) SetLast

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

SetLast sets the "last" field.

func (*AgentUpdateOne) SetListener

func (auo *AgentUpdateOne) SetListener(l *Listener) *AgentUpdateOne

SetListener sets the "listener" edge to the Listener entity.

func (*AgentUpdateOne) SetListenerID

func (auo *AgentUpdateOne) SetListenerID(i int64) *AgentUpdateOne

SetListenerID sets the "listener_id" field.

func (*AgentUpdateOne) SetNillableArch

func (auo *AgentUpdateOne) SetNillableArch(sa *shared.AgentArch) *AgentUpdateOne

SetNillableArch sets the "arch" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableCaps

func (auo *AgentUpdateOne) SetNillableCaps(u *uint32) *AgentUpdateOne

SetNillableCaps sets the "caps" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableColor

func (auo *AgentUpdateOne) SetNillableColor(u *uint32) *AgentUpdateOne

SetNillableColor sets the "color" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableDeletedAt

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

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableDomain

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

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableExtIP

func (auo *AgentUpdateOne) SetNillableExtIP(t *types.Inet) *AgentUpdateOne

SetNillableExtIP sets the "ext_ip" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableFirst

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

SetNillableFirst sets the "first" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableHostname

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

SetNillableHostname sets the "hostname" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableIntIP

func (auo *AgentUpdateOne) SetNillableIntIP(t *types.Inet) *AgentUpdateOne

SetNillableIntIP sets the "int_ip" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableJitter

func (auo *AgentUpdateOne) SetNillableJitter(u *uint8) *AgentUpdateOne

SetNillableJitter sets the "jitter" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableLast

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

SetNillableLast sets the "last" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableListenerID

func (auo *AgentUpdateOne) SetNillableListenerID(i *int64) *AgentUpdateOne

SetNillableListenerID sets the "listener_id" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableNote

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

SetNillableNote sets the "note" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableOs

func (auo *AgentUpdateOne) SetNillableOs(so *shared.AgentOs) *AgentUpdateOne

SetNillableOs sets the "os" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableOsMeta

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

SetNillableOsMeta sets the "os_meta" field if the given value is not nil.

func (*AgentUpdateOne) SetNillablePid

func (auo *AgentUpdateOne) SetNillablePid(i *int64) *AgentUpdateOne

SetNillablePid sets the "pid" field if the given value is not nil.

func (*AgentUpdateOne) SetNillablePrivileged

func (auo *AgentUpdateOne) SetNillablePrivileged(b *bool) *AgentUpdateOne

SetNillablePrivileged sets the "privileged" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableProcessName

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

SetNillableProcessName sets the "process_name" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableSleep

func (auo *AgentUpdateOne) SetNillableSleep(u *uint32) *AgentUpdateOne

SetNillableSleep sets the "sleep" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableUsername

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

SetNillableUsername sets the "username" field if the given value is not nil.

func (*AgentUpdateOne) SetNote

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

SetNote sets the "note" field.

func (*AgentUpdateOne) SetOs

func (auo *AgentUpdateOne) SetOs(so shared.AgentOs) *AgentUpdateOne

SetOs sets the "os" field.

func (*AgentUpdateOne) SetOsMeta

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

SetOsMeta sets the "os_meta" field.

func (*AgentUpdateOne) SetPid

func (auo *AgentUpdateOne) SetPid(i int64) *AgentUpdateOne

SetPid sets the "pid" field.

func (*AgentUpdateOne) SetPrivileged

func (auo *AgentUpdateOne) SetPrivileged(b bool) *AgentUpdateOne

SetPrivileged sets the "privileged" field.

func (*AgentUpdateOne) SetProcessName

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

SetProcessName sets the "process_name" field.

func (*AgentUpdateOne) SetSleep

func (auo *AgentUpdateOne) SetSleep(u uint32) *AgentUpdateOne

SetSleep sets the "sleep" field.

func (*AgentUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AgentUpdateOne) SetUsername

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

SetUsername sets the "username" field.

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 Blobber

type Blobber struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Time when entity was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Time when entity was updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Time when entity was soft-deleted
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// non-cryptographic hash of blob
	Hash []byte `json:"hash,omitempty"`
	// blob to store
	Blob []byte `json:"blob,omitempty"`
	// real size of blob
	Size int `json:"size,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BlobberQuery when eager-loading is set.
	Edges BlobberEdges `json:"edges"`
	// contains filtered or unexported fields
}

Blobber is the model entity for the Blobber schema.

func (*Blobber) QueryTaskArgs

func (b *Blobber) QueryTaskArgs() *TaskQuery

QueryTaskArgs queries the "task_args" edge of the Blobber entity.

func (*Blobber) QueryTaskOutput

func (b *Blobber) QueryTaskOutput() *TaskQuery

QueryTaskOutput queries the "task_output" edge of the Blobber entity.

func (*Blobber) String

func (b *Blobber) String() string

String implements the fmt.Stringer.

func (*Blobber) Unwrap

func (b *Blobber) Unwrap() *Blobber

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

func (b *Blobber) Update() *BlobberUpdateOne

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

func (*Blobber) Value

func (b *Blobber) Value(name string) (ent.Value, error)

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

type BlobberClient

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

BlobberClient is a client for the Blobber schema.

func NewBlobberClient

func NewBlobberClient(c config) *BlobberClient

NewBlobberClient returns a client for the Blobber from the given config.

func (*BlobberClient) Create

func (c *BlobberClient) Create() *BlobberCreate

Create returns a builder for creating a Blobber entity.

func (*BlobberClient) CreateBulk

func (c *BlobberClient) CreateBulk(builders ...*BlobberCreate) *BlobberCreateBulk

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

func (*BlobberClient) Delete

func (c *BlobberClient) Delete() *BlobberDelete

Delete returns a delete builder for Blobber.

func (*BlobberClient) DeleteOne

func (c *BlobberClient) DeleteOne(b *Blobber) *BlobberDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BlobberClient) DeleteOneID

func (c *BlobberClient) DeleteOneID(id int) *BlobberDeleteOne

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

func (*BlobberClient) Get

func (c *BlobberClient) Get(ctx context.Context, id int) (*Blobber, error)

Get returns a Blobber entity by its id.

func (*BlobberClient) GetX

func (c *BlobberClient) GetX(ctx context.Context, id int) *Blobber

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

func (*BlobberClient) Hooks

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

Hooks returns the client hooks.

func (*BlobberClient) Intercept

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

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

func (*BlobberClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BlobberClient) MapCreateBulk

func (c *BlobberClient) MapCreateBulk(slice any, setFunc func(*BlobberCreate, int)) *BlobberCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*BlobberClient) Query

func (c *BlobberClient) Query() *BlobberQuery

Query returns a query builder for Blobber.

func (*BlobberClient) QueryTaskArgs

func (c *BlobberClient) QueryTaskArgs(b *Blobber) *TaskQuery

QueryTaskArgs queries the task_args edge of a Blobber.

func (*BlobberClient) QueryTaskOutput

func (c *BlobberClient) QueryTaskOutput(b *Blobber) *TaskQuery

QueryTaskOutput queries the task_output edge of a Blobber.

func (*BlobberClient) Update

func (c *BlobberClient) Update() *BlobberUpdate

Update returns an update builder for Blobber.

func (*BlobberClient) UpdateOne

func (c *BlobberClient) UpdateOne(b *Blobber) *BlobberUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BlobberClient) UpdateOneID

func (c *BlobberClient) UpdateOneID(id int) *BlobberUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BlobberClient) Use

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

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

type BlobberCreate

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

BlobberCreate is the builder for creating a Blobber entity.

func (*BlobberCreate) AddTaskArgIDs

func (bc *BlobberCreate) AddTaskArgIDs(ids ...int64) *BlobberCreate

AddTaskArgIDs adds the "task_args" edge to the Task entity by IDs.

func (*BlobberCreate) AddTaskArgs

func (bc *BlobberCreate) AddTaskArgs(t ...*Task) *BlobberCreate

AddTaskArgs adds the "task_args" edges to the Task entity.

func (*BlobberCreate) AddTaskOutput

func (bc *BlobberCreate) AddTaskOutput(t ...*Task) *BlobberCreate

AddTaskOutput adds the "task_output" edges to the Task entity.

func (*BlobberCreate) AddTaskOutputIDs

func (bc *BlobberCreate) AddTaskOutputIDs(ids ...int64) *BlobberCreate

AddTaskOutputIDs adds the "task_output" edge to the Task entity by IDs.

func (*BlobberCreate) Exec

func (bc *BlobberCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlobberCreate) ExecX

func (bc *BlobberCreate) ExecX(ctx context.Context)

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

func (*BlobberCreate) Mutation

func (bc *BlobberCreate) Mutation() *BlobberMutation

Mutation returns the BlobberMutation object of the builder.

func (*BlobberCreate) Save

func (bc *BlobberCreate) Save(ctx context.Context) (*Blobber, error)

Save creates the Blobber in the database.

func (*BlobberCreate) SaveX

func (bc *BlobberCreate) SaveX(ctx context.Context) *Blobber

SaveX calls Save and panics if Save returns an error.

func (*BlobberCreate) SetBlob

func (bc *BlobberCreate) SetBlob(b []byte) *BlobberCreate

SetBlob sets the "blob" field.

func (*BlobberCreate) SetCreatedAt

func (bc *BlobberCreate) SetCreatedAt(t time.Time) *BlobberCreate

SetCreatedAt sets the "created_at" field.

func (*BlobberCreate) SetDeletedAt

func (bc *BlobberCreate) SetDeletedAt(t time.Time) *BlobberCreate

SetDeletedAt sets the "deleted_at" field.

func (*BlobberCreate) SetHash

func (bc *BlobberCreate) SetHash(b []byte) *BlobberCreate

SetHash sets the "hash" field.

func (*BlobberCreate) SetNillableCreatedAt

func (bc *BlobberCreate) SetNillableCreatedAt(t *time.Time) *BlobberCreate

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

func (*BlobberCreate) SetNillableDeletedAt

func (bc *BlobberCreate) SetNillableDeletedAt(t *time.Time) *BlobberCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BlobberCreate) SetNillableUpdatedAt

func (bc *BlobberCreate) SetNillableUpdatedAt(t *time.Time) *BlobberCreate

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

func (*BlobberCreate) SetSize

func (bc *BlobberCreate) SetSize(i int) *BlobberCreate

SetSize sets the "size" field.

func (*BlobberCreate) SetUpdatedAt

func (bc *BlobberCreate) SetUpdatedAt(t time.Time) *BlobberCreate

SetUpdatedAt sets the "updated_at" field.

type BlobberCreateBulk

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

BlobberCreateBulk is the builder for creating many Blobber entities in bulk.

func (*BlobberCreateBulk) Exec

func (bcb *BlobberCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BlobberCreateBulk) ExecX

func (bcb *BlobberCreateBulk) ExecX(ctx context.Context)

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

func (*BlobberCreateBulk) Save

func (bcb *BlobberCreateBulk) Save(ctx context.Context) ([]*Blobber, error)

Save creates the Blobber entities in the database.

func (*BlobberCreateBulk) SaveX

func (bcb *BlobberCreateBulk) SaveX(ctx context.Context) []*Blobber

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

type BlobberDelete

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

BlobberDelete is the builder for deleting a Blobber entity.

func (*BlobberDelete) Exec

func (bd *BlobberDelete) Exec(ctx context.Context) (int, error)

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

func (*BlobberDelete) ExecX

func (bd *BlobberDelete) ExecX(ctx context.Context) int

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

func (*BlobberDelete) Where

func (bd *BlobberDelete) Where(ps ...predicate.Blobber) *BlobberDelete

Where appends a list predicates to the BlobberDelete builder.

type BlobberDeleteOne

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

BlobberDeleteOne is the builder for deleting a single Blobber entity.

func (*BlobberDeleteOne) Exec

func (bdo *BlobberDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BlobberDeleteOne) ExecX

func (bdo *BlobberDeleteOne) ExecX(ctx context.Context)

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

func (*BlobberDeleteOne) Where

Where appends a list predicates to the BlobberDelete builder.

type BlobberEdges

type BlobberEdges struct {
	// TaskArgs holds the value of the task_args edge.
	TaskArgs []*Task `json:"task_args,omitempty"`
	// TaskOutput holds the value of the task_output edge.
	TaskOutput []*Task `json:"task_output,omitempty"`
	// contains filtered or unexported fields
}

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

func (BlobberEdges) TaskArgsOrErr

func (e BlobberEdges) TaskArgsOrErr() ([]*Task, error)

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

func (BlobberEdges) TaskOutputOrErr

func (e BlobberEdges) TaskOutputOrErr() ([]*Task, error)

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

type BlobberGroupBy

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

BlobberGroupBy is the group-by builder for Blobber entities.

func (*BlobberGroupBy) Aggregate

func (bgb *BlobberGroupBy) Aggregate(fns ...AggregateFunc) *BlobberGroupBy

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

func (*BlobberGroupBy) Bool

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

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

func (*BlobberGroupBy) BoolX

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

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

func (*BlobberGroupBy) Bools

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

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

func (*BlobberGroupBy) BoolsX

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

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

func (*BlobberGroupBy) Float64

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

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

func (*BlobberGroupBy) Float64X

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

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

func (*BlobberGroupBy) Float64s

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

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

func (*BlobberGroupBy) Float64sX

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

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

func (*BlobberGroupBy) Int

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

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

func (*BlobberGroupBy) IntX

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

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

func (*BlobberGroupBy) Ints

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

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

func (*BlobberGroupBy) IntsX

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

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

func (*BlobberGroupBy) Scan

func (bgb *BlobberGroupBy) Scan(ctx context.Context, v any) error

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

func (*BlobberGroupBy) ScanX

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

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

func (*BlobberGroupBy) String

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

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

func (*BlobberGroupBy) StringX

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

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

func (*BlobberGroupBy) Strings

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

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

func (*BlobberGroupBy) StringsX

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

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

type BlobberMutation

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

BlobberMutation represents an operation that mutates the Blobber nodes in the graph.

func (*BlobberMutation) AddField

func (m *BlobberMutation) 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 (*BlobberMutation) AddSize

func (m *BlobberMutation) AddSize(i int)

AddSize adds i to the "size" field.

func (*BlobberMutation) AddTaskArgIDs

func (m *BlobberMutation) AddTaskArgIDs(ids ...int64)

AddTaskArgIDs adds the "task_args" edge to the Task entity by ids.

func (*BlobberMutation) AddTaskOutputIDs

func (m *BlobberMutation) AddTaskOutputIDs(ids ...int64)

AddTaskOutputIDs adds the "task_output" edge to the Task entity by ids.

func (*BlobberMutation) AddedEdges

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

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

func (*BlobberMutation) AddedField

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

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

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

func (*BlobberMutation) AddedIDs

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

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

func (*BlobberMutation) AddedSize

func (m *BlobberMutation) AddedSize() (r int, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*BlobberMutation) Blob

func (m *BlobberMutation) Blob() (r []byte, exists bool)

Blob returns the value of the "blob" field in the mutation.

func (*BlobberMutation) ClearDeletedAt

func (m *BlobberMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BlobberMutation) ClearEdge

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

func (m *BlobberMutation) 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 (*BlobberMutation) ClearTaskArgs

func (m *BlobberMutation) ClearTaskArgs()

ClearTaskArgs clears the "task_args" edge to the Task entity.

func (*BlobberMutation) ClearTaskOutput

func (m *BlobberMutation) ClearTaskOutput()

ClearTaskOutput clears the "task_output" edge to the Task entity.

func (*BlobberMutation) ClearedEdges

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

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

func (*BlobberMutation) ClearedFields

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

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

func (BlobberMutation) Client

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

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

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

func (*BlobberMutation) DeletedAt

func (m *BlobberMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*BlobberMutation) DeletedAtCleared

func (m *BlobberMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*BlobberMutation) EdgeCleared

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

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

func (*BlobberMutation) Field

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

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

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

func (*BlobberMutation) Fields

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

func (m *BlobberMutation) Hash() (r []byte, exists bool)

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

func (*BlobberMutation) ID

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

func (m *BlobberMutation) 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 (*BlobberMutation) OldBlob

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

OldBlob returns the old "blob" field's value of the Blobber entity. If the Blobber 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 (*BlobberMutation) OldCreatedAt

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

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

func (m *BlobberMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Blobber entity. If the Blobber 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 (*BlobberMutation) OldField

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

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

OldHash returns the old "hash" field's value of the Blobber entity. If the Blobber 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 (*BlobberMutation) OldSize

func (m *BlobberMutation) OldSize(ctx context.Context) (v int, err error)

OldSize returns the old "size" field's value of the Blobber entity. If the Blobber 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 (*BlobberMutation) OldUpdatedAt

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

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

func (m *BlobberMutation) Op() Op

Op returns the operation name.

func (*BlobberMutation) RemoveTaskArgIDs

func (m *BlobberMutation) RemoveTaskArgIDs(ids ...int64)

RemoveTaskArgIDs removes the "task_args" edge to the Task entity by IDs.

func (*BlobberMutation) RemoveTaskOutputIDs

func (m *BlobberMutation) RemoveTaskOutputIDs(ids ...int64)

RemoveTaskOutputIDs removes the "task_output" edge to the Task entity by IDs.

func (*BlobberMutation) RemovedEdges

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

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

func (*BlobberMutation) RemovedIDs

func (m *BlobberMutation) 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 (*BlobberMutation) RemovedTaskArgsIDs

func (m *BlobberMutation) RemovedTaskArgsIDs() (ids []int64)

RemovedTaskArgs returns the removed IDs of the "task_args" edge to the Task entity.

func (*BlobberMutation) RemovedTaskOutputIDs

func (m *BlobberMutation) RemovedTaskOutputIDs() (ids []int64)

RemovedTaskOutput returns the removed IDs of the "task_output" edge to the Task entity.

func (*BlobberMutation) ResetBlob

func (m *BlobberMutation) ResetBlob()

ResetBlob resets all changes to the "blob" field.

func (*BlobberMutation) ResetCreatedAt

func (m *BlobberMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BlobberMutation) ResetDeletedAt

func (m *BlobberMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*BlobberMutation) ResetEdge

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

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

func (m *BlobberMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*BlobberMutation) ResetSize

func (m *BlobberMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*BlobberMutation) ResetTaskArgs

func (m *BlobberMutation) ResetTaskArgs()

ResetTaskArgs resets all changes to the "task_args" edge.

func (*BlobberMutation) ResetTaskOutput

func (m *BlobberMutation) ResetTaskOutput()

ResetTaskOutput resets all changes to the "task_output" edge.

func (*BlobberMutation) ResetUpdatedAt

func (m *BlobberMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BlobberMutation) SetBlob

func (m *BlobberMutation) SetBlob(b []byte)

SetBlob sets the "blob" field.

func (*BlobberMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BlobberMutation) SetDeletedAt

func (m *BlobberMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*BlobberMutation) SetField

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

func (m *BlobberMutation) SetHash(b []byte)

SetHash sets the "hash" field.

func (*BlobberMutation) SetOp

func (m *BlobberMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BlobberMutation) SetSize

func (m *BlobberMutation) SetSize(i int)

SetSize sets the "size" field.

func (*BlobberMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BlobberMutation) Size

func (m *BlobberMutation) Size() (r int, exists bool)

Size returns the value of the "size" field in the mutation.

func (*BlobberMutation) TaskArgsCleared

func (m *BlobberMutation) TaskArgsCleared() bool

TaskArgsCleared reports if the "task_args" edge to the Task entity was cleared.

func (*BlobberMutation) TaskArgsIDs

func (m *BlobberMutation) TaskArgsIDs() (ids []int64)

TaskArgsIDs returns the "task_args" edge IDs in the mutation.

func (*BlobberMutation) TaskOutputCleared

func (m *BlobberMutation) TaskOutputCleared() bool

TaskOutputCleared reports if the "task_output" edge to the Task entity was cleared.

func (*BlobberMutation) TaskOutputIDs

func (m *BlobberMutation) TaskOutputIDs() (ids []int64)

TaskOutputIDs returns the "task_output" edge IDs in the mutation.

func (BlobberMutation) Tx

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

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

func (*BlobberMutation) Type

func (m *BlobberMutation) Type() string

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

func (*BlobberMutation) UpdatedAt

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

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

func (*BlobberMutation) Where

func (m *BlobberMutation) Where(ps ...predicate.Blobber)

Where appends a list predicates to the BlobberMutation builder.

func (*BlobberMutation) WhereP

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

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

type BlobberQuery

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

BlobberQuery is the builder for querying Blobber entities.

func (*BlobberQuery) Aggregate

func (bq *BlobberQuery) Aggregate(fns ...AggregateFunc) *BlobberSelect

Aggregate returns a BlobberSelect configured with the given aggregations.

func (*BlobberQuery) All

func (bq *BlobberQuery) All(ctx context.Context) ([]*Blobber, error)

All executes the query and returns a list of Blobbers.

func (*BlobberQuery) AllX

func (bq *BlobberQuery) AllX(ctx context.Context) []*Blobber

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

func (*BlobberQuery) Clone

func (bq *BlobberQuery) Clone() *BlobberQuery

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

func (*BlobberQuery) Count

func (bq *BlobberQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BlobberQuery) CountX

func (bq *BlobberQuery) CountX(ctx context.Context) int

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

func (*BlobberQuery) Exist

func (bq *BlobberQuery) Exist(ctx context.Context) (bool, error)

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

func (*BlobberQuery) ExistX

func (bq *BlobberQuery) ExistX(ctx context.Context) bool

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

func (*BlobberQuery) First

func (bq *BlobberQuery) First(ctx context.Context) (*Blobber, error)

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

func (*BlobberQuery) FirstID

func (bq *BlobberQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BlobberQuery) FirstIDX

func (bq *BlobberQuery) FirstIDX(ctx context.Context) int

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

func (*BlobberQuery) FirstX

func (bq *BlobberQuery) FirstX(ctx context.Context) *Blobber

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

func (*BlobberQuery) ForShare

func (bq *BlobberQuery) ForShare(opts ...sql.LockOption) *BlobberQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*BlobberQuery) ForUpdate

func (bq *BlobberQuery) ForUpdate(opts ...sql.LockOption) *BlobberQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*BlobberQuery) GroupBy

func (bq *BlobberQuery) GroupBy(field string, fields ...string) *BlobberGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Blobber.Query().
	GroupBy(blobber.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BlobberQuery) IDs

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

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

func (*BlobberQuery) IDsX

func (bq *BlobberQuery) IDsX(ctx context.Context) []int

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

func (*BlobberQuery) Limit

func (bq *BlobberQuery) Limit(limit int) *BlobberQuery

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

func (*BlobberQuery) Offset

func (bq *BlobberQuery) Offset(offset int) *BlobberQuery

Offset to start from.

func (*BlobberQuery) Only

func (bq *BlobberQuery) Only(ctx context.Context) (*Blobber, error)

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

func (*BlobberQuery) OnlyID

func (bq *BlobberQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BlobberQuery) OnlyIDX

func (bq *BlobberQuery) OnlyIDX(ctx context.Context) int

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

func (*BlobberQuery) OnlyX

func (bq *BlobberQuery) OnlyX(ctx context.Context) *Blobber

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

func (*BlobberQuery) Order

func (bq *BlobberQuery) Order(o ...blobber.OrderOption) *BlobberQuery

Order specifies how the records should be ordered.

func (*BlobberQuery) QueryTaskArgs

func (bq *BlobberQuery) QueryTaskArgs() *TaskQuery

QueryTaskArgs chains the current query on the "task_args" edge.

func (*BlobberQuery) QueryTaskOutput

func (bq *BlobberQuery) QueryTaskOutput() *TaskQuery

QueryTaskOutput chains the current query on the "task_output" edge.

func (*BlobberQuery) Select

func (bq *BlobberQuery) Select(fields ...string) *BlobberSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Blobber.Query().
	Select(blobber.FieldCreatedAt).
	Scan(ctx, &v)

func (*BlobberQuery) Unique

func (bq *BlobberQuery) Unique(unique bool) *BlobberQuery

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

func (bq *BlobberQuery) Where(ps ...predicate.Blobber) *BlobberQuery

Where adds a new predicate for the BlobberQuery builder.

func (*BlobberQuery) WithTaskArgs

func (bq *BlobberQuery) WithTaskArgs(opts ...func(*TaskQuery)) *BlobberQuery

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

func (*BlobberQuery) WithTaskOutput

func (bq *BlobberQuery) WithTaskOutput(opts ...func(*TaskQuery)) *BlobberQuery

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

type BlobberSelect

type BlobberSelect struct {
	*BlobberQuery
	// contains filtered or unexported fields
}

BlobberSelect is the builder for selecting fields of Blobber entities.

func (*BlobberSelect) Aggregate

func (bs *BlobberSelect) Aggregate(fns ...AggregateFunc) *BlobberSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BlobberSelect) Bool

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

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

func (*BlobberSelect) BoolX

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

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

func (*BlobberSelect) Bools

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

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

func (*BlobberSelect) BoolsX

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

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

func (*BlobberSelect) Float64

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

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

func (*BlobberSelect) Float64X

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

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

func (*BlobberSelect) Float64s

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

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

func (*BlobberSelect) Float64sX

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

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

func (*BlobberSelect) Int

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

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

func (*BlobberSelect) IntX

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

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

func (*BlobberSelect) Ints

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

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

func (*BlobberSelect) IntsX

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

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

func (*BlobberSelect) Scan

func (bs *BlobberSelect) Scan(ctx context.Context, v any) error

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

func (*BlobberSelect) ScanX

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

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

func (*BlobberSelect) String

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

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

func (*BlobberSelect) StringX

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

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

func (*BlobberSelect) Strings

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

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

func (*BlobberSelect) StringsX

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

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

type BlobberUpdate

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

BlobberUpdate is the builder for updating Blobber entities.

func (*BlobberUpdate) AddSize

func (bu *BlobberUpdate) AddSize(i int) *BlobberUpdate

AddSize adds i to the "size" field.

func (*BlobberUpdate) AddTaskArgIDs

func (bu *BlobberUpdate) AddTaskArgIDs(ids ...int64) *BlobberUpdate

AddTaskArgIDs adds the "task_args" edge to the Task entity by IDs.

func (*BlobberUpdate) AddTaskArgs

func (bu *BlobberUpdate) AddTaskArgs(t ...*Task) *BlobberUpdate

AddTaskArgs adds the "task_args" edges to the Task entity.

func (*BlobberUpdate) AddTaskOutput

func (bu *BlobberUpdate) AddTaskOutput(t ...*Task) *BlobberUpdate

AddTaskOutput adds the "task_output" edges to the Task entity.

func (*BlobberUpdate) AddTaskOutputIDs

func (bu *BlobberUpdate) AddTaskOutputIDs(ids ...int64) *BlobberUpdate

AddTaskOutputIDs adds the "task_output" edge to the Task entity by IDs.

func (*BlobberUpdate) ClearDeletedAt

func (bu *BlobberUpdate) ClearDeletedAt() *BlobberUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BlobberUpdate) ClearTaskArgs

func (bu *BlobberUpdate) ClearTaskArgs() *BlobberUpdate

ClearTaskArgs clears all "task_args" edges to the Task entity.

func (*BlobberUpdate) ClearTaskOutput

func (bu *BlobberUpdate) ClearTaskOutput() *BlobberUpdate

ClearTaskOutput clears all "task_output" edges to the Task entity.

func (*BlobberUpdate) Exec

func (bu *BlobberUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlobberUpdate) ExecX

func (bu *BlobberUpdate) ExecX(ctx context.Context)

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

func (*BlobberUpdate) Mutation

func (bu *BlobberUpdate) Mutation() *BlobberMutation

Mutation returns the BlobberMutation object of the builder.

func (*BlobberUpdate) RemoveTaskArgIDs

func (bu *BlobberUpdate) RemoveTaskArgIDs(ids ...int64) *BlobberUpdate

RemoveTaskArgIDs removes the "task_args" edge to Task entities by IDs.

func (*BlobberUpdate) RemoveTaskArgs

func (bu *BlobberUpdate) RemoveTaskArgs(t ...*Task) *BlobberUpdate

RemoveTaskArgs removes "task_args" edges to Task entities.

func (*BlobberUpdate) RemoveTaskOutput

func (bu *BlobberUpdate) RemoveTaskOutput(t ...*Task) *BlobberUpdate

RemoveTaskOutput removes "task_output" edges to Task entities.

func (*BlobberUpdate) RemoveTaskOutputIDs

func (bu *BlobberUpdate) RemoveTaskOutputIDs(ids ...int64) *BlobberUpdate

RemoveTaskOutputIDs removes the "task_output" edge to Task entities by IDs.

func (*BlobberUpdate) Save

func (bu *BlobberUpdate) Save(ctx context.Context) (int, error)

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

func (*BlobberUpdate) SaveX

func (bu *BlobberUpdate) SaveX(ctx context.Context) int

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

func (*BlobberUpdate) SetBlob

func (bu *BlobberUpdate) SetBlob(b []byte) *BlobberUpdate

SetBlob sets the "blob" field.

func (*BlobberUpdate) SetDeletedAt

func (bu *BlobberUpdate) SetDeletedAt(t time.Time) *BlobberUpdate

SetDeletedAt sets the "deleted_at" field.

func (*BlobberUpdate) SetHash

func (bu *BlobberUpdate) SetHash(b []byte) *BlobberUpdate

SetHash sets the "hash" field.

func (*BlobberUpdate) SetNillableDeletedAt

func (bu *BlobberUpdate) SetNillableDeletedAt(t *time.Time) *BlobberUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BlobberUpdate) SetNillableSize

func (bu *BlobberUpdate) SetNillableSize(i *int) *BlobberUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*BlobberUpdate) SetSize

func (bu *BlobberUpdate) SetSize(i int) *BlobberUpdate

SetSize sets the "size" field.

func (*BlobberUpdate) SetUpdatedAt

func (bu *BlobberUpdate) SetUpdatedAt(t time.Time) *BlobberUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BlobberUpdate) Where

func (bu *BlobberUpdate) Where(ps ...predicate.Blobber) *BlobberUpdate

Where appends a list predicates to the BlobberUpdate builder.

type BlobberUpdateOne

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

BlobberUpdateOne is the builder for updating a single Blobber entity.

func (*BlobberUpdateOne) AddSize

func (buo *BlobberUpdateOne) AddSize(i int) *BlobberUpdateOne

AddSize adds i to the "size" field.

func (*BlobberUpdateOne) AddTaskArgIDs

func (buo *BlobberUpdateOne) AddTaskArgIDs(ids ...int64) *BlobberUpdateOne

AddTaskArgIDs adds the "task_args" edge to the Task entity by IDs.

func (*BlobberUpdateOne) AddTaskArgs

func (buo *BlobberUpdateOne) AddTaskArgs(t ...*Task) *BlobberUpdateOne

AddTaskArgs adds the "task_args" edges to the Task entity.

func (*BlobberUpdateOne) AddTaskOutput

func (buo *BlobberUpdateOne) AddTaskOutput(t ...*Task) *BlobberUpdateOne

AddTaskOutput adds the "task_output" edges to the Task entity.

func (*BlobberUpdateOne) AddTaskOutputIDs

func (buo *BlobberUpdateOne) AddTaskOutputIDs(ids ...int64) *BlobberUpdateOne

AddTaskOutputIDs adds the "task_output" edge to the Task entity by IDs.

func (*BlobberUpdateOne) ClearDeletedAt

func (buo *BlobberUpdateOne) ClearDeletedAt() *BlobberUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BlobberUpdateOne) ClearTaskArgs

func (buo *BlobberUpdateOne) ClearTaskArgs() *BlobberUpdateOne

ClearTaskArgs clears all "task_args" edges to the Task entity.

func (*BlobberUpdateOne) ClearTaskOutput

func (buo *BlobberUpdateOne) ClearTaskOutput() *BlobberUpdateOne

ClearTaskOutput clears all "task_output" edges to the Task entity.

func (*BlobberUpdateOne) Exec

func (buo *BlobberUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BlobberUpdateOne) ExecX

func (buo *BlobberUpdateOne) ExecX(ctx context.Context)

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

func (*BlobberUpdateOne) Mutation

func (buo *BlobberUpdateOne) Mutation() *BlobberMutation

Mutation returns the BlobberMutation object of the builder.

func (*BlobberUpdateOne) RemoveTaskArgIDs

func (buo *BlobberUpdateOne) RemoveTaskArgIDs(ids ...int64) *BlobberUpdateOne

RemoveTaskArgIDs removes the "task_args" edge to Task entities by IDs.

func (*BlobberUpdateOne) RemoveTaskArgs

func (buo *BlobberUpdateOne) RemoveTaskArgs(t ...*Task) *BlobberUpdateOne

RemoveTaskArgs removes "task_args" edges to Task entities.

func (*BlobberUpdateOne) RemoveTaskOutput

func (buo *BlobberUpdateOne) RemoveTaskOutput(t ...*Task) *BlobberUpdateOne

RemoveTaskOutput removes "task_output" edges to Task entities.

func (*BlobberUpdateOne) RemoveTaskOutputIDs

func (buo *BlobberUpdateOne) RemoveTaskOutputIDs(ids ...int64) *BlobberUpdateOne

RemoveTaskOutputIDs removes the "task_output" edge to Task entities by IDs.

func (*BlobberUpdateOne) Save

func (buo *BlobberUpdateOne) Save(ctx context.Context) (*Blobber, error)

Save executes the query and returns the updated Blobber entity.

func (*BlobberUpdateOne) SaveX

func (buo *BlobberUpdateOne) SaveX(ctx context.Context) *Blobber

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

func (*BlobberUpdateOne) Select

func (buo *BlobberUpdateOne) Select(field string, fields ...string) *BlobberUpdateOne

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

func (*BlobberUpdateOne) SetBlob

func (buo *BlobberUpdateOne) SetBlob(b []byte) *BlobberUpdateOne

SetBlob sets the "blob" field.

func (*BlobberUpdateOne) SetDeletedAt

func (buo *BlobberUpdateOne) SetDeletedAt(t time.Time) *BlobberUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*BlobberUpdateOne) SetHash

func (buo *BlobberUpdateOne) SetHash(b []byte) *BlobberUpdateOne

SetHash sets the "hash" field.

func (*BlobberUpdateOne) SetNillableDeletedAt

func (buo *BlobberUpdateOne) SetNillableDeletedAt(t *time.Time) *BlobberUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BlobberUpdateOne) SetNillableSize

func (buo *BlobberUpdateOne) SetNillableSize(i *int) *BlobberUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*BlobberUpdateOne) SetSize

func (buo *BlobberUpdateOne) SetSize(i int) *BlobberUpdateOne

SetSize sets the "size" field.

func (*BlobberUpdateOne) SetUpdatedAt

func (buo *BlobberUpdateOne) SetUpdatedAt(t time.Time) *BlobberUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*BlobberUpdateOne) Where

Where appends a list predicates to the BlobberUpdate builder.

type Blobbers

type Blobbers []*Blobber

Blobbers is a parsable slice of Blobber.

type Chat

type Chat struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// when message created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// creator of message
	AuthorID int64 `json:"author_id,omitempty"`
	// message itself
	Message string `json:"message,omitempty"`
	// is message created by server
	IsServer bool `json:"is_server,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChatQuery when eager-loading is set.
	Edges ChatEdges `json:"edges"`
	// contains filtered or unexported fields
}

Chat is the model entity for the Chat schema.

func (*Chat) QueryOperator

func (c *Chat) QueryOperator() *OperatorQuery

QueryOperator queries the "operator" edge of the Chat entity.

func (*Chat) String

func (c *Chat) String() string

String implements the fmt.Stringer.

func (*Chat) Unwrap

func (c *Chat) Unwrap() *Chat

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

func (c *Chat) Update() *ChatUpdateOne

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

func (*Chat) Value

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

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

type ChatClient

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

ChatClient is a client for the Chat schema.

func NewChatClient

func NewChatClient(c config) *ChatClient

NewChatClient returns a client for the Chat from the given config.

func (*ChatClient) Create

func (c *ChatClient) Create() *ChatCreate

Create returns a builder for creating a Chat entity.

func (*ChatClient) CreateBulk

func (c *ChatClient) CreateBulk(builders ...*ChatCreate) *ChatCreateBulk

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

func (*ChatClient) Delete

func (c *ChatClient) Delete() *ChatDelete

Delete returns a delete builder for Chat.

func (*ChatClient) DeleteOne

func (c *ChatClient) DeleteOne(ch *Chat) *ChatDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatClient) DeleteOneID

func (c *ChatClient) DeleteOneID(id int) *ChatDeleteOne

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

func (*ChatClient) Get

func (c *ChatClient) Get(ctx context.Context, id int) (*Chat, error)

Get returns a Chat entity by its id.

func (*ChatClient) GetX

func (c *ChatClient) GetX(ctx context.Context, id int) *Chat

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

func (*ChatClient) Hooks

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

Hooks returns the client hooks.

func (*ChatClient) Intercept

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

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

func (*ChatClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ChatClient) MapCreateBulk

func (c *ChatClient) MapCreateBulk(slice any, setFunc func(*ChatCreate, int)) *ChatCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ChatClient) Query

func (c *ChatClient) Query() *ChatQuery

Query returns a query builder for Chat.

func (*ChatClient) QueryOperator

func (c *ChatClient) QueryOperator(ch *Chat) *OperatorQuery

QueryOperator queries the operator edge of a Chat.

func (*ChatClient) Update

func (c *ChatClient) Update() *ChatUpdate

Update returns an update builder for Chat.

func (*ChatClient) UpdateOne

func (c *ChatClient) UpdateOne(ch *Chat) *ChatUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatClient) UpdateOneID

func (c *ChatClient) UpdateOneID(id int) *ChatUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatClient) Use

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

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

type ChatCreate

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

ChatCreate is the builder for creating a Chat entity.

func (*ChatCreate) Exec

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

Exec executes the query.

func (*ChatCreate) ExecX

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

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

func (*ChatCreate) Mutation

func (cc *ChatCreate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatCreate) Save

func (cc *ChatCreate) Save(ctx context.Context) (*Chat, error)

Save creates the Chat in the database.

func (*ChatCreate) SaveX

func (cc *ChatCreate) SaveX(ctx context.Context) *Chat

SaveX calls Save and panics if Save returns an error.

func (*ChatCreate) SetAuthorID

func (cc *ChatCreate) SetAuthorID(i int64) *ChatCreate

SetAuthorID sets the "author_id" field.

func (*ChatCreate) SetCreatedAt

func (cc *ChatCreate) SetCreatedAt(t time.Time) *ChatCreate

SetCreatedAt sets the "created_at" field.

func (*ChatCreate) SetIsServer

func (cc *ChatCreate) SetIsServer(b bool) *ChatCreate

SetIsServer sets the "is_server" field.

func (*ChatCreate) SetMessage

func (cc *ChatCreate) SetMessage(s string) *ChatCreate

SetMessage sets the "message" field.

func (*ChatCreate) SetNillableAuthorID

func (cc *ChatCreate) SetNillableAuthorID(i *int64) *ChatCreate

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*ChatCreate) SetNillableCreatedAt

func (cc *ChatCreate) SetNillableCreatedAt(t *time.Time) *ChatCreate

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

func (*ChatCreate) SetNillableIsServer

func (cc *ChatCreate) SetNillableIsServer(b *bool) *ChatCreate

SetNillableIsServer sets the "is_server" field if the given value is not nil.

func (*ChatCreate) SetNillableOperatorID

func (cc *ChatCreate) SetNillableOperatorID(id *int64) *ChatCreate

SetNillableOperatorID sets the "operator" edge to the Operator entity by ID if the given value is not nil.

func (*ChatCreate) SetOperator

func (cc *ChatCreate) SetOperator(o *Operator) *ChatCreate

SetOperator sets the "operator" edge to the Operator entity.

func (*ChatCreate) SetOperatorID

func (cc *ChatCreate) SetOperatorID(id int64) *ChatCreate

SetOperatorID sets the "operator" edge to the Operator entity by ID.

type ChatCreateBulk

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

ChatCreateBulk is the builder for creating many Chat entities in bulk.

func (*ChatCreateBulk) Exec

func (ccb *ChatCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatCreateBulk) ExecX

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

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

func (*ChatCreateBulk) Save

func (ccb *ChatCreateBulk) Save(ctx context.Context) ([]*Chat, error)

Save creates the Chat entities in the database.

func (*ChatCreateBulk) SaveX

func (ccb *ChatCreateBulk) SaveX(ctx context.Context) []*Chat

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

type ChatDelete

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

ChatDelete is the builder for deleting a Chat entity.

func (*ChatDelete) Exec

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

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

func (*ChatDelete) ExecX

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

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

func (*ChatDelete) Where

func (cd *ChatDelete) Where(ps ...predicate.Chat) *ChatDelete

Where appends a list predicates to the ChatDelete builder.

type ChatDeleteOne

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

ChatDeleteOne is the builder for deleting a single Chat entity.

func (*ChatDeleteOne) Exec

func (cdo *ChatDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatDeleteOne) ExecX

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

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

func (*ChatDeleteOne) Where

func (cdo *ChatDeleteOne) Where(ps ...predicate.Chat) *ChatDeleteOne

Where appends a list predicates to the ChatDelete builder.

type ChatEdges

type ChatEdges struct {
	// Operator holds the value of the operator edge.
	Operator *Operator `json:"operator,omitempty"`
	// contains filtered or unexported fields
}

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

func (ChatEdges) OperatorOrErr

func (e ChatEdges) OperatorOrErr() (*Operator, error)

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

type ChatGroupBy

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

ChatGroupBy is the group-by builder for Chat entities.

func (*ChatGroupBy) Aggregate

func (cgb *ChatGroupBy) Aggregate(fns ...AggregateFunc) *ChatGroupBy

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

func (*ChatGroupBy) Bool

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

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

func (*ChatGroupBy) BoolX

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

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

func (*ChatGroupBy) Bools

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

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

func (*ChatGroupBy) BoolsX

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

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

func (*ChatGroupBy) Float64

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

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

func (*ChatGroupBy) Float64X

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

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

func (*ChatGroupBy) Float64s

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

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

func (*ChatGroupBy) Float64sX

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

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

func (*ChatGroupBy) Int

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

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

func (*ChatGroupBy) IntX

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

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

func (*ChatGroupBy) Ints

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

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

func (*ChatGroupBy) IntsX

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

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

func (*ChatGroupBy) Scan

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

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

func (*ChatGroupBy) ScanX

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

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

func (*ChatGroupBy) String

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

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

func (*ChatGroupBy) StringX

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

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

func (*ChatGroupBy) Strings

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

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

func (*ChatGroupBy) StringsX

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

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

type ChatMutation

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

ChatMutation represents an operation that mutates the Chat nodes in the graph.

func (*ChatMutation) AddField

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

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

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

func (*ChatMutation) AddedField

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

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

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

func (*ChatMutation) AddedIDs

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

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

func (*ChatMutation) AuthorID

func (m *ChatMutation) AuthorID() (r int64, exists bool)

AuthorID returns the value of the "author_id" field in the mutation.

func (*ChatMutation) AuthorIDCleared

func (m *ChatMutation) AuthorIDCleared() bool

AuthorIDCleared returns if the "author_id" field was cleared in this mutation.

func (*ChatMutation) ClearAuthorID

func (m *ChatMutation) ClearAuthorID()

ClearAuthorID clears the value of the "author_id" field.

func (*ChatMutation) ClearEdge

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

func (m *ChatMutation) 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 (*ChatMutation) ClearOperator

func (m *ChatMutation) ClearOperator()

ClearOperator clears the "operator" edge to the Operator entity.

func (*ChatMutation) ClearedEdges

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

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

func (*ChatMutation) ClearedFields

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

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

func (ChatMutation) Client

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

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

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

func (*ChatMutation) EdgeCleared

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

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

func (*ChatMutation) Field

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

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

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

func (*ChatMutation) Fields

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

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

func (m *ChatMutation) 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 (*ChatMutation) IsServer

func (m *ChatMutation) IsServer() (r bool, exists bool)

IsServer returns the value of the "is_server" field in the mutation.

func (*ChatMutation) Message

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

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

func (*ChatMutation) OldAuthorID

func (m *ChatMutation) OldAuthorID(ctx context.Context) (v int64, err error)

OldAuthorID returns the old "author_id" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldCreatedAt

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

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

func (m *ChatMutation) 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 (*ChatMutation) OldIsServer

func (m *ChatMutation) OldIsServer(ctx context.Context) (v bool, err error)

OldIsServer returns the old "is_server" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldMessage

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

OldMessage returns the old "message" field's value of the Chat entity. If the Chat 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 (*ChatMutation) Op

func (m *ChatMutation) Op() Op

Op returns the operation name.

func (*ChatMutation) OperatorCleared

func (m *ChatMutation) OperatorCleared() bool

OperatorCleared reports if the "operator" edge to the Operator entity was cleared.

func (*ChatMutation) OperatorID

func (m *ChatMutation) OperatorID() (id int64, exists bool)

OperatorID returns the "operator" edge ID in the mutation.

func (*ChatMutation) OperatorIDs

func (m *ChatMutation) OperatorIDs() (ids []int64)

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

func (*ChatMutation) RemovedEdges

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

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

func (*ChatMutation) RemovedIDs

func (m *ChatMutation) 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 (*ChatMutation) ResetAuthorID

func (m *ChatMutation) ResetAuthorID()

ResetAuthorID resets all changes to the "author_id" field.

func (*ChatMutation) ResetCreatedAt

func (m *ChatMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ChatMutation) ResetEdge

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

func (m *ChatMutation) 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 (*ChatMutation) ResetIsServer

func (m *ChatMutation) ResetIsServer()

ResetIsServer resets all changes to the "is_server" field.

func (*ChatMutation) ResetMessage

func (m *ChatMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*ChatMutation) ResetOperator

func (m *ChatMutation) ResetOperator()

ResetOperator resets all changes to the "operator" edge.

func (*ChatMutation) SetAuthorID

func (m *ChatMutation) SetAuthorID(i int64)

SetAuthorID sets the "author_id" field.

func (*ChatMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ChatMutation) SetField

func (m *ChatMutation) 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 (*ChatMutation) SetIsServer

func (m *ChatMutation) SetIsServer(b bool)

SetIsServer sets the "is_server" field.

func (*ChatMutation) SetMessage

func (m *ChatMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*ChatMutation) SetOp

func (m *ChatMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatMutation) SetOperatorID

func (m *ChatMutation) SetOperatorID(id int64)

SetOperatorID sets the "operator" edge to the Operator entity by id.

func (ChatMutation) Tx

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

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

func (*ChatMutation) Type

func (m *ChatMutation) Type() string

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

func (*ChatMutation) Where

func (m *ChatMutation) Where(ps ...predicate.Chat)

Where appends a list predicates to the ChatMutation builder.

func (*ChatMutation) WhereP

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

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

type ChatQuery

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

ChatQuery is the builder for querying Chat entities.

func (*ChatQuery) Aggregate

func (cq *ChatQuery) Aggregate(fns ...AggregateFunc) *ChatSelect

Aggregate returns a ChatSelect configured with the given aggregations.

func (*ChatQuery) All

func (cq *ChatQuery) All(ctx context.Context) ([]*Chat, error)

All executes the query and returns a list of Chats.

func (*ChatQuery) AllX

func (cq *ChatQuery) AllX(ctx context.Context) []*Chat

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

func (*ChatQuery) Clone

func (cq *ChatQuery) Clone() *ChatQuery

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

func (*ChatQuery) Count

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

Count returns the count of the given query.

func (*ChatQuery) CountX

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

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

func (*ChatQuery) Exist

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

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

func (*ChatQuery) ExistX

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

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

func (*ChatQuery) First

func (cq *ChatQuery) First(ctx context.Context) (*Chat, error)

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

func (*ChatQuery) FirstID

func (cq *ChatQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ChatQuery) FirstIDX

func (cq *ChatQuery) FirstIDX(ctx context.Context) int

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

func (*ChatQuery) FirstX

func (cq *ChatQuery) FirstX(ctx context.Context) *Chat

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

func (*ChatQuery) ForShare

func (cq *ChatQuery) ForShare(opts ...sql.LockOption) *ChatQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ChatQuery) ForUpdate

func (cq *ChatQuery) ForUpdate(opts ...sql.LockOption) *ChatQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ChatQuery) GroupBy

func (cq *ChatQuery) GroupBy(field string, fields ...string) *ChatGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Chat.Query().
	GroupBy(chat.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChatQuery) IDs

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

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

func (*ChatQuery) IDsX

func (cq *ChatQuery) IDsX(ctx context.Context) []int

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

func (*ChatQuery) Limit

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

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

func (*ChatQuery) Offset

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

Offset to start from.

func (*ChatQuery) Only

func (cq *ChatQuery) Only(ctx context.Context) (*Chat, error)

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

func (*ChatQuery) OnlyID

func (cq *ChatQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ChatQuery) OnlyIDX

func (cq *ChatQuery) OnlyIDX(ctx context.Context) int

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

func (*ChatQuery) OnlyX

func (cq *ChatQuery) OnlyX(ctx context.Context) *Chat

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

func (*ChatQuery) Order

func (cq *ChatQuery) Order(o ...chat.OrderOption) *ChatQuery

Order specifies how the records should be ordered.

func (*ChatQuery) QueryOperator

func (cq *ChatQuery) QueryOperator() *OperatorQuery

QueryOperator chains the current query on the "operator" edge.

func (*ChatQuery) Select

func (cq *ChatQuery) Select(fields ...string) *ChatSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Chat.Query().
	Select(chat.FieldCreatedAt).
	Scan(ctx, &v)

func (*ChatQuery) Unique

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

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

func (cq *ChatQuery) Where(ps ...predicate.Chat) *ChatQuery

Where adds a new predicate for the ChatQuery builder.

func (*ChatQuery) WithOperator

func (cq *ChatQuery) WithOperator(opts ...func(*OperatorQuery)) *ChatQuery

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

type ChatSelect

type ChatSelect struct {
	*ChatQuery
	// contains filtered or unexported fields
}

ChatSelect is the builder for selecting fields of Chat entities.

func (*ChatSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ChatSelect) Bool

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

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

func (*ChatSelect) BoolX

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

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

func (*ChatSelect) Bools

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

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

func (*ChatSelect) BoolsX

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

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

func (*ChatSelect) Float64

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

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

func (*ChatSelect) Float64X

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

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

func (*ChatSelect) Float64s

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

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

func (*ChatSelect) Float64sX

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

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

func (*ChatSelect) Int

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

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

func (*ChatSelect) IntX

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

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

func (*ChatSelect) Ints

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

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

func (*ChatSelect) IntsX

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

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

func (*ChatSelect) Scan

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

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

func (*ChatSelect) ScanX

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

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

func (*ChatSelect) String

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

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

func (*ChatSelect) StringX

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

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

func (*ChatSelect) Strings

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

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

func (*ChatSelect) StringsX

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

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

type ChatUpdate

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

ChatUpdate is the builder for updating Chat entities.

func (*ChatUpdate) ClearAuthorID

func (cu *ChatUpdate) ClearAuthorID() *ChatUpdate

ClearAuthorID clears the value of the "author_id" field.

func (*ChatUpdate) ClearOperator

func (cu *ChatUpdate) ClearOperator() *ChatUpdate

ClearOperator clears the "operator" edge to the Operator entity.

func (*ChatUpdate) Exec

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

Exec executes the query.

func (*ChatUpdate) ExecX

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

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

func (*ChatUpdate) Mutation

func (cu *ChatUpdate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdate) Save

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

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

func (*ChatUpdate) SaveX

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

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

func (*ChatUpdate) SetAuthorID

func (cu *ChatUpdate) SetAuthorID(i int64) *ChatUpdate

SetAuthorID sets the "author_id" field.

func (*ChatUpdate) SetIsServer

func (cu *ChatUpdate) SetIsServer(b bool) *ChatUpdate

SetIsServer sets the "is_server" field.

func (*ChatUpdate) SetMessage

func (cu *ChatUpdate) SetMessage(s string) *ChatUpdate

SetMessage sets the "message" field.

func (*ChatUpdate) SetNillableAuthorID

func (cu *ChatUpdate) SetNillableAuthorID(i *int64) *ChatUpdate

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*ChatUpdate) SetNillableIsServer

func (cu *ChatUpdate) SetNillableIsServer(b *bool) *ChatUpdate

SetNillableIsServer sets the "is_server" field if the given value is not nil.

func (*ChatUpdate) SetNillableMessage

func (cu *ChatUpdate) SetNillableMessage(s *string) *ChatUpdate

SetNillableMessage sets the "message" field if the given value is not nil.

func (*ChatUpdate) SetNillableOperatorID

func (cu *ChatUpdate) SetNillableOperatorID(id *int64) *ChatUpdate

SetNillableOperatorID sets the "operator" edge to the Operator entity by ID if the given value is not nil.

func (*ChatUpdate) SetOperator

func (cu *ChatUpdate) SetOperator(o *Operator) *ChatUpdate

SetOperator sets the "operator" edge to the Operator entity.

func (*ChatUpdate) SetOperatorID

func (cu *ChatUpdate) SetOperatorID(id int64) *ChatUpdate

SetOperatorID sets the "operator" edge to the Operator entity by ID.

func (*ChatUpdate) Where

func (cu *ChatUpdate) Where(ps ...predicate.Chat) *ChatUpdate

Where appends a list predicates to the ChatUpdate builder.

type ChatUpdateOne

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

ChatUpdateOne is the builder for updating a single Chat entity.

func (*ChatUpdateOne) ClearAuthorID

func (cuo *ChatUpdateOne) ClearAuthorID() *ChatUpdateOne

ClearAuthorID clears the value of the "author_id" field.

func (*ChatUpdateOne) ClearOperator

func (cuo *ChatUpdateOne) ClearOperator() *ChatUpdateOne

ClearOperator clears the "operator" edge to the Operator entity.

func (*ChatUpdateOne) Exec

func (cuo *ChatUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatUpdateOne) ExecX

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

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

func (*ChatUpdateOne) Mutation

func (cuo *ChatUpdateOne) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdateOne) Save

func (cuo *ChatUpdateOne) Save(ctx context.Context) (*Chat, error)

Save executes the query and returns the updated Chat entity.

func (*ChatUpdateOne) SaveX

func (cuo *ChatUpdateOne) SaveX(ctx context.Context) *Chat

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

func (*ChatUpdateOne) Select

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

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

func (*ChatUpdateOne) SetAuthorID

func (cuo *ChatUpdateOne) SetAuthorID(i int64) *ChatUpdateOne

SetAuthorID sets the "author_id" field.

func (*ChatUpdateOne) SetIsServer

func (cuo *ChatUpdateOne) SetIsServer(b bool) *ChatUpdateOne

SetIsServer sets the "is_server" field.

func (*ChatUpdateOne) SetMessage

func (cuo *ChatUpdateOne) SetMessage(s string) *ChatUpdateOne

SetMessage sets the "message" field.

func (*ChatUpdateOne) SetNillableAuthorID

func (cuo *ChatUpdateOne) SetNillableAuthorID(i *int64) *ChatUpdateOne

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableIsServer

func (cuo *ChatUpdateOne) SetNillableIsServer(b *bool) *ChatUpdateOne

SetNillableIsServer sets the "is_server" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableMessage

func (cuo *ChatUpdateOne) SetNillableMessage(s *string) *ChatUpdateOne

SetNillableMessage sets the "message" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableOperatorID

func (cuo *ChatUpdateOne) SetNillableOperatorID(id *int64) *ChatUpdateOne

SetNillableOperatorID sets the "operator" edge to the Operator entity by ID if the given value is not nil.

func (*ChatUpdateOne) SetOperator

func (cuo *ChatUpdateOne) SetOperator(o *Operator) *ChatUpdateOne

SetOperator sets the "operator" edge to the Operator entity.

func (*ChatUpdateOne) SetOperatorID

func (cuo *ChatUpdateOne) SetOperatorID(id int64) *ChatUpdateOne

SetOperatorID sets the "operator" edge to the Operator entity by ID.

func (*ChatUpdateOne) Where

func (cuo *ChatUpdateOne) Where(ps ...predicate.Chat) *ChatUpdateOne

Where appends a list predicates to the ChatUpdate builder.

type Chats

type Chats []*Chat

Chats is a parsable slice of Chat.

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
	// Blobber is the client for interacting with the Blobber builders.
	Blobber *BlobberClient
	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// Command is the client for interacting with the Command builders.
	Command *CommandClient
	// Credential is the client for interacting with the Credential builders.
	Credential *CredentialClient
	// Listener is the client for interacting with the Listener builders.
	Listener *ListenerClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Operator is the client for interacting with the Operator builders.
	Operator *OperatorClient
	// Pki is the client for interacting with the Pki builders.
	Pki *PkiClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// 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 Command

type Command struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// agent ID
	AgentID uint32 `json:"agent_id,omitempty"`
	// command with arguments
	Cmd string `json:"cmd,omitempty"`
	// is group visible for other operators
	Visible bool `json:"visible,omitempty"`
	// author of group
	AuthorID int64 `json:"author_id,omitempty"`
	// when group created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// when group closed
	ClosedAt time.Time `json:"closed_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CommandQuery when eager-loading is set.
	Edges CommandEdges `json:"edges"`
	// contains filtered or unexported fields
}

Command is the model entity for the Command schema.

func (*Command) QueryAgent

func (c *Command) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the Command entity.

func (*Command) QueryMessage

func (c *Command) QueryMessage() *MessageQuery

QueryMessage queries the "message" edge of the Command entity.

func (*Command) QueryOperator

func (c *Command) QueryOperator() *OperatorQuery

QueryOperator queries the "operator" edge of the Command entity.

func (*Command) QueryTask

func (c *Command) QueryTask() *TaskQuery

QueryTask queries the "task" edge of the Command entity.

func (*Command) String

func (c *Command) String() string

String implements the fmt.Stringer.

func (*Command) Unwrap

func (c *Command) Unwrap() *Command

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

func (c *Command) Update() *CommandUpdateOne

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

func (*Command) Value

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

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

type CommandClient

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

CommandClient is a client for the Command schema.

func NewCommandClient

func NewCommandClient(c config) *CommandClient

NewCommandClient returns a client for the Command from the given config.

func (*CommandClient) Create

func (c *CommandClient) Create() *CommandCreate

Create returns a builder for creating a Command entity.

func (*CommandClient) CreateBulk

func (c *CommandClient) CreateBulk(builders ...*CommandCreate) *CommandCreateBulk

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

func (*CommandClient) Delete

func (c *CommandClient) Delete() *CommandDelete

Delete returns a delete builder for Command.

func (*CommandClient) DeleteOne

func (c *CommandClient) DeleteOne(co *Command) *CommandDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CommandClient) DeleteOneID

func (c *CommandClient) DeleteOneID(id int64) *CommandDeleteOne

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

func (*CommandClient) Get

func (c *CommandClient) Get(ctx context.Context, id int64) (*Command, error)

Get returns a Command entity by its id.

func (*CommandClient) GetX

func (c *CommandClient) GetX(ctx context.Context, id int64) *Command

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

func (*CommandClient) Hooks

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

Hooks returns the client hooks.

func (*CommandClient) Intercept

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

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

func (*CommandClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CommandClient) MapCreateBulk

func (c *CommandClient) MapCreateBulk(slice any, setFunc func(*CommandCreate, int)) *CommandCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CommandClient) Query

func (c *CommandClient) Query() *CommandQuery

Query returns a query builder for Command.

func (*CommandClient) QueryAgent

func (c *CommandClient) QueryAgent(co *Command) *AgentQuery

QueryAgent queries the agent edge of a Command.

func (*CommandClient) QueryMessage

func (c *CommandClient) QueryMessage(co *Command) *MessageQuery

QueryMessage queries the message edge of a Command.

func (*CommandClient) QueryOperator

func (c *CommandClient) QueryOperator(co *Command) *OperatorQuery

QueryOperator queries the operator edge of a Command.

func (*CommandClient) QueryTask

func (c *CommandClient) QueryTask(co *Command) *TaskQuery

QueryTask queries the task edge of a Command.

func (*CommandClient) Update

func (c *CommandClient) Update() *CommandUpdate

Update returns an update builder for Command.

func (*CommandClient) UpdateOne

func (c *CommandClient) UpdateOne(co *Command) *CommandUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CommandClient) UpdateOneID

func (c *CommandClient) UpdateOneID(id int64) *CommandUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CommandClient) Use

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

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

type CommandCreate

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

CommandCreate is the builder for creating a Command entity.

func (*CommandCreate) AddMessage

func (cc *CommandCreate) AddMessage(m ...*Message) *CommandCreate

AddMessage adds the "message" edges to the Message entity.

func (*CommandCreate) AddMessageIDs

func (cc *CommandCreate) AddMessageIDs(ids ...int) *CommandCreate

AddMessageIDs adds the "message" edge to the Message entity by IDs.

func (*CommandCreate) AddTask

func (cc *CommandCreate) AddTask(t ...*Task) *CommandCreate

AddTask adds the "task" edges to the Task entity.

func (*CommandCreate) AddTaskIDs

func (cc *CommandCreate) AddTaskIDs(ids ...int64) *CommandCreate

AddTaskIDs adds the "task" edge to the Task entity by IDs.

func (*CommandCreate) Exec

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

Exec executes the query.

func (*CommandCreate) ExecX

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

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

func (*CommandCreate) Mutation

func (cc *CommandCreate) Mutation() *CommandMutation

Mutation returns the CommandMutation object of the builder.

func (*CommandCreate) Save

func (cc *CommandCreate) Save(ctx context.Context) (*Command, error)

Save creates the Command in the database.

func (*CommandCreate) SaveX

func (cc *CommandCreate) SaveX(ctx context.Context) *Command

SaveX calls Save and panics if Save returns an error.

func (*CommandCreate) SetAgent

func (cc *CommandCreate) SetAgent(a *Agent) *CommandCreate

SetAgent sets the "agent" edge to the Agent entity.

func (*CommandCreate) SetAgentID

func (cc *CommandCreate) SetAgentID(u uint32) *CommandCreate

SetAgentID sets the "agent_id" field.

func (*CommandCreate) SetAuthorID

func (cc *CommandCreate) SetAuthorID(i int64) *CommandCreate

SetAuthorID sets the "author_id" field.

func (*CommandCreate) SetClosedAt

func (cc *CommandCreate) SetClosedAt(t time.Time) *CommandCreate

SetClosedAt sets the "closed_at" field.

func (*CommandCreate) SetCmd

func (cc *CommandCreate) SetCmd(s string) *CommandCreate

SetCmd sets the "cmd" field.

func (*CommandCreate) SetCreatedAt

func (cc *CommandCreate) SetCreatedAt(t time.Time) *CommandCreate

SetCreatedAt sets the "created_at" field.

func (*CommandCreate) SetID

func (cc *CommandCreate) SetID(i int64) *CommandCreate

SetID sets the "id" field.

func (*CommandCreate) SetNillableClosedAt

func (cc *CommandCreate) SetNillableClosedAt(t *time.Time) *CommandCreate

SetNillableClosedAt sets the "closed_at" field if the given value is not nil.

func (*CommandCreate) SetNillableCreatedAt

func (cc *CommandCreate) SetNillableCreatedAt(t *time.Time) *CommandCreate

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

func (*CommandCreate) SetOperator

func (cc *CommandCreate) SetOperator(o *Operator) *CommandCreate

SetOperator sets the "operator" edge to the Operator entity.

func (*CommandCreate) SetOperatorID

func (cc *CommandCreate) SetOperatorID(id int64) *CommandCreate

SetOperatorID sets the "operator" edge to the Operator entity by ID.

func (*CommandCreate) SetVisible

func (cc *CommandCreate) SetVisible(b bool) *CommandCreate

SetVisible sets the "visible" field.

type CommandCreateBulk

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

CommandCreateBulk is the builder for creating many Command entities in bulk.

func (*CommandCreateBulk) Exec

func (ccb *CommandCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CommandCreateBulk) ExecX

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

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

func (*CommandCreateBulk) Save

func (ccb *CommandCreateBulk) Save(ctx context.Context) ([]*Command, error)

Save creates the Command entities in the database.

func (*CommandCreateBulk) SaveX

func (ccb *CommandCreateBulk) SaveX(ctx context.Context) []*Command

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

type CommandDelete

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

CommandDelete is the builder for deleting a Command entity.

func (*CommandDelete) Exec

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

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

func (*CommandDelete) ExecX

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

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

func (*CommandDelete) Where

func (cd *CommandDelete) Where(ps ...predicate.Command) *CommandDelete

Where appends a list predicates to the CommandDelete builder.

type CommandDeleteOne

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

CommandDeleteOne is the builder for deleting a single Command entity.

func (*CommandDeleteOne) Exec

func (cdo *CommandDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CommandDeleteOne) ExecX

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

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

func (*CommandDeleteOne) Where

Where appends a list predicates to the CommandDelete builder.

type CommandEdges

type CommandEdges struct {
	// Agent holds the value of the agent edge.
	Agent *Agent `json:"agent,omitempty"`
	// Operator holds the value of the operator edge.
	Operator *Operator `json:"operator,omitempty"`
	// Message holds the value of the message edge.
	Message []*Message `json:"message,omitempty"`
	// Task holds the value of the task edge.
	Task []*Task `json:"task,omitempty"`
	// contains filtered or unexported fields
}

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

func (CommandEdges) AgentOrErr

func (e CommandEdges) AgentOrErr() (*Agent, error)

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

func (CommandEdges) MessageOrErr

func (e CommandEdges) MessageOrErr() ([]*Message, error)

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

func (CommandEdges) OperatorOrErr

func (e CommandEdges) OperatorOrErr() (*Operator, error)

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

func (CommandEdges) TaskOrErr

func (e CommandEdges) TaskOrErr() ([]*Task, error)

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

type CommandGroupBy

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

CommandGroupBy is the group-by builder for Command entities.

func (*CommandGroupBy) Aggregate

func (cgb *CommandGroupBy) Aggregate(fns ...AggregateFunc) *CommandGroupBy

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

func (*CommandGroupBy) Bool

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

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

func (*CommandGroupBy) BoolX

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

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

func (*CommandGroupBy) Bools

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

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

func (*CommandGroupBy) BoolsX

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

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

func (*CommandGroupBy) Float64

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

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

func (*CommandGroupBy) Float64X

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

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

func (*CommandGroupBy) Float64s

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

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

func (*CommandGroupBy) Float64sX

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

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

func (*CommandGroupBy) Int

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

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

func (*CommandGroupBy) IntX

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

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

func (*CommandGroupBy) Ints

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

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

func (*CommandGroupBy) IntsX

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

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

func (*CommandGroupBy) Scan

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

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

func (*CommandGroupBy) ScanX

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

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

func (*CommandGroupBy) String

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

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

func (*CommandGroupBy) StringX

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

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

func (*CommandGroupBy) Strings

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

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

func (*CommandGroupBy) StringsX

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

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

type CommandMutation

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

CommandMutation represents an operation that mutates the Command nodes in the graph.

func (*CommandMutation) AddField

func (m *CommandMutation) 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 (*CommandMutation) AddMessageIDs

func (m *CommandMutation) AddMessageIDs(ids ...int)

AddMessageIDs adds the "message" edge to the Message entity by ids.

func (*CommandMutation) AddTaskIDs

func (m *CommandMutation) AddTaskIDs(ids ...int64)

AddTaskIDs adds the "task" edge to the Task entity by ids.

func (*CommandMutation) AddedEdges

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

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

func (*CommandMutation) AddedField

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

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

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

func (*CommandMutation) AddedIDs

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

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

func (*CommandMutation) AgentCleared

func (m *CommandMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*CommandMutation) AgentID

func (m *CommandMutation) AgentID() (r uint32, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*CommandMutation) AgentIDs

func (m *CommandMutation) AgentIDs() (ids []uint32)

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

func (*CommandMutation) AuthorID

func (m *CommandMutation) AuthorID() (r int64, exists bool)

AuthorID returns the value of the "author_id" field in the mutation.

func (*CommandMutation) ClearAgent

func (m *CommandMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*CommandMutation) ClearClosedAt

func (m *CommandMutation) ClearClosedAt()

ClearClosedAt clears the value of the "closed_at" field.

func (*CommandMutation) ClearEdge

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

func (m *CommandMutation) 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 (*CommandMutation) ClearMessage

func (m *CommandMutation) ClearMessage()

ClearMessage clears the "message" edge to the Message entity.

func (*CommandMutation) ClearOperator

func (m *CommandMutation) ClearOperator()

ClearOperator clears the "operator" edge to the Operator entity.

func (*CommandMutation) ClearTask

func (m *CommandMutation) ClearTask()

ClearTask clears the "task" edge to the Task entity.

func (*CommandMutation) ClearedEdges

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

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

func (*CommandMutation) ClearedFields

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

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

func (CommandMutation) Client

func (m CommandMutation) 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 (*CommandMutation) ClosedAt

func (m *CommandMutation) ClosedAt() (r time.Time, exists bool)

ClosedAt returns the value of the "closed_at" field in the mutation.

func (*CommandMutation) ClosedAtCleared

func (m *CommandMutation) ClosedAtCleared() bool

ClosedAtCleared returns if the "closed_at" field was cleared in this mutation.

func (*CommandMutation) Cmd

func (m *CommandMutation) Cmd() (r string, exists bool)

Cmd returns the value of the "cmd" field in the mutation.

func (*CommandMutation) CreatedAt

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

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

func (*CommandMutation) EdgeCleared

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

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

func (*CommandMutation) Field

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

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

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

func (*CommandMutation) Fields

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

func (m *CommandMutation) ID() (id int64, 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 (*CommandMutation) IDs

func (m *CommandMutation) IDs(ctx context.Context) ([]int64, 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 (*CommandMutation) MessageCleared

func (m *CommandMutation) MessageCleared() bool

MessageCleared reports if the "message" edge to the Message entity was cleared.

func (*CommandMutation) MessageIDs

func (m *CommandMutation) MessageIDs() (ids []int)

MessageIDs returns the "message" edge IDs in the mutation.

func (*CommandMutation) OldAgentID

func (m *CommandMutation) OldAgentID(ctx context.Context) (v uint32, err error)

OldAgentID returns the old "agent_id" field's value of the Command entity. If the Command 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 (*CommandMutation) OldAuthorID

func (m *CommandMutation) OldAuthorID(ctx context.Context) (v int64, err error)

OldAuthorID returns the old "author_id" field's value of the Command entity. If the Command 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 (*CommandMutation) OldClosedAt

func (m *CommandMutation) OldClosedAt(ctx context.Context) (v time.Time, err error)

OldClosedAt returns the old "closed_at" field's value of the Command entity. If the Command 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 (*CommandMutation) OldCmd

func (m *CommandMutation) OldCmd(ctx context.Context) (v string, err error)

OldCmd returns the old "cmd" field's value of the Command entity. If the Command 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 (*CommandMutation) OldCreatedAt

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

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

func (m *CommandMutation) 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 (*CommandMutation) OldVisible

func (m *CommandMutation) OldVisible(ctx context.Context) (v bool, err error)

OldVisible returns the old "visible" field's value of the Command entity. If the Command 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 (*CommandMutation) Op

func (m *CommandMutation) Op() Op

Op returns the operation name.

func (*CommandMutation) OperatorCleared

func (m *CommandMutation) OperatorCleared() bool

OperatorCleared reports if the "operator" edge to the Operator entity was cleared.

func (*CommandMutation) OperatorID

func (m *CommandMutation) OperatorID() (id int64, exists bool)

OperatorID returns the "operator" edge ID in the mutation.

func (*CommandMutation) OperatorIDs

func (m *CommandMutation) OperatorIDs() (ids []int64)

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

func (*CommandMutation) RemoveMessageIDs

func (m *CommandMutation) RemoveMessageIDs(ids ...int)

RemoveMessageIDs removes the "message" edge to the Message entity by IDs.

func (*CommandMutation) RemoveTaskIDs

func (m *CommandMutation) RemoveTaskIDs(ids ...int64)

RemoveTaskIDs removes the "task" edge to the Task entity by IDs.

func (*CommandMutation) RemovedEdges

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

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

func (*CommandMutation) RemovedIDs

func (m *CommandMutation) 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 (*CommandMutation) RemovedMessageIDs

func (m *CommandMutation) RemovedMessageIDs() (ids []int)

RemovedMessage returns the removed IDs of the "message" edge to the Message entity.

func (*CommandMutation) RemovedTaskIDs

func (m *CommandMutation) RemovedTaskIDs() (ids []int64)

RemovedTask returns the removed IDs of the "task" edge to the Task entity.

func (*CommandMutation) ResetAgent

func (m *CommandMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*CommandMutation) ResetAgentID

func (m *CommandMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*CommandMutation) ResetAuthorID

func (m *CommandMutation) ResetAuthorID()

ResetAuthorID resets all changes to the "author_id" field.

func (*CommandMutation) ResetClosedAt

func (m *CommandMutation) ResetClosedAt()

ResetClosedAt resets all changes to the "closed_at" field.

func (*CommandMutation) ResetCmd

func (m *CommandMutation) ResetCmd()

ResetCmd resets all changes to the "cmd" field.

func (*CommandMutation) ResetCreatedAt

func (m *CommandMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CommandMutation) ResetEdge

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

func (m *CommandMutation) 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 (*CommandMutation) ResetMessage

func (m *CommandMutation) ResetMessage()

ResetMessage resets all changes to the "message" edge.

func (*CommandMutation) ResetOperator

func (m *CommandMutation) ResetOperator()

ResetOperator resets all changes to the "operator" edge.

func (*CommandMutation) ResetTask

func (m *CommandMutation) ResetTask()

ResetTask resets all changes to the "task" edge.

func (*CommandMutation) ResetVisible

func (m *CommandMutation) ResetVisible()

ResetVisible resets all changes to the "visible" field.

func (*CommandMutation) SetAgentID

func (m *CommandMutation) SetAgentID(u uint32)

SetAgentID sets the "agent_id" field.

func (*CommandMutation) SetAuthorID

func (m *CommandMutation) SetAuthorID(i int64)

SetAuthorID sets the "author_id" field.

func (*CommandMutation) SetClosedAt

func (m *CommandMutation) SetClosedAt(t time.Time)

SetClosedAt sets the "closed_at" field.

func (*CommandMutation) SetCmd

func (m *CommandMutation) SetCmd(s string)

SetCmd sets the "cmd" field.

func (*CommandMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CommandMutation) SetField

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

func (m *CommandMutation) SetID(id int64)

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

func (*CommandMutation) SetOp

func (m *CommandMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CommandMutation) SetOperatorID

func (m *CommandMutation) SetOperatorID(id int64)

SetOperatorID sets the "operator" edge to the Operator entity by id.

func (*CommandMutation) SetVisible

func (m *CommandMutation) SetVisible(b bool)

SetVisible sets the "visible" field.

func (*CommandMutation) TaskCleared

func (m *CommandMutation) TaskCleared() bool

TaskCleared reports if the "task" edge to the Task entity was cleared.

func (*CommandMutation) TaskIDs

func (m *CommandMutation) TaskIDs() (ids []int64)

TaskIDs returns the "task" edge IDs in the mutation.

func (CommandMutation) Tx

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

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

func (*CommandMutation) Type

func (m *CommandMutation) Type() string

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

func (*CommandMutation) Visible

func (m *CommandMutation) Visible() (r bool, exists bool)

Visible returns the value of the "visible" field in the mutation.

func (*CommandMutation) Where

func (m *CommandMutation) Where(ps ...predicate.Command)

Where appends a list predicates to the CommandMutation builder.

func (*CommandMutation) WhereP

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

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

type CommandQuery

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

CommandQuery is the builder for querying Command entities.

func (*CommandQuery) Aggregate

func (cq *CommandQuery) Aggregate(fns ...AggregateFunc) *CommandSelect

Aggregate returns a CommandSelect configured with the given aggregations.

func (*CommandQuery) All

func (cq *CommandQuery) All(ctx context.Context) ([]*Command, error)

All executes the query and returns a list of Commands.

func (*CommandQuery) AllX

func (cq *CommandQuery) AllX(ctx context.Context) []*Command

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

func (*CommandQuery) Clone

func (cq *CommandQuery) Clone() *CommandQuery

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

func (*CommandQuery) Count

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

Count returns the count of the given query.

func (*CommandQuery) CountX

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

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

func (*CommandQuery) Exist

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

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

func (*CommandQuery) ExistX

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

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

func (*CommandQuery) First

func (cq *CommandQuery) First(ctx context.Context) (*Command, error)

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

func (*CommandQuery) FirstID

func (cq *CommandQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*CommandQuery) FirstIDX

func (cq *CommandQuery) FirstIDX(ctx context.Context) int64

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

func (*CommandQuery) FirstX

func (cq *CommandQuery) FirstX(ctx context.Context) *Command

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

func (*CommandQuery) ForShare

func (cq *CommandQuery) ForShare(opts ...sql.LockOption) *CommandQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*CommandQuery) ForUpdate

func (cq *CommandQuery) ForUpdate(opts ...sql.LockOption) *CommandQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*CommandQuery) GroupBy

func (cq *CommandQuery) GroupBy(field string, fields ...string) *CommandGroupBy

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 {
	AgentID uint32 `json:"agent_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Command.Query().
	GroupBy(command.FieldAgentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CommandQuery) IDs

func (cq *CommandQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*CommandQuery) IDsX

func (cq *CommandQuery) IDsX(ctx context.Context) []int64

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

func (*CommandQuery) Limit

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

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

func (*CommandQuery) Offset

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

Offset to start from.

func (*CommandQuery) Only

func (cq *CommandQuery) Only(ctx context.Context) (*Command, error)

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

func (*CommandQuery) OnlyID

func (cq *CommandQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*CommandQuery) OnlyIDX

func (cq *CommandQuery) OnlyIDX(ctx context.Context) int64

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

func (*CommandQuery) OnlyX

func (cq *CommandQuery) OnlyX(ctx context.Context) *Command

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

func (*CommandQuery) Order

func (cq *CommandQuery) Order(o ...command.OrderOption) *CommandQuery

Order specifies how the records should be ordered.

func (*CommandQuery) QueryAgent

func (cq *CommandQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*CommandQuery) QueryMessage

func (cq *CommandQuery) QueryMessage() *MessageQuery

QueryMessage chains the current query on the "message" edge.

func (*CommandQuery) QueryOperator

func (cq *CommandQuery) QueryOperator() *OperatorQuery

QueryOperator chains the current query on the "operator" edge.

func (*CommandQuery) QueryTask

func (cq *CommandQuery) QueryTask() *TaskQuery

QueryTask chains the current query on the "task" edge.

func (*CommandQuery) Select

func (cq *CommandQuery) Select(fields ...string) *CommandSelect

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 {
	AgentID uint32 `json:"agent_id,omitempty"`
}

client.Command.Query().
	Select(command.FieldAgentID).
	Scan(ctx, &v)

func (*CommandQuery) Unique

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

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

func (cq *CommandQuery) Where(ps ...predicate.Command) *CommandQuery

Where adds a new predicate for the CommandQuery builder.

func (*CommandQuery) WithAgent

func (cq *CommandQuery) WithAgent(opts ...func(*AgentQuery)) *CommandQuery

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

func (*CommandQuery) WithMessage

func (cq *CommandQuery) WithMessage(opts ...func(*MessageQuery)) *CommandQuery

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

func (*CommandQuery) WithOperator

func (cq *CommandQuery) WithOperator(opts ...func(*OperatorQuery)) *CommandQuery

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

func (*CommandQuery) WithTask

func (cq *CommandQuery) WithTask(opts ...func(*TaskQuery)) *CommandQuery

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

type CommandSelect

type CommandSelect struct {
	*CommandQuery
	// contains filtered or unexported fields
}

CommandSelect is the builder for selecting fields of Command entities.

func (*CommandSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CommandSelect) Bool

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

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

func (*CommandSelect) BoolX

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

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

func (*CommandSelect) Bools

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

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

func (*CommandSelect) BoolsX

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

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

func (*CommandSelect) Float64

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

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

func (*CommandSelect) Float64X

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

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

func (*CommandSelect) Float64s

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

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

func (*CommandSelect) Float64sX

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

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

func (*CommandSelect) Int

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

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

func (*CommandSelect) IntX

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

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

func (*CommandSelect) Ints

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

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

func (*CommandSelect) IntsX

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

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

func (*CommandSelect) Scan

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

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

func (*CommandSelect) ScanX

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

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

func (*CommandSelect) String

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

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

func (*CommandSelect) StringX

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

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

func (*CommandSelect) Strings

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

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

func (*CommandSelect) StringsX

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

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

type CommandUpdate

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

CommandUpdate is the builder for updating Command entities.

func (*CommandUpdate) AddMessage

func (cu *CommandUpdate) AddMessage(m ...*Message) *CommandUpdate

AddMessage adds the "message" edges to the Message entity.

func (*CommandUpdate) AddMessageIDs

func (cu *CommandUpdate) AddMessageIDs(ids ...int) *CommandUpdate

AddMessageIDs adds the "message" edge to the Message entity by IDs.

func (*CommandUpdate) AddTask

func (cu *CommandUpdate) AddTask(t ...*Task) *CommandUpdate

AddTask adds the "task" edges to the Task entity.

func (*CommandUpdate) AddTaskIDs

func (cu *CommandUpdate) AddTaskIDs(ids ...int64) *CommandUpdate

AddTaskIDs adds the "task" edge to the Task entity by IDs.

func (*CommandUpdate) ClearAgent

func (cu *CommandUpdate) ClearAgent() *CommandUpdate

ClearAgent clears the "agent" edge to the Agent entity.

func (*CommandUpdate) ClearClosedAt

func (cu *CommandUpdate) ClearClosedAt() *CommandUpdate

ClearClosedAt clears the value of the "closed_at" field.

func (*CommandUpdate) ClearMessage

func (cu *CommandUpdate) ClearMessage() *CommandUpdate

ClearMessage clears all "message" edges to the Message entity.

func (*CommandUpdate) ClearOperator

func (cu *CommandUpdate) ClearOperator() *CommandUpdate

ClearOperator clears the "operator" edge to the Operator entity.

func (*CommandUpdate) ClearTask

func (cu *CommandUpdate) ClearTask() *CommandUpdate

ClearTask clears all "task" edges to the Task entity.

func (*CommandUpdate) Exec

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

Exec executes the query.

func (*CommandUpdate) ExecX

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

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

func (*CommandUpdate) Mutation

func (cu *CommandUpdate) Mutation() *CommandMutation

Mutation returns the CommandMutation object of the builder.

func (*CommandUpdate) RemoveMessage

func (cu *CommandUpdate) RemoveMessage(m ...*Message) *CommandUpdate

RemoveMessage removes "message" edges to Message entities.

func (*CommandUpdate) RemoveMessageIDs

func (cu *CommandUpdate) RemoveMessageIDs(ids ...int) *CommandUpdate

RemoveMessageIDs removes the "message" edge to Message entities by IDs.

func (*CommandUpdate) RemoveTask

func (cu *CommandUpdate) RemoveTask(t ...*Task) *CommandUpdate

RemoveTask removes "task" edges to Task entities.

func (*CommandUpdate) RemoveTaskIDs

func (cu *CommandUpdate) RemoveTaskIDs(ids ...int64) *CommandUpdate

RemoveTaskIDs removes the "task" edge to Task entities by IDs.

func (*CommandUpdate) Save

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

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

func (*CommandUpdate) SaveX

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

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

func (*CommandUpdate) SetAgent

func (cu *CommandUpdate) SetAgent(a *Agent) *CommandUpdate

SetAgent sets the "agent" edge to the Agent entity.

func (*CommandUpdate) SetAgentID

func (cu *CommandUpdate) SetAgentID(u uint32) *CommandUpdate

SetAgentID sets the "agent_id" field.

func (*CommandUpdate) SetAuthorID

func (cu *CommandUpdate) SetAuthorID(i int64) *CommandUpdate

SetAuthorID sets the "author_id" field.

func (*CommandUpdate) SetClosedAt

func (cu *CommandUpdate) SetClosedAt(t time.Time) *CommandUpdate

SetClosedAt sets the "closed_at" field.

func (*CommandUpdate) SetCmd

func (cu *CommandUpdate) SetCmd(s string) *CommandUpdate

SetCmd sets the "cmd" field.

func (*CommandUpdate) SetCreatedAt

func (cu *CommandUpdate) SetCreatedAt(t time.Time) *CommandUpdate

SetCreatedAt sets the "created_at" field.

func (*CommandUpdate) SetNillableAgentID

func (cu *CommandUpdate) SetNillableAgentID(u *uint32) *CommandUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*CommandUpdate) SetNillableAuthorID

func (cu *CommandUpdate) SetNillableAuthorID(i *int64) *CommandUpdate

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*CommandUpdate) SetNillableClosedAt

func (cu *CommandUpdate) SetNillableClosedAt(t *time.Time) *CommandUpdate

SetNillableClosedAt sets the "closed_at" field if the given value is not nil.

func (*CommandUpdate) SetNillableCmd

func (cu *CommandUpdate) SetNillableCmd(s *string) *CommandUpdate

SetNillableCmd sets the "cmd" field if the given value is not nil.

func (*CommandUpdate) SetNillableCreatedAt

func (cu *CommandUpdate) SetNillableCreatedAt(t *time.Time) *CommandUpdate

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

func (*CommandUpdate) SetNillableVisible

func (cu *CommandUpdate) SetNillableVisible(b *bool) *CommandUpdate

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*CommandUpdate) SetOperator

func (cu *CommandUpdate) SetOperator(o *Operator) *CommandUpdate

SetOperator sets the "operator" edge to the Operator entity.

func (*CommandUpdate) SetOperatorID

func (cu *CommandUpdate) SetOperatorID(id int64) *CommandUpdate

SetOperatorID sets the "operator" edge to the Operator entity by ID.

func (*CommandUpdate) SetVisible

func (cu *CommandUpdate) SetVisible(b bool) *CommandUpdate

SetVisible sets the "visible" field.

func (*CommandUpdate) Where

func (cu *CommandUpdate) Where(ps ...predicate.Command) *CommandUpdate

Where appends a list predicates to the CommandUpdate builder.

type CommandUpdateOne

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

CommandUpdateOne is the builder for updating a single Command entity.

func (*CommandUpdateOne) AddMessage

func (cuo *CommandUpdateOne) AddMessage(m ...*Message) *CommandUpdateOne

AddMessage adds the "message" edges to the Message entity.

func (*CommandUpdateOne) AddMessageIDs

func (cuo *CommandUpdateOne) AddMessageIDs(ids ...int) *CommandUpdateOne

AddMessageIDs adds the "message" edge to the Message entity by IDs.

func (*CommandUpdateOne) AddTask

func (cuo *CommandUpdateOne) AddTask(t ...*Task) *CommandUpdateOne

AddTask adds the "task" edges to the Task entity.

func (*CommandUpdateOne) AddTaskIDs

func (cuo *CommandUpdateOne) AddTaskIDs(ids ...int64) *CommandUpdateOne

AddTaskIDs adds the "task" edge to the Task entity by IDs.

func (*CommandUpdateOne) ClearAgent

func (cuo *CommandUpdateOne) ClearAgent() *CommandUpdateOne

ClearAgent clears the "agent" edge to the Agent entity.

func (*CommandUpdateOne) ClearClosedAt

func (cuo *CommandUpdateOne) ClearClosedAt() *CommandUpdateOne

ClearClosedAt clears the value of the "closed_at" field.

func (*CommandUpdateOne) ClearMessage

func (cuo *CommandUpdateOne) ClearMessage() *CommandUpdateOne

ClearMessage clears all "message" edges to the Message entity.

func (*CommandUpdateOne) ClearOperator

func (cuo *CommandUpdateOne) ClearOperator() *CommandUpdateOne

ClearOperator clears the "operator" edge to the Operator entity.

func (*CommandUpdateOne) ClearTask

func (cuo *CommandUpdateOne) ClearTask() *CommandUpdateOne

ClearTask clears all "task" edges to the Task entity.

func (*CommandUpdateOne) Exec

func (cuo *CommandUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CommandUpdateOne) ExecX

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

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

func (*CommandUpdateOne) Mutation

func (cuo *CommandUpdateOne) Mutation() *CommandMutation

Mutation returns the CommandMutation object of the builder.

func (*CommandUpdateOne) RemoveMessage

func (cuo *CommandUpdateOne) RemoveMessage(m ...*Message) *CommandUpdateOne

RemoveMessage removes "message" edges to Message entities.

func (*CommandUpdateOne) RemoveMessageIDs

func (cuo *CommandUpdateOne) RemoveMessageIDs(ids ...int) *CommandUpdateOne

RemoveMessageIDs removes the "message" edge to Message entities by IDs.

func (*CommandUpdateOne) RemoveTask

func (cuo *CommandUpdateOne) RemoveTask(t ...*Task) *CommandUpdateOne

RemoveTask removes "task" edges to Task entities.

func (*CommandUpdateOne) RemoveTaskIDs

func (cuo *CommandUpdateOne) RemoveTaskIDs(ids ...int64) *CommandUpdateOne

RemoveTaskIDs removes the "task" edge to Task entities by IDs.

func (*CommandUpdateOne) Save

func (cuo *CommandUpdateOne) Save(ctx context.Context) (*Command, error)

Save executes the query and returns the updated Command entity.

func (*CommandUpdateOne) SaveX

func (cuo *CommandUpdateOne) SaveX(ctx context.Context) *Command

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

func (*CommandUpdateOne) Select

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

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

func (*CommandUpdateOne) SetAgent

func (cuo *CommandUpdateOne) SetAgent(a *Agent) *CommandUpdateOne

SetAgent sets the "agent" edge to the Agent entity.

func (*CommandUpdateOne) SetAgentID

func (cuo *CommandUpdateOne) SetAgentID(u uint32) *CommandUpdateOne

SetAgentID sets the "agent_id" field.

func (*CommandUpdateOne) SetAuthorID

func (cuo *CommandUpdateOne) SetAuthorID(i int64) *CommandUpdateOne

SetAuthorID sets the "author_id" field.

func (*CommandUpdateOne) SetClosedAt

func (cuo *CommandUpdateOne) SetClosedAt(t time.Time) *CommandUpdateOne

SetClosedAt sets the "closed_at" field.

func (*CommandUpdateOne) SetCmd

func (cuo *CommandUpdateOne) SetCmd(s string) *CommandUpdateOne

SetCmd sets the "cmd" field.

func (*CommandUpdateOne) SetCreatedAt

func (cuo *CommandUpdateOne) SetCreatedAt(t time.Time) *CommandUpdateOne

SetCreatedAt sets the "created_at" field.

func (*CommandUpdateOne) SetNillableAgentID

func (cuo *CommandUpdateOne) SetNillableAgentID(u *uint32) *CommandUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*CommandUpdateOne) SetNillableAuthorID

func (cuo *CommandUpdateOne) SetNillableAuthorID(i *int64) *CommandUpdateOne

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*CommandUpdateOne) SetNillableClosedAt

func (cuo *CommandUpdateOne) SetNillableClosedAt(t *time.Time) *CommandUpdateOne

SetNillableClosedAt sets the "closed_at" field if the given value is not nil.

func (*CommandUpdateOne) SetNillableCmd

func (cuo *CommandUpdateOne) SetNillableCmd(s *string) *CommandUpdateOne

SetNillableCmd sets the "cmd" field if the given value is not nil.

func (*CommandUpdateOne) SetNillableCreatedAt

func (cuo *CommandUpdateOne) SetNillableCreatedAt(t *time.Time) *CommandUpdateOne

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

func (*CommandUpdateOne) SetNillableVisible

func (cuo *CommandUpdateOne) SetNillableVisible(b *bool) *CommandUpdateOne

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*CommandUpdateOne) SetOperator

func (cuo *CommandUpdateOne) SetOperator(o *Operator) *CommandUpdateOne

SetOperator sets the "operator" edge to the Operator entity.

func (*CommandUpdateOne) SetOperatorID

func (cuo *CommandUpdateOne) SetOperatorID(id int64) *CommandUpdateOne

SetOperatorID sets the "operator" edge to the Operator entity by ID.

func (*CommandUpdateOne) SetVisible

func (cuo *CommandUpdateOne) SetVisible(b bool) *CommandUpdateOne

SetVisible sets the "visible" field.

func (*CommandUpdateOne) Where

Where appends a list predicates to the CommandUpdate builder.

type Commands

type Commands []*Command

Commands is a parsable slice of Command.

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 Credential

type Credential struct {

	// ID of the ent.
	// credential ID
	ID int64 `json:"id,omitempty"`
	// Time when entity was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Time when entity was updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Time when entity was soft-deleted
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// username of credential
	Username string `json:"username,omitempty"`
	// password/hash/secret
	Secret string `json:"secret,omitempty"`
	// realm of host (or zone where credentials are valid)
	Realm string `json:"realm,omitempty"`
	// host from which creds has been extracted
	Host string `json:"host,omitempty"`
	// note of credential
	Note string `json:"note,omitempty"`
	// color of entity
	Color uint32 `json:"color,omitempty"`
	// contains filtered or unexported fields
}

Credential is the model entity for the Credential schema.

func (*Credential) String

func (c *Credential) String() string

String implements the fmt.Stringer.

func (*Credential) Unwrap

func (c *Credential) Unwrap() *Credential

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

func (c *Credential) Update() *CredentialUpdateOne

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

func (*Credential) Value

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

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

type CredentialClient

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

CredentialClient is a client for the Credential schema.

func NewCredentialClient

func NewCredentialClient(c config) *CredentialClient

NewCredentialClient returns a client for the Credential from the given config.

func (*CredentialClient) Create

func (c *CredentialClient) Create() *CredentialCreate

Create returns a builder for creating a Credential entity.

func (*CredentialClient) CreateBulk

func (c *CredentialClient) CreateBulk(builders ...*CredentialCreate) *CredentialCreateBulk

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

func (*CredentialClient) Delete

func (c *CredentialClient) Delete() *CredentialDelete

Delete returns a delete builder for Credential.

func (*CredentialClient) DeleteOne

func (c *CredentialClient) DeleteOne(cr *Credential) *CredentialDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CredentialClient) DeleteOneID

func (c *CredentialClient) DeleteOneID(id int64) *CredentialDeleteOne

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

func (*CredentialClient) Get

func (c *CredentialClient) Get(ctx context.Context, id int64) (*Credential, error)

Get returns a Credential entity by its id.

func (*CredentialClient) GetX

func (c *CredentialClient) GetX(ctx context.Context, id int64) *Credential

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

func (*CredentialClient) Hooks

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

Hooks returns the client hooks.

func (*CredentialClient) Intercept

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

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

func (*CredentialClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CredentialClient) MapCreateBulk

func (c *CredentialClient) MapCreateBulk(slice any, setFunc func(*CredentialCreate, int)) *CredentialCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CredentialClient) Query

func (c *CredentialClient) Query() *CredentialQuery

Query returns a query builder for Credential.

func (*CredentialClient) Update

func (c *CredentialClient) Update() *CredentialUpdate

Update returns an update builder for Credential.

func (*CredentialClient) UpdateOne

func (c *CredentialClient) UpdateOne(cr *Credential) *CredentialUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CredentialClient) UpdateOneID

func (c *CredentialClient) UpdateOneID(id int64) *CredentialUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CredentialClient) Use

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

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

type CredentialCreate

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

CredentialCreate is the builder for creating a Credential entity.

func (*CredentialCreate) Exec

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

Exec executes the query.

func (*CredentialCreate) ExecX

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

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

func (*CredentialCreate) Mutation

func (cc *CredentialCreate) Mutation() *CredentialMutation

Mutation returns the CredentialMutation object of the builder.

func (*CredentialCreate) Save

func (cc *CredentialCreate) Save(ctx context.Context) (*Credential, error)

Save creates the Credential in the database.

func (*CredentialCreate) SaveX

func (cc *CredentialCreate) SaveX(ctx context.Context) *Credential

SaveX calls Save and panics if Save returns an error.

func (*CredentialCreate) SetColor

func (cc *CredentialCreate) SetColor(u uint32) *CredentialCreate

SetColor sets the "color" field.

func (*CredentialCreate) SetCreatedAt

func (cc *CredentialCreate) SetCreatedAt(t time.Time) *CredentialCreate

SetCreatedAt sets the "created_at" field.

func (*CredentialCreate) SetDeletedAt

func (cc *CredentialCreate) SetDeletedAt(t time.Time) *CredentialCreate

SetDeletedAt sets the "deleted_at" field.

func (*CredentialCreate) SetHost

func (cc *CredentialCreate) SetHost(s string) *CredentialCreate

SetHost sets the "host" field.

func (*CredentialCreate) SetID

func (cc *CredentialCreate) SetID(i int64) *CredentialCreate

SetID sets the "id" field.

func (*CredentialCreate) SetNillableColor

func (cc *CredentialCreate) SetNillableColor(u *uint32) *CredentialCreate

SetNillableColor sets the "color" field if the given value is not nil.

func (*CredentialCreate) SetNillableCreatedAt

func (cc *CredentialCreate) SetNillableCreatedAt(t *time.Time) *CredentialCreate

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

func (*CredentialCreate) SetNillableDeletedAt

func (cc *CredentialCreate) SetNillableDeletedAt(t *time.Time) *CredentialCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CredentialCreate) SetNillableHost

func (cc *CredentialCreate) SetNillableHost(s *string) *CredentialCreate

SetNillableHost sets the "host" field if the given value is not nil.

func (*CredentialCreate) SetNillableNote

func (cc *CredentialCreate) SetNillableNote(s *string) *CredentialCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*CredentialCreate) SetNillableRealm

func (cc *CredentialCreate) SetNillableRealm(s *string) *CredentialCreate

SetNillableRealm sets the "realm" field if the given value is not nil.

func (*CredentialCreate) SetNillableSecret

func (cc *CredentialCreate) SetNillableSecret(s *string) *CredentialCreate

SetNillableSecret sets the "secret" field if the given value is not nil.

func (*CredentialCreate) SetNillableUpdatedAt

func (cc *CredentialCreate) SetNillableUpdatedAt(t *time.Time) *CredentialCreate

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

func (*CredentialCreate) SetNillableUsername

func (cc *CredentialCreate) SetNillableUsername(s *string) *CredentialCreate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*CredentialCreate) SetNote

func (cc *CredentialCreate) SetNote(s string) *CredentialCreate

SetNote sets the "note" field.

func (*CredentialCreate) SetRealm

func (cc *CredentialCreate) SetRealm(s string) *CredentialCreate

SetRealm sets the "realm" field.

func (*CredentialCreate) SetSecret

func (cc *CredentialCreate) SetSecret(s string) *CredentialCreate

SetSecret sets the "secret" field.

func (*CredentialCreate) SetUpdatedAt

func (cc *CredentialCreate) SetUpdatedAt(t time.Time) *CredentialCreate

SetUpdatedAt sets the "updated_at" field.

func (*CredentialCreate) SetUsername

func (cc *CredentialCreate) SetUsername(s string) *CredentialCreate

SetUsername sets the "username" field.

type CredentialCreateBulk

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

CredentialCreateBulk is the builder for creating many Credential entities in bulk.

func (*CredentialCreateBulk) Exec

func (ccb *CredentialCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CredentialCreateBulk) ExecX

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

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

func (*CredentialCreateBulk) Save

func (ccb *CredentialCreateBulk) Save(ctx context.Context) ([]*Credential, error)

Save creates the Credential entities in the database.

func (*CredentialCreateBulk) SaveX

func (ccb *CredentialCreateBulk) SaveX(ctx context.Context) []*Credential

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

type CredentialDelete

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

CredentialDelete is the builder for deleting a Credential entity.

func (*CredentialDelete) Exec

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

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

func (*CredentialDelete) ExecX

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

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

func (*CredentialDelete) Where

Where appends a list predicates to the CredentialDelete builder.

type CredentialDeleteOne

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

CredentialDeleteOne is the builder for deleting a single Credential entity.

func (*CredentialDeleteOne) Exec

func (cdo *CredentialDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CredentialDeleteOne) ExecX

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

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

func (*CredentialDeleteOne) Where

Where appends a list predicates to the CredentialDelete builder.

type CredentialGroupBy

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

CredentialGroupBy is the group-by builder for Credential entities.

func (*CredentialGroupBy) Aggregate

func (cgb *CredentialGroupBy) Aggregate(fns ...AggregateFunc) *CredentialGroupBy

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

func (*CredentialGroupBy) Bool

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

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

func (*CredentialGroupBy) BoolX

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

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

func (*CredentialGroupBy) Bools

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

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

func (*CredentialGroupBy) BoolsX

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

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

func (*CredentialGroupBy) Float64

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

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

func (*CredentialGroupBy) Float64X

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

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

func (*CredentialGroupBy) Float64s

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

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

func (*CredentialGroupBy) Float64sX

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

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

func (*CredentialGroupBy) Int

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

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

func (*CredentialGroupBy) IntX

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

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

func (*CredentialGroupBy) Ints

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

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

func (*CredentialGroupBy) IntsX

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

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

func (*CredentialGroupBy) Scan

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

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

func (*CredentialGroupBy) ScanX

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

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

func (*CredentialGroupBy) String

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

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

func (*CredentialGroupBy) StringX

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

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

func (*CredentialGroupBy) Strings

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

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

func (*CredentialGroupBy) StringsX

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

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

type CredentialMutation

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

CredentialMutation represents an operation that mutates the Credential nodes in the graph.

func (*CredentialMutation) AddColor

func (m *CredentialMutation) AddColor(u int32)

AddColor adds u to the "color" field.

func (*CredentialMutation) AddField

func (m *CredentialMutation) 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 (*CredentialMutation) AddedColor

func (m *CredentialMutation) AddedColor() (r int32, exists bool)

AddedColor returns the value that was added to the "color" field in this mutation.

func (*CredentialMutation) AddedEdges

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

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

func (*CredentialMutation) AddedField

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

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

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

func (*CredentialMutation) AddedIDs

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

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

func (*CredentialMutation) ClearDeletedAt

func (m *CredentialMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CredentialMutation) ClearEdge

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

func (m *CredentialMutation) 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 (*CredentialMutation) ClearHost

func (m *CredentialMutation) ClearHost()

ClearHost clears the value of the "host" field.

func (*CredentialMutation) ClearNote

func (m *CredentialMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*CredentialMutation) ClearRealm

func (m *CredentialMutation) ClearRealm()

ClearRealm clears the value of the "realm" field.

func (*CredentialMutation) ClearSecret

func (m *CredentialMutation) ClearSecret()

ClearSecret clears the value of the "secret" field.

func (*CredentialMutation) ClearUsername

func (m *CredentialMutation) ClearUsername()

ClearUsername clears the value of the "username" field.

func (*CredentialMutation) ClearedEdges

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

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

func (*CredentialMutation) ClearedFields

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

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

func (CredentialMutation) Client

func (m CredentialMutation) 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 (*CredentialMutation) Color

func (m *CredentialMutation) Color() (r uint32, exists bool)

Color returns the value of the "color" field in the mutation.

func (*CredentialMutation) CreatedAt

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

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

func (*CredentialMutation) DeletedAt

func (m *CredentialMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*CredentialMutation) DeletedAtCleared

func (m *CredentialMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*CredentialMutation) EdgeCleared

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

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

func (*CredentialMutation) Field

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

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

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

func (*CredentialMutation) Fields

func (m *CredentialMutation) 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 (*CredentialMutation) Host

func (m *CredentialMutation) Host() (r string, exists bool)

Host returns the value of the "host" field in the mutation.

func (*CredentialMutation) HostCleared

func (m *CredentialMutation) HostCleared() bool

HostCleared returns if the "host" field was cleared in this mutation.

func (*CredentialMutation) ID

func (m *CredentialMutation) ID() (id int64, 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 (*CredentialMutation) IDs

func (m *CredentialMutation) IDs(ctx context.Context) ([]int64, 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 (*CredentialMutation) Note

func (m *CredentialMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*CredentialMutation) NoteCleared

func (m *CredentialMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*CredentialMutation) OldColor

func (m *CredentialMutation) OldColor(ctx context.Context) (v uint32, err error)

OldColor returns the old "color" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldCreatedAt

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

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

func (m *CredentialMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldField

func (m *CredentialMutation) 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 (*CredentialMutation) OldHost

func (m *CredentialMutation) OldHost(ctx context.Context) (v string, err error)

OldHost returns the old "host" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldNote

func (m *CredentialMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldRealm

func (m *CredentialMutation) OldRealm(ctx context.Context) (v string, err error)

OldRealm returns the old "realm" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldSecret

func (m *CredentialMutation) OldSecret(ctx context.Context) (v string, err error)

OldSecret returns the old "secret" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldUpdatedAt

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

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

func (m *CredentialMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) Op

func (m *CredentialMutation) Op() Op

Op returns the operation name.

func (*CredentialMutation) Realm

func (m *CredentialMutation) Realm() (r string, exists bool)

Realm returns the value of the "realm" field in the mutation.

func (*CredentialMutation) RealmCleared

func (m *CredentialMutation) RealmCleared() bool

RealmCleared returns if the "realm" field was cleared in this mutation.

func (*CredentialMutation) RemovedEdges

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

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

func (*CredentialMutation) RemovedIDs

func (m *CredentialMutation) 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 (*CredentialMutation) ResetColor

func (m *CredentialMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*CredentialMutation) ResetCreatedAt

func (m *CredentialMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CredentialMutation) ResetDeletedAt

func (m *CredentialMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*CredentialMutation) ResetEdge

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

func (m *CredentialMutation) 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 (*CredentialMutation) ResetHost

func (m *CredentialMutation) ResetHost()

ResetHost resets all changes to the "host" field.

func (*CredentialMutation) ResetNote

func (m *CredentialMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*CredentialMutation) ResetRealm

func (m *CredentialMutation) ResetRealm()

ResetRealm resets all changes to the "realm" field.

func (*CredentialMutation) ResetSecret

func (m *CredentialMutation) ResetSecret()

ResetSecret resets all changes to the "secret" field.

func (*CredentialMutation) ResetUpdatedAt

func (m *CredentialMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CredentialMutation) ResetUsername

func (m *CredentialMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*CredentialMutation) Secret

func (m *CredentialMutation) Secret() (r string, exists bool)

Secret returns the value of the "secret" field in the mutation.

func (*CredentialMutation) SecretCleared

func (m *CredentialMutation) SecretCleared() bool

SecretCleared returns if the "secret" field was cleared in this mutation.

func (*CredentialMutation) SetColor

func (m *CredentialMutation) SetColor(u uint32)

SetColor sets the "color" field.

func (*CredentialMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CredentialMutation) SetDeletedAt

func (m *CredentialMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*CredentialMutation) SetField

func (m *CredentialMutation) 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 (*CredentialMutation) SetHost

func (m *CredentialMutation) SetHost(s string)

SetHost sets the "host" field.

func (*CredentialMutation) SetID

func (m *CredentialMutation) SetID(id int64)

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

func (*CredentialMutation) SetNote

func (m *CredentialMutation) SetNote(s string)

SetNote sets the "note" field.

func (*CredentialMutation) SetOp

func (m *CredentialMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CredentialMutation) SetRealm

func (m *CredentialMutation) SetRealm(s string)

SetRealm sets the "realm" field.

func (*CredentialMutation) SetSecret

func (m *CredentialMutation) SetSecret(s string)

SetSecret sets the "secret" field.

func (*CredentialMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CredentialMutation) SetUsername

func (m *CredentialMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (CredentialMutation) Tx

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

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

func (*CredentialMutation) Type

func (m *CredentialMutation) Type() string

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

func (*CredentialMutation) UpdatedAt

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

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

func (*CredentialMutation) Username

func (m *CredentialMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*CredentialMutation) UsernameCleared

func (m *CredentialMutation) UsernameCleared() bool

UsernameCleared returns if the "username" field was cleared in this mutation.

func (*CredentialMutation) Where

func (m *CredentialMutation) Where(ps ...predicate.Credential)

Where appends a list predicates to the CredentialMutation builder.

func (*CredentialMutation) WhereP

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

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

type CredentialQuery

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

CredentialQuery is the builder for querying Credential entities.

func (*CredentialQuery) Aggregate

func (cq *CredentialQuery) Aggregate(fns ...AggregateFunc) *CredentialSelect

Aggregate returns a CredentialSelect configured with the given aggregations.

func (*CredentialQuery) All

func (cq *CredentialQuery) All(ctx context.Context) ([]*Credential, error)

All executes the query and returns a list of Credentials.

func (*CredentialQuery) AllX

func (cq *CredentialQuery) AllX(ctx context.Context) []*Credential

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

func (*CredentialQuery) Clone

func (cq *CredentialQuery) Clone() *CredentialQuery

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

func (*CredentialQuery) Count

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

Count returns the count of the given query.

func (*CredentialQuery) CountX

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

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

func (*CredentialQuery) Exist

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

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

func (*CredentialQuery) ExistX

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

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

func (*CredentialQuery) First

func (cq *CredentialQuery) First(ctx context.Context) (*Credential, error)

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

func (*CredentialQuery) FirstID

func (cq *CredentialQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*CredentialQuery) FirstIDX

func (cq *CredentialQuery) FirstIDX(ctx context.Context) int64

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

func (*CredentialQuery) FirstX

func (cq *CredentialQuery) FirstX(ctx context.Context) *Credential

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

func (*CredentialQuery) ForShare

func (cq *CredentialQuery) ForShare(opts ...sql.LockOption) *CredentialQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*CredentialQuery) ForUpdate

func (cq *CredentialQuery) ForUpdate(opts ...sql.LockOption) *CredentialQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*CredentialQuery) GroupBy

func (cq *CredentialQuery) GroupBy(field string, fields ...string) *CredentialGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Credential.Query().
	GroupBy(credential.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CredentialQuery) IDs

func (cq *CredentialQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*CredentialQuery) IDsX

func (cq *CredentialQuery) IDsX(ctx context.Context) []int64

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

func (*CredentialQuery) Limit

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

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

func (*CredentialQuery) Offset

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

Offset to start from.

func (*CredentialQuery) Only

func (cq *CredentialQuery) Only(ctx context.Context) (*Credential, error)

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

func (*CredentialQuery) OnlyID

func (cq *CredentialQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*CredentialQuery) OnlyIDX

func (cq *CredentialQuery) OnlyIDX(ctx context.Context) int64

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

func (*CredentialQuery) OnlyX

func (cq *CredentialQuery) OnlyX(ctx context.Context) *Credential

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

func (*CredentialQuery) Order

Order specifies how the records should be ordered.

func (*CredentialQuery) Select

func (cq *CredentialQuery) Select(fields ...string) *CredentialSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Credential.Query().
	Select(credential.FieldCreatedAt).
	Scan(ctx, &v)

func (*CredentialQuery) Unique

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

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

Where adds a new predicate for the CredentialQuery builder.

type CredentialSelect

type CredentialSelect struct {
	*CredentialQuery
	// contains filtered or unexported fields
}

CredentialSelect is the builder for selecting fields of Credential entities.

func (*CredentialSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CredentialSelect) Bool

func (s *CredentialSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) BoolX

func (s *CredentialSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CredentialSelect) Bools

func (s *CredentialSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) BoolsX

func (s *CredentialSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CredentialSelect) Float64

func (s *CredentialSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) Float64X

func (s *CredentialSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CredentialSelect) Float64s

func (s *CredentialSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) Float64sX

func (s *CredentialSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CredentialSelect) Int

func (s *CredentialSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) IntX

func (s *CredentialSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CredentialSelect) Ints

func (s *CredentialSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) IntsX

func (s *CredentialSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CredentialSelect) Scan

func (cs *CredentialSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CredentialSelect) ScanX

func (s *CredentialSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CredentialSelect) String

func (s *CredentialSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) StringX

func (s *CredentialSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CredentialSelect) Strings

func (s *CredentialSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CredentialSelect) StringsX

func (s *CredentialSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CredentialUpdate

type CredentialUpdate struct {
	// contains filtered or unexported fields
}

CredentialUpdate is the builder for updating Credential entities.

func (*CredentialUpdate) AddColor

func (cu *CredentialUpdate) AddColor(u int32) *CredentialUpdate

AddColor adds u to the "color" field.

func (*CredentialUpdate) ClearDeletedAt

func (cu *CredentialUpdate) ClearDeletedAt() *CredentialUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CredentialUpdate) ClearHost

func (cu *CredentialUpdate) ClearHost() *CredentialUpdate

ClearHost clears the value of the "host" field.

func (*CredentialUpdate) ClearNote

func (cu *CredentialUpdate) ClearNote() *CredentialUpdate

ClearNote clears the value of the "note" field.

func (*CredentialUpdate) ClearRealm

func (cu *CredentialUpdate) ClearRealm() *CredentialUpdate

ClearRealm clears the value of the "realm" field.

func (*CredentialUpdate) ClearSecret

func (cu *CredentialUpdate) ClearSecret() *CredentialUpdate

ClearSecret clears the value of the "secret" field.

func (*CredentialUpdate) ClearUsername

func (cu *CredentialUpdate) ClearUsername() *CredentialUpdate

ClearUsername clears the value of the "username" field.

func (*CredentialUpdate) Exec

func (cu *CredentialUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CredentialUpdate) ExecX

func (cu *CredentialUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CredentialUpdate) Mutation

func (cu *CredentialUpdate) Mutation() *CredentialMutation

Mutation returns the CredentialMutation object of the builder.

func (*CredentialUpdate) Save

func (cu *CredentialUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CredentialUpdate) SaveX

func (cu *CredentialUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CredentialUpdate) SetColor

func (cu *CredentialUpdate) SetColor(u uint32) *CredentialUpdate

SetColor sets the "color" field.

func (*CredentialUpdate) SetDeletedAt

func (cu *CredentialUpdate) SetDeletedAt(t time.Time) *CredentialUpdate

SetDeletedAt sets the "deleted_at" field.

func (*CredentialUpdate) SetHost

func (cu *CredentialUpdate) SetHost(s string) *CredentialUpdate

SetHost sets the "host" field.

func (*CredentialUpdate) SetNillableColor

func (cu *CredentialUpdate) SetNillableColor(u *uint32) *CredentialUpdate

SetNillableColor sets the "color" field if the given value is not nil.

func (*CredentialUpdate) SetNillableDeletedAt

func (cu *CredentialUpdate) SetNillableDeletedAt(t *time.Time) *CredentialUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CredentialUpdate) SetNillableHost

func (cu *CredentialUpdate) SetNillableHost(s *string) *CredentialUpdate

SetNillableHost sets the "host" field if the given value is not nil.

func (*CredentialUpdate) SetNillableNote

func (cu *CredentialUpdate) SetNillableNote(s *string) *CredentialUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*CredentialUpdate) SetNillableRealm

func (cu *CredentialUpdate) SetNillableRealm(s *string) *CredentialUpdate

SetNillableRealm sets the "realm" field if the given value is not nil.

func (*CredentialUpdate) SetNillableSecret

func (cu *CredentialUpdate) SetNillableSecret(s *string) *CredentialUpdate

SetNillableSecret sets the "secret" field if the given value is not nil.

func (*CredentialUpdate) SetNillableUsername

func (cu *CredentialUpdate) SetNillableUsername(s *string) *CredentialUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*CredentialUpdate) SetNote

func (cu *CredentialUpdate) SetNote(s string) *CredentialUpdate

SetNote sets the "note" field.

func (*CredentialUpdate) SetRealm

func (cu *CredentialUpdate) SetRealm(s string) *CredentialUpdate

SetRealm sets the "realm" field.

func (*CredentialUpdate) SetSecret

func (cu *CredentialUpdate) SetSecret(s string) *CredentialUpdate

SetSecret sets the "secret" field.

func (*CredentialUpdate) SetUpdatedAt

func (cu *CredentialUpdate) SetUpdatedAt(t time.Time) *CredentialUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CredentialUpdate) SetUsername

func (cu *CredentialUpdate) SetUsername(s string) *CredentialUpdate

SetUsername sets the "username" field.

func (*CredentialUpdate) Where

Where appends a list predicates to the CredentialUpdate builder.

type CredentialUpdateOne

type CredentialUpdateOne struct {
	// contains filtered or unexported fields
}

CredentialUpdateOne is the builder for updating a single Credential entity.

func (*CredentialUpdateOne) AddColor

func (cuo *CredentialUpdateOne) AddColor(u int32) *CredentialUpdateOne

AddColor adds u to the "color" field.

func (*CredentialUpdateOne) ClearDeletedAt

func (cuo *CredentialUpdateOne) ClearDeletedAt() *CredentialUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CredentialUpdateOne) ClearHost

func (cuo *CredentialUpdateOne) ClearHost() *CredentialUpdateOne

ClearHost clears the value of the "host" field.

func (*CredentialUpdateOne) ClearNote

func (cuo *CredentialUpdateOne) ClearNote() *CredentialUpdateOne

ClearNote clears the value of the "note" field.

func (*CredentialUpdateOne) ClearRealm

func (cuo *CredentialUpdateOne) ClearRealm() *CredentialUpdateOne

ClearRealm clears the value of the "realm" field.

func (*CredentialUpdateOne) ClearSecret

func (cuo *CredentialUpdateOne) ClearSecret() *CredentialUpdateOne

ClearSecret clears the value of the "secret" field.

func (*CredentialUpdateOne) ClearUsername

func (cuo *CredentialUpdateOne) ClearUsername() *CredentialUpdateOne

ClearUsername clears the value of the "username" field.

func (*CredentialUpdateOne) Exec

func (cuo *CredentialUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CredentialUpdateOne) ExecX

func (cuo *CredentialUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CredentialUpdateOne) Mutation

func (cuo *CredentialUpdateOne) Mutation() *CredentialMutation

Mutation returns the CredentialMutation object of the builder.

func (*CredentialUpdateOne) Save

func (cuo *CredentialUpdateOne) Save(ctx context.Context) (*Credential, error)

Save executes the query and returns the updated Credential entity.

func (*CredentialUpdateOne) SaveX

func (cuo *CredentialUpdateOne) SaveX(ctx context.Context) *Credential

SaveX is like Save, but panics if an error occurs.

func (*CredentialUpdateOne) Select

func (cuo *CredentialUpdateOne) Select(field string, fields ...string) *CredentialUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CredentialUpdateOne) SetColor

SetColor sets the "color" field.

func (*CredentialUpdateOne) SetDeletedAt

func (cuo *CredentialUpdateOne) SetDeletedAt(t time.Time) *CredentialUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*CredentialUpdateOne) SetHost

SetHost sets the "host" field.

func (*CredentialUpdateOne) SetNillableColor

func (cuo *CredentialUpdateOne) SetNillableColor(u *uint32) *CredentialUpdateOne

SetNillableColor sets the "color" field if the given value is not nil.

func (*CredentialUpdateOne) SetNillableDeletedAt

func (cuo *CredentialUpdateOne) SetNillableDeletedAt(t *time.Time) *CredentialUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CredentialUpdateOne) SetNillableHost

func (cuo *CredentialUpdateOne) SetNillableHost(s *string) *CredentialUpdateOne

SetNillableHost sets the "host" field if the given value is not nil.

func (*CredentialUpdateOne) SetNillableNote

func (cuo *CredentialUpdateOne) SetNillableNote(s *string) *CredentialUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*CredentialUpdateOne) SetNillableRealm

func (cuo *CredentialUpdateOne) SetNillableRealm(s *string) *CredentialUpdateOne

SetNillableRealm sets the "realm" field if the given value is not nil.

func (*CredentialUpdateOne) SetNillableSecret

func (cuo *CredentialUpdateOne) SetNillableSecret(s *string) *CredentialUpdateOne

SetNillableSecret sets the "secret" field if the given value is not nil.

func (*CredentialUpdateOne) SetNillableUsername

func (cuo *CredentialUpdateOne) SetNillableUsername(s *string) *CredentialUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*CredentialUpdateOne) SetNote

SetNote sets the "note" field.

func (*CredentialUpdateOne) SetRealm

SetRealm sets the "realm" field.

func (*CredentialUpdateOne) SetSecret

func (cuo *CredentialUpdateOne) SetSecret(s string) *CredentialUpdateOne

SetSecret sets the "secret" field.

func (*CredentialUpdateOne) SetUpdatedAt

func (cuo *CredentialUpdateOne) SetUpdatedAt(t time.Time) *CredentialUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CredentialUpdateOne) SetUsername

func (cuo *CredentialUpdateOne) SetUsername(s string) *CredentialUpdateOne

SetUsername sets the "username" field.

func (*CredentialUpdateOne) Where

Where appends a list predicates to the CredentialUpdate builder.

type Credentials

type Credentials []*Credential

Credentials is a parsable slice of Credential.

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 Listener

type Listener struct {

	// ID of the ent.
	// listener ID
	ID int64 `json:"id,omitempty"`
	// Time when entity was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Time when entity was updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Time when entity was soft-deleted
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// authentication token of listener
	Token string `json:"token,omitempty"`
	// freehand name of listener
	Name string `json:"name,omitempty"`
	// bind ip address of listener
	IP types.Inet `json:"ip,omitempty"`
	// bind port of listener
	Port uint16 `json:"port,omitempty"`
	// color of entity
	Color uint32 `json:"color,omitempty"`
	// note of listener
	Note string `json:"note,omitempty"`
	// last activity of listener
	Last time.Time `json:"last,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ListenerQuery when eager-loading is set.
	Edges ListenerEdges `json:"edges"`
	// contains filtered or unexported fields
}

Listener is the model entity for the Listener schema.

func (*Listener) QueryAgent

func (l *Listener) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the Listener entity.

func (*Listener) String

func (l *Listener) String() string

String implements the fmt.Stringer.

func (*Listener) Unwrap

func (l *Listener) Unwrap() *Listener

Unwrap unwraps the Listener 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 (*Listener) Update

func (l *Listener) Update() *ListenerUpdateOne

Update returns a builder for updating this Listener. Note that you need to call Listener.Unwrap() before calling this method if this Listener was returned from a transaction, and the transaction was committed or rolled back.

func (*Listener) Value

func (l *Listener) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Listener. This includes values selected through modifiers, order, etc.

type ListenerClient

type ListenerClient struct {
	// contains filtered or unexported fields
}

ListenerClient is a client for the Listener schema.

func NewListenerClient

func NewListenerClient(c config) *ListenerClient

NewListenerClient returns a client for the Listener from the given config.

func (*ListenerClient) Create

func (c *ListenerClient) Create() *ListenerCreate

Create returns a builder for creating a Listener entity.

func (*ListenerClient) CreateBulk

func (c *ListenerClient) CreateBulk(builders ...*ListenerCreate) *ListenerCreateBulk

CreateBulk returns a builder for creating a bulk of Listener entities.

func (*ListenerClient) Delete

func (c *ListenerClient) Delete() *ListenerDelete

Delete returns a delete builder for Listener.

func (*ListenerClient) DeleteOne

func (c *ListenerClient) DeleteOne(l *Listener) *ListenerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ListenerClient) DeleteOneID

func (c *ListenerClient) DeleteOneID(id int64) *ListenerDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ListenerClient) Get

func (c *ListenerClient) Get(ctx context.Context, id int64) (*Listener, error)

Get returns a Listener entity by its id.

func (*ListenerClient) GetX

func (c *ListenerClient) GetX(ctx context.Context, id int64) *Listener

GetX is like Get, but panics if an error occurs.

func (*ListenerClient) Hooks

func (c *ListenerClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ListenerClient) Intercept

func (c *ListenerClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `listener.Intercept(f(g(h())))`.

func (*ListenerClient) Interceptors

func (c *ListenerClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ListenerClient) MapCreateBulk

func (c *ListenerClient) MapCreateBulk(slice any, setFunc func(*ListenerCreate, int)) *ListenerCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ListenerClient) Query

func (c *ListenerClient) Query() *ListenerQuery

Query returns a query builder for Listener.

func (*ListenerClient) QueryAgent

func (c *ListenerClient) QueryAgent(l *Listener) *AgentQuery

QueryAgent queries the agent edge of a Listener.

func (*ListenerClient) Update

func (c *ListenerClient) Update() *ListenerUpdate

Update returns an update builder for Listener.

func (*ListenerClient) UpdateOne

func (c *ListenerClient) UpdateOne(l *Listener) *ListenerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ListenerClient) UpdateOneID

func (c *ListenerClient) UpdateOneID(id int64) *ListenerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ListenerClient) Use

func (c *ListenerClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `listener.Hooks(f(g(h())))`.

type ListenerCreate

type ListenerCreate struct {
	// contains filtered or unexported fields
}

ListenerCreate is the builder for creating a Listener entity.

func (*ListenerCreate) AddAgent

func (lc *ListenerCreate) AddAgent(a ...*Agent) *ListenerCreate

AddAgent adds the "agent" edges to the Agent entity.

func (*ListenerCreate) AddAgentIDs

func (lc *ListenerCreate) AddAgentIDs(ids ...uint32) *ListenerCreate

AddAgentIDs adds the "agent" edge to the Agent entity by IDs.

func (*ListenerCreate) Exec

func (lc *ListenerCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ListenerCreate) ExecX

func (lc *ListenerCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ListenerCreate) Mutation

func (lc *ListenerCreate) Mutation() *ListenerMutation

Mutation returns the ListenerMutation object of the builder.

func (*ListenerCreate) Save

func (lc *ListenerCreate) Save(ctx context.Context) (*Listener, error)

Save creates the Listener in the database.

func (*ListenerCreate) SaveX

func (lc *ListenerCreate) SaveX(ctx context.Context) *Listener

SaveX calls Save and panics if Save returns an error.

func (*ListenerCreate) SetColor

func (lc *ListenerCreate) SetColor(u uint32) *ListenerCreate

SetColor sets the "color" field.

func (*ListenerCreate) SetCreatedAt

func (lc *ListenerCreate) SetCreatedAt(t time.Time) *ListenerCreate

SetCreatedAt sets the "created_at" field.

func (*ListenerCreate) SetDeletedAt

func (lc *ListenerCreate) SetDeletedAt(t time.Time) *ListenerCreate

SetDeletedAt sets the "deleted_at" field.

func (*ListenerCreate) SetID

func (lc *ListenerCreate) SetID(i int64) *ListenerCreate

SetID sets the "id" field.

func (*ListenerCreate) SetIP

func (lc *ListenerCreate) SetIP(t types.Inet) *ListenerCreate

SetIP sets the "ip" field.

func (*ListenerCreate) SetLast

func (lc *ListenerCreate) SetLast(t time.Time) *ListenerCreate

SetLast sets the "last" field.

func (*ListenerCreate) SetName

func (lc *ListenerCreate) SetName(s string) *ListenerCreate

SetName sets the "name" field.

func (*ListenerCreate) SetNillableColor

func (lc *ListenerCreate) SetNillableColor(u *uint32) *ListenerCreate

SetNillableColor sets the "color" field if the given value is not nil.

func (*ListenerCreate) SetNillableCreatedAt

func (lc *ListenerCreate) SetNillableCreatedAt(t *time.Time) *ListenerCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ListenerCreate) SetNillableDeletedAt

func (lc *ListenerCreate) SetNillableDeletedAt(t *time.Time) *ListenerCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ListenerCreate) SetNillableIP

func (lc *ListenerCreate) SetNillableIP(t *types.Inet) *ListenerCreate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*ListenerCreate) SetNillableLast

func (lc *ListenerCreate) SetNillableLast(t *time.Time) *ListenerCreate

SetNillableLast sets the "last" field if the given value is not nil.

func (*ListenerCreate) SetNillableName

func (lc *ListenerCreate) SetNillableName(s *string) *ListenerCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*ListenerCreate) SetNillableNote

func (lc *ListenerCreate) SetNillableNote(s *string) *ListenerCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*ListenerCreate) SetNillablePort

func (lc *ListenerCreate) SetNillablePort(u *uint16) *ListenerCreate

SetNillablePort sets the "port" field if the given value is not nil.

func (*ListenerCreate) SetNillableToken

func (lc *ListenerCreate) SetNillableToken(s *string) *ListenerCreate

SetNillableToken sets the "token" field if the given value is not nil.

func (*ListenerCreate) SetNillableUpdatedAt

func (lc *ListenerCreate) SetNillableUpdatedAt(t *time.Time) *ListenerCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ListenerCreate) SetNote

func (lc *ListenerCreate) SetNote(s string) *ListenerCreate

SetNote sets the "note" field.

func (*ListenerCreate) SetPort

func (lc *ListenerCreate) SetPort(u uint16) *ListenerCreate

SetPort sets the "port" field.

func (*ListenerCreate) SetToken

func (lc *ListenerCreate) SetToken(s string) *ListenerCreate

SetToken sets the "token" field.

func (*ListenerCreate) SetUpdatedAt

func (lc *ListenerCreate) SetUpdatedAt(t time.Time) *ListenerCreate

SetUpdatedAt sets the "updated_at" field.

type ListenerCreateBulk

type ListenerCreateBulk struct {
	// contains filtered or unexported fields
}

ListenerCreateBulk is the builder for creating many Listener entities in bulk.

func (*ListenerCreateBulk) Exec

func (lcb *ListenerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ListenerCreateBulk) ExecX

func (lcb *ListenerCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ListenerCreateBulk) Save

func (lcb *ListenerCreateBulk) Save(ctx context.Context) ([]*Listener, error)

Save creates the Listener entities in the database.

func (*ListenerCreateBulk) SaveX

func (lcb *ListenerCreateBulk) SaveX(ctx context.Context) []*Listener

SaveX is like Save, but panics if an error occurs.

type ListenerDelete

type ListenerDelete struct {
	// contains filtered or unexported fields
}

ListenerDelete is the builder for deleting a Listener entity.

func (*ListenerDelete) Exec

func (ld *ListenerDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ListenerDelete) ExecX

func (ld *ListenerDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ListenerDelete) Where

func (ld *ListenerDelete) Where(ps ...predicate.Listener) *ListenerDelete

Where appends a list predicates to the ListenerDelete builder.

type ListenerDeleteOne

type ListenerDeleteOne struct {
	// contains filtered or unexported fields
}

ListenerDeleteOne is the builder for deleting a single Listener entity.

func (*ListenerDeleteOne) Exec

func (ldo *ListenerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ListenerDeleteOne) ExecX

func (ldo *ListenerDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ListenerDeleteOne) Where

Where appends a list predicates to the ListenerDelete builder.

type ListenerEdges

type ListenerEdges struct {
	// Agent holds the value of the agent edge.
	Agent []*Agent `json:"agent,omitempty"`
	// contains filtered or unexported fields
}

ListenerEdges holds the relations/edges for other nodes in the graph.

func (ListenerEdges) AgentOrErr

func (e ListenerEdges) AgentOrErr() ([]*Agent, error)

AgentOrErr returns the Agent value or an error if the edge was not loaded in eager-loading.

type ListenerGroupBy

type ListenerGroupBy struct {
	// contains filtered or unexported fields
}

ListenerGroupBy is the group-by builder for Listener entities.

func (*ListenerGroupBy) Aggregate

func (lgb *ListenerGroupBy) Aggregate(fns ...AggregateFunc) *ListenerGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ListenerGroupBy) Bool

func (s *ListenerGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) BoolX

func (s *ListenerGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ListenerGroupBy) Bools

func (s *ListenerGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) BoolsX

func (s *ListenerGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ListenerGroupBy) Float64

func (s *ListenerGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) Float64X

func (s *ListenerGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ListenerGroupBy) Float64s

func (s *ListenerGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) Float64sX

func (s *ListenerGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ListenerGroupBy) Int

func (s *ListenerGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) IntX

func (s *ListenerGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ListenerGroupBy) Ints

func (s *ListenerGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) IntsX

func (s *ListenerGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ListenerGroupBy) Scan

func (lgb *ListenerGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ListenerGroupBy) ScanX

func (s *ListenerGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ListenerGroupBy) String

func (s *ListenerGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) StringX

func (s *ListenerGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ListenerGroupBy) Strings

func (s *ListenerGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ListenerGroupBy) StringsX

func (s *ListenerGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ListenerMutation

type ListenerMutation struct {
	// contains filtered or unexported fields
}

ListenerMutation represents an operation that mutates the Listener nodes in the graph.

func (*ListenerMutation) AddAgentIDs

func (m *ListenerMutation) AddAgentIDs(ids ...uint32)

AddAgentIDs adds the "agent" edge to the Agent entity by ids.

func (*ListenerMutation) AddColor

func (m *ListenerMutation) AddColor(u int32)

AddColor adds u to the "color" field.

func (*ListenerMutation) AddField

func (m *ListenerMutation) 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 (*ListenerMutation) AddPort

func (m *ListenerMutation) AddPort(u int16)

AddPort adds u to the "port" field.

func (*ListenerMutation) AddedColor

func (m *ListenerMutation) AddedColor() (r int32, exists bool)

AddedColor returns the value that was added to the "color" field in this mutation.

func (*ListenerMutation) AddedEdges

func (m *ListenerMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ListenerMutation) AddedField

func (m *ListenerMutation) 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 (*ListenerMutation) AddedFields

func (m *ListenerMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ListenerMutation) AddedIDs

func (m *ListenerMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ListenerMutation) AddedPort

func (m *ListenerMutation) AddedPort() (r int16, exists bool)

AddedPort returns the value that was added to the "port" field in this mutation.

func (*ListenerMutation) AgentCleared

func (m *ListenerMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*ListenerMutation) AgentIDs

func (m *ListenerMutation) AgentIDs() (ids []uint32)

AgentIDs returns the "agent" edge IDs in the mutation.

func (*ListenerMutation) ClearAgent

func (m *ListenerMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*ListenerMutation) ClearDeletedAt

func (m *ListenerMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ListenerMutation) ClearEdge

func (m *ListenerMutation) 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 (*ListenerMutation) ClearField

func (m *ListenerMutation) 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 (*ListenerMutation) ClearIP

func (m *ListenerMutation) ClearIP()

ClearIP clears the value of the "ip" field.

func (*ListenerMutation) ClearName

func (m *ListenerMutation) ClearName()

ClearName clears the value of the "name" field.

func (*ListenerMutation) ClearNote

func (m *ListenerMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*ListenerMutation) ClearPort

func (m *ListenerMutation) ClearPort()

ClearPort clears the value of the "port" field.

func (*ListenerMutation) ClearToken

func (m *ListenerMutation) ClearToken()

ClearToken clears the value of the "token" field.

func (*ListenerMutation) ClearedEdges

func (m *ListenerMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ListenerMutation) ClearedFields

func (m *ListenerMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ListenerMutation) Client

func (m ListenerMutation) 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 (*ListenerMutation) Color

func (m *ListenerMutation) Color() (r uint32, exists bool)

Color returns the value of the "color" field in the mutation.

func (*ListenerMutation) CreatedAt

func (m *ListenerMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ListenerMutation) DeletedAt

func (m *ListenerMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*ListenerMutation) DeletedAtCleared

func (m *ListenerMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*ListenerMutation) EdgeCleared

func (m *ListenerMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ListenerMutation) Field

func (m *ListenerMutation) 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 (*ListenerMutation) FieldCleared

func (m *ListenerMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ListenerMutation) Fields

func (m *ListenerMutation) 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 (*ListenerMutation) ID

func (m *ListenerMutation) ID() (id int64, 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 (*ListenerMutation) IDs

func (m *ListenerMutation) IDs(ctx context.Context) ([]int64, 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 (*ListenerMutation) IP

func (m *ListenerMutation) IP() (r types.Inet, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*ListenerMutation) IPCleared

func (m *ListenerMutation) IPCleared() bool

IPCleared returns if the "ip" field was cleared in this mutation.

func (*ListenerMutation) Last

func (m *ListenerMutation) Last() (r time.Time, exists bool)

Last returns the value of the "last" field in the mutation.

func (*ListenerMutation) Name

func (m *ListenerMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ListenerMutation) NameCleared

func (m *ListenerMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*ListenerMutation) Note

func (m *ListenerMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*ListenerMutation) NoteCleared

func (m *ListenerMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*ListenerMutation) OldColor

func (m *ListenerMutation) OldColor(ctx context.Context) (v uint32, err error)

OldColor returns the old "color" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldCreatedAt

func (m *ListenerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldDeletedAt

func (m *ListenerMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldField

func (m *ListenerMutation) 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 (*ListenerMutation) OldIP

func (m *ListenerMutation) OldIP(ctx context.Context) (v types.Inet, err error)

OldIP returns the old "ip" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldLast

func (m *ListenerMutation) OldLast(ctx context.Context) (v time.Time, err error)

OldLast returns the old "last" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldName

func (m *ListenerMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldNote

func (m *ListenerMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldPort

func (m *ListenerMutation) OldPort(ctx context.Context) (v uint16, err error)

OldPort returns the old "port" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldToken

func (m *ListenerMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) OldUpdatedAt

func (m *ListenerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Listener entity. If the Listener 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 (*ListenerMutation) Op

func (m *ListenerMutation) Op() Op

Op returns the operation name.

func (*ListenerMutation) Port

func (m *ListenerMutation) Port() (r uint16, exists bool)

Port returns the value of the "port" field in the mutation.

func (*ListenerMutation) PortCleared

func (m *ListenerMutation) PortCleared() bool

PortCleared returns if the "port" field was cleared in this mutation.

func (*ListenerMutation) RemoveAgentIDs

func (m *ListenerMutation) RemoveAgentIDs(ids ...uint32)

RemoveAgentIDs removes the "agent" edge to the Agent entity by IDs.

func (*ListenerMutation) RemovedAgentIDs

func (m *ListenerMutation) RemovedAgentIDs() (ids []uint32)

RemovedAgent returns the removed IDs of the "agent" edge to the Agent entity.

func (*ListenerMutation) RemovedEdges

func (m *ListenerMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ListenerMutation) RemovedIDs

func (m *ListenerMutation) 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 (*ListenerMutation) ResetAgent

func (m *ListenerMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*ListenerMutation) ResetColor

func (m *ListenerMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*ListenerMutation) ResetCreatedAt

func (m *ListenerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ListenerMutation) ResetDeletedAt

func (m *ListenerMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*ListenerMutation) ResetEdge

func (m *ListenerMutation) 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 (*ListenerMutation) ResetField

func (m *ListenerMutation) 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 (*ListenerMutation) ResetIP

func (m *ListenerMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*ListenerMutation) ResetLast

func (m *ListenerMutation) ResetLast()

ResetLast resets all changes to the "last" field.

func (*ListenerMutation) ResetName

func (m *ListenerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ListenerMutation) ResetNote

func (m *ListenerMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*ListenerMutation) ResetPort

func (m *ListenerMutation) ResetPort()

ResetPort resets all changes to the "port" field.

func (*ListenerMutation) ResetToken

func (m *ListenerMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*ListenerMutation) ResetUpdatedAt

func (m *ListenerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ListenerMutation) SetColor

func (m *ListenerMutation) SetColor(u uint32)

SetColor sets the "color" field.

func (*ListenerMutation) SetCreatedAt

func (m *ListenerMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ListenerMutation) SetDeletedAt

func (m *ListenerMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*ListenerMutation) SetField

func (m *ListenerMutation) 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 (*ListenerMutation) SetID

func (m *ListenerMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Listener entities.

func (*ListenerMutation) SetIP

func (m *ListenerMutation) SetIP(t types.Inet)

SetIP sets the "ip" field.

func (*ListenerMutation) SetLast

func (m *ListenerMutation) SetLast(t time.Time)

SetLast sets the "last" field.

func (*ListenerMutation) SetName

func (m *ListenerMutation) SetName(s string)

SetName sets the "name" field.

func (*ListenerMutation) SetNote

func (m *ListenerMutation) SetNote(s string)

SetNote sets the "note" field.

func (*ListenerMutation) SetOp

func (m *ListenerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ListenerMutation) SetPort

func (m *ListenerMutation) SetPort(u uint16)

SetPort sets the "port" field.

func (*ListenerMutation) SetToken

func (m *ListenerMutation) SetToken(s string)

SetToken sets the "token" field.

func (*ListenerMutation) SetUpdatedAt

func (m *ListenerMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ListenerMutation) Token

func (m *ListenerMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (*ListenerMutation) TokenCleared

func (m *ListenerMutation) TokenCleared() bool

TokenCleared returns if the "token" field was cleared in this mutation.

func (ListenerMutation) Tx

func (m ListenerMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ListenerMutation) Type

func (m *ListenerMutation) Type() string

Type returns the node type of this mutation (Listener).

func (*ListenerMutation) UpdatedAt

func (m *ListenerMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ListenerMutation) Where

func (m *ListenerMutation) Where(ps ...predicate.Listener)

Where appends a list predicates to the ListenerMutation builder.

func (*ListenerMutation) WhereP

func (m *ListenerMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ListenerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ListenerQuery

type ListenerQuery struct {
	// contains filtered or unexported fields
}

ListenerQuery is the builder for querying Listener entities.

func (*ListenerQuery) Aggregate

func (lq *ListenerQuery) Aggregate(fns ...AggregateFunc) *ListenerSelect

Aggregate returns a ListenerSelect configured with the given aggregations.

func (*ListenerQuery) All

func (lq *ListenerQuery) All(ctx context.Context) ([]*Listener, error)

All executes the query and returns a list of Listeners.

func (*ListenerQuery) AllX

func (lq *ListenerQuery) AllX(ctx context.Context) []*Listener

AllX is like All, but panics if an error occurs.

func (*ListenerQuery) Clone

func (lq *ListenerQuery) Clone() *ListenerQuery

Clone returns a duplicate of the ListenerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ListenerQuery) Count

func (lq *ListenerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ListenerQuery) CountX

func (lq *ListenerQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ListenerQuery) Exist

func (lq *ListenerQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ListenerQuery) ExistX

func (lq *ListenerQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ListenerQuery) First

func (lq *ListenerQuery) First(ctx context.Context) (*Listener, error)

First returns the first Listener entity from the query. Returns a *NotFoundError when no Listener was found.

func (*ListenerQuery) FirstID

func (lq *ListenerQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Listener ID from the query. Returns a *NotFoundError when no Listener ID was found.

func (*ListenerQuery) FirstIDX

func (lq *ListenerQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*ListenerQuery) FirstX

func (lq *ListenerQuery) FirstX(ctx context.Context) *Listener

FirstX is like First, but panics if an error occurs.

func (*ListenerQuery) ForShare

func (lq *ListenerQuery) ForShare(opts ...sql.LockOption) *ListenerQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ListenerQuery) ForUpdate

func (lq *ListenerQuery) ForUpdate(opts ...sql.LockOption) *ListenerQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ListenerQuery) GroupBy

func (lq *ListenerQuery) GroupBy(field string, fields ...string) *ListenerGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Listener.Query().
	GroupBy(listener.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ListenerQuery) IDs

func (lq *ListenerQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Listener IDs.

func (*ListenerQuery) IDsX

func (lq *ListenerQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*ListenerQuery) Limit

func (lq *ListenerQuery) Limit(limit int) *ListenerQuery

Limit the number of records to be returned by this query.

func (*ListenerQuery) Offset

func (lq *ListenerQuery) Offset(offset int) *ListenerQuery

Offset to start from.

func (*ListenerQuery) Only

func (lq *ListenerQuery) Only(ctx context.Context) (*Listener, error)

Only returns a single Listener entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Listener entity is found. Returns a *NotFoundError when no Listener entities are found.

func (*ListenerQuery) OnlyID

func (lq *ListenerQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Listener ID in the query. Returns a *NotSingularError when more than one Listener ID is found. Returns a *NotFoundError when no entities are found.

func (*ListenerQuery) OnlyIDX

func (lq *ListenerQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ListenerQuery) OnlyX

func (lq *ListenerQuery) OnlyX(ctx context.Context) *Listener

OnlyX is like Only, but panics if an error occurs.

func (*ListenerQuery) Order

Order specifies how the records should be ordered.

func (*ListenerQuery) QueryAgent

func (lq *ListenerQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*ListenerQuery) Select

func (lq *ListenerQuery) Select(fields ...string) *ListenerSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Listener.Query().
	Select(listener.FieldCreatedAt).
	Scan(ctx, &v)

func (*ListenerQuery) Unique

func (lq *ListenerQuery) Unique(unique bool) *ListenerQuery

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 (*ListenerQuery) Where

func (lq *ListenerQuery) Where(ps ...predicate.Listener) *ListenerQuery

Where adds a new predicate for the ListenerQuery builder.

func (*ListenerQuery) WithAgent

func (lq *ListenerQuery) WithAgent(opts ...func(*AgentQuery)) *ListenerQuery

WithAgent tells the query-builder to eager-load the nodes that are connected to the "agent" edge. The optional arguments are used to configure the query builder of the edge.

type ListenerSelect

type ListenerSelect struct {
	*ListenerQuery
	// contains filtered or unexported fields
}

ListenerSelect is the builder for selecting fields of Listener entities.

func (*ListenerSelect) Aggregate

func (ls *ListenerSelect) Aggregate(fns ...AggregateFunc) *ListenerSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ListenerSelect) Bool

func (s *ListenerSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) BoolX

func (s *ListenerSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ListenerSelect) Bools

func (s *ListenerSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) BoolsX

func (s *ListenerSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ListenerSelect) Float64

func (s *ListenerSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) Float64X

func (s *ListenerSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ListenerSelect) Float64s

func (s *ListenerSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) Float64sX

func (s *ListenerSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ListenerSelect) Int

func (s *ListenerSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) IntX

func (s *ListenerSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ListenerSelect) Ints

func (s *ListenerSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) IntsX

func (s *ListenerSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ListenerSelect) Scan

func (ls *ListenerSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ListenerSelect) ScanX

func (s *ListenerSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ListenerSelect) String

func (s *ListenerSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) StringX

func (s *ListenerSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ListenerSelect) Strings

func (s *ListenerSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ListenerSelect) StringsX

func (s *ListenerSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ListenerUpdate

type ListenerUpdate struct {
	// contains filtered or unexported fields
}

ListenerUpdate is the builder for updating Listener entities.

func (*ListenerUpdate) AddAgent

func (lu *ListenerUpdate) AddAgent(a ...*Agent) *ListenerUpdate

AddAgent adds the "agent" edges to the Agent entity.

func (*ListenerUpdate) AddAgentIDs

func (lu *ListenerUpdate) AddAgentIDs(ids ...uint32) *ListenerUpdate

AddAgentIDs adds the "agent" edge to the Agent entity by IDs.

func (*ListenerUpdate) AddColor

func (lu *ListenerUpdate) AddColor(u int32) *ListenerUpdate

AddColor adds u to the "color" field.

func (*ListenerUpdate) AddPort

func (lu *ListenerUpdate) AddPort(u int16) *ListenerUpdate

AddPort adds u to the "port" field.

func (*ListenerUpdate) ClearAgent

func (lu *ListenerUpdate) ClearAgent() *ListenerUpdate

ClearAgent clears all "agent" edges to the Agent entity.

func (*ListenerUpdate) ClearDeletedAt

func (lu *ListenerUpdate) ClearDeletedAt() *ListenerUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ListenerUpdate) ClearIP

func (lu *ListenerUpdate) ClearIP() *ListenerUpdate

ClearIP clears the value of the "ip" field.

func (*ListenerUpdate) ClearName

func (lu *ListenerUpdate) ClearName() *ListenerUpdate

ClearName clears the value of the "name" field.

func (*ListenerUpdate) ClearNote

func (lu *ListenerUpdate) ClearNote() *ListenerUpdate

ClearNote clears the value of the "note" field.

func (*ListenerUpdate) ClearPort

func (lu *ListenerUpdate) ClearPort() *ListenerUpdate

ClearPort clears the value of the "port" field.

func (*ListenerUpdate) ClearToken

func (lu *ListenerUpdate) ClearToken() *ListenerUpdate

ClearToken clears the value of the "token" field.

func (*ListenerUpdate) Exec

func (lu *ListenerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ListenerUpdate) ExecX

func (lu *ListenerUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ListenerUpdate) Mutation

func (lu *ListenerUpdate) Mutation() *ListenerMutation

Mutation returns the ListenerMutation object of the builder.

func (*ListenerUpdate) RemoveAgent

func (lu *ListenerUpdate) RemoveAgent(a ...*Agent) *ListenerUpdate

RemoveAgent removes "agent" edges to Agent entities.

func (*ListenerUpdate) RemoveAgentIDs

func (lu *ListenerUpdate) RemoveAgentIDs(ids ...uint32) *ListenerUpdate

RemoveAgentIDs removes the "agent" edge to Agent entities by IDs.

func (*ListenerUpdate) Save

func (lu *ListenerUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ListenerUpdate) SaveX

func (lu *ListenerUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ListenerUpdate) SetColor

func (lu *ListenerUpdate) SetColor(u uint32) *ListenerUpdate

SetColor sets the "color" field.

func (*ListenerUpdate) SetDeletedAt

func (lu *ListenerUpdate) SetDeletedAt(t time.Time) *ListenerUpdate

SetDeletedAt sets the "deleted_at" field.

func (*ListenerUpdate) SetIP

func (lu *ListenerUpdate) SetIP(t types.Inet) *ListenerUpdate

SetIP sets the "ip" field.

func (*ListenerUpdate) SetLast

func (lu *ListenerUpdate) SetLast(t time.Time) *ListenerUpdate

SetLast sets the "last" field.

func (*ListenerUpdate) SetName

func (lu *ListenerUpdate) SetName(s string) *ListenerUpdate

SetName sets the "name" field.

func (*ListenerUpdate) SetNillableColor

func (lu *ListenerUpdate) SetNillableColor(u *uint32) *ListenerUpdate

SetNillableColor sets the "color" field if the given value is not nil.

func (*ListenerUpdate) SetNillableDeletedAt

func (lu *ListenerUpdate) SetNillableDeletedAt(t *time.Time) *ListenerUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ListenerUpdate) SetNillableIP

func (lu *ListenerUpdate) SetNillableIP(t *types.Inet) *ListenerUpdate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*ListenerUpdate) SetNillableLast

func (lu *ListenerUpdate) SetNillableLast(t *time.Time) *ListenerUpdate

SetNillableLast sets the "last" field if the given value is not nil.

func (*ListenerUpdate) SetNillableName

func (lu *ListenerUpdate) SetNillableName(s *string) *ListenerUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ListenerUpdate) SetNillableNote

func (lu *ListenerUpdate) SetNillableNote(s *string) *ListenerUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*ListenerUpdate) SetNillablePort

func (lu *ListenerUpdate) SetNillablePort(u *uint16) *ListenerUpdate

SetNillablePort sets the "port" field if the given value is not nil.

func (*ListenerUpdate) SetNillableToken

func (lu *ListenerUpdate) SetNillableToken(s *string) *ListenerUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*ListenerUpdate) SetNote

func (lu *ListenerUpdate) SetNote(s string) *ListenerUpdate

SetNote sets the "note" field.

func (*ListenerUpdate) SetPort

func (lu *ListenerUpdate) SetPort(u uint16) *ListenerUpdate

SetPort sets the "port" field.

func (*ListenerUpdate) SetToken

func (lu *ListenerUpdate) SetToken(s string) *ListenerUpdate

SetToken sets the "token" field.

func (*ListenerUpdate) SetUpdatedAt

func (lu *ListenerUpdate) SetUpdatedAt(t time.Time) *ListenerUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ListenerUpdate) Where

func (lu *ListenerUpdate) Where(ps ...predicate.Listener) *ListenerUpdate

Where appends a list predicates to the ListenerUpdate builder.

type ListenerUpdateOne

type ListenerUpdateOne struct {
	// contains filtered or unexported fields
}

ListenerUpdateOne is the builder for updating a single Listener entity.

func (*ListenerUpdateOne) AddAgent

func (luo *ListenerUpdateOne) AddAgent(a ...*Agent) *ListenerUpdateOne

AddAgent adds the "agent" edges to the Agent entity.

func (*ListenerUpdateOne) AddAgentIDs

func (luo *ListenerUpdateOne) AddAgentIDs(ids ...uint32) *ListenerUpdateOne

AddAgentIDs adds the "agent" edge to the Agent entity by IDs.

func (*ListenerUpdateOne) AddColor

func (luo *ListenerUpdateOne) AddColor(u int32) *ListenerUpdateOne

AddColor adds u to the "color" field.

func (*ListenerUpdateOne) AddPort

func (luo *ListenerUpdateOne) AddPort(u int16) *ListenerUpdateOne

AddPort adds u to the "port" field.

func (*ListenerUpdateOne) ClearAgent

func (luo *ListenerUpdateOne) ClearAgent() *ListenerUpdateOne

ClearAgent clears all "agent" edges to the Agent entity.

func (*ListenerUpdateOne) ClearDeletedAt

func (luo *ListenerUpdateOne) ClearDeletedAt() *ListenerUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ListenerUpdateOne) ClearIP

func (luo *ListenerUpdateOne) ClearIP() *ListenerUpdateOne

ClearIP clears the value of the "ip" field.

func (*ListenerUpdateOne) ClearName

func (luo *ListenerUpdateOne) ClearName() *ListenerUpdateOne

ClearName clears the value of the "name" field.

func (*ListenerUpdateOne) ClearNote

func (luo *ListenerUpdateOne) ClearNote() *ListenerUpdateOne

ClearNote clears the value of the "note" field.

func (*ListenerUpdateOne) ClearPort

func (luo *ListenerUpdateOne) ClearPort() *ListenerUpdateOne

ClearPort clears the value of the "port" field.

func (*ListenerUpdateOne) ClearToken

func (luo *ListenerUpdateOne) ClearToken() *ListenerUpdateOne

ClearToken clears the value of the "token" field.

func (*ListenerUpdateOne) Exec

func (luo *ListenerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ListenerUpdateOne) ExecX

func (luo *ListenerUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ListenerUpdateOne) Mutation

func (luo *ListenerUpdateOne) Mutation() *ListenerMutation

Mutation returns the ListenerMutation object of the builder.

func (*ListenerUpdateOne) RemoveAgent

func (luo *ListenerUpdateOne) RemoveAgent(a ...*Agent) *ListenerUpdateOne

RemoveAgent removes "agent" edges to Agent entities.

func (*ListenerUpdateOne) RemoveAgentIDs

func (luo *ListenerUpdateOne) RemoveAgentIDs(ids ...uint32) *ListenerUpdateOne

RemoveAgentIDs removes the "agent" edge to Agent entities by IDs.

func (*ListenerUpdateOne) Save

func (luo *ListenerUpdateOne) Save(ctx context.Context) (*Listener, error)

Save executes the query and returns the updated Listener entity.

func (*ListenerUpdateOne) SaveX

func (luo *ListenerUpdateOne) SaveX(ctx context.Context) *Listener

SaveX is like Save, but panics if an error occurs.

func (*ListenerUpdateOne) Select

func (luo *ListenerUpdateOne) Select(field string, fields ...string) *ListenerUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ListenerUpdateOne) SetColor

func (luo *ListenerUpdateOne) SetColor(u uint32) *ListenerUpdateOne

SetColor sets the "color" field.

func (*ListenerUpdateOne) SetDeletedAt

func (luo *ListenerUpdateOne) SetDeletedAt(t time.Time) *ListenerUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*ListenerUpdateOne) SetIP

SetIP sets the "ip" field.

func (*ListenerUpdateOne) SetLast

func (luo *ListenerUpdateOne) SetLast(t time.Time) *ListenerUpdateOne

SetLast sets the "last" field.

func (*ListenerUpdateOne) SetName

func (luo *ListenerUpdateOne) SetName(s string) *ListenerUpdateOne

SetName sets the "name" field.

func (*ListenerUpdateOne) SetNillableColor

func (luo *ListenerUpdateOne) SetNillableColor(u *uint32) *ListenerUpdateOne

SetNillableColor sets the "color" field if the given value is not nil.

func (*ListenerUpdateOne) SetNillableDeletedAt

func (luo *ListenerUpdateOne) SetNillableDeletedAt(t *time.Time) *ListenerUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ListenerUpdateOne) SetNillableIP

func (luo *ListenerUpdateOne) SetNillableIP(t *types.Inet) *ListenerUpdateOne

SetNillableIP sets the "ip" field if the given value is not nil.

func (*ListenerUpdateOne) SetNillableLast

func (luo *ListenerUpdateOne) SetNillableLast(t *time.Time) *ListenerUpdateOne

SetNillableLast sets the "last" field if the given value is not nil.

func (*ListenerUpdateOne) SetNillableName

func (luo *ListenerUpdateOne) SetNillableName(s *string) *ListenerUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ListenerUpdateOne) SetNillableNote

func (luo *ListenerUpdateOne) SetNillableNote(s *string) *ListenerUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*ListenerUpdateOne) SetNillablePort

func (luo *ListenerUpdateOne) SetNillablePort(u *uint16) *ListenerUpdateOne

SetNillablePort sets the "port" field if the given value is not nil.

func (*ListenerUpdateOne) SetNillableToken

func (luo *ListenerUpdateOne) SetNillableToken(s *string) *ListenerUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*ListenerUpdateOne) SetNote

func (luo *ListenerUpdateOne) SetNote(s string) *ListenerUpdateOne

SetNote sets the "note" field.

func (*ListenerUpdateOne) SetPort

func (luo *ListenerUpdateOne) SetPort(u uint16) *ListenerUpdateOne

SetPort sets the "port" field.

func (*ListenerUpdateOne) SetToken

func (luo *ListenerUpdateOne) SetToken(s string) *ListenerUpdateOne

SetToken sets the "token" field.

func (*ListenerUpdateOne) SetUpdatedAt

func (luo *ListenerUpdateOne) SetUpdatedAt(t time.Time) *ListenerUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ListenerUpdateOne) Where

Where appends a list predicates to the ListenerUpdate builder.

type Listeners

type Listeners []*Listener

Listeners is a parsable slice of Listener.

type Message

type Message struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// id of command
	CommandID int64 `json:"command_id,omitempty"`
	// type of message
	Type shared.TaskMessage `json:"type,omitempty"`
	// message itself
	Message string `json:"message,omitempty"`
	// when message created
	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 MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QueryCommand

func (m *Message) QueryCommand() *CommandQuery

QueryCommand queries the "command" edge of the Message entity.

func (*Message) String

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (m *Message) Unwrap() *Message

Unwrap unwraps the Message entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Message) Update

func (m *Message) Update() *MessageUpdateOne

Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.

func (*Message) Value

func (m *Message) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Message. This includes values selected through modifiers, order, etc.

type MessageClient

type MessageClient struct {
	// contains filtered or unexported fields
}

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

CreateBulk returns a builder for creating a bulk of Message entities.

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id int) *MessageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id int) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id int) *Message

GetX is like Get, but panics if an error occurs.

func (*MessageClient) Hooks

func (c *MessageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MessageClient) Intercept

func (c *MessageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `message.Intercept(f(g(h())))`.

func (*MessageClient) Interceptors

func (c *MessageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MessageClient) Query

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryCommand

func (c *MessageClient) QueryCommand(m *Message) *CommandQuery

QueryCommand queries the command edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id int) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

func (c *MessageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `message.Hooks(f(g(h())))`.

type MessageCreate

type MessageCreate struct {
	// contains filtered or unexported fields
}

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec

func (mc *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (mc *MessageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreate) Mutation

func (mc *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (mc *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetCommand

func (mc *MessageCreate) SetCommand(c *Command) *MessageCreate

SetCommand sets the "command" edge to the Command entity.

func (*MessageCreate) SetCommandID

func (mc *MessageCreate) SetCommandID(i int64) *MessageCreate

SetCommandID sets the "command_id" field.

func (*MessageCreate) SetCreatedAt

func (mc *MessageCreate) SetCreatedAt(t time.Time) *MessageCreate

SetCreatedAt sets the "created_at" field.

func (*MessageCreate) SetMessage

func (mc *MessageCreate) SetMessage(s string) *MessageCreate

SetMessage sets the "message" field.

func (*MessageCreate) SetNillableCreatedAt

func (mc *MessageCreate) SetNillableCreatedAt(t *time.Time) *MessageCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MessageCreate) SetType

func (mc *MessageCreate) SetType(sm shared.TaskMessage) *MessageCreate

SetType sets the "type" field.

type MessageCreateBulk

type MessageCreateBulk struct {
	// contains filtered or unexported fields
}

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (mcb *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (mcb *MessageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreateBulk) Save

func (mcb *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (mcb *MessageCreateBulk) SaveX(ctx context.Context) []*Message

SaveX is like Save, but panics if an error occurs.

type MessageDelete

type MessageDelete struct {
	// contains filtered or unexported fields
}

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (md *MessageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MessageDelete) ExecX

func (md *MessageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MessageDelete) Where

func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

type MessageDeleteOne struct {
	// contains filtered or unexported fields
}

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (mdo *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (mdo *MessageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Command holds the value of the command edge.
	Command *Command `json:"command,omitempty"`
	// contains filtered or unexported fields
}

MessageEdges holds the relations/edges for other nodes in the graph.

func (MessageEdges) CommandOrErr

func (e MessageEdges) CommandOrErr() (*Command, error)

CommandOrErr returns the Command value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MessageGroupBy

type MessageGroupBy struct {
	// contains filtered or unexported fields
}

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MessageGroupBy) Bool

func (s *MessageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolX

func (s *MessageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageGroupBy) Bools

func (s *MessageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolsX

func (s *MessageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageGroupBy) Float64

func (s *MessageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64X

func (s *MessageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageGroupBy) Float64s

func (s *MessageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64sX

func (s *MessageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageGroupBy) Int

func (s *MessageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntX

func (s *MessageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageGroupBy) Ints

func (s *MessageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntsX

func (s *MessageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageGroupBy) Scan

func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageGroupBy) ScanX

func (s *MessageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageGroupBy) String

func (s *MessageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringX

func (s *MessageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageGroupBy) Strings

func (s *MessageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringsX

func (s *MessageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageMutation

type MessageMutation struct {
	// contains filtered or unexported fields
}

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

func (m *MessageMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageMutation) AddedEdges

func (m *MessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageMutation) AddedField

func (m *MessageMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageMutation) AddedFields

func (m *MessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageMutation) AddedIDs

func (m *MessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageMutation) ClearCommand

func (m *MessageMutation) ClearCommand()

ClearCommand clears the "command" edge to the Command entity.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MessageMutation) ClearField

func (m *MessageMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageMutation) ClearedEdges

func (m *MessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageMutation) ClearedFields

func (m *MessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageMutation) Client

func (m MessageMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MessageMutation) CommandCleared

func (m *MessageMutation) CommandCleared() bool

CommandCleared reports if the "command" edge to the Command entity was cleared.

func (*MessageMutation) CommandID

func (m *MessageMutation) CommandID() (r int64, exists bool)

CommandID returns the value of the "command_id" field in the mutation.

func (*MessageMutation) CommandIDs

func (m *MessageMutation) CommandIDs() (ids []int64)

CommandIDs returns the "command" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CommandID instead. It exists only for internal usage by the builders.

func (*MessageMutation) CreatedAt

func (m *MessageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MessageMutation) EdgeCleared

func (m *MessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageMutation) Field

func (m *MessageMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageMutation) FieldCleared

func (m *MessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageMutation) Fields

func (m *MessageMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MessageMutation) GetType

func (m *MessageMutation) GetType() (r shared.TaskMessage, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*MessageMutation) ID

func (m *MessageMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MessageMutation) IDs

func (m *MessageMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MessageMutation) Message

func (m *MessageMutation) Message() (r string, exists bool)

Message returns the value of the "message" field in the mutation.

func (*MessageMutation) OldCommandID

func (m *MessageMutation) OldCommandID(ctx context.Context) (v int64, err error)

OldCommandID returns the old "command_id" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldCreatedAt

func (m *MessageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldField

func (m *MessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MessageMutation) OldMessage

func (m *MessageMutation) OldMessage(ctx context.Context) (v string, err error)

OldMessage returns the old "message" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldType

func (m *MessageMutation) OldType(ctx context.Context) (v shared.TaskMessage, err error)

OldType returns the old "type" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) RemovedEdges

func (m *MessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MessageMutation) ResetCommand

func (m *MessageMutation) ResetCommand()

ResetCommand resets all changes to the "command" edge.

func (*MessageMutation) ResetCommandID

func (m *MessageMutation) ResetCommandID()

ResetCommandID resets all changes to the "command_id" field.

func (*MessageMutation) ResetCreatedAt

func (m *MessageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MessageMutation) ResetField

func (m *MessageMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageMutation) ResetMessage

func (m *MessageMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*MessageMutation) ResetType

func (m *MessageMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*MessageMutation) SetCommandID

func (m *MessageMutation) SetCommandID(i int64)

SetCommandID sets the "command_id" field.

func (*MessageMutation) SetCreatedAt

func (m *MessageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MessageMutation) SetField

func (m *MessageMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageMutation) SetMessage

func (m *MessageMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetType

func (m *MessageMutation) SetType(sm shared.TaskMessage)

SetType sets the "type" field.

func (MessageMutation) Tx

func (m MessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

Type returns the node type of this mutation (Message).

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MessageQuery

type MessageQuery struct {
	// contains filtered or unexported fields
}

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (mq *MessageQuery) AllX(ctx context.Context) []*Message

AllX is like All, but panics if an error occurs.

func (*MessageQuery) Clone

func (mq *MessageQuery) Clone() *MessageQuery

Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageQuery) Count

func (mq *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (mq *MessageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MessageQuery) Exist

func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MessageQuery) ExistX

func (mq *MessageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MessageQuery) First

func (mq *MessageQuery) First(ctx context.Context) (*Message, error)

First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.

func (*MessageQuery) FirstID

func (mq *MessageQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.

func (*MessageQuery) FirstIDX

func (mq *MessageQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MessageQuery) FirstX

func (mq *MessageQuery) FirstX(ctx context.Context) *Message

FirstX is like First, but panics if an error occurs.

func (*MessageQuery) ForShare

func (mq *MessageQuery) ForShare(opts ...sql.LockOption) *MessageQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*MessageQuery) ForUpdate

func (mq *MessageQuery) ForUpdate(opts ...sql.LockOption) *MessageQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*MessageQuery) GroupBy

func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CommandID int64 `json:"command_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldCommandID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

func (mq *MessageQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Message IDs.

func (*MessageQuery) IDsX

func (mq *MessageQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MessageQuery) Limit

func (mq *MessageQuery) Limit(limit int) *MessageQuery

Limit the number of records to be returned by this query.

func (*MessageQuery) Offset

func (mq *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only

func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)

Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.

func (*MessageQuery) OnlyID

func (mq *MessageQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageQuery) OnlyIDX

func (mq *MessageQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MessageQuery) OnlyX

func (mq *MessageQuery) OnlyX(ctx context.Context) *Message

OnlyX is like Only, but panics if an error occurs.

func (*MessageQuery) Order

func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QueryCommand

func (mq *MessageQuery) QueryCommand() *CommandQuery

QueryCommand chains the current query on the "command" edge.

func (*MessageQuery) Select

func (mq *MessageQuery) Select(fields ...string) *MessageSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CommandID int64 `json:"command_id,omitempty"`
}

client.Message.Query().
	Select(message.FieldCommandID).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (mq *MessageQuery) Unique(unique bool) *MessageQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MessageQuery) Where

func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithCommand

func (mq *MessageQuery) WithCommand(opts ...func(*CommandQuery)) *MessageQuery

WithCommand tells the query-builder to eager-load the nodes that are connected to the "command" edge. The optional arguments are used to configure the query builder of the edge.

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

func (s *MessageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolX

func (s *MessageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageSelect) Bools

func (s *MessageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolsX

func (s *MessageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageSelect) Float64

func (s *MessageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64X

func (s *MessageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageSelect) Float64s

func (s *MessageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64sX

func (s *MessageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageSelect) Int

func (s *MessageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntX

func (s *MessageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageSelect) Ints

func (s *MessageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntsX

func (s *MessageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageSelect) Scan

func (ms *MessageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageSelect) ScanX

func (s *MessageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageSelect) String

func (s *MessageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringX

func (s *MessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageSelect) Strings

func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringsX

func (s *MessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageUpdate

type MessageUpdate struct {
	// contains filtered or unexported fields
}

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) ClearCommand

func (mu *MessageUpdate) ClearCommand() *MessageUpdate

ClearCommand clears the "command" edge to the Command entity.

func (*MessageUpdate) Exec

func (mu *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (mu *MessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdate) Mutation

func (mu *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) Save

func (mu *MessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageUpdate) SaveX

func (mu *MessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdate) SetCommand

func (mu *MessageUpdate) SetCommand(c *Command) *MessageUpdate

SetCommand sets the "command" edge to the Command entity.

func (*MessageUpdate) SetCommandID

func (mu *MessageUpdate) SetCommandID(i int64) *MessageUpdate

SetCommandID sets the "command_id" field.

func (*MessageUpdate) SetCreatedAt

func (mu *MessageUpdate) SetCreatedAt(t time.Time) *MessageUpdate

SetCreatedAt sets the "created_at" field.

func (*MessageUpdate) SetMessage

func (mu *MessageUpdate) SetMessage(s string) *MessageUpdate

SetMessage sets the "message" field.

func (*MessageUpdate) SetNillableCommandID

func (mu *MessageUpdate) SetNillableCommandID(i *int64) *MessageUpdate

SetNillableCommandID sets the "command_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableCreatedAt

func (mu *MessageUpdate) SetNillableCreatedAt(t *time.Time) *MessageUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MessageUpdate) SetNillableMessage

func (mu *MessageUpdate) SetNillableMessage(s *string) *MessageUpdate

SetNillableMessage sets the "message" field if the given value is not nil.

func (*MessageUpdate) SetNillableType

func (mu *MessageUpdate) SetNillableType(sm *shared.TaskMessage) *MessageUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*MessageUpdate) SetType

func (mu *MessageUpdate) SetType(sm shared.TaskMessage) *MessageUpdate

SetType sets the "type" field.

func (*MessageUpdate) Where

func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

type MessageUpdateOne struct {
	// contains filtered or unexported fields
}

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) ClearCommand

func (muo *MessageUpdateOne) ClearCommand() *MessageUpdateOne

ClearCommand clears the "command" edge to the Command entity.

func (*MessageUpdateOne) Exec

func (muo *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (muo *MessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdateOne) Mutation

func (muo *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) Save

func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdateOne) Select

func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetCommand

func (muo *MessageUpdateOne) SetCommand(c *Command) *MessageUpdateOne

SetCommand sets the "command" edge to the Command entity.

func (*MessageUpdateOne) SetCommandID

func (muo *MessageUpdateOne) SetCommandID(i int64) *MessageUpdateOne

SetCommandID sets the "command_id" field.

func (*MessageUpdateOne) SetCreatedAt

func (muo *MessageUpdateOne) SetCreatedAt(t time.Time) *MessageUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MessageUpdateOne) SetMessage

func (muo *MessageUpdateOne) SetMessage(s string) *MessageUpdateOne

SetMessage sets the "message" field.

func (*MessageUpdateOne) SetNillableCommandID

func (muo *MessageUpdateOne) SetNillableCommandID(i *int64) *MessageUpdateOne

SetNillableCommandID sets the "command_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableCreatedAt

func (muo *MessageUpdateOne) SetNillableCreatedAt(t *time.Time) *MessageUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableMessage

func (muo *MessageUpdateOne) SetNillableMessage(s *string) *MessageUpdateOne

SetNillableMessage sets the "message" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableType

func (muo *MessageUpdateOne) SetNillableType(sm *shared.TaskMessage) *MessageUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*MessageUpdateOne) SetType

SetType sets the "type" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Operator

type Operator struct {

	// ID of the ent.
	// operator ID
	ID int64 `json:"id,omitempty"`
	// Time when entity was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Time when entity was updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Time when entity was soft-deleted
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// username of operator
	Username string `json:"username,omitempty"`
	// access token for operator
	Token string `json:"token,omitempty"`
	// color of entity
	Color uint32 `json:"color,omitempty"`
	// last activity of operator
	Last time.Time `json:"last,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OperatorQuery when eager-loading is set.
	Edges OperatorEdges `json:"edges"`
	// contains filtered or unexported fields
}

Operator is the model entity for the Operator schema.

func (*Operator) QueryChat

func (o *Operator) QueryChat() *ChatQuery

QueryChat queries the "chat" edge of the Operator entity.

func (*Operator) QueryCommand

func (o *Operator) QueryCommand() *CommandQuery

QueryCommand queries the "command" edge of the Operator entity.

func (*Operator) String

func (o *Operator) String() string

String implements the fmt.Stringer.

func (*Operator) Unwrap

func (o *Operator) Unwrap() *Operator

Unwrap unwraps the Operator 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 (*Operator) Update

func (o *Operator) Update() *OperatorUpdateOne

Update returns a builder for updating this Operator. Note that you need to call Operator.Unwrap() before calling this method if this Operator was returned from a transaction, and the transaction was committed or rolled back.

func (*Operator) Value

func (o *Operator) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Operator. This includes values selected through modifiers, order, etc.

type OperatorClient

type OperatorClient struct {
	// contains filtered or unexported fields
}

OperatorClient is a client for the Operator schema.

func NewOperatorClient

func NewOperatorClient(c config) *OperatorClient

NewOperatorClient returns a client for the Operator from the given config.

func (*OperatorClient) Create

func (c *OperatorClient) Create() *OperatorCreate

Create returns a builder for creating a Operator entity.

func (*OperatorClient) CreateBulk

func (c *OperatorClient) CreateBulk(builders ...*OperatorCreate) *OperatorCreateBulk

CreateBulk returns a builder for creating a bulk of Operator entities.

func (*OperatorClient) Delete

func (c *OperatorClient) Delete() *OperatorDelete

Delete returns a delete builder for Operator.

func (*OperatorClient) DeleteOne

func (c *OperatorClient) DeleteOne(o *Operator) *OperatorDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OperatorClient) DeleteOneID

func (c *OperatorClient) DeleteOneID(id int64) *OperatorDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OperatorClient) Get

func (c *OperatorClient) Get(ctx context.Context, id int64) (*Operator, error)

Get returns a Operator entity by its id.

func (*OperatorClient) GetX

func (c *OperatorClient) GetX(ctx context.Context, id int64) *Operator

GetX is like Get, but panics if an error occurs.

func (*OperatorClient) Hooks

func (c *OperatorClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OperatorClient) Intercept

func (c *OperatorClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `operator.Intercept(f(g(h())))`.

func (*OperatorClient) Interceptors

func (c *OperatorClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OperatorClient) MapCreateBulk

func (c *OperatorClient) MapCreateBulk(slice any, setFunc func(*OperatorCreate, int)) *OperatorCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*OperatorClient) Query

func (c *OperatorClient) Query() *OperatorQuery

Query returns a query builder for Operator.

func (*OperatorClient) QueryChat

func (c *OperatorClient) QueryChat(o *Operator) *ChatQuery

QueryChat queries the chat edge of a Operator.

func (*OperatorClient) QueryCommand

func (c *OperatorClient) QueryCommand(o *Operator) *CommandQuery

QueryCommand queries the command edge of a Operator.

func (*OperatorClient) Update

func (c *OperatorClient) Update() *OperatorUpdate

Update returns an update builder for Operator.

func (*OperatorClient) UpdateOne

func (c *OperatorClient) UpdateOne(o *Operator) *OperatorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OperatorClient) UpdateOneID

func (c *OperatorClient) UpdateOneID(id int64) *OperatorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OperatorClient) Use

func (c *OperatorClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `operator.Hooks(f(g(h())))`.

type OperatorCreate

type OperatorCreate struct {
	// contains filtered or unexported fields
}

OperatorCreate is the builder for creating a Operator entity.

func (*OperatorCreate) AddChat

func (oc *OperatorCreate) AddChat(c ...*Chat) *OperatorCreate

AddChat adds the "chat" edges to the Chat entity.

func (*OperatorCreate) AddChatIDs

func (oc *OperatorCreate) AddChatIDs(ids ...int) *OperatorCreate

AddChatIDs adds the "chat" edge to the Chat entity by IDs.

func (*OperatorCreate) AddCommand

func (oc *OperatorCreate) AddCommand(c ...*Command) *OperatorCreate

AddCommand adds the "command" edges to the Command entity.

func (*OperatorCreate) AddCommandIDs

func (oc *OperatorCreate) AddCommandIDs(ids ...int64) *OperatorCreate

AddCommandIDs adds the "command" edge to the Command entity by IDs.

func (*OperatorCreate) Exec

func (oc *OperatorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OperatorCreate) ExecX

func (oc *OperatorCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OperatorCreate) Mutation

func (oc *OperatorCreate) Mutation() *OperatorMutation

Mutation returns the OperatorMutation object of the builder.

func (*OperatorCreate) Save

func (oc *OperatorCreate) Save(ctx context.Context) (*Operator, error)

Save creates the Operator in the database.

func (*OperatorCreate) SaveX

func (oc *OperatorCreate) SaveX(ctx context.Context) *Operator

SaveX calls Save and panics if Save returns an error.

func (*OperatorCreate) SetColor

func (oc *OperatorCreate) SetColor(u uint32) *OperatorCreate

SetColor sets the "color" field.

func (*OperatorCreate) SetCreatedAt

func (oc *OperatorCreate) SetCreatedAt(t time.Time) *OperatorCreate

SetCreatedAt sets the "created_at" field.

func (*OperatorCreate) SetDeletedAt

func (oc *OperatorCreate) SetDeletedAt(t time.Time) *OperatorCreate

SetDeletedAt sets the "deleted_at" field.

func (*OperatorCreate) SetID

func (oc *OperatorCreate) SetID(i int64) *OperatorCreate

SetID sets the "id" field.

func (*OperatorCreate) SetLast

func (oc *OperatorCreate) SetLast(t time.Time) *OperatorCreate

SetLast sets the "last" field.

func (*OperatorCreate) SetNillableColor

func (oc *OperatorCreate) SetNillableColor(u *uint32) *OperatorCreate

SetNillableColor sets the "color" field if the given value is not nil.

func (*OperatorCreate) SetNillableCreatedAt

func (oc *OperatorCreate) SetNillableCreatedAt(t *time.Time) *OperatorCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OperatorCreate) SetNillableDeletedAt

func (oc *OperatorCreate) SetNillableDeletedAt(t *time.Time) *OperatorCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*OperatorCreate) SetNillableLast

func (oc *OperatorCreate) SetNillableLast(t *time.Time) *OperatorCreate

SetNillableLast sets the "last" field if the given value is not nil.

func (*OperatorCreate) SetNillableToken

func (oc *OperatorCreate) SetNillableToken(s *string) *OperatorCreate

SetNillableToken sets the "token" field if the given value is not nil.

func (*OperatorCreate) SetNillableUpdatedAt

func (oc *OperatorCreate) SetNillableUpdatedAt(t *time.Time) *OperatorCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OperatorCreate) SetToken

func (oc *OperatorCreate) SetToken(s string) *OperatorCreate

SetToken sets the "token" field.

func (*OperatorCreate) SetUpdatedAt

func (oc *OperatorCreate) SetUpdatedAt(t time.Time) *OperatorCreate

SetUpdatedAt sets the "updated_at" field.

func (*OperatorCreate) SetUsername

func (oc *OperatorCreate) SetUsername(s string) *OperatorCreate

SetUsername sets the "username" field.

type OperatorCreateBulk

type OperatorCreateBulk struct {
	// contains filtered or unexported fields
}

OperatorCreateBulk is the builder for creating many Operator entities in bulk.

func (*OperatorCreateBulk) Exec

func (ocb *OperatorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OperatorCreateBulk) ExecX

func (ocb *OperatorCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OperatorCreateBulk) Save

func (ocb *OperatorCreateBulk) Save(ctx context.Context) ([]*Operator, error)

Save creates the Operator entities in the database.

func (*OperatorCreateBulk) SaveX

func (ocb *OperatorCreateBulk) SaveX(ctx context.Context) []*Operator

SaveX is like Save, but panics if an error occurs.

type OperatorDelete

type OperatorDelete struct {
	// contains filtered or unexported fields
}

OperatorDelete is the builder for deleting a Operator entity.

func (*OperatorDelete) Exec

func (od *OperatorDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OperatorDelete) ExecX

func (od *OperatorDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OperatorDelete) Where

func (od *OperatorDelete) Where(ps ...predicate.Operator) *OperatorDelete

Where appends a list predicates to the OperatorDelete builder.

type OperatorDeleteOne

type OperatorDeleteOne struct {
	// contains filtered or unexported fields
}

OperatorDeleteOne is the builder for deleting a single Operator entity.

func (*OperatorDeleteOne) Exec

func (odo *OperatorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OperatorDeleteOne) ExecX

func (odo *OperatorDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OperatorDeleteOne) Where

Where appends a list predicates to the OperatorDelete builder.

type OperatorEdges

type OperatorEdges struct {
	// Chat holds the value of the chat edge.
	Chat []*Chat `json:"chat,omitempty"`
	// Command holds the value of the command edge.
	Command []*Command `json:"command,omitempty"`
	// contains filtered or unexported fields
}

OperatorEdges holds the relations/edges for other nodes in the graph.

func (OperatorEdges) ChatOrErr

func (e OperatorEdges) ChatOrErr() ([]*Chat, error)

ChatOrErr returns the Chat value or an error if the edge was not loaded in eager-loading.

func (OperatorEdges) CommandOrErr

func (e OperatorEdges) CommandOrErr() ([]*Command, error)

CommandOrErr returns the Command value or an error if the edge was not loaded in eager-loading.

type OperatorGroupBy

type OperatorGroupBy struct {
	// contains filtered or unexported fields
}

OperatorGroupBy is the group-by builder for Operator entities.

func (*OperatorGroupBy) Aggregate

func (ogb *OperatorGroupBy) Aggregate(fns ...AggregateFunc) *OperatorGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OperatorGroupBy) Bool

func (s *OperatorGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) BoolX

func (s *OperatorGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OperatorGroupBy) Bools

func (s *OperatorGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) BoolsX

func (s *OperatorGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OperatorGroupBy) Float64

func (s *OperatorGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) Float64X

func (s *OperatorGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OperatorGroupBy) Float64s

func (s *OperatorGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) Float64sX

func (s *OperatorGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OperatorGroupBy) Int

func (s *OperatorGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) IntX

func (s *OperatorGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OperatorGroupBy) Ints

func (s *OperatorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) IntsX

func (s *OperatorGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OperatorGroupBy) Scan

func (ogb *OperatorGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OperatorGroupBy) ScanX

func (s *OperatorGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OperatorGroupBy) String

func (s *OperatorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) StringX

func (s *OperatorGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OperatorGroupBy) Strings

func (s *OperatorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OperatorGroupBy) StringsX

func (s *OperatorGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OperatorMutation

type OperatorMutation struct {
	// contains filtered or unexported fields
}

OperatorMutation represents an operation that mutates the Operator nodes in the graph.

func (*OperatorMutation) AddChatIDs

func (m *OperatorMutation) AddChatIDs(ids ...int)

AddChatIDs adds the "chat" edge to the Chat entity by ids.

func (*OperatorMutation) AddColor

func (m *OperatorMutation) AddColor(u int32)

AddColor adds u to the "color" field.

func (*OperatorMutation) AddCommandIDs

func (m *OperatorMutation) AddCommandIDs(ids ...int64)

AddCommandIDs adds the "command" edge to the Command entity by ids.

func (*OperatorMutation) AddField

func (m *OperatorMutation) 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 (*OperatorMutation) AddedColor

func (m *OperatorMutation) AddedColor() (r int32, exists bool)

AddedColor returns the value that was added to the "color" field in this mutation.

func (*OperatorMutation) AddedEdges

func (m *OperatorMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OperatorMutation) AddedField

func (m *OperatorMutation) 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 (*OperatorMutation) AddedFields

func (m *OperatorMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OperatorMutation) AddedIDs

func (m *OperatorMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OperatorMutation) ChatCleared

func (m *OperatorMutation) ChatCleared() bool

ChatCleared reports if the "chat" edge to the Chat entity was cleared.

func (*OperatorMutation) ChatIDs

func (m *OperatorMutation) ChatIDs() (ids []int)

ChatIDs returns the "chat" edge IDs in the mutation.

func (*OperatorMutation) ClearChat

func (m *OperatorMutation) ClearChat()

ClearChat clears the "chat" edge to the Chat entity.

func (*OperatorMutation) ClearCommand

func (m *OperatorMutation) ClearCommand()

ClearCommand clears the "command" edge to the Command entity.

func (*OperatorMutation) ClearDeletedAt

func (m *OperatorMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*OperatorMutation) ClearEdge

func (m *OperatorMutation) 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 (*OperatorMutation) ClearField

func (m *OperatorMutation) 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 (*OperatorMutation) ClearToken

func (m *OperatorMutation) ClearToken()

ClearToken clears the value of the "token" field.

func (*OperatorMutation) ClearedEdges

func (m *OperatorMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OperatorMutation) ClearedFields

func (m *OperatorMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OperatorMutation) Client

func (m OperatorMutation) 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 (*OperatorMutation) Color

func (m *OperatorMutation) Color() (r uint32, exists bool)

Color returns the value of the "color" field in the mutation.

func (*OperatorMutation) CommandCleared

func (m *OperatorMutation) CommandCleared() bool

CommandCleared reports if the "command" edge to the Command entity was cleared.

func (*OperatorMutation) CommandIDs

func (m *OperatorMutation) CommandIDs() (ids []int64)

CommandIDs returns the "command" edge IDs in the mutation.

func (*OperatorMutation) CreatedAt

func (m *OperatorMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OperatorMutation) DeletedAt

func (m *OperatorMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*OperatorMutation) DeletedAtCleared

func (m *OperatorMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*OperatorMutation) EdgeCleared

func (m *OperatorMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OperatorMutation) Field

func (m *OperatorMutation) 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 (*OperatorMutation) FieldCleared

func (m *OperatorMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OperatorMutation) Fields

func (m *OperatorMutation) 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 (*OperatorMutation) ID

func (m *OperatorMutation) ID() (id int64, 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 (*OperatorMutation) IDs

func (m *OperatorMutation) IDs(ctx context.Context) ([]int64, 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 (*OperatorMutation) Last

func (m *OperatorMutation) Last() (r time.Time, exists bool)

Last returns the value of the "last" field in the mutation.

func (*OperatorMutation) OldColor

func (m *OperatorMutation) OldColor(ctx context.Context) (v uint32, err error)

OldColor returns the old "color" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldCreatedAt

func (m *OperatorMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldDeletedAt

func (m *OperatorMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldField

func (m *OperatorMutation) 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 (*OperatorMutation) OldLast

func (m *OperatorMutation) OldLast(ctx context.Context) (v time.Time, err error)

OldLast returns the old "last" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldToken

func (m *OperatorMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldUpdatedAt

func (m *OperatorMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldUsername

func (m *OperatorMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) Op

func (m *OperatorMutation) Op() Op

Op returns the operation name.

func (*OperatorMutation) RemoveChatIDs

func (m *OperatorMutation) RemoveChatIDs(ids ...int)

RemoveChatIDs removes the "chat" edge to the Chat entity by IDs.

func (*OperatorMutation) RemoveCommandIDs

func (m *OperatorMutation) RemoveCommandIDs(ids ...int64)

RemoveCommandIDs removes the "command" edge to the Command entity by IDs.

func (*OperatorMutation) RemovedChatIDs

func (m *OperatorMutation) RemovedChatIDs() (ids []int)

RemovedChat returns the removed IDs of the "chat" edge to the Chat entity.

func (*OperatorMutation) RemovedCommandIDs

func (m *OperatorMutation) RemovedCommandIDs() (ids []int64)

RemovedCommand returns the removed IDs of the "command" edge to the Command entity.

func (*OperatorMutation) RemovedEdges

func (m *OperatorMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OperatorMutation) RemovedIDs

func (m *OperatorMutation) 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 (*OperatorMutation) ResetChat

func (m *OperatorMutation) ResetChat()

ResetChat resets all changes to the "chat" edge.

func (*OperatorMutation) ResetColor

func (m *OperatorMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*OperatorMutation) ResetCommand

func (m *OperatorMutation) ResetCommand()

ResetCommand resets all changes to the "command" edge.

func (*OperatorMutation) ResetCreatedAt

func (m *OperatorMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OperatorMutation) ResetDeletedAt

func (m *OperatorMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*OperatorMutation) ResetEdge

func (m *OperatorMutation) 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 (*OperatorMutation) ResetField

func (m *OperatorMutation) 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 (*OperatorMutation) ResetLast

func (m *OperatorMutation) ResetLast()

ResetLast resets all changes to the "last" field.

func (*OperatorMutation) ResetToken

func (m *OperatorMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*OperatorMutation) ResetUpdatedAt

func (m *OperatorMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OperatorMutation) ResetUsername

func (m *OperatorMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*OperatorMutation) SetColor

func (m *OperatorMutation) SetColor(u uint32)

SetColor sets the "color" field.

func (*OperatorMutation) SetCreatedAt

func (m *OperatorMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OperatorMutation) SetDeletedAt

func (m *OperatorMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*OperatorMutation) SetField

func (m *OperatorMutation) 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 (*OperatorMutation) SetID

func (m *OperatorMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Operator entities.

func (*OperatorMutation) SetLast

func (m *OperatorMutation) SetLast(t time.Time)

SetLast sets the "last" field.

func (*OperatorMutation) SetOp

func (m *OperatorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OperatorMutation) SetToken

func (m *OperatorMutation) SetToken(s string)

SetToken sets the "token" field.

func (*OperatorMutation) SetUpdatedAt

func (m *OperatorMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OperatorMutation) SetUsername

func (m *OperatorMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*OperatorMutation) Token

func (m *OperatorMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (*OperatorMutation) TokenCleared

func (m *OperatorMutation) TokenCleared() bool

TokenCleared returns if the "token" field was cleared in this mutation.

func (OperatorMutation) Tx

func (m OperatorMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OperatorMutation) Type

func (m *OperatorMutation) Type() string

Type returns the node type of this mutation (Operator).

func (*OperatorMutation) UpdatedAt

func (m *OperatorMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OperatorMutation) Username

func (m *OperatorMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*OperatorMutation) Where

func (m *OperatorMutation) Where(ps ...predicate.Operator)

Where appends a list predicates to the OperatorMutation builder.

func (*OperatorMutation) WhereP

func (m *OperatorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OperatorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OperatorQuery

type OperatorQuery struct {
	// contains filtered or unexported fields
}

OperatorQuery is the builder for querying Operator entities.

func (*OperatorQuery) Aggregate

func (oq *OperatorQuery) Aggregate(fns ...AggregateFunc) *OperatorSelect

Aggregate returns a OperatorSelect configured with the given aggregations.

func (*OperatorQuery) All

func (oq *OperatorQuery) All(ctx context.Context) ([]*Operator, error)

All executes the query and returns a list of Operators.

func (*OperatorQuery) AllX

func (oq *OperatorQuery) AllX(ctx context.Context) []*Operator

AllX is like All, but panics if an error occurs.

func (*OperatorQuery) Clone

func (oq *OperatorQuery) Clone() *OperatorQuery

Clone returns a duplicate of the OperatorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OperatorQuery) Count

func (oq *OperatorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OperatorQuery) CountX

func (oq *OperatorQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OperatorQuery) Exist

func (oq *OperatorQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OperatorQuery) ExistX

func (oq *OperatorQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OperatorQuery) First

func (oq *OperatorQuery) First(ctx context.Context) (*Operator, error)

First returns the first Operator entity from the query. Returns a *NotFoundError when no Operator was found.

func (*OperatorQuery) FirstID

func (oq *OperatorQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Operator ID from the query. Returns a *NotFoundError when no Operator ID was found.

func (*OperatorQuery) FirstIDX

func (oq *OperatorQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*OperatorQuery) FirstX

func (oq *OperatorQuery) FirstX(ctx context.Context) *Operator

FirstX is like First, but panics if an error occurs.

func (*OperatorQuery) ForShare

func (oq *OperatorQuery) ForShare(opts ...sql.LockOption) *OperatorQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*OperatorQuery) ForUpdate

func (oq *OperatorQuery) ForUpdate(opts ...sql.LockOption) *OperatorQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*OperatorQuery) GroupBy

func (oq *OperatorQuery) GroupBy(field string, fields ...string) *OperatorGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Operator.Query().
	GroupBy(operator.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OperatorQuery) IDs

func (oq *OperatorQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Operator IDs.

func (*OperatorQuery) IDsX

func (oq *OperatorQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*OperatorQuery) Limit

func (oq *OperatorQuery) Limit(limit int) *OperatorQuery

Limit the number of records to be returned by this query.

func (*OperatorQuery) Offset

func (oq *OperatorQuery) Offset(offset int) *OperatorQuery

Offset to start from.

func (*OperatorQuery) Only

func (oq *OperatorQuery) Only(ctx context.Context) (*Operator, error)

Only returns a single Operator entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Operator entity is found. Returns a *NotFoundError when no Operator entities are found.

func (*OperatorQuery) OnlyID

func (oq *OperatorQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Operator ID in the query. Returns a *NotSingularError when more than one Operator ID is found. Returns a *NotFoundError when no entities are found.

func (*OperatorQuery) OnlyIDX

func (oq *OperatorQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OperatorQuery) OnlyX

func (oq *OperatorQuery) OnlyX(ctx context.Context) *Operator

OnlyX is like Only, but panics if an error occurs.

func (*OperatorQuery) Order

Order specifies how the records should be ordered.

func (*OperatorQuery) QueryChat

func (oq *OperatorQuery) QueryChat() *ChatQuery

QueryChat chains the current query on the "chat" edge.

func (*OperatorQuery) QueryCommand

func (oq *OperatorQuery) QueryCommand() *CommandQuery

QueryCommand chains the current query on the "command" edge.

func (*OperatorQuery) Select

func (oq *OperatorQuery) Select(fields ...string) *OperatorSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Operator.Query().
	Select(operator.FieldCreatedAt).
	Scan(ctx, &v)

func (*OperatorQuery) Unique

func (oq *OperatorQuery) Unique(unique bool) *OperatorQuery

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 (*OperatorQuery) Where

func (oq *OperatorQuery) Where(ps ...predicate.Operator) *OperatorQuery

Where adds a new predicate for the OperatorQuery builder.

func (*OperatorQuery) WithChat

func (oq *OperatorQuery) WithChat(opts ...func(*ChatQuery)) *OperatorQuery

WithChat tells the query-builder to eager-load the nodes that are connected to the "chat" edge. The optional arguments are used to configure the query builder of the edge.

func (*OperatorQuery) WithCommand

func (oq *OperatorQuery) WithCommand(opts ...func(*CommandQuery)) *OperatorQuery

WithCommand tells the query-builder to eager-load the nodes that are connected to the "command" edge. The optional arguments are used to configure the query builder of the edge.

type OperatorSelect

type OperatorSelect struct {
	*OperatorQuery
	// contains filtered or unexported fields
}

OperatorSelect is the builder for selecting fields of Operator entities.

func (*OperatorSelect) Aggregate

func (os *OperatorSelect) Aggregate(fns ...AggregateFunc) *OperatorSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OperatorSelect) Bool

func (s *OperatorSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) BoolX

func (s *OperatorSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OperatorSelect) Bools

func (s *OperatorSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) BoolsX

func (s *OperatorSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OperatorSelect) Float64

func (s *OperatorSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) Float64X

func (s *OperatorSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OperatorSelect) Float64s

func (s *OperatorSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) Float64sX

func (s *OperatorSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OperatorSelect) Int

func (s *OperatorSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) IntX

func (s *OperatorSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OperatorSelect) Ints

func (s *OperatorSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) IntsX

func (s *OperatorSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OperatorSelect) Scan

func (os *OperatorSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OperatorSelect) ScanX

func (s *OperatorSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OperatorSelect) String

func (s *OperatorSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) StringX

func (s *OperatorSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OperatorSelect) Strings

func (s *OperatorSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OperatorSelect) StringsX

func (s *OperatorSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OperatorUpdate

type OperatorUpdate struct {
	// contains filtered or unexported fields
}

OperatorUpdate is the builder for updating Operator entities.

func (*OperatorUpdate) AddChat

func (ou *OperatorUpdate) AddChat(c ...*Chat) *OperatorUpdate

AddChat adds the "chat" edges to the Chat entity.

func (*OperatorUpdate) AddChatIDs

func (ou *OperatorUpdate) AddChatIDs(ids ...int) *OperatorUpdate

AddChatIDs adds the "chat" edge to the Chat entity by IDs.

func (*OperatorUpdate) AddColor

func (ou *OperatorUpdate) AddColor(u int32) *OperatorUpdate

AddColor adds u to the "color" field.

func (*OperatorUpdate) AddCommand

func (ou *OperatorUpdate) AddCommand(c ...*Command) *OperatorUpdate

AddCommand adds the "command" edges to the Command entity.

func (*OperatorUpdate) AddCommandIDs

func (ou *OperatorUpdate) AddCommandIDs(ids ...int64) *OperatorUpdate

AddCommandIDs adds the "command" edge to the Command entity by IDs.

func (*OperatorUpdate) ClearChat

func (ou *OperatorUpdate) ClearChat() *OperatorUpdate

ClearChat clears all "chat" edges to the Chat entity.

func (*OperatorUpdate) ClearCommand

func (ou *OperatorUpdate) ClearCommand() *OperatorUpdate

ClearCommand clears all "command" edges to the Command entity.

func (*OperatorUpdate) ClearDeletedAt

func (ou *OperatorUpdate) ClearDeletedAt() *OperatorUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*OperatorUpdate) ClearToken

func (ou *OperatorUpdate) ClearToken() *OperatorUpdate

ClearToken clears the value of the "token" field.

func (*OperatorUpdate) Exec

func (ou *OperatorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OperatorUpdate) ExecX

func (ou *OperatorUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OperatorUpdate) Mutation

func (ou *OperatorUpdate) Mutation() *OperatorMutation

Mutation returns the OperatorMutation object of the builder.

func (*OperatorUpdate) RemoveChat

func (ou *OperatorUpdate) RemoveChat(c ...*Chat) *OperatorUpdate

RemoveChat removes "chat" edges to Chat entities.

func (*OperatorUpdate) RemoveChatIDs

func (ou *OperatorUpdate) RemoveChatIDs(ids ...int) *OperatorUpdate

RemoveChatIDs removes the "chat" edge to Chat entities by IDs.

func (*OperatorUpdate) RemoveCommand

func (ou *OperatorUpdate) RemoveCommand(c ...*Command) *OperatorUpdate

RemoveCommand removes "command" edges to Command entities.

func (*OperatorUpdate) RemoveCommandIDs

func (ou *OperatorUpdate) RemoveCommandIDs(ids ...int64) *OperatorUpdate

RemoveCommandIDs removes the "command" edge to Command entities by IDs.

func (*OperatorUpdate) Save

func (ou *OperatorUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OperatorUpdate) SaveX

func (ou *OperatorUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OperatorUpdate) SetColor

func (ou *OperatorUpdate) SetColor(u uint32) *OperatorUpdate

SetColor sets the "color" field.

func (*OperatorUpdate) SetDeletedAt

func (ou *OperatorUpdate) SetDeletedAt(t time.Time) *OperatorUpdate

SetDeletedAt sets the "deleted_at" field.

func (*OperatorUpdate) SetLast

func (ou *OperatorUpdate) SetLast(t time.Time) *OperatorUpdate

SetLast sets the "last" field.

func (*OperatorUpdate) SetNillableColor

func (ou *OperatorUpdate) SetNillableColor(u *uint32) *OperatorUpdate

SetNillableColor sets the "color" field if the given value is not nil.

func (*OperatorUpdate) SetNillableDeletedAt

func (ou *OperatorUpdate) SetNillableDeletedAt(t *time.Time) *OperatorUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*OperatorUpdate) SetNillableLast

func (ou *OperatorUpdate) SetNillableLast(t *time.Time) *OperatorUpdate

SetNillableLast sets the "last" field if the given value is not nil.

func (*OperatorUpdate) SetNillableToken

func (ou *OperatorUpdate) SetNillableToken(s *string) *OperatorUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*OperatorUpdate) SetNillableUsername

func (ou *OperatorUpdate) SetNillableUsername(s *string) *OperatorUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*OperatorUpdate) SetToken

func (ou *OperatorUpdate) SetToken(s string) *OperatorUpdate

SetToken sets the "token" field.

func (*OperatorUpdate) SetUpdatedAt

func (ou *OperatorUpdate) SetUpdatedAt(t time.Time) *OperatorUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OperatorUpdate) SetUsername

func (ou *OperatorUpdate) SetUsername(s string) *OperatorUpdate

SetUsername sets the "username" field.

func (*OperatorUpdate) Where

func (ou *OperatorUpdate) Where(ps ...predicate.Operator) *OperatorUpdate

Where appends a list predicates to the OperatorUpdate builder.

type OperatorUpdateOne

type OperatorUpdateOne struct {
	// contains filtered or unexported fields
}

OperatorUpdateOne is the builder for updating a single Operator entity.

func (*OperatorUpdateOne) AddChat

func (ouo *OperatorUpdateOne) AddChat(c ...*Chat) *OperatorUpdateOne

AddChat adds the "chat" edges to the Chat entity.

func (*OperatorUpdateOne) AddChatIDs

func (ouo *OperatorUpdateOne) AddChatIDs(ids ...int) *OperatorUpdateOne

AddChatIDs adds the "chat" edge to the Chat entity by IDs.

func (*OperatorUpdateOne) AddColor

func (ouo *OperatorUpdateOne) AddColor(u int32) *OperatorUpdateOne

AddColor adds u to the "color" field.

func (*OperatorUpdateOne) AddCommand

func (ouo *OperatorUpdateOne) AddCommand(c ...*Command) *OperatorUpdateOne

AddCommand adds the "command" edges to the Command entity.

func (*OperatorUpdateOne) AddCommandIDs

func (ouo *OperatorUpdateOne) AddCommandIDs(ids ...int64) *OperatorUpdateOne

AddCommandIDs adds the "command" edge to the Command entity by IDs.

func (*OperatorUpdateOne) ClearChat

func (ouo *OperatorUpdateOne) ClearChat() *OperatorUpdateOne

ClearChat clears all "chat" edges to the Chat entity.

func (*OperatorUpdateOne) ClearCommand

func (ouo *OperatorUpdateOne) ClearCommand() *OperatorUpdateOne

ClearCommand clears all "command" edges to the Command entity.

func (*OperatorUpdateOne) ClearDeletedAt

func (ouo *OperatorUpdateOne) ClearDeletedAt() *OperatorUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*OperatorUpdateOne) ClearToken

func (ouo *OperatorUpdateOne) ClearToken() *OperatorUpdateOne

ClearToken clears the value of the "token" field.

func (*OperatorUpdateOne) Exec

func (ouo *OperatorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OperatorUpdateOne) ExecX

func (ouo *OperatorUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OperatorUpdateOne) Mutation

func (ouo *OperatorUpdateOne) Mutation() *OperatorMutation

Mutation returns the OperatorMutation object of the builder.

func (*OperatorUpdateOne) RemoveChat

func (ouo *OperatorUpdateOne) RemoveChat(c ...*Chat) *OperatorUpdateOne

RemoveChat removes "chat" edges to Chat entities.

func (*OperatorUpdateOne) RemoveChatIDs

func (ouo *OperatorUpdateOne) RemoveChatIDs(ids ...int) *OperatorUpdateOne

RemoveChatIDs removes the "chat" edge to Chat entities by IDs.

func (*OperatorUpdateOne) RemoveCommand

func (ouo *OperatorUpdateOne) RemoveCommand(c ...*Command) *OperatorUpdateOne

RemoveCommand removes "command" edges to Command entities.

func (*OperatorUpdateOne) RemoveCommandIDs

func (ouo *OperatorUpdateOne) RemoveCommandIDs(ids ...int64) *OperatorUpdateOne

RemoveCommandIDs removes the "command" edge to Command entities by IDs.

func (*OperatorUpdateOne) Save

func (ouo *OperatorUpdateOne) Save(ctx context.Context) (*Operator, error)

Save executes the query and returns the updated Operator entity.

func (*OperatorUpdateOne) SaveX

func (ouo *OperatorUpdateOne) SaveX(ctx context.Context) *Operator

SaveX is like Save, but panics if an error occurs.

func (*OperatorUpdateOne) Select

func (ouo *OperatorUpdateOne) Select(field string, fields ...string) *OperatorUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OperatorUpdateOne) SetColor

func (ouo *OperatorUpdateOne) SetColor(u uint32) *OperatorUpdateOne

SetColor sets the "color" field.

func (*OperatorUpdateOne) SetDeletedAt

func (ouo *OperatorUpdateOne) SetDeletedAt(t time.Time) *OperatorUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*OperatorUpdateOne) SetLast

func (ouo *OperatorUpdateOne) SetLast(t time.Time) *OperatorUpdateOne

SetLast sets the "last" field.

func (*OperatorUpdateOne) SetNillableColor

func (ouo *OperatorUpdateOne) SetNillableColor(u *uint32) *OperatorUpdateOne

SetNillableColor sets the "color" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableDeletedAt

func (ouo *OperatorUpdateOne) SetNillableDeletedAt(t *time.Time) *OperatorUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableLast

func (ouo *OperatorUpdateOne) SetNillableLast(t *time.Time) *OperatorUpdateOne

SetNillableLast sets the "last" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableToken

func (ouo *OperatorUpdateOne) SetNillableToken(s *string) *OperatorUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableUsername

func (ouo *OperatorUpdateOne) SetNillableUsername(s *string) *OperatorUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*OperatorUpdateOne) SetToken

func (ouo *OperatorUpdateOne) SetToken(s string) *OperatorUpdateOne

SetToken sets the "token" field.

func (*OperatorUpdateOne) SetUpdatedAt

func (ouo *OperatorUpdateOne) SetUpdatedAt(t time.Time) *OperatorUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OperatorUpdateOne) SetUsername

func (ouo *OperatorUpdateOne) SetUsername(s string) *OperatorUpdateOne

SetUsername sets the "username" field.

func (*OperatorUpdateOne) Where

Where appends a list predicates to the OperatorUpdate builder.

type Operators

type Operators []*Operator

Operators is a parsable slice of Operator.

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 Pki

type Pki struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Time when entity was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Time when entity was updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Time when entity was soft-deleted
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// type of certificate blob (ca, listener, operator)
	Type pki.Type `json:"type,omitempty"`
	// certificate key
	Key []byte `json:"key,omitempty"`
	// certificate chain
	Cert []byte `json:"cert,omitempty"`
	// contains filtered or unexported fields
}

Pki is the model entity for the Pki schema.

func (*Pki) String

func (pk *Pki) String() string

String implements the fmt.Stringer.

func (*Pki) Unwrap

func (pk *Pki) Unwrap() *Pki

Unwrap unwraps the Pki 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 (*Pki) Update

func (pk *Pki) Update() *PkiUpdateOne

Update returns a builder for updating this Pki. Note that you need to call Pki.Unwrap() before calling this method if this Pki was returned from a transaction, and the transaction was committed or rolled back.

func (*Pki) Value

func (pk *Pki) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Pki. This includes values selected through modifiers, order, etc.

type PkiClient

type PkiClient struct {
	// contains filtered or unexported fields
}

PkiClient is a client for the Pki schema.

func NewPkiClient

func NewPkiClient(c config) *PkiClient

NewPkiClient returns a client for the Pki from the given config.

func (*PkiClient) Create

func (c *PkiClient) Create() *PkiCreate

Create returns a builder for creating a Pki entity.

func (*PkiClient) CreateBulk

func (c *PkiClient) CreateBulk(builders ...*PkiCreate) *PkiCreateBulk

CreateBulk returns a builder for creating a bulk of Pki entities.

func (*PkiClient) Delete

func (c *PkiClient) Delete() *PkiDelete

Delete returns a delete builder for Pki.

func (*PkiClient) DeleteOne

func (c *PkiClient) DeleteOne(pk *Pki) *PkiDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PkiClient) DeleteOneID

func (c *PkiClient) DeleteOneID(id int) *PkiDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PkiClient) Get

func (c *PkiClient) Get(ctx context.Context, id int) (*Pki, error)

Get returns a Pki entity by its id.

func (*PkiClient) GetX

func (c *PkiClient) GetX(ctx context.Context, id int) *Pki

GetX is like Get, but panics if an error occurs.

func (*PkiClient) Hooks

func (c *PkiClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PkiClient) Intercept

func (c *PkiClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pki.Intercept(f(g(h())))`.

func (*PkiClient) Interceptors

func (c *PkiClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PkiClient) MapCreateBulk

func (c *PkiClient) MapCreateBulk(slice any, setFunc func(*PkiCreate, int)) *PkiCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PkiClient) Query

func (c *PkiClient) Query() *PkiQuery

Query returns a query builder for Pki.

func (*PkiClient) Update

func (c *PkiClient) Update() *PkiUpdate

Update returns an update builder for Pki.

func (*PkiClient) UpdateOne

func (c *PkiClient) UpdateOne(pk *Pki) *PkiUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PkiClient) UpdateOneID

func (c *PkiClient) UpdateOneID(id int) *PkiUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PkiClient) Use

func (c *PkiClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `pki.Hooks(f(g(h())))`.

type PkiCreate

type PkiCreate struct {
	// contains filtered or unexported fields
}

PkiCreate is the builder for creating a Pki entity.

func (*PkiCreate) Exec

func (pc *PkiCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PkiCreate) ExecX

func (pc *PkiCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkiCreate) Mutation

func (pc *PkiCreate) Mutation() *PkiMutation

Mutation returns the PkiMutation object of the builder.

func (*PkiCreate) Save

func (pc *PkiCreate) Save(ctx context.Context) (*Pki, error)

Save creates the Pki in the database.

func (*PkiCreate) SaveX

func (pc *PkiCreate) SaveX(ctx context.Context) *Pki

SaveX calls Save and panics if Save returns an error.

func (*PkiCreate) SetCert

func (pc *PkiCreate) SetCert(b []byte) *PkiCreate

SetCert sets the "cert" field.

func (*PkiCreate) SetCreatedAt

func (pc *PkiCreate) SetCreatedAt(t time.Time) *PkiCreate

SetCreatedAt sets the "created_at" field.

func (*PkiCreate) SetDeletedAt

func (pc *PkiCreate) SetDeletedAt(t time.Time) *PkiCreate

SetDeletedAt sets the "deleted_at" field.

func (*PkiCreate) SetKey

func (pc *PkiCreate) SetKey(b []byte) *PkiCreate

SetKey sets the "key" field.

func (*PkiCreate) SetNillableCreatedAt

func (pc *PkiCreate) SetNillableCreatedAt(t *time.Time) *PkiCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PkiCreate) SetNillableDeletedAt

func (pc *PkiCreate) SetNillableDeletedAt(t *time.Time) *PkiCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PkiCreate) SetNillableUpdatedAt

func (pc *PkiCreate) SetNillableUpdatedAt(t *time.Time) *PkiCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PkiCreate) SetType

func (pc *PkiCreate) SetType(pk pki.Type) *PkiCreate

SetType sets the "type" field.

func (*PkiCreate) SetUpdatedAt

func (pc *PkiCreate) SetUpdatedAt(t time.Time) *PkiCreate

SetUpdatedAt sets the "updated_at" field.

type PkiCreateBulk

type PkiCreateBulk struct {
	// contains filtered or unexported fields
}

PkiCreateBulk is the builder for creating many Pki entities in bulk.

func (*PkiCreateBulk) Exec

func (pcb *PkiCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PkiCreateBulk) ExecX

func (pcb *PkiCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkiCreateBulk) Save

func (pcb *PkiCreateBulk) Save(ctx context.Context) ([]*Pki, error)

Save creates the Pki entities in the database.

func (*PkiCreateBulk) SaveX

func (pcb *PkiCreateBulk) SaveX(ctx context.Context) []*Pki

SaveX is like Save, but panics if an error occurs.

type PkiDelete

type PkiDelete struct {
	// contains filtered or unexported fields
}

PkiDelete is the builder for deleting a Pki entity.

func (*PkiDelete) Exec

func (pd *PkiDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PkiDelete) ExecX

func (pd *PkiDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PkiDelete) Where

func (pd *PkiDelete) Where(ps ...predicate.Pki) *PkiDelete

Where appends a list predicates to the PkiDelete builder.

type PkiDeleteOne

type PkiDeleteOne struct {
	// contains filtered or unexported fields
}

PkiDeleteOne is the builder for deleting a single Pki entity.

func (*PkiDeleteOne) Exec

func (pdo *PkiDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PkiDeleteOne) ExecX

func (pdo *PkiDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkiDeleteOne) Where

func (pdo *PkiDeleteOne) Where(ps ...predicate.Pki) *PkiDeleteOne

Where appends a list predicates to the PkiDelete builder.

type PkiGroupBy

type PkiGroupBy struct {
	// contains filtered or unexported fields
}

PkiGroupBy is the group-by builder for Pki entities.

func (*PkiGroupBy) Aggregate

func (pgb *PkiGroupBy) Aggregate(fns ...AggregateFunc) *PkiGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PkiGroupBy) Bool

func (s *PkiGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) BoolX

func (s *PkiGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PkiGroupBy) Bools

func (s *PkiGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) BoolsX

func (s *PkiGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PkiGroupBy) Float64

func (s *PkiGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) Float64X

func (s *PkiGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PkiGroupBy) Float64s

func (s *PkiGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) Float64sX

func (s *PkiGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PkiGroupBy) Int

func (s *PkiGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) IntX

func (s *PkiGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PkiGroupBy) Ints

func (s *PkiGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) IntsX

func (s *PkiGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PkiGroupBy) Scan

func (pgb *PkiGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PkiGroupBy) ScanX

func (s *PkiGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PkiGroupBy) String

func (s *PkiGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) StringX

func (s *PkiGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PkiGroupBy) Strings

func (s *PkiGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PkiGroupBy) StringsX

func (s *PkiGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PkiMutation

type PkiMutation struct {
	// contains filtered or unexported fields
}

PkiMutation represents an operation that mutates the Pki nodes in the graph.

func (*PkiMutation) AddField

func (m *PkiMutation) 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 (*PkiMutation) AddedEdges

func (m *PkiMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PkiMutation) AddedField

func (m *PkiMutation) 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 (*PkiMutation) AddedFields

func (m *PkiMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PkiMutation) AddedIDs

func (m *PkiMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PkiMutation) Cert

func (m *PkiMutation) Cert() (r []byte, exists bool)

Cert returns the value of the "cert" field in the mutation.

func (*PkiMutation) ClearDeletedAt

func (m *PkiMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PkiMutation) ClearEdge

func (m *PkiMutation) 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 (*PkiMutation) ClearField

func (m *PkiMutation) 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 (*PkiMutation) ClearedEdges

func (m *PkiMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PkiMutation) ClearedFields

func (m *PkiMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PkiMutation) Client

func (m PkiMutation) 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 (*PkiMutation) CreatedAt

func (m *PkiMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PkiMutation) DeletedAt

func (m *PkiMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PkiMutation) DeletedAtCleared

func (m *PkiMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PkiMutation) EdgeCleared

func (m *PkiMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PkiMutation) Field

func (m *PkiMutation) 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 (*PkiMutation) FieldCleared

func (m *PkiMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PkiMutation) Fields

func (m *PkiMutation) 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 (*PkiMutation) GetType

func (m *PkiMutation) GetType() (r pki.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*PkiMutation) ID

func (m *PkiMutation) 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 (*PkiMutation) IDs

func (m *PkiMutation) 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 (*PkiMutation) Key

func (m *PkiMutation) Key() (r []byte, exists bool)

Key returns the value of the "key" field in the mutation.

func (*PkiMutation) OldCert

func (m *PkiMutation) OldCert(ctx context.Context) (v []byte, err error)

OldCert returns the old "cert" field's value of the Pki entity. If the Pki 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 (*PkiMutation) OldCreatedAt

func (m *PkiMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Pki entity. If the Pki 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 (*PkiMutation) OldDeletedAt

func (m *PkiMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Pki entity. If the Pki 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 (*PkiMutation) OldField

func (m *PkiMutation) 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 (*PkiMutation) OldKey

func (m *PkiMutation) OldKey(ctx context.Context) (v []byte, err error)

OldKey returns the old "key" field's value of the Pki entity. If the Pki 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 (*PkiMutation) OldType

func (m *PkiMutation) OldType(ctx context.Context) (v pki.Type, err error)

OldType returns the old "type" field's value of the Pki entity. If the Pki 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 (*PkiMutation) OldUpdatedAt

func (m *PkiMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Pki entity. If the Pki 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 (*PkiMutation) Op

func (m *PkiMutation) Op() Op

Op returns the operation name.

func (*PkiMutation) RemovedEdges

func (m *PkiMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PkiMutation) RemovedIDs

func (m *PkiMutation) 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 (*PkiMutation) ResetCert

func (m *PkiMutation) ResetCert()

ResetCert resets all changes to the "cert" field.

func (*PkiMutation) ResetCreatedAt

func (m *PkiMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PkiMutation) ResetDeletedAt

func (m *PkiMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PkiMutation) ResetEdge

func (m *PkiMutation) 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 (*PkiMutation) ResetField

func (m *PkiMutation) 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 (*PkiMutation) ResetKey

func (m *PkiMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*PkiMutation) ResetType

func (m *PkiMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*PkiMutation) ResetUpdatedAt

func (m *PkiMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PkiMutation) SetCert

func (m *PkiMutation) SetCert(b []byte)

SetCert sets the "cert" field.

func (*PkiMutation) SetCreatedAt

func (m *PkiMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PkiMutation) SetDeletedAt

func (m *PkiMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PkiMutation) SetField

func (m *PkiMutation) 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 (*PkiMutation) SetKey

func (m *PkiMutation) SetKey(b []byte)

SetKey sets the "key" field.

func (*PkiMutation) SetOp

func (m *PkiMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PkiMutation) SetType

func (m *PkiMutation) SetType(pk pki.Type)

SetType sets the "type" field.

func (*PkiMutation) SetUpdatedAt

func (m *PkiMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (PkiMutation) Tx

func (m PkiMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PkiMutation) Type

func (m *PkiMutation) Type() string

Type returns the node type of this mutation (Pki).

func (*PkiMutation) UpdatedAt

func (m *PkiMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PkiMutation) Where

func (m *PkiMutation) Where(ps ...predicate.Pki)

Where appends a list predicates to the PkiMutation builder.

func (*PkiMutation) WhereP

func (m *PkiMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PkiMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PkiQuery

type PkiQuery struct {
	// contains filtered or unexported fields
}

PkiQuery is the builder for querying Pki entities.

func (*PkiQuery) Aggregate

func (pq *PkiQuery) Aggregate(fns ...AggregateFunc) *PkiSelect

Aggregate returns a PkiSelect configured with the given aggregations.

func (*PkiQuery) All

func (pq *PkiQuery) All(ctx context.Context) ([]*Pki, error)

All executes the query and returns a list of Pkis.

func (*PkiQuery) AllX

func (pq *PkiQuery) AllX(ctx context.Context) []*Pki

AllX is like All, but panics if an error occurs.

func (*PkiQuery) Clone

func (pq *PkiQuery) Clone() *PkiQuery

Clone returns a duplicate of the PkiQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PkiQuery) Count

func (pq *PkiQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PkiQuery) CountX

func (pq *PkiQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PkiQuery) Exist

func (pq *PkiQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PkiQuery) ExistX

func (pq *PkiQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PkiQuery) First

func (pq *PkiQuery) First(ctx context.Context) (*Pki, error)

First returns the first Pki entity from the query. Returns a *NotFoundError when no Pki was found.

func (*PkiQuery) FirstID

func (pq *PkiQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Pki ID from the query. Returns a *NotFoundError when no Pki ID was found.

func (*PkiQuery) FirstIDX

func (pq *PkiQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PkiQuery) FirstX

func (pq *PkiQuery) FirstX(ctx context.Context) *Pki

FirstX is like First, but panics if an error occurs.

func (*PkiQuery) ForShare

func (pq *PkiQuery) ForShare(opts ...sql.LockOption) *PkiQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*PkiQuery) ForUpdate

func (pq *PkiQuery) ForUpdate(opts ...sql.LockOption) *PkiQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*PkiQuery) GroupBy

func (pq *PkiQuery) GroupBy(field string, fields ...string) *PkiGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Pki.Query().
	GroupBy(pki.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PkiQuery) IDs

func (pq *PkiQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Pki IDs.

func (*PkiQuery) IDsX

func (pq *PkiQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PkiQuery) Limit

func (pq *PkiQuery) Limit(limit int) *PkiQuery

Limit the number of records to be returned by this query.

func (*PkiQuery) Offset

func (pq *PkiQuery) Offset(offset int) *PkiQuery

Offset to start from.

func (*PkiQuery) Only

func (pq *PkiQuery) Only(ctx context.Context) (*Pki, error)

Only returns a single Pki entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Pki entity is found. Returns a *NotFoundError when no Pki entities are found.

func (*PkiQuery) OnlyID

func (pq *PkiQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Pki ID in the query. Returns a *NotSingularError when more than one Pki ID is found. Returns a *NotFoundError when no entities are found.

func (*PkiQuery) OnlyIDX

func (pq *PkiQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PkiQuery) OnlyX

func (pq *PkiQuery) OnlyX(ctx context.Context) *Pki

OnlyX is like Only, but panics if an error occurs.

func (*PkiQuery) Order

func (pq *PkiQuery) Order(o ...pki.OrderOption) *PkiQuery

Order specifies how the records should be ordered.

func (*PkiQuery) Select

func (pq *PkiQuery) Select(fields ...string) *PkiSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Pki.Query().
	Select(pki.FieldCreatedAt).
	Scan(ctx, &v)

func (*PkiQuery) Unique

func (pq *PkiQuery) Unique(unique bool) *PkiQuery

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 (*PkiQuery) Where

func (pq *PkiQuery) Where(ps ...predicate.Pki) *PkiQuery

Where adds a new predicate for the PkiQuery builder.

type PkiSelect

type PkiSelect struct {
	*PkiQuery
	// contains filtered or unexported fields
}

PkiSelect is the builder for selecting fields of Pki entities.

func (*PkiSelect) Aggregate

func (ps *PkiSelect) Aggregate(fns ...AggregateFunc) *PkiSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PkiSelect) Bool

func (s *PkiSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PkiSelect) BoolX

func (s *PkiSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PkiSelect) Bools

func (s *PkiSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PkiSelect) BoolsX

func (s *PkiSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PkiSelect) Float64

func (s *PkiSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PkiSelect) Float64X

func (s *PkiSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PkiSelect) Float64s

func (s *PkiSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PkiSelect) Float64sX

func (s *PkiSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PkiSelect) Int

func (s *PkiSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PkiSelect) IntX

func (s *PkiSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PkiSelect) Ints

func (s *PkiSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PkiSelect) IntsX

func (s *PkiSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PkiSelect) Scan

func (ps *PkiSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PkiSelect) ScanX

func (s *PkiSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PkiSelect) String

func (s *PkiSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PkiSelect) StringX

func (s *PkiSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PkiSelect) Strings

func (s *PkiSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PkiSelect) StringsX

func (s *PkiSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PkiUpdate

type PkiUpdate struct {
	// contains filtered or unexported fields
}

PkiUpdate is the builder for updating Pki entities.

func (*PkiUpdate) ClearDeletedAt

func (pu *PkiUpdate) ClearDeletedAt() *PkiUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PkiUpdate) Exec

func (pu *PkiUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PkiUpdate) ExecX

func (pu *PkiUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkiUpdate) Mutation

func (pu *PkiUpdate) Mutation() *PkiMutation

Mutation returns the PkiMutation object of the builder.

func (*PkiUpdate) Save

func (pu *PkiUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PkiUpdate) SaveX

func (pu *PkiUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PkiUpdate) SetCert

func (pu *PkiUpdate) SetCert(b []byte) *PkiUpdate

SetCert sets the "cert" field.

func (*PkiUpdate) SetDeletedAt

func (pu *PkiUpdate) SetDeletedAt(t time.Time) *PkiUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PkiUpdate) SetKey

func (pu *PkiUpdate) SetKey(b []byte) *PkiUpdate

SetKey sets the "key" field.

func (*PkiUpdate) SetNillableDeletedAt

func (pu *PkiUpdate) SetNillableDeletedAt(t *time.Time) *PkiUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PkiUpdate) SetNillableType

func (pu *PkiUpdate) SetNillableType(pk *pki.Type) *PkiUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*PkiUpdate) SetType

func (pu *PkiUpdate) SetType(pk pki.Type) *PkiUpdate

SetType sets the "type" field.

func (*PkiUpdate) SetUpdatedAt

func (pu *PkiUpdate) SetUpdatedAt(t time.Time) *PkiUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PkiUpdate) Where

func (pu *PkiUpdate) Where(ps ...predicate.Pki) *PkiUpdate

Where appends a list predicates to the PkiUpdate builder.

type PkiUpdateOne

type PkiUpdateOne struct {
	// contains filtered or unexported fields
}

PkiUpdateOne is the builder for updating a single Pki entity.

func (*PkiUpdateOne) ClearDeletedAt

func (puo *PkiUpdateOne) ClearDeletedAt() *PkiUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PkiUpdateOne) Exec

func (puo *PkiUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PkiUpdateOne) ExecX

func (puo *PkiUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkiUpdateOne) Mutation

func (puo *PkiUpdateOne) Mutation() *PkiMutation

Mutation returns the PkiMutation object of the builder.

func (*PkiUpdateOne) Save

func (puo *PkiUpdateOne) Save(ctx context.Context) (*Pki, error)

Save executes the query and returns the updated Pki entity.

func (*PkiUpdateOne) SaveX

func (puo *PkiUpdateOne) SaveX(ctx context.Context) *Pki

SaveX is like Save, but panics if an error occurs.

func (*PkiUpdateOne) Select

func (puo *PkiUpdateOne) Select(field string, fields ...string) *PkiUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PkiUpdateOne) SetCert

func (puo *PkiUpdateOne) SetCert(b []byte) *PkiUpdateOne

SetCert sets the "cert" field.

func (*PkiUpdateOne) SetDeletedAt

func (puo *PkiUpdateOne) SetDeletedAt(t time.Time) *PkiUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*PkiUpdateOne) SetKey

func (puo *PkiUpdateOne) SetKey(b []byte) *PkiUpdateOne

SetKey sets the "key" field.

func (*PkiUpdateOne) SetNillableDeletedAt

func (puo *PkiUpdateOne) SetNillableDeletedAt(t *time.Time) *PkiUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PkiUpdateOne) SetNillableType

func (puo *PkiUpdateOne) SetNillableType(pk *pki.Type) *PkiUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*PkiUpdateOne) SetType

func (puo *PkiUpdateOne) SetType(pk pki.Type) *PkiUpdateOne

SetType sets the "type" field.

func (*PkiUpdateOne) SetUpdatedAt

func (puo *PkiUpdateOne) SetUpdatedAt(t time.Time) *PkiUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PkiUpdateOne) Where

func (puo *PkiUpdateOne) Where(ps ...predicate.Pki) *PkiUpdateOne

Where appends a list predicates to the PkiUpdate builder.

type Pkis

type Pkis []*Pki

Pkis is a parsable slice of Pki.

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 Task

type Task struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// id of command
	CommandID int64 `json:"command_id,omitempty"`
	// id of agent
	AgentID uint32 `json:"agent_id,omitempty"`
	// time when task created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// time when task pushed to the agent
	PushedAt time.Time `json:"pushed_at,omitempty"`
	// time when task results received
	DoneAt time.Time `json:"done_at,omitempty"`
	// status of task
	Status shared.TaskStatus `json:"status,omitempty"`
	// capability to execute
	Cap shared.Capability `json:"cap,omitempty"`
	// capability arguments
	ArgsID int `json:"args_id,omitempty"`
	// task output
	OutputID int `json:"output_id,omitempty"`
	// is output bigger than constant value
	OutputBig bool `json:"output_big,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskQuery when eager-loading is set.
	Edges TaskEdges `json:"edges"`
	// contains filtered or unexported fields
}

Task is the model entity for the Task schema.

func (*Task) QueryAgent

func (t *Task) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the Task entity.

func (*Task) QueryBlobberArgs

func (t *Task) QueryBlobberArgs() *BlobberQuery

QueryBlobberArgs queries the "blobber_args" edge of the Task entity.

func (*Task) QueryBlobberOutput

func (t *Task) QueryBlobberOutput() *BlobberQuery

QueryBlobberOutput queries the "blobber_output" edge of the Task entity.

func (*Task) QueryCommand

func (t *Task) QueryCommand() *CommandQuery

QueryCommand queries the "command" edge of the Task entity.

func (*Task) String

func (t *Task) String() string

String implements the fmt.Stringer.

func (*Task) Unwrap

func (t *Task) Unwrap() *Task

Unwrap unwraps the Task 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 (*Task) Update

func (t *Task) Update() *TaskUpdateOne

Update returns a builder for updating this Task. Note that you need to call Task.Unwrap() before calling this method if this Task was returned from a transaction, and the transaction was committed or rolled back.

func (*Task) Value

func (t *Task) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Task. This includes values selected through modifiers, order, etc.

type TaskClient

type TaskClient struct {
	// contains filtered or unexported fields
}

TaskClient is a client for the Task schema.

func NewTaskClient

func NewTaskClient(c config) *TaskClient

NewTaskClient returns a client for the Task from the given config.

func (*TaskClient) Create

func (c *TaskClient) Create() *TaskCreate

Create returns a builder for creating a Task entity.

func (*TaskClient) CreateBulk

func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk

CreateBulk returns a builder for creating a bulk of Task entities.

func (*TaskClient) Delete

func (c *TaskClient) Delete() *TaskDelete

Delete returns a delete builder for Task.

func (*TaskClient) DeleteOne

func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TaskClient) DeleteOneID

func (c *TaskClient) DeleteOneID(id int64) *TaskDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TaskClient) Get

func (c *TaskClient) Get(ctx context.Context, id int64) (*Task, error)

Get returns a Task entity by its id.

func (*TaskClient) GetX

func (c *TaskClient) GetX(ctx context.Context, id int64) *Task

GetX is like Get, but panics if an error occurs.

func (*TaskClient) Hooks

func (c *TaskClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TaskClient) Intercept

func (c *TaskClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `task.Intercept(f(g(h())))`.

func (*TaskClient) Interceptors

func (c *TaskClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TaskClient) MapCreateBulk

func (c *TaskClient) MapCreateBulk(slice any, setFunc func(*TaskCreate, int)) *TaskCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TaskClient) Query

func (c *TaskClient) Query() *TaskQuery

Query returns a query builder for Task.

func (*TaskClient) QueryAgent

func (c *TaskClient) QueryAgent(t *Task) *AgentQuery

QueryAgent queries the agent edge of a Task.

func (*TaskClient) QueryBlobberArgs

func (c *TaskClient) QueryBlobberArgs(t *Task) *BlobberQuery

QueryBlobberArgs queries the blobber_args edge of a Task.

func (*TaskClient) QueryBlobberOutput

func (c *TaskClient) QueryBlobberOutput(t *Task) *BlobberQuery

QueryBlobberOutput queries the blobber_output edge of a Task.

func (*TaskClient) QueryCommand

func (c *TaskClient) QueryCommand(t *Task) *CommandQuery

QueryCommand queries the command edge of a Task.

func (*TaskClient) Update

func (c *TaskClient) Update() *TaskUpdate

Update returns an update builder for Task.

func (*TaskClient) UpdateOne

func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskClient) UpdateOneID

func (c *TaskClient) UpdateOneID(id int64) *TaskUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskClient) Use

func (c *TaskClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `task.Hooks(f(g(h())))`.

type TaskCreate

type TaskCreate struct {
	// contains filtered or unexported fields
}

TaskCreate is the builder for creating a Task entity.

func (*TaskCreate) Exec

func (tc *TaskCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreate) ExecX

func (tc *TaskCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskCreate) Mutation

func (tc *TaskCreate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskCreate) Save

func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)

Save creates the Task in the database.

func (*TaskCreate) SaveX

func (tc *TaskCreate) SaveX(ctx context.Context) *Task

SaveX calls Save and panics if Save returns an error.

func (*TaskCreate) SetAgent

func (tc *TaskCreate) SetAgent(a *Agent) *TaskCreate

SetAgent sets the "agent" edge to the Agent entity.

func (*TaskCreate) SetAgentID

func (tc *TaskCreate) SetAgentID(u uint32) *TaskCreate

SetAgentID sets the "agent_id" field.

func (*TaskCreate) SetArgsID

func (tc *TaskCreate) SetArgsID(i int) *TaskCreate

SetArgsID sets the "args_id" field.

func (*TaskCreate) SetBlobberArgs

func (tc *TaskCreate) SetBlobberArgs(b *Blobber) *TaskCreate

SetBlobberArgs sets the "blobber_args" edge to the Blobber entity.

func (*TaskCreate) SetBlobberArgsID

func (tc *TaskCreate) SetBlobberArgsID(id int) *TaskCreate

SetBlobberArgsID sets the "blobber_args" edge to the Blobber entity by ID.

func (*TaskCreate) SetBlobberOutput

func (tc *TaskCreate) SetBlobberOutput(b *Blobber) *TaskCreate

SetBlobberOutput sets the "blobber_output" edge to the Blobber entity.

func (*TaskCreate) SetBlobberOutputID

func (tc *TaskCreate) SetBlobberOutputID(id int) *TaskCreate

SetBlobberOutputID sets the "blobber_output" edge to the Blobber entity by ID.

func (*TaskCreate) SetCap

func (tc *TaskCreate) SetCap(s shared.Capability) *TaskCreate

SetCap sets the "cap" field.

func (*TaskCreate) SetCommand

func (tc *TaskCreate) SetCommand(c *Command) *TaskCreate

SetCommand sets the "command" edge to the Command entity.

func (*TaskCreate) SetCommandID

func (tc *TaskCreate) SetCommandID(i int64) *TaskCreate

SetCommandID sets the "command_id" field.

func (*TaskCreate) SetCreatedAt

func (tc *TaskCreate) SetCreatedAt(t time.Time) *TaskCreate

SetCreatedAt sets the "created_at" field.

func (*TaskCreate) SetDoneAt

func (tc *TaskCreate) SetDoneAt(t time.Time) *TaskCreate

SetDoneAt sets the "done_at" field.

func (*TaskCreate) SetID

func (tc *TaskCreate) SetID(i int64) *TaskCreate

SetID sets the "id" field.

func (*TaskCreate) SetNillableBlobberOutputID

func (tc *TaskCreate) SetNillableBlobberOutputID(id *int) *TaskCreate

SetNillableBlobberOutputID sets the "blobber_output" edge to the Blobber entity by ID if the given value is not nil.

func (*TaskCreate) SetNillableCreatedAt

func (tc *TaskCreate) SetNillableCreatedAt(t *time.Time) *TaskCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TaskCreate) SetNillableDoneAt

func (tc *TaskCreate) SetNillableDoneAt(t *time.Time) *TaskCreate

SetNillableDoneAt sets the "done_at" field if the given value is not nil.

func (*TaskCreate) SetNillableOutputBig

func (tc *TaskCreate) SetNillableOutputBig(b *bool) *TaskCreate

SetNillableOutputBig sets the "output_big" field if the given value is not nil.

func (*TaskCreate) SetNillableOutputID

func (tc *TaskCreate) SetNillableOutputID(i *int) *TaskCreate

SetNillableOutputID sets the "output_id" field if the given value is not nil.

func (*TaskCreate) SetNillablePushedAt

func (tc *TaskCreate) SetNillablePushedAt(t *time.Time) *TaskCreate

SetNillablePushedAt sets the "pushed_at" field if the given value is not nil.

func (*TaskCreate) SetOutputBig

func (tc *TaskCreate) SetOutputBig(b bool) *TaskCreate

SetOutputBig sets the "output_big" field.

func (*TaskCreate) SetOutputID

func (tc *TaskCreate) SetOutputID(i int) *TaskCreate

SetOutputID sets the "output_id" field.

func (*TaskCreate) SetPushedAt

func (tc *TaskCreate) SetPushedAt(t time.Time) *TaskCreate

SetPushedAt sets the "pushed_at" field.

func (*TaskCreate) SetStatus

func (tc *TaskCreate) SetStatus(ss shared.TaskStatus) *TaskCreate

SetStatus sets the "status" field.

type TaskCreateBulk

type TaskCreateBulk struct {
	// contains filtered or unexported fields
}

TaskCreateBulk is the builder for creating many Task entities in bulk.

func (*TaskCreateBulk) Exec

func (tcb *TaskCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreateBulk) ExecX

func (tcb *TaskCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskCreateBulk) Save

func (tcb *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error)

Save creates the Task entities in the database.

func (*TaskCreateBulk) SaveX

func (tcb *TaskCreateBulk) SaveX(ctx context.Context) []*Task

SaveX is like Save, but panics if an error occurs.

type TaskDelete

type TaskDelete struct {
	// contains filtered or unexported fields
}

TaskDelete is the builder for deleting a Task entity.

func (*TaskDelete) Exec

func (td *TaskDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TaskDelete) ExecX

func (td *TaskDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TaskDelete) Where

func (td *TaskDelete) Where(ps ...predicate.Task) *TaskDelete

Where appends a list predicates to the TaskDelete builder.

type TaskDeleteOne

type TaskDeleteOne struct {
	// contains filtered or unexported fields
}

TaskDeleteOne is the builder for deleting a single Task entity.

func (*TaskDeleteOne) Exec

func (tdo *TaskDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskDeleteOne) ExecX

func (tdo *TaskDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskDeleteOne) Where

func (tdo *TaskDeleteOne) Where(ps ...predicate.Task) *TaskDeleteOne

Where appends a list predicates to the TaskDelete builder.

type TaskEdges

type TaskEdges struct {
	// Command holds the value of the command edge.
	Command *Command `json:"command,omitempty"`
	// Agent holds the value of the agent edge.
	Agent *Agent `json:"agent,omitempty"`
	// BlobberArgs holds the value of the blobber_args edge.
	BlobberArgs *Blobber `json:"blobber_args,omitempty"`
	// BlobberOutput holds the value of the blobber_output edge.
	BlobberOutput *Blobber `json:"blobber_output,omitempty"`
	// contains filtered or unexported fields
}

TaskEdges holds the relations/edges for other nodes in the graph.

func (TaskEdges) AgentOrErr

func (e TaskEdges) AgentOrErr() (*Agent, error)

AgentOrErr returns the Agent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TaskEdges) BlobberArgsOrErr

func (e TaskEdges) BlobberArgsOrErr() (*Blobber, error)

BlobberArgsOrErr returns the BlobberArgs value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TaskEdges) BlobberOutputOrErr

func (e TaskEdges) BlobberOutputOrErr() (*Blobber, error)

BlobberOutputOrErr returns the BlobberOutput value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TaskEdges) CommandOrErr

func (e TaskEdges) CommandOrErr() (*Command, error)

CommandOrErr returns the Command value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TaskGroupBy

type TaskGroupBy struct {
	// contains filtered or unexported fields
}

TaskGroupBy is the group-by builder for Task entities.

func (*TaskGroupBy) Aggregate

func (tgb *TaskGroupBy) Aggregate(fns ...AggregateFunc) *TaskGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TaskGroupBy) Bool

func (s *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) BoolX

func (s *TaskGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskGroupBy) Bools

func (s *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) BoolsX

func (s *TaskGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskGroupBy) Float64

func (s *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) Float64X

func (s *TaskGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskGroupBy) Float64s

func (s *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) Float64sX

func (s *TaskGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskGroupBy) Int

func (s *TaskGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) IntX

func (s *TaskGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskGroupBy) Ints

func (s *TaskGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) IntsX

func (s *TaskGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskGroupBy) Scan

func (tgb *TaskGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TaskGroupBy) ScanX

func (s *TaskGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TaskGroupBy) String

func (s *TaskGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) StringX

func (s *TaskGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskGroupBy) Strings

func (s *TaskGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) StringsX

func (s *TaskGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskMutation

type TaskMutation struct {
	// contains filtered or unexported fields
}

TaskMutation represents an operation that mutates the Task nodes in the graph.

func (*TaskMutation) AddField

func (m *TaskMutation) 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 (*TaskMutation) AddedEdges

func (m *TaskMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TaskMutation) AddedField

func (m *TaskMutation) 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 (*TaskMutation) AddedFields

func (m *TaskMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TaskMutation) AddedIDs

func (m *TaskMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TaskMutation) AgentCleared

func (m *TaskMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*TaskMutation) AgentID

func (m *TaskMutation) AgentID() (r uint32, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*TaskMutation) AgentIDs

func (m *TaskMutation) AgentIDs() (ids []uint32)

AgentIDs returns the "agent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AgentID instead. It exists only for internal usage by the builders.

func (*TaskMutation) ArgsID

func (m *TaskMutation) ArgsID() (r int, exists bool)

ArgsID returns the value of the "args_id" field in the mutation.

func (*TaskMutation) BlobberArgsCleared

func (m *TaskMutation) BlobberArgsCleared() bool

BlobberArgsCleared reports if the "blobber_args" edge to the Blobber entity was cleared.

func (*TaskMutation) BlobberArgsID

func (m *TaskMutation) BlobberArgsID() (id int, exists bool)

BlobberArgsID returns the "blobber_args" edge ID in the mutation.

func (*TaskMutation) BlobberArgsIDs

func (m *TaskMutation) BlobberArgsIDs() (ids []int)

BlobberArgsIDs returns the "blobber_args" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BlobberArgsID instead. It exists only for internal usage by the builders.

func (*TaskMutation) BlobberOutputCleared

func (m *TaskMutation) BlobberOutputCleared() bool

BlobberOutputCleared reports if the "blobber_output" edge to the Blobber entity was cleared.

func (*TaskMutation) BlobberOutputID

func (m *TaskMutation) BlobberOutputID() (id int, exists bool)

BlobberOutputID returns the "blobber_output" edge ID in the mutation.

func (*TaskMutation) BlobberOutputIDs

func (m *TaskMutation) BlobberOutputIDs() (ids []int)

BlobberOutputIDs returns the "blobber_output" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BlobberOutputID instead. It exists only for internal usage by the builders.

func (*TaskMutation) Cap

func (m *TaskMutation) Cap() (r shared.Capability, exists bool)

Cap returns the value of the "cap" field in the mutation.

func (*TaskMutation) ClearAgent

func (m *TaskMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*TaskMutation) ClearBlobberArgs

func (m *TaskMutation) ClearBlobberArgs()

ClearBlobberArgs clears the "blobber_args" edge to the Blobber entity.

func (*TaskMutation) ClearBlobberOutput

func (m *TaskMutation) ClearBlobberOutput()

ClearBlobberOutput clears the "blobber_output" edge to the Blobber entity.

func (*TaskMutation) ClearCommand

func (m *TaskMutation) ClearCommand()

ClearCommand clears the "command" edge to the Command entity.

func (*TaskMutation) ClearDoneAt

func (m *TaskMutation) ClearDoneAt()

ClearDoneAt clears the value of the "done_at" field.

func (*TaskMutation) ClearEdge

func (m *TaskMutation) 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 (*TaskMutation) ClearField

func (m *TaskMutation) 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 (*TaskMutation) ClearOutputBig

func (m *TaskMutation) ClearOutputBig()

ClearOutputBig clears the value of the "output_big" field.

func (*TaskMutation) ClearOutputID

func (m *TaskMutation) ClearOutputID()

ClearOutputID clears the value of the "output_id" field.

func (*TaskMutation) ClearPushedAt

func (m *TaskMutation) ClearPushedAt()

ClearPushedAt clears the value of the "pushed_at" field.

func (*TaskMutation) ClearedEdges

func (m *TaskMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TaskMutation) ClearedFields

func (m *TaskMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TaskMutation) Client

func (m TaskMutation) 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 (*TaskMutation) CommandCleared

func (m *TaskMutation) CommandCleared() bool

CommandCleared reports if the "command" edge to the Command entity was cleared.

func (*TaskMutation) CommandID

func (m *TaskMutation) CommandID() (r int64, exists bool)

CommandID returns the value of the "command_id" field in the mutation.

func (*TaskMutation) CommandIDs

func (m *TaskMutation) CommandIDs() (ids []int64)

CommandIDs returns the "command" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CommandID instead. It exists only for internal usage by the builders.

func (*TaskMutation) CreatedAt

func (m *TaskMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TaskMutation) DoneAt

func (m *TaskMutation) DoneAt() (r time.Time, exists bool)

DoneAt returns the value of the "done_at" field in the mutation.

func (*TaskMutation) DoneAtCleared

func (m *TaskMutation) DoneAtCleared() bool

DoneAtCleared returns if the "done_at" field was cleared in this mutation.

func (*TaskMutation) EdgeCleared

func (m *TaskMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TaskMutation) Field

func (m *TaskMutation) 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 (*TaskMutation) FieldCleared

func (m *TaskMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TaskMutation) Fields

func (m *TaskMutation) 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 (*TaskMutation) ID

func (m *TaskMutation) ID() (id int64, 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 (*TaskMutation) IDs

func (m *TaskMutation) IDs(ctx context.Context) ([]int64, 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 (*TaskMutation) OldAgentID

func (m *TaskMutation) OldAgentID(ctx context.Context) (v uint32, err error)

OldAgentID returns the old "agent_id" field's value of the Task entity. If the Task 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 (*TaskMutation) OldArgsID

func (m *TaskMutation) OldArgsID(ctx context.Context) (v int, err error)

OldArgsID returns the old "args_id" field's value of the Task entity. If the Task 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 (*TaskMutation) OldCap

func (m *TaskMutation) OldCap(ctx context.Context) (v shared.Capability, err error)

OldCap returns the old "cap" field's value of the Task entity. If the Task 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 (*TaskMutation) OldCommandID

func (m *TaskMutation) OldCommandID(ctx context.Context) (v int64, err error)

OldCommandID returns the old "command_id" field's value of the Task entity. If the Task 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 (*TaskMutation) OldCreatedAt

func (m *TaskMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Task entity. If the Task 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 (*TaskMutation) OldDoneAt

func (m *TaskMutation) OldDoneAt(ctx context.Context) (v time.Time, err error)

OldDoneAt returns the old "done_at" field's value of the Task entity. If the Task 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 (*TaskMutation) OldField

func (m *TaskMutation) 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 (*TaskMutation) OldOutputBig

func (m *TaskMutation) OldOutputBig(ctx context.Context) (v bool, err error)

OldOutputBig returns the old "output_big" field's value of the Task entity. If the Task 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 (*TaskMutation) OldOutputID

func (m *TaskMutation) OldOutputID(ctx context.Context) (v int, err error)

OldOutputID returns the old "output_id" field's value of the Task entity. If the Task 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 (*TaskMutation) OldPushedAt

func (m *TaskMutation) OldPushedAt(ctx context.Context) (v time.Time, err error)

OldPushedAt returns the old "pushed_at" field's value of the Task entity. If the Task 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 (*TaskMutation) OldStatus

func (m *TaskMutation) OldStatus(ctx context.Context) (v shared.TaskStatus, err error)

OldStatus returns the old "status" field's value of the Task entity. If the Task 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 (*TaskMutation) Op

func (m *TaskMutation) Op() Op

Op returns the operation name.

func (*TaskMutation) OutputBig

func (m *TaskMutation) OutputBig() (r bool, exists bool)

OutputBig returns the value of the "output_big" field in the mutation.

func (*TaskMutation) OutputBigCleared

func (m *TaskMutation) OutputBigCleared() bool

OutputBigCleared returns if the "output_big" field was cleared in this mutation.

func (*TaskMutation) OutputID

func (m *TaskMutation) OutputID() (r int, exists bool)

OutputID returns the value of the "output_id" field in the mutation.

func (*TaskMutation) OutputIDCleared

func (m *TaskMutation) OutputIDCleared() bool

OutputIDCleared returns if the "output_id" field was cleared in this mutation.

func (*TaskMutation) PushedAt

func (m *TaskMutation) PushedAt() (r time.Time, exists bool)

PushedAt returns the value of the "pushed_at" field in the mutation.

func (*TaskMutation) PushedAtCleared

func (m *TaskMutation) PushedAtCleared() bool

PushedAtCleared returns if the "pushed_at" field was cleared in this mutation.

func (*TaskMutation) RemovedEdges

func (m *TaskMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TaskMutation) RemovedIDs

func (m *TaskMutation) 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 (*TaskMutation) ResetAgent

func (m *TaskMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*TaskMutation) ResetAgentID

func (m *TaskMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*TaskMutation) ResetArgsID

func (m *TaskMutation) ResetArgsID()

ResetArgsID resets all changes to the "args_id" field.

func (*TaskMutation) ResetBlobberArgs

func (m *TaskMutation) ResetBlobberArgs()

ResetBlobberArgs resets all changes to the "blobber_args" edge.

func (*TaskMutation) ResetBlobberOutput

func (m *TaskMutation) ResetBlobberOutput()

ResetBlobberOutput resets all changes to the "blobber_output" edge.

func (*TaskMutation) ResetCap

func (m *TaskMutation) ResetCap()

ResetCap resets all changes to the "cap" field.

func (*TaskMutation) ResetCommand

func (m *TaskMutation) ResetCommand()

ResetCommand resets all changes to the "command" edge.

func (*TaskMutation) ResetCommandID

func (m *TaskMutation) ResetCommandID()

ResetCommandID resets all changes to the "command_id" field.

func (*TaskMutation) ResetCreatedAt

func (m *TaskMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TaskMutation) ResetDoneAt

func (m *TaskMutation) ResetDoneAt()

ResetDoneAt resets all changes to the "done_at" field.

func (*TaskMutation) ResetEdge

func (m *TaskMutation) 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 (*TaskMutation) ResetField

func (m *TaskMutation) 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 (*TaskMutation) ResetOutputBig

func (m *TaskMutation) ResetOutputBig()

ResetOutputBig resets all changes to the "output_big" field.

func (*TaskMutation) ResetOutputID

func (m *TaskMutation) ResetOutputID()

ResetOutputID resets all changes to the "output_id" field.

func (*TaskMutation) ResetPushedAt

func (m *TaskMutation) ResetPushedAt()

ResetPushedAt resets all changes to the "pushed_at" field.

func (*TaskMutation) ResetStatus

func (m *TaskMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TaskMutation) SetAgentID

func (m *TaskMutation) SetAgentID(u uint32)

SetAgentID sets the "agent_id" field.

func (*TaskMutation) SetArgsID

func (m *TaskMutation) SetArgsID(i int)

SetArgsID sets the "args_id" field.

func (*TaskMutation) SetBlobberArgsID

func (m *TaskMutation) SetBlobberArgsID(id int)

SetBlobberArgsID sets the "blobber_args" edge to the Blobber entity by id.

func (*TaskMutation) SetBlobberOutputID

func (m *TaskMutation) SetBlobberOutputID(id int)

SetBlobberOutputID sets the "blobber_output" edge to the Blobber entity by id.

func (*TaskMutation) SetCap

func (m *TaskMutation) SetCap(s shared.Capability)

SetCap sets the "cap" field.

func (*TaskMutation) SetCommandID

func (m *TaskMutation) SetCommandID(i int64)

SetCommandID sets the "command_id" field.

func (*TaskMutation) SetCreatedAt

func (m *TaskMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TaskMutation) SetDoneAt

func (m *TaskMutation) SetDoneAt(t time.Time)

SetDoneAt sets the "done_at" field.

func (*TaskMutation) SetField

func (m *TaskMutation) 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 (*TaskMutation) SetID

func (m *TaskMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Task entities.

func (*TaskMutation) SetOp

func (m *TaskMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TaskMutation) SetOutputBig

func (m *TaskMutation) SetOutputBig(b bool)

SetOutputBig sets the "output_big" field.

func (*TaskMutation) SetOutputID

func (m *TaskMutation) SetOutputID(i int)

SetOutputID sets the "output_id" field.

func (*TaskMutation) SetPushedAt

func (m *TaskMutation) SetPushedAt(t time.Time)

SetPushedAt sets the "pushed_at" field.

func (*TaskMutation) SetStatus

func (m *TaskMutation) SetStatus(ss shared.TaskStatus)

SetStatus sets the "status" field.

func (*TaskMutation) Status

func (m *TaskMutation) Status() (r shared.TaskStatus, exists bool)

Status returns the value of the "status" field in the mutation.

func (TaskMutation) Tx

func (m TaskMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TaskMutation) Type

func (m *TaskMutation) Type() string

Type returns the node type of this mutation (Task).

func (*TaskMutation) Where

func (m *TaskMutation) Where(ps ...predicate.Task)

Where appends a list predicates to the TaskMutation builder.

func (*TaskMutation) WhereP

func (m *TaskMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TaskMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TaskQuery

type TaskQuery struct {
	// contains filtered or unexported fields
}

TaskQuery is the builder for querying Task entities.

func (*TaskQuery) Aggregate

func (tq *TaskQuery) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate returns a TaskSelect configured with the given aggregations.

func (*TaskQuery) All

func (tq *TaskQuery) All(ctx context.Context) ([]*Task, error)

All executes the query and returns a list of Tasks.

func (*TaskQuery) AllX

func (tq *TaskQuery) AllX(ctx context.Context) []*Task

AllX is like All, but panics if an error occurs.

func (*TaskQuery) Clone

func (tq *TaskQuery) Clone() *TaskQuery

Clone returns a duplicate of the TaskQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TaskQuery) Count

func (tq *TaskQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskQuery) CountX

func (tq *TaskQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TaskQuery) Exist

func (tq *TaskQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TaskQuery) ExistX

func (tq *TaskQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TaskQuery) First

func (tq *TaskQuery) First(ctx context.Context) (*Task, error)

First returns the first Task entity from the query. Returns a *NotFoundError when no Task was found.

func (*TaskQuery) FirstID

func (tq *TaskQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Task ID from the query. Returns a *NotFoundError when no Task ID was found.

func (*TaskQuery) FirstIDX

func (tq *TaskQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*TaskQuery) FirstX

func (tq *TaskQuery) FirstX(ctx context.Context) *Task

FirstX is like First, but panics if an error occurs.

func (*TaskQuery) ForShare

func (tq *TaskQuery) ForShare(opts ...sql.LockOption) *TaskQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*TaskQuery) ForUpdate

func (tq *TaskQuery) ForUpdate(opts ...sql.LockOption) *TaskQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*TaskQuery) GroupBy

func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy

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 {
	CommandID int64 `json:"command_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Task.Query().
	GroupBy(task.FieldCommandID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskQuery) IDs

func (tq *TaskQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Task IDs.

func (*TaskQuery) IDsX

func (tq *TaskQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*TaskQuery) Limit

func (tq *TaskQuery) Limit(limit int) *TaskQuery

Limit the number of records to be returned by this query.

func (*TaskQuery) Offset

func (tq *TaskQuery) Offset(offset int) *TaskQuery

Offset to start from.

func (*TaskQuery) Only

func (tq *TaskQuery) Only(ctx context.Context) (*Task, error)

Only returns a single Task entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Task entity is found. Returns a *NotFoundError when no Task entities are found.

func (*TaskQuery) OnlyID

func (tq *TaskQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Task ID in the query. Returns a *NotSingularError when more than one Task ID is found. Returns a *NotFoundError when no entities are found.

func (*TaskQuery) OnlyIDX

func (tq *TaskQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TaskQuery) OnlyX

func (tq *TaskQuery) OnlyX(ctx context.Context) *Task

OnlyX is like Only, but panics if an error occurs.

func (*TaskQuery) Order

func (tq *TaskQuery) Order(o ...task.OrderOption) *TaskQuery

Order specifies how the records should be ordered.

func (*TaskQuery) QueryAgent

func (tq *TaskQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*TaskQuery) QueryBlobberArgs

func (tq *TaskQuery) QueryBlobberArgs() *BlobberQuery

QueryBlobberArgs chains the current query on the "blobber_args" edge.

func (*TaskQuery) QueryBlobberOutput

func (tq *TaskQuery) QueryBlobberOutput() *BlobberQuery

QueryBlobberOutput chains the current query on the "blobber_output" edge.

func (*TaskQuery) QueryCommand

func (tq *TaskQuery) QueryCommand() *CommandQuery

QueryCommand chains the current query on the "command" edge.

func (*TaskQuery) Select

func (tq *TaskQuery) Select(fields ...string) *TaskSelect

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 {
	CommandID int64 `json:"command_id,omitempty"`
}

client.Task.Query().
	Select(task.FieldCommandID).
	Scan(ctx, &v)

func (*TaskQuery) Unique

func (tq *TaskQuery) Unique(unique bool) *TaskQuery

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 (*TaskQuery) Where

func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery

Where adds a new predicate for the TaskQuery builder.

func (*TaskQuery) WithAgent

func (tq *TaskQuery) WithAgent(opts ...func(*AgentQuery)) *TaskQuery

WithAgent tells the query-builder to eager-load the nodes that are connected to the "agent" edge. The optional arguments are used to configure the query builder of the edge.

func (*TaskQuery) WithBlobberArgs

func (tq *TaskQuery) WithBlobberArgs(opts ...func(*BlobberQuery)) *TaskQuery

WithBlobberArgs tells the query-builder to eager-load the nodes that are connected to the "blobber_args" edge. The optional arguments are used to configure the query builder of the edge.

func (*TaskQuery) WithBlobberOutput

func (tq *TaskQuery) WithBlobberOutput(opts ...func(*BlobberQuery)) *TaskQuery

WithBlobberOutput tells the query-builder to eager-load the nodes that are connected to the "blobber_output" edge. The optional arguments are used to configure the query builder of the edge.

func (*TaskQuery) WithCommand

func (tq *TaskQuery) WithCommand(opts ...func(*CommandQuery)) *TaskQuery

WithCommand tells the query-builder to eager-load the nodes that are connected to the "command" edge. The optional arguments are used to configure the query builder of the edge.

type TaskSelect

type TaskSelect struct {
	*TaskQuery
	// contains filtered or unexported fields
}

TaskSelect is the builder for selecting fields of Task entities.

func (*TaskSelect) Aggregate

func (ts *TaskSelect) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TaskSelect) Bool

func (s *TaskSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolX

func (s *TaskSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskSelect) Bools

func (s *TaskSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolsX

func (s *TaskSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskSelect) Float64

func (s *TaskSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64X

func (s *TaskSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskSelect) Float64s

func (s *TaskSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64sX

func (s *TaskSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskSelect) Int

func (s *TaskSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntX

func (s *TaskSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskSelect) Ints

func (s *TaskSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntsX

func (s *TaskSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskSelect) Scan

func (ts *TaskSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TaskSelect) ScanX

func (s *TaskSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TaskSelect) String

func (s *TaskSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringX

func (s *TaskSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskSelect) Strings

func (s *TaskSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringsX

func (s *TaskSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskUpdate

type TaskUpdate struct {
	// contains filtered or unexported fields
}

TaskUpdate is the builder for updating Task entities.

func (*TaskUpdate) ClearAgent

func (tu *TaskUpdate) ClearAgent() *TaskUpdate

ClearAgent clears the "agent" edge to the Agent entity.

func (*TaskUpdate) ClearBlobberArgs

func (tu *TaskUpdate) ClearBlobberArgs() *TaskUpdate

ClearBlobberArgs clears the "blobber_args" edge to the Blobber entity.

func (*TaskUpdate) ClearBlobberOutput

func (tu *TaskUpdate) ClearBlobberOutput() *TaskUpdate

ClearBlobberOutput clears the "blobber_output" edge to the Blobber entity.

func (*TaskUpdate) ClearCommand

func (tu *TaskUpdate) ClearCommand() *TaskUpdate

ClearCommand clears the "command" edge to the Command entity.

func (*TaskUpdate) ClearDoneAt

func (tu *TaskUpdate) ClearDoneAt() *TaskUpdate

ClearDoneAt clears the value of the "done_at" field.

func (*TaskUpdate) ClearOutputBig

func (tu *TaskUpdate) ClearOutputBig() *TaskUpdate

ClearOutputBig clears the value of the "output_big" field.

func (*TaskUpdate) ClearOutputID

func (tu *TaskUpdate) ClearOutputID() *TaskUpdate

ClearOutputID clears the value of the "output_id" field.

func (*TaskUpdate) ClearPushedAt

func (tu *TaskUpdate) ClearPushedAt() *TaskUpdate

ClearPushedAt clears the value of the "pushed_at" field.

func (*TaskUpdate) Exec

func (tu *TaskUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpdate) ExecX

func (tu *TaskUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdate) Mutation

func (tu *TaskUpdate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdate) Save

func (tu *TaskUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TaskUpdate) SaveX

func (tu *TaskUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdate) SetAgent

func (tu *TaskUpdate) SetAgent(a *Agent) *TaskUpdate

SetAgent sets the "agent" edge to the Agent entity.

func (*TaskUpdate) SetAgentID

func (tu *TaskUpdate) SetAgentID(u uint32) *TaskUpdate

SetAgentID sets the "agent_id" field.

func (*TaskUpdate) SetArgsID

func (tu *TaskUpdate) SetArgsID(i int) *TaskUpdate

SetArgsID sets the "args_id" field.

func (*TaskUpdate) SetBlobberArgs

func (tu *TaskUpdate) SetBlobberArgs(b *Blobber) *TaskUpdate

SetBlobberArgs sets the "blobber_args" edge to the Blobber entity.

func (*TaskUpdate) SetBlobberArgsID

func (tu *TaskUpdate) SetBlobberArgsID(id int) *TaskUpdate

SetBlobberArgsID sets the "blobber_args" edge to the Blobber entity by ID.

func (*TaskUpdate) SetBlobberOutput

func (tu *TaskUpdate) SetBlobberOutput(b *Blobber) *TaskUpdate

SetBlobberOutput sets the "blobber_output" edge to the Blobber entity.

func (*TaskUpdate) SetBlobberOutputID

func (tu *TaskUpdate) SetBlobberOutputID(id int) *TaskUpdate

SetBlobberOutputID sets the "blobber_output" edge to the Blobber entity by ID.

func (*TaskUpdate) SetCap

func (tu *TaskUpdate) SetCap(s shared.Capability) *TaskUpdate

SetCap sets the "cap" field.

func (*TaskUpdate) SetCommand

func (tu *TaskUpdate) SetCommand(c *Command) *TaskUpdate

SetCommand sets the "command" edge to the Command entity.

func (*TaskUpdate) SetCommandID

func (tu *TaskUpdate) SetCommandID(i int64) *TaskUpdate

SetCommandID sets the "command_id" field.

func (*TaskUpdate) SetCreatedAt

func (tu *TaskUpdate) SetCreatedAt(t time.Time) *TaskUpdate

SetCreatedAt sets the "created_at" field.

func (*TaskUpdate) SetDoneAt

func (tu *TaskUpdate) SetDoneAt(t time.Time) *TaskUpdate

SetDoneAt sets the "done_at" field.

func (*TaskUpdate) SetNillableAgentID

func (tu *TaskUpdate) SetNillableAgentID(u *uint32) *TaskUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*TaskUpdate) SetNillableArgsID

func (tu *TaskUpdate) SetNillableArgsID(i *int) *TaskUpdate

SetNillableArgsID sets the "args_id" field if the given value is not nil.

func (*TaskUpdate) SetNillableBlobberOutputID

func (tu *TaskUpdate) SetNillableBlobberOutputID(id *int) *TaskUpdate

SetNillableBlobberOutputID sets the "blobber_output" edge to the Blobber entity by ID if the given value is not nil.

func (*TaskUpdate) SetNillableCap

func (tu *TaskUpdate) SetNillableCap(s *shared.Capability) *TaskUpdate

SetNillableCap sets the "cap" field if the given value is not nil.

func (*TaskUpdate) SetNillableCommandID

func (tu *TaskUpdate) SetNillableCommandID(i *int64) *TaskUpdate

SetNillableCommandID sets the "command_id" field if the given value is not nil.

func (*TaskUpdate) SetNillableCreatedAt

func (tu *TaskUpdate) SetNillableCreatedAt(t *time.Time) *TaskUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TaskUpdate) SetNillableDoneAt

func (tu *TaskUpdate) SetNillableDoneAt(t *time.Time) *TaskUpdate

SetNillableDoneAt sets the "done_at" field if the given value is not nil.

func (*TaskUpdate) SetNillableOutputBig

func (tu *TaskUpdate) SetNillableOutputBig(b *bool) *TaskUpdate

SetNillableOutputBig sets the "output_big" field if the given value is not nil.

func (*TaskUpdate) SetNillableOutputID

func (tu *TaskUpdate) SetNillableOutputID(i *int) *TaskUpdate

SetNillableOutputID sets the "output_id" field if the given value is not nil.

func (*TaskUpdate) SetNillablePushedAt

func (tu *TaskUpdate) SetNillablePushedAt(t *time.Time) *TaskUpdate

SetNillablePushedAt sets the "pushed_at" field if the given value is not nil.

func (*TaskUpdate) SetNillableStatus

func (tu *TaskUpdate) SetNillableStatus(ss *shared.TaskStatus) *TaskUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TaskUpdate) SetOutputBig

func (tu *TaskUpdate) SetOutputBig(b bool) *TaskUpdate

SetOutputBig sets the "output_big" field.

func (*TaskUpdate) SetOutputID

func (tu *TaskUpdate) SetOutputID(i int) *TaskUpdate

SetOutputID sets the "output_id" field.

func (*TaskUpdate) SetPushedAt

func (tu *TaskUpdate) SetPushedAt(t time.Time) *TaskUpdate

SetPushedAt sets the "pushed_at" field.

func (*TaskUpdate) SetStatus

func (tu *TaskUpdate) SetStatus(ss shared.TaskStatus) *TaskUpdate

SetStatus sets the "status" field.

func (*TaskUpdate) Where

func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate

Where appends a list predicates to the TaskUpdate builder.

type TaskUpdateOne

type TaskUpdateOne struct {
	// contains filtered or unexported fields
}

TaskUpdateOne is the builder for updating a single Task entity.

func (*TaskUpdateOne) ClearAgent

func (tuo *TaskUpdateOne) ClearAgent() *TaskUpdateOne

ClearAgent clears the "agent" edge to the Agent entity.

func (*TaskUpdateOne) ClearBlobberArgs

func (tuo *TaskUpdateOne) ClearBlobberArgs() *TaskUpdateOne

ClearBlobberArgs clears the "blobber_args" edge to the Blobber entity.

func (*TaskUpdateOne) ClearBlobberOutput

func (tuo *TaskUpdateOne) ClearBlobberOutput() *TaskUpdateOne

ClearBlobberOutput clears the "blobber_output" edge to the Blobber entity.

func (*TaskUpdateOne) ClearCommand

func (tuo *TaskUpdateOne) ClearCommand() *TaskUpdateOne

ClearCommand clears the "command" edge to the Command entity.

func (*TaskUpdateOne) ClearDoneAt

func (tuo *TaskUpdateOne) ClearDoneAt() *TaskUpdateOne

ClearDoneAt clears the value of the "done_at" field.

func (*TaskUpdateOne) ClearOutputBig

func (tuo *TaskUpdateOne) ClearOutputBig() *TaskUpdateOne

ClearOutputBig clears the value of the "output_big" field.

func (*TaskUpdateOne) ClearOutputID

func (tuo *TaskUpdateOne) ClearOutputID() *TaskUpdateOne

ClearOutputID clears the value of the "output_id" field.

func (*TaskUpdateOne) ClearPushedAt

func (tuo *TaskUpdateOne) ClearPushedAt() *TaskUpdateOne

ClearPushedAt clears the value of the "pushed_at" field.

func (*TaskUpdateOne) Exec

func (tuo *TaskUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskUpdateOne) ExecX

func (tuo *TaskUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdateOne) Mutation

func (tuo *TaskUpdateOne) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdateOne) Save

func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)

Save executes the query and returns the updated Task entity.

func (*TaskUpdateOne) SaveX

func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdateOne) Select

func (tuo *TaskUpdateOne) Select(field string, fields ...string) *TaskUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TaskUpdateOne) SetAgent

func (tuo *TaskUpdateOne) SetAgent(a *Agent) *TaskUpdateOne

SetAgent sets the "agent" edge to the Agent entity.

func (*TaskUpdateOne) SetAgentID

func (tuo *TaskUpdateOne) SetAgentID(u uint32) *TaskUpdateOne

SetAgentID sets the "agent_id" field.

func (*TaskUpdateOne) SetArgsID

func (tuo *TaskUpdateOne) SetArgsID(i int) *TaskUpdateOne

SetArgsID sets the "args_id" field.

func (*TaskUpdateOne) SetBlobberArgs

func (tuo *TaskUpdateOne) SetBlobberArgs(b *Blobber) *TaskUpdateOne

SetBlobberArgs sets the "blobber_args" edge to the Blobber entity.

func (*TaskUpdateOne) SetBlobberArgsID

func (tuo *TaskUpdateOne) SetBlobberArgsID(id int) *TaskUpdateOne

SetBlobberArgsID sets the "blobber_args" edge to the Blobber entity by ID.

func (*TaskUpdateOne) SetBlobberOutput

func (tuo *TaskUpdateOne) SetBlobberOutput(b *Blobber) *TaskUpdateOne

SetBlobberOutput sets the "blobber_output" edge to the Blobber entity.

func (*TaskUpdateOne) SetBlobberOutputID

func (tuo *TaskUpdateOne) SetBlobberOutputID(id int) *TaskUpdateOne

SetBlobberOutputID sets the "blobber_output" edge to the Blobber entity by ID.

func (*TaskUpdateOne) SetCap

func (tuo *TaskUpdateOne) SetCap(s shared.Capability) *TaskUpdateOne

SetCap sets the "cap" field.

func (*TaskUpdateOne) SetCommand

func (tuo *TaskUpdateOne) SetCommand(c *Command) *TaskUpdateOne

SetCommand sets the "command" edge to the Command entity.

func (*TaskUpdateOne) SetCommandID

func (tuo *TaskUpdateOne) SetCommandID(i int64) *TaskUpdateOne

SetCommandID sets the "command_id" field.

func (*TaskUpdateOne) SetCreatedAt

func (tuo *TaskUpdateOne) SetCreatedAt(t time.Time) *TaskUpdateOne

SetCreatedAt sets the "created_at" field.

func (*TaskUpdateOne) SetDoneAt

func (tuo *TaskUpdateOne) SetDoneAt(t time.Time) *TaskUpdateOne

SetDoneAt sets the "done_at" field.

func (*TaskUpdateOne) SetNillableAgentID

func (tuo *TaskUpdateOne) SetNillableAgentID(u *uint32) *TaskUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableArgsID

func (tuo *TaskUpdateOne) SetNillableArgsID(i *int) *TaskUpdateOne

SetNillableArgsID sets the "args_id" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableBlobberOutputID

func (tuo *TaskUpdateOne) SetNillableBlobberOutputID(id *int) *TaskUpdateOne

SetNillableBlobberOutputID sets the "blobber_output" edge to the Blobber entity by ID if the given value is not nil.

func (*TaskUpdateOne) SetNillableCap

func (tuo *TaskUpdateOne) SetNillableCap(s *shared.Capability) *TaskUpdateOne

SetNillableCap sets the "cap" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCommandID

func (tuo *TaskUpdateOne) SetNillableCommandID(i *int64) *TaskUpdateOne

SetNillableCommandID sets the "command_id" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCreatedAt

func (tuo *TaskUpdateOne) SetNillableCreatedAt(t *time.Time) *TaskUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableDoneAt

func (tuo *TaskUpdateOne) SetNillableDoneAt(t *time.Time) *TaskUpdateOne

SetNillableDoneAt sets the "done_at" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableOutputBig

func (tuo *TaskUpdateOne) SetNillableOutputBig(b *bool) *TaskUpdateOne

SetNillableOutputBig sets the "output_big" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableOutputID

func (tuo *TaskUpdateOne) SetNillableOutputID(i *int) *TaskUpdateOne

SetNillableOutputID sets the "output_id" field if the given value is not nil.

func (*TaskUpdateOne) SetNillablePushedAt

func (tuo *TaskUpdateOne) SetNillablePushedAt(t *time.Time) *TaskUpdateOne

SetNillablePushedAt sets the "pushed_at" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableStatus

func (tuo *TaskUpdateOne) SetNillableStatus(ss *shared.TaskStatus) *TaskUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TaskUpdateOne) SetOutputBig

func (tuo *TaskUpdateOne) SetOutputBig(b bool) *TaskUpdateOne

SetOutputBig sets the "output_big" field.

func (*TaskUpdateOne) SetOutputID

func (tuo *TaskUpdateOne) SetOutputID(i int) *TaskUpdateOne

SetOutputID sets the "output_id" field.

func (*TaskUpdateOne) SetPushedAt

func (tuo *TaskUpdateOne) SetPushedAt(t time.Time) *TaskUpdateOne

SetPushedAt sets the "pushed_at" field.

func (*TaskUpdateOne) SetStatus

func (tuo *TaskUpdateOne) SetStatus(ss shared.TaskStatus) *TaskUpdateOne

SetStatus sets the "status" field.

func (*TaskUpdateOne) Where

func (tuo *TaskUpdateOne) Where(ps ...predicate.Task) *TaskUpdateOne

Where appends a list predicates to the TaskUpdate builder.

type Tasks

type Tasks []*Task

Tasks is a parsable slice of Task.

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
	// Blobber is the client for interacting with the Blobber builders.
	Blobber *BlobberClient
	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// Command is the client for interacting with the Command builders.
	Command *CommandClient
	// Credential is the client for interacting with the Credential builders.
	Credential *CredentialClient
	// Listener is the client for interacting with the Listener builders.
	Listener *ListenerClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Operator is the client for interacting with the Operator builders.
	Operator *OperatorClient
	// Pki is the client for interacting with the Pki builders.
	Pki *PkiClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳