ent

package
v0.0.0-...-0eef1dd Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 23 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.
	TypeContainer = "Container"
	TypeJob       = "Job"
	TypeMount     = "Mount"
	TypeNode      = "Node"
	TypePort      = "Port"
	TypeUser      = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Container is the client for interacting with the Container builders.
	Container *ContainerClient
	// Job is the client for interacting with the Job builders.
	Job *JobClient
	// Mount is the client for interacting with the Mount builders.
	Mount *MountClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// Port is the client for interacting with the Port builders.
	Port *PortClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	Container.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Container

type Container struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Cid holds the value of the "cid" field.
	Cid string `json:"cid,omitempty"`
	// Image holds the value of the "image" field.
	Image string `json:"image,omitempty"`
	// CPU holds the value of the "cpu" field.
	CPU int64 `json:"cpu,omitempty"`
	// Memory holds the value of the "memory" field.
	Memory int64 `json:"memory,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt int64 `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ContainerQuery when eager-loading is set.
	Edges ContainerEdges `json:"edges"`
	// contains filtered or unexported fields
}

container info table

func (*Container) QueryJobs

func (c *Container) QueryJobs() *JobQuery

QueryJobs queries the "jobs" edge of the Container entity.

func (*Container) QueryMounts

func (c *Container) QueryMounts() *MountQuery

QueryMounts queries the "mounts" edge of the Container entity.

func (*Container) QueryNode

func (c *Container) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the Container entity.

func (*Container) QueryOwner

func (c *Container) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Container entity.

func (*Container) QueryPorts

func (c *Container) QueryPorts() *PortQuery

QueryPorts queries the "ports" edge of the Container entity.

func (*Container) String

func (c *Container) String() string

String implements the fmt.Stringer.

func (*Container) Unwrap

func (c *Container) Unwrap() *Container

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

func (c *Container) Update() *ContainerUpdateOne

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

func (*Container) Value

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

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

type ContainerClient

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

ContainerClient is a client for the Container schema.

func NewContainerClient

func NewContainerClient(c config) *ContainerClient

NewContainerClient returns a client for the Container from the given config.

func (*ContainerClient) Create

func (c *ContainerClient) Create() *ContainerCreate

Create returns a builder for creating a Container entity.

func (*ContainerClient) CreateBulk

func (c *ContainerClient) CreateBulk(builders ...*ContainerCreate) *ContainerCreateBulk

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

func (*ContainerClient) Delete

func (c *ContainerClient) Delete() *ContainerDelete

Delete returns a delete builder for Container.

func (*ContainerClient) DeleteOne

func (c *ContainerClient) DeleteOne(co *Container) *ContainerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ContainerClient) DeleteOneID

func (c *ContainerClient) DeleteOneID(id int) *ContainerDeleteOne

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

func (*ContainerClient) Get

func (c *ContainerClient) Get(ctx context.Context, id int) (*Container, error)

Get returns a Container entity by its id.

func (*ContainerClient) GetX

func (c *ContainerClient) GetX(ctx context.Context, id int) *Container

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

func (*ContainerClient) Hooks

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

Hooks returns the client hooks.

func (*ContainerClient) Intercept

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

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

func (*ContainerClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ContainerClient) MapCreateBulk

func (c *ContainerClient) MapCreateBulk(slice any, setFunc func(*ContainerCreate, int)) *ContainerCreateBulk

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

func (c *ContainerClient) Query() *ContainerQuery

Query returns a query builder for Container.

func (*ContainerClient) QueryJobs

func (c *ContainerClient) QueryJobs(co *Container) *JobQuery

QueryJobs queries the jobs edge of a Container.

func (*ContainerClient) QueryMounts

func (c *ContainerClient) QueryMounts(co *Container) *MountQuery

QueryMounts queries the mounts edge of a Container.

func (*ContainerClient) QueryNode

func (c *ContainerClient) QueryNode(co *Container) *NodeQuery

QueryNode queries the node edge of a Container.

func (*ContainerClient) QueryOwner

func (c *ContainerClient) QueryOwner(co *Container) *UserQuery

QueryOwner queries the owner edge of a Container.

func (*ContainerClient) QueryPorts

func (c *ContainerClient) QueryPorts(co *Container) *PortQuery

QueryPorts queries the ports edge of a Container.

func (*ContainerClient) Update

func (c *ContainerClient) Update() *ContainerUpdate

Update returns an update builder for Container.

func (*ContainerClient) UpdateOne

func (c *ContainerClient) UpdateOne(co *Container) *ContainerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ContainerClient) UpdateOneID

func (c *ContainerClient) UpdateOneID(id int) *ContainerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ContainerClient) Use

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

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

type ContainerCreate

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

ContainerCreate is the builder for creating a Container entity.

func (*ContainerCreate) AddJobIDs

func (cc *ContainerCreate) AddJobIDs(ids ...int) *ContainerCreate

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*ContainerCreate) AddJobs

func (cc *ContainerCreate) AddJobs(j ...*Job) *ContainerCreate

AddJobs adds the "jobs" edges to the Job entity.

func (*ContainerCreate) AddMountIDs

func (cc *ContainerCreate) AddMountIDs(ids ...int) *ContainerCreate

AddMountIDs adds the "mounts" edge to the Mount entity by IDs.

func (*ContainerCreate) AddMounts

func (cc *ContainerCreate) AddMounts(m ...*Mount) *ContainerCreate

AddMounts adds the "mounts" edges to the Mount entity.

func (*ContainerCreate) AddNode

func (cc *ContainerCreate) AddNode(n ...*Node) *ContainerCreate

AddNode adds the "node" edges to the Node entity.

func (*ContainerCreate) AddNodeIDs

func (cc *ContainerCreate) AddNodeIDs(ids ...int) *ContainerCreate

AddNodeIDs adds the "node" edge to the Node entity by IDs.

func (*ContainerCreate) AddOwner

func (cc *ContainerCreate) AddOwner(u ...*User) *ContainerCreate

AddOwner adds the "owner" edges to the User entity.

func (*ContainerCreate) AddOwnerIDs

func (cc *ContainerCreate) AddOwnerIDs(ids ...int) *ContainerCreate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*ContainerCreate) AddPortIDs

func (cc *ContainerCreate) AddPortIDs(ids ...int) *ContainerCreate

AddPortIDs adds the "ports" edge to the Port entity by IDs.

func (*ContainerCreate) AddPorts

func (cc *ContainerCreate) AddPorts(p ...*Port) *ContainerCreate

AddPorts adds the "ports" edges to the Port entity.

func (*ContainerCreate) Exec

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

Exec executes the query.

func (*ContainerCreate) ExecX

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

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

func (*ContainerCreate) Mutation

func (cc *ContainerCreate) Mutation() *ContainerMutation

Mutation returns the ContainerMutation object of the builder.

func (*ContainerCreate) Save

func (cc *ContainerCreate) Save(ctx context.Context) (*Container, error)

Save creates the Container in the database.

func (*ContainerCreate) SaveX

func (cc *ContainerCreate) SaveX(ctx context.Context) *Container

SaveX calls Save and panics if Save returns an error.

func (*ContainerCreate) SetCPU

func (cc *ContainerCreate) SetCPU(i int64) *ContainerCreate

SetCPU sets the "cpu" field.

func (*ContainerCreate) SetCid

func (cc *ContainerCreate) SetCid(s string) *ContainerCreate

SetCid sets the "cid" field.

func (*ContainerCreate) SetCreatedAt

func (cc *ContainerCreate) SetCreatedAt(i int64) *ContainerCreate

SetCreatedAt sets the "created_at" field.

func (*ContainerCreate) SetImage

func (cc *ContainerCreate) SetImage(s string) *ContainerCreate

SetImage sets the "image" field.

func (*ContainerCreate) SetMemory

func (cc *ContainerCreate) SetMemory(i int64) *ContainerCreate

SetMemory sets the "memory" field.

func (*ContainerCreate) SetName

func (cc *ContainerCreate) SetName(s string) *ContainerCreate

SetName sets the "name" field.

func (*ContainerCreate) SetNillableCreatedAt

func (cc *ContainerCreate) SetNillableCreatedAt(i *int64) *ContainerCreate

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

func (*ContainerCreate) SetNillableUpdatedAt

func (cc *ContainerCreate) SetNillableUpdatedAt(i *int64) *ContainerCreate

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

func (*ContainerCreate) SetUpdatedAt

func (cc *ContainerCreate) SetUpdatedAt(i int64) *ContainerCreate

SetUpdatedAt sets the "updated_at" field.

type ContainerCreateBulk

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

ContainerCreateBulk is the builder for creating many Container entities in bulk.

func (*ContainerCreateBulk) Exec

func (ccb *ContainerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ContainerCreateBulk) ExecX

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

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

func (*ContainerCreateBulk) Save

func (ccb *ContainerCreateBulk) Save(ctx context.Context) ([]*Container, error)

Save creates the Container entities in the database.

func (*ContainerCreateBulk) SaveX

func (ccb *ContainerCreateBulk) SaveX(ctx context.Context) []*Container

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

type ContainerDelete

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

ContainerDelete is the builder for deleting a Container entity.

func (*ContainerDelete) Exec

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

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

func (*ContainerDelete) ExecX

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

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

func (*ContainerDelete) Where

Where appends a list predicates to the ContainerDelete builder.

type ContainerDeleteOne

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

ContainerDeleteOne is the builder for deleting a single Container entity.

func (*ContainerDeleteOne) Exec

func (cdo *ContainerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ContainerDeleteOne) ExecX

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

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

func (*ContainerDeleteOne) Where

Where appends a list predicates to the ContainerDelete builder.

type ContainerEdges

type ContainerEdges struct {
	// Owner holds the value of the owner edge.
	Owner []*User `json:"owner,omitempty"`
	// Node holds the value of the node edge.
	Node []*Node `json:"node,omitempty"`
	// Mounts holds the value of the mounts edge.
	Mounts []*Mount `json:"mounts,omitempty"`
	// Ports holds the value of the ports edge.
	Ports []*Port `json:"ports,omitempty"`
	// Jobs holds the value of the jobs edge.
	Jobs []*Job `json:"jobs,omitempty"`
	// contains filtered or unexported fields
}

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

func (ContainerEdges) JobsOrErr

func (e ContainerEdges) JobsOrErr() ([]*Job, error)

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

func (ContainerEdges) MountsOrErr

func (e ContainerEdges) MountsOrErr() ([]*Mount, error)

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

func (ContainerEdges) NodeOrErr

func (e ContainerEdges) NodeOrErr() ([]*Node, error)

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

func (ContainerEdges) OwnerOrErr

func (e ContainerEdges) OwnerOrErr() ([]*User, error)

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

func (ContainerEdges) PortsOrErr

func (e ContainerEdges) PortsOrErr() ([]*Port, error)

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

type ContainerGroupBy

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

ContainerGroupBy is the group-by builder for Container entities.

func (*ContainerGroupBy) Aggregate

func (cgb *ContainerGroupBy) Aggregate(fns ...AggregateFunc) *ContainerGroupBy

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

func (*ContainerGroupBy) Bool

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

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

func (*ContainerGroupBy) BoolX

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

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

func (*ContainerGroupBy) Bools

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

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

func (*ContainerGroupBy) BoolsX

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

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

func (*ContainerGroupBy) Float64

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

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

func (*ContainerGroupBy) Float64X

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

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

func (*ContainerGroupBy) Float64s

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

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

func (*ContainerGroupBy) Float64sX

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

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

func (*ContainerGroupBy) Int

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

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

func (*ContainerGroupBy) IntX

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

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

func (*ContainerGroupBy) Ints

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

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

func (*ContainerGroupBy) IntsX

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

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

func (*ContainerGroupBy) Scan

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

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

func (*ContainerGroupBy) ScanX

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

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

func (*ContainerGroupBy) String

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

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

func (*ContainerGroupBy) StringX

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

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

func (*ContainerGroupBy) Strings

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

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

func (*ContainerGroupBy) StringsX

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

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

type ContainerMutation

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

ContainerMutation represents an operation that mutates the Container nodes in the graph.

func (*ContainerMutation) AddCPU

func (m *ContainerMutation) AddCPU(i int64)

AddCPU adds i to the "cpu" field.

func (*ContainerMutation) AddCreatedAt

func (m *ContainerMutation) AddCreatedAt(i int64)

AddCreatedAt adds i to the "created_at" field.

func (*ContainerMutation) AddField

func (m *ContainerMutation) 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 (*ContainerMutation) AddJobIDs

func (m *ContainerMutation) AddJobIDs(ids ...int)

AddJobIDs adds the "jobs" edge to the Job entity by ids.

func (*ContainerMutation) AddMemory

func (m *ContainerMutation) AddMemory(i int64)

AddMemory adds i to the "memory" field.

func (*ContainerMutation) AddMountIDs

func (m *ContainerMutation) AddMountIDs(ids ...int)

AddMountIDs adds the "mounts" edge to the Mount entity by ids.

func (*ContainerMutation) AddNodeIDs

func (m *ContainerMutation) AddNodeIDs(ids ...int)

AddNodeIDs adds the "node" edge to the Node entity by ids.

func (*ContainerMutation) AddOwnerIDs

func (m *ContainerMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the User entity by ids.

func (*ContainerMutation) AddPortIDs

func (m *ContainerMutation) AddPortIDs(ids ...int)

AddPortIDs adds the "ports" edge to the Port entity by ids.

func (*ContainerMutation) AddUpdatedAt

func (m *ContainerMutation) AddUpdatedAt(i int64)

AddUpdatedAt adds i to the "updated_at" field.

func (*ContainerMutation) AddedCPU

func (m *ContainerMutation) AddedCPU() (r int64, exists bool)

AddedCPU returns the value that was added to the "cpu" field in this mutation.

func (*ContainerMutation) AddedCreatedAt

func (m *ContainerMutation) AddedCreatedAt() (r int64, exists bool)

AddedCreatedAt returns the value that was added to the "created_at" field in this mutation.

func (*ContainerMutation) AddedEdges

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

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

func (*ContainerMutation) AddedField

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

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

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

func (*ContainerMutation) AddedIDs

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

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

func (*ContainerMutation) AddedMemory

func (m *ContainerMutation) AddedMemory() (r int64, exists bool)

AddedMemory returns the value that was added to the "memory" field in this mutation.

func (*ContainerMutation) AddedUpdatedAt

func (m *ContainerMutation) AddedUpdatedAt() (r int64, exists bool)

AddedUpdatedAt returns the value that was added to the "updated_at" field in this mutation.

func (*ContainerMutation) CPU

func (m *ContainerMutation) CPU() (r int64, exists bool)

CPU returns the value of the "cpu" field in the mutation.

func (*ContainerMutation) Cid

func (m *ContainerMutation) Cid() (r string, exists bool)

Cid returns the value of the "cid" field in the mutation.

func (*ContainerMutation) ClearEdge

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

func (m *ContainerMutation) 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 (*ContainerMutation) ClearJobs

func (m *ContainerMutation) ClearJobs()

ClearJobs clears the "jobs" edge to the Job entity.

func (*ContainerMutation) ClearMounts

func (m *ContainerMutation) ClearMounts()

ClearMounts clears the "mounts" edge to the Mount entity.

func (*ContainerMutation) ClearNode

func (m *ContainerMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*ContainerMutation) ClearOwner

func (m *ContainerMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*ContainerMutation) ClearPorts

func (m *ContainerMutation) ClearPorts()

ClearPorts clears the "ports" edge to the Port entity.

func (*ContainerMutation) ClearedEdges

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

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

func (*ContainerMutation) ClearedFields

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

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

func (ContainerMutation) Client

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

func (m *ContainerMutation) CreatedAt() (r int64, exists bool)

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

func (*ContainerMutation) EdgeCleared

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

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

func (*ContainerMutation) Field

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

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

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

func (*ContainerMutation) Fields

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

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

func (m *ContainerMutation) 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 (*ContainerMutation) Image

func (m *ContainerMutation) Image() (r string, exists bool)

Image returns the value of the "image" field in the mutation.

func (*ContainerMutation) JobsCleared

func (m *ContainerMutation) JobsCleared() bool

JobsCleared reports if the "jobs" edge to the Job entity was cleared.

func (*ContainerMutation) JobsIDs

func (m *ContainerMutation) JobsIDs() (ids []int)

JobsIDs returns the "jobs" edge IDs in the mutation.

func (*ContainerMutation) Memory

func (m *ContainerMutation) Memory() (r int64, exists bool)

Memory returns the value of the "memory" field in the mutation.

func (*ContainerMutation) MountsCleared

func (m *ContainerMutation) MountsCleared() bool

MountsCleared reports if the "mounts" edge to the Mount entity was cleared.

func (*ContainerMutation) MountsIDs

func (m *ContainerMutation) MountsIDs() (ids []int)

MountsIDs returns the "mounts" edge IDs in the mutation.

func (*ContainerMutation) Name

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

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

func (*ContainerMutation) NodeCleared

func (m *ContainerMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*ContainerMutation) NodeIDs

func (m *ContainerMutation) NodeIDs() (ids []int)

NodeIDs returns the "node" edge IDs in the mutation.

func (*ContainerMutation) OldCPU

func (m *ContainerMutation) OldCPU(ctx context.Context) (v int64, err error)

OldCPU returns the old "cpu" field's value of the Container entity. If the Container 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 (*ContainerMutation) OldCid

func (m *ContainerMutation) OldCid(ctx context.Context) (v string, err error)

OldCid returns the old "cid" field's value of the Container entity. If the Container 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 (*ContainerMutation) OldCreatedAt

func (m *ContainerMutation) OldCreatedAt(ctx context.Context) (v int64, err error)

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

func (m *ContainerMutation) 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 (*ContainerMutation) OldImage

func (m *ContainerMutation) OldImage(ctx context.Context) (v string, err error)

OldImage returns the old "image" field's value of the Container entity. If the Container 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 (*ContainerMutation) OldMemory

func (m *ContainerMutation) OldMemory(ctx context.Context) (v int64, err error)

OldMemory returns the old "memory" field's value of the Container entity. If the Container 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 (*ContainerMutation) OldName

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

OldName returns the old "name" field's value of the Container entity. If the Container 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 (*ContainerMutation) OldUpdatedAt

func (m *ContainerMutation) OldUpdatedAt(ctx context.Context) (v int64, err error)

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

func (m *ContainerMutation) Op() Op

Op returns the operation name.

func (*ContainerMutation) OwnerCleared

func (m *ContainerMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*ContainerMutation) OwnerIDs

func (m *ContainerMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*ContainerMutation) PortsCleared

func (m *ContainerMutation) PortsCleared() bool

PortsCleared reports if the "ports" edge to the Port entity was cleared.

func (*ContainerMutation) PortsIDs

func (m *ContainerMutation) PortsIDs() (ids []int)

PortsIDs returns the "ports" edge IDs in the mutation.

func (*ContainerMutation) RemoveJobIDs

func (m *ContainerMutation) RemoveJobIDs(ids ...int)

RemoveJobIDs removes the "jobs" edge to the Job entity by IDs.

func (*ContainerMutation) RemoveMountIDs

func (m *ContainerMutation) RemoveMountIDs(ids ...int)

RemoveMountIDs removes the "mounts" edge to the Mount entity by IDs.

func (*ContainerMutation) RemoveNodeIDs

func (m *ContainerMutation) RemoveNodeIDs(ids ...int)

RemoveNodeIDs removes the "node" edge to the Node entity by IDs.

func (*ContainerMutation) RemoveOwnerIDs

func (m *ContainerMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the User entity by IDs.

func (*ContainerMutation) RemovePortIDs

func (m *ContainerMutation) RemovePortIDs(ids ...int)

RemovePortIDs removes the "ports" edge to the Port entity by IDs.

func (*ContainerMutation) RemovedEdges

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

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

func (*ContainerMutation) RemovedIDs

func (m *ContainerMutation) 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 (*ContainerMutation) RemovedJobsIDs

func (m *ContainerMutation) RemovedJobsIDs() (ids []int)

RemovedJobs returns the removed IDs of the "jobs" edge to the Job entity.

func (*ContainerMutation) RemovedMountsIDs

func (m *ContainerMutation) RemovedMountsIDs() (ids []int)

RemovedMounts returns the removed IDs of the "mounts" edge to the Mount entity.

func (*ContainerMutation) RemovedNodeIDs

func (m *ContainerMutation) RemovedNodeIDs() (ids []int)

RemovedNode returns the removed IDs of the "node" edge to the Node entity.

func (*ContainerMutation) RemovedOwnerIDs

func (m *ContainerMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the User entity.

func (*ContainerMutation) RemovedPortsIDs

func (m *ContainerMutation) RemovedPortsIDs() (ids []int)

RemovedPorts returns the removed IDs of the "ports" edge to the Port entity.

func (*ContainerMutation) ResetCPU

func (m *ContainerMutation) ResetCPU()

ResetCPU resets all changes to the "cpu" field.

func (*ContainerMutation) ResetCid

func (m *ContainerMutation) ResetCid()

ResetCid resets all changes to the "cid" field.

func (*ContainerMutation) ResetCreatedAt

func (m *ContainerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ContainerMutation) ResetEdge

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

func (m *ContainerMutation) 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 (*ContainerMutation) ResetImage

func (m *ContainerMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*ContainerMutation) ResetJobs

func (m *ContainerMutation) ResetJobs()

ResetJobs resets all changes to the "jobs" edge.

func (*ContainerMutation) ResetMemory

func (m *ContainerMutation) ResetMemory()

ResetMemory resets all changes to the "memory" field.

func (*ContainerMutation) ResetMounts

func (m *ContainerMutation) ResetMounts()

ResetMounts resets all changes to the "mounts" edge.

func (*ContainerMutation) ResetName

func (m *ContainerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ContainerMutation) ResetNode

func (m *ContainerMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*ContainerMutation) ResetOwner

func (m *ContainerMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*ContainerMutation) ResetPorts

func (m *ContainerMutation) ResetPorts()

ResetPorts resets all changes to the "ports" edge.

func (*ContainerMutation) ResetUpdatedAt

func (m *ContainerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ContainerMutation) SetCPU

func (m *ContainerMutation) SetCPU(i int64)

SetCPU sets the "cpu" field.

func (*ContainerMutation) SetCid

func (m *ContainerMutation) SetCid(s string)

SetCid sets the "cid" field.

func (*ContainerMutation) SetCreatedAt

func (m *ContainerMutation) SetCreatedAt(i int64)

SetCreatedAt sets the "created_at" field.

func (*ContainerMutation) SetField

func (m *ContainerMutation) 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 (*ContainerMutation) SetImage

func (m *ContainerMutation) SetImage(s string)

SetImage sets the "image" field.

func (*ContainerMutation) SetMemory

func (m *ContainerMutation) SetMemory(i int64)

SetMemory sets the "memory" field.

func (*ContainerMutation) SetName

func (m *ContainerMutation) SetName(s string)

SetName sets the "name" field.

func (*ContainerMutation) SetOp

func (m *ContainerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ContainerMutation) SetUpdatedAt

func (m *ContainerMutation) SetUpdatedAt(i int64)

SetUpdatedAt sets the "updated_at" field.

func (ContainerMutation) Tx

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

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

func (*ContainerMutation) Type

func (m *ContainerMutation) Type() string

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

func (*ContainerMutation) UpdatedAt

func (m *ContainerMutation) UpdatedAt() (r int64, exists bool)

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

func (*ContainerMutation) Where

func (m *ContainerMutation) Where(ps ...predicate.Container)

Where appends a list predicates to the ContainerMutation builder.

func (*ContainerMutation) WhereP

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

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

type ContainerQuery

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

ContainerQuery is the builder for querying Container entities.

func (*ContainerQuery) Aggregate

func (cq *ContainerQuery) Aggregate(fns ...AggregateFunc) *ContainerSelect

Aggregate returns a ContainerSelect configured with the given aggregations.

func (*ContainerQuery) All

func (cq *ContainerQuery) All(ctx context.Context) ([]*Container, error)

All executes the query and returns a list of Containers.

func (*ContainerQuery) AllX

func (cq *ContainerQuery) AllX(ctx context.Context) []*Container

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

func (*ContainerQuery) Clone

func (cq *ContainerQuery) Clone() *ContainerQuery

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

func (*ContainerQuery) Count

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

Count returns the count of the given query.

func (*ContainerQuery) CountX

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

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

func (*ContainerQuery) Exist

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

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

func (*ContainerQuery) ExistX

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

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

func (*ContainerQuery) First

func (cq *ContainerQuery) First(ctx context.Context) (*Container, error)

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

func (*ContainerQuery) FirstID

func (cq *ContainerQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ContainerQuery) FirstIDX

func (cq *ContainerQuery) FirstIDX(ctx context.Context) int

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

func (*ContainerQuery) FirstX

func (cq *ContainerQuery) FirstX(ctx context.Context) *Container

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

func (*ContainerQuery) GroupBy

func (cq *ContainerQuery) GroupBy(field string, fields ...string) *ContainerGroupBy

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

Example:

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

client.Container.Query().
	GroupBy(container.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ContainerQuery) IDs

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

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

func (*ContainerQuery) IDsX

func (cq *ContainerQuery) IDsX(ctx context.Context) []int

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

func (*ContainerQuery) Limit

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

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

func (*ContainerQuery) Offset

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

Offset to start from.

func (*ContainerQuery) Only

func (cq *ContainerQuery) Only(ctx context.Context) (*Container, error)

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

func (*ContainerQuery) OnlyID

func (cq *ContainerQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ContainerQuery) OnlyIDX

func (cq *ContainerQuery) OnlyIDX(ctx context.Context) int

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

func (*ContainerQuery) OnlyX

func (cq *ContainerQuery) OnlyX(ctx context.Context) *Container

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

func (*ContainerQuery) Order

Order specifies how the records should be ordered.

func (*ContainerQuery) QueryJobs

func (cq *ContainerQuery) QueryJobs() *JobQuery

QueryJobs chains the current query on the "jobs" edge.

func (*ContainerQuery) QueryMounts

func (cq *ContainerQuery) QueryMounts() *MountQuery

QueryMounts chains the current query on the "mounts" edge.

func (*ContainerQuery) QueryNode

func (cq *ContainerQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*ContainerQuery) QueryOwner

func (cq *ContainerQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*ContainerQuery) QueryPorts

func (cq *ContainerQuery) QueryPorts() *PortQuery

QueryPorts chains the current query on the "ports" edge.

func (*ContainerQuery) Select

func (cq *ContainerQuery) Select(fields ...string) *ContainerSelect

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

Example:

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

client.Container.Query().
	Select(container.FieldName).
	Scan(ctx, &v)

func (*ContainerQuery) Unique

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

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

Where adds a new predicate for the ContainerQuery builder.

func (*ContainerQuery) WithJobs

func (cq *ContainerQuery) WithJobs(opts ...func(*JobQuery)) *ContainerQuery

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

func (*ContainerQuery) WithMounts

func (cq *ContainerQuery) WithMounts(opts ...func(*MountQuery)) *ContainerQuery

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

func (*ContainerQuery) WithNode

func (cq *ContainerQuery) WithNode(opts ...func(*NodeQuery)) *ContainerQuery

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

func (*ContainerQuery) WithOwner

func (cq *ContainerQuery) WithOwner(opts ...func(*UserQuery)) *ContainerQuery

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

func (*ContainerQuery) WithPorts

func (cq *ContainerQuery) WithPorts(opts ...func(*PortQuery)) *ContainerQuery

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

type ContainerSelect

type ContainerSelect struct {
	*ContainerQuery
	// contains filtered or unexported fields
}

ContainerSelect is the builder for selecting fields of Container entities.

func (*ContainerSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ContainerSelect) Bool

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

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

func (*ContainerSelect) BoolX

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

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

func (*ContainerSelect) Bools

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

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

func (*ContainerSelect) BoolsX

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

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

func (*ContainerSelect) Float64

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

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

func (*ContainerSelect) Float64X

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

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

func (*ContainerSelect) Float64s

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

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

func (*ContainerSelect) Float64sX

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

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

func (*ContainerSelect) Int

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

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

func (*ContainerSelect) IntX

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

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

func (*ContainerSelect) Ints

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

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

func (*ContainerSelect) IntsX

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

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

func (*ContainerSelect) Scan

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

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

func (*ContainerSelect) ScanX

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

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

func (*ContainerSelect) String

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

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

func (*ContainerSelect) StringX

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

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

func (*ContainerSelect) Strings

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

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

func (*ContainerSelect) StringsX

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

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

type ContainerUpdate

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

ContainerUpdate is the builder for updating Container entities.

func (*ContainerUpdate) AddCPU

func (cu *ContainerUpdate) AddCPU(i int64) *ContainerUpdate

AddCPU adds i to the "cpu" field.

func (*ContainerUpdate) AddCreatedAt

func (cu *ContainerUpdate) AddCreatedAt(i int64) *ContainerUpdate

AddCreatedAt adds i to the "created_at" field.

func (*ContainerUpdate) AddJobIDs

func (cu *ContainerUpdate) AddJobIDs(ids ...int) *ContainerUpdate

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*ContainerUpdate) AddJobs

func (cu *ContainerUpdate) AddJobs(j ...*Job) *ContainerUpdate

AddJobs adds the "jobs" edges to the Job entity.

func (*ContainerUpdate) AddMemory

func (cu *ContainerUpdate) AddMemory(i int64) *ContainerUpdate

AddMemory adds i to the "memory" field.

func (*ContainerUpdate) AddMountIDs

func (cu *ContainerUpdate) AddMountIDs(ids ...int) *ContainerUpdate

AddMountIDs adds the "mounts" edge to the Mount entity by IDs.

func (*ContainerUpdate) AddMounts

func (cu *ContainerUpdate) AddMounts(m ...*Mount) *ContainerUpdate

AddMounts adds the "mounts" edges to the Mount entity.

func (*ContainerUpdate) AddNode

func (cu *ContainerUpdate) AddNode(n ...*Node) *ContainerUpdate

AddNode adds the "node" edges to the Node entity.

func (*ContainerUpdate) AddNodeIDs

func (cu *ContainerUpdate) AddNodeIDs(ids ...int) *ContainerUpdate

AddNodeIDs adds the "node" edge to the Node entity by IDs.

func (*ContainerUpdate) AddOwner

func (cu *ContainerUpdate) AddOwner(u ...*User) *ContainerUpdate

AddOwner adds the "owner" edges to the User entity.

func (*ContainerUpdate) AddOwnerIDs

func (cu *ContainerUpdate) AddOwnerIDs(ids ...int) *ContainerUpdate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*ContainerUpdate) AddPortIDs

func (cu *ContainerUpdate) AddPortIDs(ids ...int) *ContainerUpdate

AddPortIDs adds the "ports" edge to the Port entity by IDs.

func (*ContainerUpdate) AddPorts

func (cu *ContainerUpdate) AddPorts(p ...*Port) *ContainerUpdate

AddPorts adds the "ports" edges to the Port entity.

func (*ContainerUpdate) AddUpdatedAt

func (cu *ContainerUpdate) AddUpdatedAt(i int64) *ContainerUpdate

AddUpdatedAt adds i to the "updated_at" field.

func (*ContainerUpdate) ClearJobs

func (cu *ContainerUpdate) ClearJobs() *ContainerUpdate

ClearJobs clears all "jobs" edges to the Job entity.

func (*ContainerUpdate) ClearMounts

func (cu *ContainerUpdate) ClearMounts() *ContainerUpdate

ClearMounts clears all "mounts" edges to the Mount entity.

func (*ContainerUpdate) ClearNode

func (cu *ContainerUpdate) ClearNode() *ContainerUpdate

ClearNode clears all "node" edges to the Node entity.

func (*ContainerUpdate) ClearOwner

func (cu *ContainerUpdate) ClearOwner() *ContainerUpdate

ClearOwner clears all "owner" edges to the User entity.

func (*ContainerUpdate) ClearPorts

func (cu *ContainerUpdate) ClearPorts() *ContainerUpdate

ClearPorts clears all "ports" edges to the Port entity.

func (*ContainerUpdate) Exec

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

Exec executes the query.

func (*ContainerUpdate) ExecX

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

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

func (*ContainerUpdate) Mutation

func (cu *ContainerUpdate) Mutation() *ContainerMutation

Mutation returns the ContainerMutation object of the builder.

func (*ContainerUpdate) RemoveJobIDs

func (cu *ContainerUpdate) RemoveJobIDs(ids ...int) *ContainerUpdate

RemoveJobIDs removes the "jobs" edge to Job entities by IDs.

func (*ContainerUpdate) RemoveJobs

func (cu *ContainerUpdate) RemoveJobs(j ...*Job) *ContainerUpdate

RemoveJobs removes "jobs" edges to Job entities.

func (*ContainerUpdate) RemoveMountIDs

func (cu *ContainerUpdate) RemoveMountIDs(ids ...int) *ContainerUpdate

RemoveMountIDs removes the "mounts" edge to Mount entities by IDs.

func (*ContainerUpdate) RemoveMounts

func (cu *ContainerUpdate) RemoveMounts(m ...*Mount) *ContainerUpdate

RemoveMounts removes "mounts" edges to Mount entities.

func (*ContainerUpdate) RemoveNode

func (cu *ContainerUpdate) RemoveNode(n ...*Node) *ContainerUpdate

RemoveNode removes "node" edges to Node entities.

func (*ContainerUpdate) RemoveNodeIDs

func (cu *ContainerUpdate) RemoveNodeIDs(ids ...int) *ContainerUpdate

RemoveNodeIDs removes the "node" edge to Node entities by IDs.

func (*ContainerUpdate) RemoveOwner

func (cu *ContainerUpdate) RemoveOwner(u ...*User) *ContainerUpdate

RemoveOwner removes "owner" edges to User entities.

func (*ContainerUpdate) RemoveOwnerIDs

func (cu *ContainerUpdate) RemoveOwnerIDs(ids ...int) *ContainerUpdate

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*ContainerUpdate) RemovePortIDs

func (cu *ContainerUpdate) RemovePortIDs(ids ...int) *ContainerUpdate

RemovePortIDs removes the "ports" edge to Port entities by IDs.

func (*ContainerUpdate) RemovePorts

func (cu *ContainerUpdate) RemovePorts(p ...*Port) *ContainerUpdate

RemovePorts removes "ports" edges to Port entities.

func (*ContainerUpdate) Save

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

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

func (*ContainerUpdate) SaveX

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

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

func (*ContainerUpdate) SetCPU

func (cu *ContainerUpdate) SetCPU(i int64) *ContainerUpdate

SetCPU sets the "cpu" field.

func (*ContainerUpdate) SetCid

func (cu *ContainerUpdate) SetCid(s string) *ContainerUpdate

SetCid sets the "cid" field.

func (*ContainerUpdate) SetCreatedAt

func (cu *ContainerUpdate) SetCreatedAt(i int64) *ContainerUpdate

SetCreatedAt sets the "created_at" field.

func (*ContainerUpdate) SetImage

func (cu *ContainerUpdate) SetImage(s string) *ContainerUpdate

SetImage sets the "image" field.

func (*ContainerUpdate) SetMemory

func (cu *ContainerUpdate) SetMemory(i int64) *ContainerUpdate

SetMemory sets the "memory" field.

func (*ContainerUpdate) SetName

func (cu *ContainerUpdate) SetName(s string) *ContainerUpdate

SetName sets the "name" field.

func (*ContainerUpdate) SetNillableCPU

func (cu *ContainerUpdate) SetNillableCPU(i *int64) *ContainerUpdate

SetNillableCPU sets the "cpu" field if the given value is not nil.

func (*ContainerUpdate) SetNillableCid

func (cu *ContainerUpdate) SetNillableCid(s *string) *ContainerUpdate

SetNillableCid sets the "cid" field if the given value is not nil.

func (*ContainerUpdate) SetNillableCreatedAt

func (cu *ContainerUpdate) SetNillableCreatedAt(i *int64) *ContainerUpdate

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

func (*ContainerUpdate) SetNillableImage

func (cu *ContainerUpdate) SetNillableImage(s *string) *ContainerUpdate

SetNillableImage sets the "image" field if the given value is not nil.

func (*ContainerUpdate) SetNillableMemory

func (cu *ContainerUpdate) SetNillableMemory(i *int64) *ContainerUpdate

SetNillableMemory sets the "memory" field if the given value is not nil.

func (*ContainerUpdate) SetNillableName

func (cu *ContainerUpdate) SetNillableName(s *string) *ContainerUpdate

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

func (*ContainerUpdate) SetUpdatedAt

func (cu *ContainerUpdate) SetUpdatedAt(i int64) *ContainerUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ContainerUpdate) Where

Where appends a list predicates to the ContainerUpdate builder.

type ContainerUpdateOne

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

ContainerUpdateOne is the builder for updating a single Container entity.

func (*ContainerUpdateOne) AddCPU

AddCPU adds i to the "cpu" field.

func (*ContainerUpdateOne) AddCreatedAt

func (cuo *ContainerUpdateOne) AddCreatedAt(i int64) *ContainerUpdateOne

AddCreatedAt adds i to the "created_at" field.

func (*ContainerUpdateOne) AddJobIDs

func (cuo *ContainerUpdateOne) AddJobIDs(ids ...int) *ContainerUpdateOne

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*ContainerUpdateOne) AddJobs

func (cuo *ContainerUpdateOne) AddJobs(j ...*Job) *ContainerUpdateOne

AddJobs adds the "jobs" edges to the Job entity.

func (*ContainerUpdateOne) AddMemory

func (cuo *ContainerUpdateOne) AddMemory(i int64) *ContainerUpdateOne

AddMemory adds i to the "memory" field.

func (*ContainerUpdateOne) AddMountIDs

func (cuo *ContainerUpdateOne) AddMountIDs(ids ...int) *ContainerUpdateOne

AddMountIDs adds the "mounts" edge to the Mount entity by IDs.

func (*ContainerUpdateOne) AddMounts

func (cuo *ContainerUpdateOne) AddMounts(m ...*Mount) *ContainerUpdateOne

AddMounts adds the "mounts" edges to the Mount entity.

func (*ContainerUpdateOne) AddNode

func (cuo *ContainerUpdateOne) AddNode(n ...*Node) *ContainerUpdateOne

AddNode adds the "node" edges to the Node entity.

func (*ContainerUpdateOne) AddNodeIDs

func (cuo *ContainerUpdateOne) AddNodeIDs(ids ...int) *ContainerUpdateOne

AddNodeIDs adds the "node" edge to the Node entity by IDs.

func (*ContainerUpdateOne) AddOwner

func (cuo *ContainerUpdateOne) AddOwner(u ...*User) *ContainerUpdateOne

AddOwner adds the "owner" edges to the User entity.

func (*ContainerUpdateOne) AddOwnerIDs

func (cuo *ContainerUpdateOne) AddOwnerIDs(ids ...int) *ContainerUpdateOne

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*ContainerUpdateOne) AddPortIDs

func (cuo *ContainerUpdateOne) AddPortIDs(ids ...int) *ContainerUpdateOne

AddPortIDs adds the "ports" edge to the Port entity by IDs.

func (*ContainerUpdateOne) AddPorts

func (cuo *ContainerUpdateOne) AddPorts(p ...*Port) *ContainerUpdateOne

AddPorts adds the "ports" edges to the Port entity.

func (*ContainerUpdateOne) AddUpdatedAt

func (cuo *ContainerUpdateOne) AddUpdatedAt(i int64) *ContainerUpdateOne

AddUpdatedAt adds i to the "updated_at" field.

func (*ContainerUpdateOne) ClearJobs

func (cuo *ContainerUpdateOne) ClearJobs() *ContainerUpdateOne

ClearJobs clears all "jobs" edges to the Job entity.

func (*ContainerUpdateOne) ClearMounts

func (cuo *ContainerUpdateOne) ClearMounts() *ContainerUpdateOne

ClearMounts clears all "mounts" edges to the Mount entity.

func (*ContainerUpdateOne) ClearNode

func (cuo *ContainerUpdateOne) ClearNode() *ContainerUpdateOne

ClearNode clears all "node" edges to the Node entity.

func (*ContainerUpdateOne) ClearOwner

func (cuo *ContainerUpdateOne) ClearOwner() *ContainerUpdateOne

ClearOwner clears all "owner" edges to the User entity.

func (*ContainerUpdateOne) ClearPorts

func (cuo *ContainerUpdateOne) ClearPorts() *ContainerUpdateOne

ClearPorts clears all "ports" edges to the Port entity.

func (*ContainerUpdateOne) Exec

func (cuo *ContainerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ContainerUpdateOne) ExecX

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

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

func (*ContainerUpdateOne) Mutation

func (cuo *ContainerUpdateOne) Mutation() *ContainerMutation

Mutation returns the ContainerMutation object of the builder.

func (*ContainerUpdateOne) RemoveJobIDs

func (cuo *ContainerUpdateOne) RemoveJobIDs(ids ...int) *ContainerUpdateOne

RemoveJobIDs removes the "jobs" edge to Job entities by IDs.

func (*ContainerUpdateOne) RemoveJobs

func (cuo *ContainerUpdateOne) RemoveJobs(j ...*Job) *ContainerUpdateOne

RemoveJobs removes "jobs" edges to Job entities.

func (*ContainerUpdateOne) RemoveMountIDs

func (cuo *ContainerUpdateOne) RemoveMountIDs(ids ...int) *ContainerUpdateOne

RemoveMountIDs removes the "mounts" edge to Mount entities by IDs.

func (*ContainerUpdateOne) RemoveMounts

func (cuo *ContainerUpdateOne) RemoveMounts(m ...*Mount) *ContainerUpdateOne

RemoveMounts removes "mounts" edges to Mount entities.

func (*ContainerUpdateOne) RemoveNode

func (cuo *ContainerUpdateOne) RemoveNode(n ...*Node) *ContainerUpdateOne

RemoveNode removes "node" edges to Node entities.

func (*ContainerUpdateOne) RemoveNodeIDs

func (cuo *ContainerUpdateOne) RemoveNodeIDs(ids ...int) *ContainerUpdateOne

RemoveNodeIDs removes the "node" edge to Node entities by IDs.

func (*ContainerUpdateOne) RemoveOwner

func (cuo *ContainerUpdateOne) RemoveOwner(u ...*User) *ContainerUpdateOne

RemoveOwner removes "owner" edges to User entities.

func (*ContainerUpdateOne) RemoveOwnerIDs

func (cuo *ContainerUpdateOne) RemoveOwnerIDs(ids ...int) *ContainerUpdateOne

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*ContainerUpdateOne) RemovePortIDs

func (cuo *ContainerUpdateOne) RemovePortIDs(ids ...int) *ContainerUpdateOne

RemovePortIDs removes the "ports" edge to Port entities by IDs.

func (*ContainerUpdateOne) RemovePorts

func (cuo *ContainerUpdateOne) RemovePorts(p ...*Port) *ContainerUpdateOne

RemovePorts removes "ports" edges to Port entities.

func (*ContainerUpdateOne) Save

func (cuo *ContainerUpdateOne) Save(ctx context.Context) (*Container, error)

Save executes the query and returns the updated Container entity.

func (*ContainerUpdateOne) SaveX

func (cuo *ContainerUpdateOne) SaveX(ctx context.Context) *Container

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

func (*ContainerUpdateOne) Select

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

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

func (*ContainerUpdateOne) SetCPU

SetCPU sets the "cpu" field.

func (*ContainerUpdateOne) SetCid

SetCid sets the "cid" field.

func (*ContainerUpdateOne) SetCreatedAt

func (cuo *ContainerUpdateOne) SetCreatedAt(i int64) *ContainerUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ContainerUpdateOne) SetImage

func (cuo *ContainerUpdateOne) SetImage(s string) *ContainerUpdateOne

SetImage sets the "image" field.

func (*ContainerUpdateOne) SetMemory

func (cuo *ContainerUpdateOne) SetMemory(i int64) *ContainerUpdateOne

SetMemory sets the "memory" field.

func (*ContainerUpdateOne) SetName

func (cuo *ContainerUpdateOne) SetName(s string) *ContainerUpdateOne

SetName sets the "name" field.

func (*ContainerUpdateOne) SetNillableCPU

func (cuo *ContainerUpdateOne) SetNillableCPU(i *int64) *ContainerUpdateOne

SetNillableCPU sets the "cpu" field if the given value is not nil.

func (*ContainerUpdateOne) SetNillableCid

func (cuo *ContainerUpdateOne) SetNillableCid(s *string) *ContainerUpdateOne

SetNillableCid sets the "cid" field if the given value is not nil.

func (*ContainerUpdateOne) SetNillableCreatedAt

func (cuo *ContainerUpdateOne) SetNillableCreatedAt(i *int64) *ContainerUpdateOne

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

func (*ContainerUpdateOne) SetNillableImage

func (cuo *ContainerUpdateOne) SetNillableImage(s *string) *ContainerUpdateOne

SetNillableImage sets the "image" field if the given value is not nil.

func (*ContainerUpdateOne) SetNillableMemory

func (cuo *ContainerUpdateOne) SetNillableMemory(i *int64) *ContainerUpdateOne

SetNillableMemory sets the "memory" field if the given value is not nil.

func (*ContainerUpdateOne) SetNillableName

func (cuo *ContainerUpdateOne) SetNillableName(s *string) *ContainerUpdateOne

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

func (*ContainerUpdateOne) SetUpdatedAt

func (cuo *ContainerUpdateOne) SetUpdatedAt(i int64) *ContainerUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ContainerUpdateOne) Where

Where appends a list predicates to the ContainerUpdate builder.

type Containers

type Containers []*Container

Containers is a parsable slice of Container.

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 Job

type Job struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// JobType holds the value of the "job_type" field.
	JobType int `json:"job_type,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt int64 `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the JobQuery when eager-loading is set.
	Edges JobEdges `json:"edges"`
	// contains filtered or unexported fields
}

container cron job tables

func (*Job) QueryOwner

func (j *Job) QueryOwner() *ContainerQuery

QueryOwner queries the "owner" edge of the Job entity.

func (*Job) String

func (j *Job) String() string

String implements the fmt.Stringer.

func (*Job) Unwrap

func (j *Job) Unwrap() *Job

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

func (j *Job) Update() *JobUpdateOne

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

func (*Job) Value

func (j *Job) Value(name string) (ent.Value, error)

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

type JobClient

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

JobClient is a client for the Job schema.

func NewJobClient

func NewJobClient(c config) *JobClient

NewJobClient returns a client for the Job from the given config.

func (*JobClient) Create

func (c *JobClient) Create() *JobCreate

Create returns a builder for creating a Job entity.

func (*JobClient) CreateBulk

func (c *JobClient) CreateBulk(builders ...*JobCreate) *JobCreateBulk

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

func (*JobClient) Delete

func (c *JobClient) Delete() *JobDelete

Delete returns a delete builder for Job.

func (*JobClient) DeleteOne

func (c *JobClient) DeleteOne(j *Job) *JobDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*JobClient) DeleteOneID

func (c *JobClient) DeleteOneID(id int) *JobDeleteOne

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

func (*JobClient) Get

func (c *JobClient) Get(ctx context.Context, id int) (*Job, error)

Get returns a Job entity by its id.

func (*JobClient) GetX

func (c *JobClient) GetX(ctx context.Context, id int) *Job

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

func (*JobClient) Hooks

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

Hooks returns the client hooks.

func (*JobClient) Intercept

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

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

func (*JobClient) Interceptors

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

Interceptors returns the client interceptors.

func (*JobClient) MapCreateBulk

func (c *JobClient) MapCreateBulk(slice any, setFunc func(*JobCreate, int)) *JobCreateBulk

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

func (c *JobClient) Query() *JobQuery

Query returns a query builder for Job.

func (*JobClient) QueryOwner

func (c *JobClient) QueryOwner(j *Job) *ContainerQuery

QueryOwner queries the owner edge of a Job.

func (*JobClient) Update

func (c *JobClient) Update() *JobUpdate

Update returns an update builder for Job.

func (*JobClient) UpdateOne

func (c *JobClient) UpdateOne(j *Job) *JobUpdateOne

UpdateOne returns an update builder for the given entity.

func (*JobClient) UpdateOneID

func (c *JobClient) UpdateOneID(id int) *JobUpdateOne

UpdateOneID returns an update builder for the given id.

func (*JobClient) Use

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

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

type JobCreate

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

JobCreate is the builder for creating a Job entity.

func (*JobCreate) AddOwner

func (jc *JobCreate) AddOwner(c ...*Container) *JobCreate

AddOwner adds the "owner" edges to the Container entity.

func (*JobCreate) AddOwnerIDs

func (jc *JobCreate) AddOwnerIDs(ids ...int) *JobCreate

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*JobCreate) Exec

func (jc *JobCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*JobCreate) ExecX

func (jc *JobCreate) ExecX(ctx context.Context)

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

func (*JobCreate) Mutation

func (jc *JobCreate) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobCreate) Save

func (jc *JobCreate) Save(ctx context.Context) (*Job, error)

Save creates the Job in the database.

func (*JobCreate) SaveX

func (jc *JobCreate) SaveX(ctx context.Context) *Job

SaveX calls Save and panics if Save returns an error.

func (*JobCreate) SetCreatedAt

func (jc *JobCreate) SetCreatedAt(i int64) *JobCreate

SetCreatedAt sets the "created_at" field.

func (*JobCreate) SetDescription

func (jc *JobCreate) SetDescription(s string) *JobCreate

SetDescription sets the "description" field.

func (*JobCreate) SetJobType

func (jc *JobCreate) SetJobType(i int) *JobCreate

SetJobType sets the "job_type" field.

func (*JobCreate) SetName

func (jc *JobCreate) SetName(s string) *JobCreate

SetName sets the "name" field.

func (*JobCreate) SetNillableCreatedAt

func (jc *JobCreate) SetNillableCreatedAt(i *int64) *JobCreate

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

func (*JobCreate) SetNillableUpdatedAt

func (jc *JobCreate) SetNillableUpdatedAt(i *int64) *JobCreate

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

func (*JobCreate) SetUpdatedAt

func (jc *JobCreate) SetUpdatedAt(i int64) *JobCreate

SetUpdatedAt sets the "updated_at" field.

type JobCreateBulk

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

JobCreateBulk is the builder for creating many Job entities in bulk.

func (*JobCreateBulk) Exec

func (jcb *JobCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*JobCreateBulk) ExecX

func (jcb *JobCreateBulk) ExecX(ctx context.Context)

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

func (*JobCreateBulk) Save

func (jcb *JobCreateBulk) Save(ctx context.Context) ([]*Job, error)

Save creates the Job entities in the database.

func (*JobCreateBulk) SaveX

func (jcb *JobCreateBulk) SaveX(ctx context.Context) []*Job

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

type JobDelete

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

JobDelete is the builder for deleting a Job entity.

func (*JobDelete) Exec

func (jd *JobDelete) Exec(ctx context.Context) (int, error)

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

func (*JobDelete) ExecX

func (jd *JobDelete) ExecX(ctx context.Context) int

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

func (*JobDelete) Where

func (jd *JobDelete) Where(ps ...predicate.Job) *JobDelete

Where appends a list predicates to the JobDelete builder.

type JobDeleteOne

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

JobDeleteOne is the builder for deleting a single Job entity.

func (*JobDeleteOne) Exec

func (jdo *JobDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*JobDeleteOne) ExecX

func (jdo *JobDeleteOne) ExecX(ctx context.Context)

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

func (*JobDeleteOne) Where

func (jdo *JobDeleteOne) Where(ps ...predicate.Job) *JobDeleteOne

Where appends a list predicates to the JobDelete builder.

type JobEdges

type JobEdges struct {
	// Owner holds the value of the owner edge.
	Owner []*Container `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (JobEdges) OwnerOrErr

func (e JobEdges) OwnerOrErr() ([]*Container, error)

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

type JobGroupBy

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

JobGroupBy is the group-by builder for Job entities.

func (*JobGroupBy) Aggregate

func (jgb *JobGroupBy) Aggregate(fns ...AggregateFunc) *JobGroupBy

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

func (*JobGroupBy) Bool

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

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

func (*JobGroupBy) BoolX

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

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

func (*JobGroupBy) Bools

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

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

func (*JobGroupBy) BoolsX

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

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

func (*JobGroupBy) Float64

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

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

func (*JobGroupBy) Float64X

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

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

func (*JobGroupBy) Float64s

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

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

func (*JobGroupBy) Float64sX

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

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

func (*JobGroupBy) Int

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

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

func (*JobGroupBy) IntX

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

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

func (*JobGroupBy) Ints

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

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

func (*JobGroupBy) IntsX

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

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

func (*JobGroupBy) Scan

func (jgb *JobGroupBy) Scan(ctx context.Context, v any) error

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

func (*JobGroupBy) ScanX

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

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

func (*JobGroupBy) String

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

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

func (*JobGroupBy) StringX

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

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

func (*JobGroupBy) Strings

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

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

func (*JobGroupBy) StringsX

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

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

type JobMutation

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

JobMutation represents an operation that mutates the Job nodes in the graph.

func (*JobMutation) AddCreatedAt

func (m *JobMutation) AddCreatedAt(i int64)

AddCreatedAt adds i to the "created_at" field.

func (*JobMutation) AddField

func (m *JobMutation) 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 (*JobMutation) AddJobType

func (m *JobMutation) AddJobType(i int)

AddJobType adds i to the "job_type" field.

func (*JobMutation) AddOwnerIDs

func (m *JobMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the Container entity by ids.

func (*JobMutation) AddUpdatedAt

func (m *JobMutation) AddUpdatedAt(i int64)

AddUpdatedAt adds i to the "updated_at" field.

func (*JobMutation) AddedCreatedAt

func (m *JobMutation) AddedCreatedAt() (r int64, exists bool)

AddedCreatedAt returns the value that was added to the "created_at" field in this mutation.

func (*JobMutation) AddedEdges

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

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

func (*JobMutation) AddedField

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

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

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

func (*JobMutation) AddedIDs

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

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

func (*JobMutation) AddedJobType

func (m *JobMutation) AddedJobType() (r int, exists bool)

AddedJobType returns the value that was added to the "job_type" field in this mutation.

func (*JobMutation) AddedUpdatedAt

func (m *JobMutation) AddedUpdatedAt() (r int64, exists bool)

AddedUpdatedAt returns the value that was added to the "updated_at" field in this mutation.

func (*JobMutation) ClearEdge

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

func (m *JobMutation) 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 (*JobMutation) ClearOwner

func (m *JobMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Container entity.

func (*JobMutation) ClearedEdges

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

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

func (*JobMutation) ClearedFields

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

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

func (JobMutation) Client

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

func (m *JobMutation) CreatedAt() (r int64, exists bool)

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

func (*JobMutation) Description

func (m *JobMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*JobMutation) EdgeCleared

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

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

func (*JobMutation) Field

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

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

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

func (*JobMutation) Fields

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

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

func (m *JobMutation) 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 (*JobMutation) JobType

func (m *JobMutation) JobType() (r int, exists bool)

JobType returns the value of the "job_type" field in the mutation.

func (*JobMutation) Name

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

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

func (*JobMutation) OldCreatedAt

func (m *JobMutation) OldCreatedAt(ctx context.Context) (v int64, err error)

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

func (m *JobMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Job entity. If the Job 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 (*JobMutation) OldField

func (m *JobMutation) 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 (*JobMutation) OldJobType

func (m *JobMutation) OldJobType(ctx context.Context) (v int, err error)

OldJobType returns the old "job_type" field's value of the Job entity. If the Job 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 (*JobMutation) OldName

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

OldName returns the old "name" field's value of the Job entity. If the Job 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 (*JobMutation) OldUpdatedAt

func (m *JobMutation) OldUpdatedAt(ctx context.Context) (v int64, err error)

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

func (m *JobMutation) Op() Op

Op returns the operation name.

func (*JobMutation) OwnerCleared

func (m *JobMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Container entity was cleared.

func (*JobMutation) OwnerIDs

func (m *JobMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*JobMutation) RemoveOwnerIDs

func (m *JobMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the Container entity by IDs.

func (*JobMutation) RemovedEdges

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

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

func (*JobMutation) RemovedIDs

func (m *JobMutation) 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 (*JobMutation) RemovedOwnerIDs

func (m *JobMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the Container entity.

func (*JobMutation) ResetCreatedAt

func (m *JobMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*JobMutation) ResetDescription

func (m *JobMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*JobMutation) ResetEdge

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

func (m *JobMutation) 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 (*JobMutation) ResetJobType

func (m *JobMutation) ResetJobType()

ResetJobType resets all changes to the "job_type" field.

func (*JobMutation) ResetName

func (m *JobMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*JobMutation) ResetOwner

func (m *JobMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*JobMutation) ResetUpdatedAt

func (m *JobMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*JobMutation) SetCreatedAt

func (m *JobMutation) SetCreatedAt(i int64)

SetCreatedAt sets the "created_at" field.

func (*JobMutation) SetDescription

func (m *JobMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*JobMutation) SetField

func (m *JobMutation) 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 (*JobMutation) SetJobType

func (m *JobMutation) SetJobType(i int)

SetJobType sets the "job_type" field.

func (*JobMutation) SetName

func (m *JobMutation) SetName(s string)

SetName sets the "name" field.

func (*JobMutation) SetOp

func (m *JobMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*JobMutation) SetUpdatedAt

func (m *JobMutation) SetUpdatedAt(i int64)

SetUpdatedAt sets the "updated_at" field.

func (JobMutation) Tx

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

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

func (*JobMutation) Type

func (m *JobMutation) Type() string

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

func (*JobMutation) UpdatedAt

func (m *JobMutation) UpdatedAt() (r int64, exists bool)

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

func (*JobMutation) Where

func (m *JobMutation) Where(ps ...predicate.Job)

Where appends a list predicates to the JobMutation builder.

func (*JobMutation) WhereP

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

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

type JobQuery

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

JobQuery is the builder for querying Job entities.

func (*JobQuery) Aggregate

func (jq *JobQuery) Aggregate(fns ...AggregateFunc) *JobSelect

Aggregate returns a JobSelect configured with the given aggregations.

func (*JobQuery) All

func (jq *JobQuery) All(ctx context.Context) ([]*Job, error)

All executes the query and returns a list of Jobs.

func (*JobQuery) AllX

func (jq *JobQuery) AllX(ctx context.Context) []*Job

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

func (*JobQuery) Clone

func (jq *JobQuery) Clone() *JobQuery

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

func (*JobQuery) Count

func (jq *JobQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*JobQuery) CountX

func (jq *JobQuery) CountX(ctx context.Context) int

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

func (*JobQuery) Exist

func (jq *JobQuery) Exist(ctx context.Context) (bool, error)

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

func (*JobQuery) ExistX

func (jq *JobQuery) ExistX(ctx context.Context) bool

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

func (*JobQuery) First

func (jq *JobQuery) First(ctx context.Context) (*Job, error)

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

func (*JobQuery) FirstID

func (jq *JobQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*JobQuery) FirstIDX

func (jq *JobQuery) FirstIDX(ctx context.Context) int

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

func (*JobQuery) FirstX

func (jq *JobQuery) FirstX(ctx context.Context) *Job

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

func (*JobQuery) GroupBy

func (jq *JobQuery) GroupBy(field string, fields ...string) *JobGroupBy

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

Example:

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

client.Job.Query().
	GroupBy(job.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*JobQuery) IDs

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

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

func (*JobQuery) IDsX

func (jq *JobQuery) IDsX(ctx context.Context) []int

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

func (*JobQuery) Limit

func (jq *JobQuery) Limit(limit int) *JobQuery

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

func (*JobQuery) Offset

func (jq *JobQuery) Offset(offset int) *JobQuery

Offset to start from.

func (*JobQuery) Only

func (jq *JobQuery) Only(ctx context.Context) (*Job, error)

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

func (*JobQuery) OnlyID

func (jq *JobQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*JobQuery) OnlyIDX

func (jq *JobQuery) OnlyIDX(ctx context.Context) int

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

func (*JobQuery) OnlyX

func (jq *JobQuery) OnlyX(ctx context.Context) *Job

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

func (*JobQuery) Order

func (jq *JobQuery) Order(o ...job.OrderOption) *JobQuery

Order specifies how the records should be ordered.

func (*JobQuery) QueryOwner

func (jq *JobQuery) QueryOwner() *ContainerQuery

QueryOwner chains the current query on the "owner" edge.

func (*JobQuery) Select

func (jq *JobQuery) Select(fields ...string) *JobSelect

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

Example:

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

client.Job.Query().
	Select(job.FieldName).
	Scan(ctx, &v)

func (*JobQuery) Unique

func (jq *JobQuery) Unique(unique bool) *JobQuery

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

func (jq *JobQuery) Where(ps ...predicate.Job) *JobQuery

Where adds a new predicate for the JobQuery builder.

func (*JobQuery) WithOwner

func (jq *JobQuery) WithOwner(opts ...func(*ContainerQuery)) *JobQuery

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

type JobSelect

type JobSelect struct {
	*JobQuery
	// contains filtered or unexported fields
}

JobSelect is the builder for selecting fields of Job entities.

func (*JobSelect) Aggregate

func (js *JobSelect) Aggregate(fns ...AggregateFunc) *JobSelect

Aggregate adds the given aggregation functions to the selector query.

func (*JobSelect) Bool

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

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

func (*JobSelect) BoolX

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

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

func (*JobSelect) Bools

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

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

func (*JobSelect) BoolsX

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

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

func (*JobSelect) Float64

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

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

func (*JobSelect) Float64X

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

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

func (*JobSelect) Float64s

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

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

func (*JobSelect) Float64sX

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

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

func (*JobSelect) Int

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

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

func (*JobSelect) IntX

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

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

func (*JobSelect) Ints

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

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

func (*JobSelect) IntsX

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

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

func (*JobSelect) Scan

func (js *JobSelect) Scan(ctx context.Context, v any) error

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

func (*JobSelect) ScanX

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

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

func (*JobSelect) String

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

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

func (*JobSelect) StringX

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

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

func (*JobSelect) Strings

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

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

func (*JobSelect) StringsX

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

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

type JobUpdate

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

JobUpdate is the builder for updating Job entities.

func (*JobUpdate) AddCreatedAt

func (ju *JobUpdate) AddCreatedAt(i int64) *JobUpdate

AddCreatedAt adds i to the "created_at" field.

func (*JobUpdate) AddJobType

func (ju *JobUpdate) AddJobType(i int) *JobUpdate

AddJobType adds i to the "job_type" field.

func (*JobUpdate) AddOwner

func (ju *JobUpdate) AddOwner(c ...*Container) *JobUpdate

AddOwner adds the "owner" edges to the Container entity.

func (*JobUpdate) AddOwnerIDs

func (ju *JobUpdate) AddOwnerIDs(ids ...int) *JobUpdate

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*JobUpdate) AddUpdatedAt

func (ju *JobUpdate) AddUpdatedAt(i int64) *JobUpdate

AddUpdatedAt adds i to the "updated_at" field.

func (*JobUpdate) ClearOwner

func (ju *JobUpdate) ClearOwner() *JobUpdate

ClearOwner clears all "owner" edges to the Container entity.

func (*JobUpdate) Exec

func (ju *JobUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*JobUpdate) ExecX

func (ju *JobUpdate) ExecX(ctx context.Context)

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

func (*JobUpdate) Mutation

func (ju *JobUpdate) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobUpdate) RemoveOwner

func (ju *JobUpdate) RemoveOwner(c ...*Container) *JobUpdate

RemoveOwner removes "owner" edges to Container entities.

func (*JobUpdate) RemoveOwnerIDs

func (ju *JobUpdate) RemoveOwnerIDs(ids ...int) *JobUpdate

RemoveOwnerIDs removes the "owner" edge to Container entities by IDs.

func (*JobUpdate) Save

func (ju *JobUpdate) Save(ctx context.Context) (int, error)

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

func (*JobUpdate) SaveX

func (ju *JobUpdate) SaveX(ctx context.Context) int

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

func (*JobUpdate) SetCreatedAt

func (ju *JobUpdate) SetCreatedAt(i int64) *JobUpdate

SetCreatedAt sets the "created_at" field.

func (*JobUpdate) SetDescription

func (ju *JobUpdate) SetDescription(s string) *JobUpdate

SetDescription sets the "description" field.

func (*JobUpdate) SetJobType

func (ju *JobUpdate) SetJobType(i int) *JobUpdate

SetJobType sets the "job_type" field.

func (*JobUpdate) SetName

func (ju *JobUpdate) SetName(s string) *JobUpdate

SetName sets the "name" field.

func (*JobUpdate) SetNillableCreatedAt

func (ju *JobUpdate) SetNillableCreatedAt(i *int64) *JobUpdate

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

func (*JobUpdate) SetNillableDescription

func (ju *JobUpdate) SetNillableDescription(s *string) *JobUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*JobUpdate) SetNillableJobType

func (ju *JobUpdate) SetNillableJobType(i *int) *JobUpdate

SetNillableJobType sets the "job_type" field if the given value is not nil.

func (*JobUpdate) SetNillableName

func (ju *JobUpdate) SetNillableName(s *string) *JobUpdate

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

func (*JobUpdate) SetUpdatedAt

func (ju *JobUpdate) SetUpdatedAt(i int64) *JobUpdate

SetUpdatedAt sets the "updated_at" field.

func (*JobUpdate) Where

func (ju *JobUpdate) Where(ps ...predicate.Job) *JobUpdate

Where appends a list predicates to the JobUpdate builder.

type JobUpdateOne

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

JobUpdateOne is the builder for updating a single Job entity.

func (*JobUpdateOne) AddCreatedAt

func (juo *JobUpdateOne) AddCreatedAt(i int64) *JobUpdateOne

AddCreatedAt adds i to the "created_at" field.

func (*JobUpdateOne) AddJobType

func (juo *JobUpdateOne) AddJobType(i int) *JobUpdateOne

AddJobType adds i to the "job_type" field.

func (*JobUpdateOne) AddOwner

func (juo *JobUpdateOne) AddOwner(c ...*Container) *JobUpdateOne

AddOwner adds the "owner" edges to the Container entity.

func (*JobUpdateOne) AddOwnerIDs

func (juo *JobUpdateOne) AddOwnerIDs(ids ...int) *JobUpdateOne

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*JobUpdateOne) AddUpdatedAt

func (juo *JobUpdateOne) AddUpdatedAt(i int64) *JobUpdateOne

AddUpdatedAt adds i to the "updated_at" field.

func (*JobUpdateOne) ClearOwner

func (juo *JobUpdateOne) ClearOwner() *JobUpdateOne

ClearOwner clears all "owner" edges to the Container entity.

func (*JobUpdateOne) Exec

func (juo *JobUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*JobUpdateOne) ExecX

func (juo *JobUpdateOne) ExecX(ctx context.Context)

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

func (*JobUpdateOne) Mutation

func (juo *JobUpdateOne) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobUpdateOne) RemoveOwner

func (juo *JobUpdateOne) RemoveOwner(c ...*Container) *JobUpdateOne

RemoveOwner removes "owner" edges to Container entities.

func (*JobUpdateOne) RemoveOwnerIDs

func (juo *JobUpdateOne) RemoveOwnerIDs(ids ...int) *JobUpdateOne

RemoveOwnerIDs removes the "owner" edge to Container entities by IDs.

func (*JobUpdateOne) Save

func (juo *JobUpdateOne) Save(ctx context.Context) (*Job, error)

Save executes the query and returns the updated Job entity.

func (*JobUpdateOne) SaveX

func (juo *JobUpdateOne) SaveX(ctx context.Context) *Job

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

func (*JobUpdateOne) Select

func (juo *JobUpdateOne) Select(field string, fields ...string) *JobUpdateOne

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

func (*JobUpdateOne) SetCreatedAt

func (juo *JobUpdateOne) SetCreatedAt(i int64) *JobUpdateOne

SetCreatedAt sets the "created_at" field.

func (*JobUpdateOne) SetDescription

func (juo *JobUpdateOne) SetDescription(s string) *JobUpdateOne

SetDescription sets the "description" field.

func (*JobUpdateOne) SetJobType

func (juo *JobUpdateOne) SetJobType(i int) *JobUpdateOne

SetJobType sets the "job_type" field.

func (*JobUpdateOne) SetName

func (juo *JobUpdateOne) SetName(s string) *JobUpdateOne

SetName sets the "name" field.

func (*JobUpdateOne) SetNillableCreatedAt

func (juo *JobUpdateOne) SetNillableCreatedAt(i *int64) *JobUpdateOne

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

func (*JobUpdateOne) SetNillableDescription

func (juo *JobUpdateOne) SetNillableDescription(s *string) *JobUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*JobUpdateOne) SetNillableJobType

func (juo *JobUpdateOne) SetNillableJobType(i *int) *JobUpdateOne

SetNillableJobType sets the "job_type" field if the given value is not nil.

func (*JobUpdateOne) SetNillableName

func (juo *JobUpdateOne) SetNillableName(s *string) *JobUpdateOne

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

func (*JobUpdateOne) SetUpdatedAt

func (juo *JobUpdateOne) SetUpdatedAt(i int64) *JobUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*JobUpdateOne) Where

func (juo *JobUpdateOne) Where(ps ...predicate.Job) *JobUpdateOne

Where appends a list predicates to the JobUpdate builder.

type Jobs

type Jobs []*Job

Jobs is a parsable slice of Job.

type Mount

type Mount struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Host holds the value of the "host" field.
	Host string `json:"host,omitempty"`
	// Bind holds the value of the "bind" field.
	Bind string `json:"bind,omitempty"`
	// IsDir holds the value of the "is_dir" field.
	IsDir bool `json:"is_dir,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt int64 `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MountQuery when eager-loading is set.
	Edges MountEdges `json:"edges"`
	// contains filtered or unexported fields
}

container mount record table

func (*Mount) QueryOwner

func (m *Mount) QueryOwner() *ContainerQuery

QueryOwner queries the "owner" edge of the Mount entity.

func (*Mount) String

func (m *Mount) String() string

String implements the fmt.Stringer.

func (*Mount) Unwrap

func (m *Mount) Unwrap() *Mount

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

func (m *Mount) Update() *MountUpdateOne

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

func (*Mount) Value

func (m *Mount) Value(name string) (ent.Value, error)

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

type MountClient

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

MountClient is a client for the Mount schema.

func NewMountClient

func NewMountClient(c config) *MountClient

NewMountClient returns a client for the Mount from the given config.

func (*MountClient) Create

func (c *MountClient) Create() *MountCreate

Create returns a builder for creating a Mount entity.

func (*MountClient) CreateBulk

func (c *MountClient) CreateBulk(builders ...*MountCreate) *MountCreateBulk

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

func (*MountClient) Delete

func (c *MountClient) Delete() *MountDelete

Delete returns a delete builder for Mount.

func (*MountClient) DeleteOne

func (c *MountClient) DeleteOne(m *Mount) *MountDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MountClient) DeleteOneID

func (c *MountClient) DeleteOneID(id int) *MountDeleteOne

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

func (*MountClient) Get

func (c *MountClient) Get(ctx context.Context, id int) (*Mount, error)

Get returns a Mount entity by its id.

func (*MountClient) GetX

func (c *MountClient) GetX(ctx context.Context, id int) *Mount

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

func (*MountClient) Hooks

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

Hooks returns the client hooks.

func (*MountClient) Intercept

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

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

func (*MountClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MountClient) MapCreateBulk

func (c *MountClient) MapCreateBulk(slice any, setFunc func(*MountCreate, int)) *MountCreateBulk

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

func (c *MountClient) Query() *MountQuery

Query returns a query builder for Mount.

func (*MountClient) QueryOwner

func (c *MountClient) QueryOwner(m *Mount) *ContainerQuery

QueryOwner queries the owner edge of a Mount.

func (*MountClient) Update

func (c *MountClient) Update() *MountUpdate

Update returns an update builder for Mount.

func (*MountClient) UpdateOne

func (c *MountClient) UpdateOne(m *Mount) *MountUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MountClient) UpdateOneID

func (c *MountClient) UpdateOneID(id int) *MountUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MountClient) Use

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

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

type MountCreate

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

MountCreate is the builder for creating a Mount entity.

func (*MountCreate) AddOwner

func (mc *MountCreate) AddOwner(c ...*Container) *MountCreate

AddOwner adds the "owner" edges to the Container entity.

func (*MountCreate) AddOwnerIDs

func (mc *MountCreate) AddOwnerIDs(ids ...int) *MountCreate

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*MountCreate) Exec

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

Exec executes the query.

func (*MountCreate) ExecX

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

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

func (*MountCreate) Mutation

func (mc *MountCreate) Mutation() *MountMutation

Mutation returns the MountMutation object of the builder.

func (*MountCreate) Save

func (mc *MountCreate) Save(ctx context.Context) (*Mount, error)

Save creates the Mount in the database.

func (*MountCreate) SaveX

func (mc *MountCreate) SaveX(ctx context.Context) *Mount

SaveX calls Save and panics if Save returns an error.

func (*MountCreate) SetBind

func (mc *MountCreate) SetBind(s string) *MountCreate

SetBind sets the "bind" field.

func (*MountCreate) SetCreatedAt

func (mc *MountCreate) SetCreatedAt(i int64) *MountCreate

SetCreatedAt sets the "created_at" field.

func (*MountCreate) SetHost

func (mc *MountCreate) SetHost(s string) *MountCreate

SetHost sets the "host" field.

func (*MountCreate) SetIsDir

func (mc *MountCreate) SetIsDir(b bool) *MountCreate

SetIsDir sets the "is_dir" field.

func (*MountCreate) SetNillableCreatedAt

func (mc *MountCreate) SetNillableCreatedAt(i *int64) *MountCreate

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

func (*MountCreate) SetNillableUpdatedAt

func (mc *MountCreate) SetNillableUpdatedAt(i *int64) *MountCreate

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

func (*MountCreate) SetUpdatedAt

func (mc *MountCreate) SetUpdatedAt(i int64) *MountCreate

SetUpdatedAt sets the "updated_at" field.

type MountCreateBulk

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

MountCreateBulk is the builder for creating many Mount entities in bulk.

func (*MountCreateBulk) Exec

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

Exec executes the query.

func (*MountCreateBulk) ExecX

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

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

func (*MountCreateBulk) Save

func (mcb *MountCreateBulk) Save(ctx context.Context) ([]*Mount, error)

Save creates the Mount entities in the database.

func (*MountCreateBulk) SaveX

func (mcb *MountCreateBulk) SaveX(ctx context.Context) []*Mount

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

type MountDelete

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

MountDelete is the builder for deleting a Mount entity.

func (*MountDelete) Exec

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

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

func (*MountDelete) ExecX

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

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

func (*MountDelete) Where

func (md *MountDelete) Where(ps ...predicate.Mount) *MountDelete

Where appends a list predicates to the MountDelete builder.

type MountDeleteOne

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

MountDeleteOne is the builder for deleting a single Mount entity.

func (*MountDeleteOne) Exec

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

Exec executes the deletion query.

func (*MountDeleteOne) ExecX

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

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

func (*MountDeleteOne) Where

func (mdo *MountDeleteOne) Where(ps ...predicate.Mount) *MountDeleteOne

Where appends a list predicates to the MountDelete builder.

type MountEdges

type MountEdges struct {
	// Owner holds the value of the owner edge.
	Owner []*Container `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (MountEdges) OwnerOrErr

func (e MountEdges) OwnerOrErr() ([]*Container, error)

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

type MountGroupBy

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

MountGroupBy is the group-by builder for Mount entities.

func (*MountGroupBy) Aggregate

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

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

func (*MountGroupBy) Bool

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

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

func (*MountGroupBy) BoolX

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

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

func (*MountGroupBy) Bools

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

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

func (*MountGroupBy) BoolsX

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

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

func (*MountGroupBy) Float64

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

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

func (*MountGroupBy) Float64X

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

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

func (*MountGroupBy) Float64s

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

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

func (*MountGroupBy) Float64sX

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

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

func (*MountGroupBy) Int

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

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

func (*MountGroupBy) IntX

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

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

func (*MountGroupBy) Ints

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

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

func (*MountGroupBy) IntsX

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

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

func (*MountGroupBy) Scan

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

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

func (*MountGroupBy) ScanX

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

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

func (*MountGroupBy) String

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

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

func (*MountGroupBy) StringX

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

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

func (*MountGroupBy) Strings

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

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

func (*MountGroupBy) StringsX

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

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

type MountMutation

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

MountMutation represents an operation that mutates the Mount nodes in the graph.

func (*MountMutation) AddCreatedAt

func (m *MountMutation) AddCreatedAt(i int64)

AddCreatedAt adds i to the "created_at" field.

func (*MountMutation) AddField

func (m *MountMutation) 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 (*MountMutation) AddOwnerIDs

func (m *MountMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the Container entity by ids.

func (*MountMutation) AddUpdatedAt

func (m *MountMutation) AddUpdatedAt(i int64)

AddUpdatedAt adds i to the "updated_at" field.

func (*MountMutation) AddedCreatedAt

func (m *MountMutation) AddedCreatedAt() (r int64, exists bool)

AddedCreatedAt returns the value that was added to the "created_at" field in this mutation.

func (*MountMutation) AddedEdges

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

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

func (*MountMutation) AddedField

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

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

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

func (*MountMutation) AddedIDs

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

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

func (*MountMutation) AddedUpdatedAt

func (m *MountMutation) AddedUpdatedAt() (r int64, exists bool)

AddedUpdatedAt returns the value that was added to the "updated_at" field in this mutation.

func (*MountMutation) Bind

func (m *MountMutation) Bind() (r string, exists bool)

Bind returns the value of the "bind" field in the mutation.

func (*MountMutation) ClearEdge

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

func (m *MountMutation) 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 (*MountMutation) ClearOwner

func (m *MountMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Container entity.

func (*MountMutation) ClearedEdges

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

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

func (*MountMutation) ClearedFields

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

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

func (MountMutation) Client

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

func (m *MountMutation) CreatedAt() (r int64, exists bool)

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

func (*MountMutation) EdgeCleared

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

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

func (*MountMutation) Field

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

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

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

func (*MountMutation) Fields

func (m *MountMutation) 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 (*MountMutation) Host

func (m *MountMutation) Host() (r string, exists bool)

Host returns the value of the "host" field in the mutation.

func (*MountMutation) ID

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

func (m *MountMutation) 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 (*MountMutation) IsDir

func (m *MountMutation) IsDir() (r bool, exists bool)

IsDir returns the value of the "is_dir" field in the mutation.

func (*MountMutation) OldBind

func (m *MountMutation) OldBind(ctx context.Context) (v string, err error)

OldBind returns the old "bind" field's value of the Mount entity. If the Mount 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 (*MountMutation) OldCreatedAt

func (m *MountMutation) OldCreatedAt(ctx context.Context) (v int64, err error)

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

func (m *MountMutation) 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 (*MountMutation) OldHost

func (m *MountMutation) OldHost(ctx context.Context) (v string, err error)

OldHost returns the old "host" field's value of the Mount entity. If the Mount 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 (*MountMutation) OldIsDir

func (m *MountMutation) OldIsDir(ctx context.Context) (v bool, err error)

OldIsDir returns the old "is_dir" field's value of the Mount entity. If the Mount 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 (*MountMutation) OldUpdatedAt

func (m *MountMutation) OldUpdatedAt(ctx context.Context) (v int64, err error)

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

func (m *MountMutation) Op() Op

Op returns the operation name.

func (*MountMutation) OwnerCleared

func (m *MountMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Container entity was cleared.

func (*MountMutation) OwnerIDs

func (m *MountMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*MountMutation) RemoveOwnerIDs

func (m *MountMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the Container entity by IDs.

func (*MountMutation) RemovedEdges

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

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

func (*MountMutation) RemovedIDs

func (m *MountMutation) 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 (*MountMutation) RemovedOwnerIDs

func (m *MountMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the Container entity.

func (*MountMutation) ResetBind

func (m *MountMutation) ResetBind()

ResetBind resets all changes to the "bind" field.

func (*MountMutation) ResetCreatedAt

func (m *MountMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MountMutation) ResetEdge

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

func (m *MountMutation) 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 (*MountMutation) ResetHost

func (m *MountMutation) ResetHost()

ResetHost resets all changes to the "host" field.

func (*MountMutation) ResetIsDir

func (m *MountMutation) ResetIsDir()

ResetIsDir resets all changes to the "is_dir" field.

func (*MountMutation) ResetOwner

func (m *MountMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*MountMutation) ResetUpdatedAt

func (m *MountMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MountMutation) SetBind

func (m *MountMutation) SetBind(s string)

SetBind sets the "bind" field.

func (*MountMutation) SetCreatedAt

func (m *MountMutation) SetCreatedAt(i int64)

SetCreatedAt sets the "created_at" field.

func (*MountMutation) SetField

func (m *MountMutation) 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 (*MountMutation) SetHost

func (m *MountMutation) SetHost(s string)

SetHost sets the "host" field.

func (*MountMutation) SetIsDir

func (m *MountMutation) SetIsDir(b bool)

SetIsDir sets the "is_dir" field.

func (*MountMutation) SetOp

func (m *MountMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MountMutation) SetUpdatedAt

func (m *MountMutation) SetUpdatedAt(i int64)

SetUpdatedAt sets the "updated_at" field.

func (MountMutation) Tx

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

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

func (*MountMutation) Type

func (m *MountMutation) Type() string

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

func (*MountMutation) UpdatedAt

func (m *MountMutation) UpdatedAt() (r int64, exists bool)

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

func (*MountMutation) Where

func (m *MountMutation) Where(ps ...predicate.Mount)

Where appends a list predicates to the MountMutation builder.

func (*MountMutation) WhereP

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

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

type MountQuery

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

MountQuery is the builder for querying Mount entities.

func (*MountQuery) Aggregate

func (mq *MountQuery) Aggregate(fns ...AggregateFunc) *MountSelect

Aggregate returns a MountSelect configured with the given aggregations.

func (*MountQuery) All

func (mq *MountQuery) All(ctx context.Context) ([]*Mount, error)

All executes the query and returns a list of Mounts.

func (*MountQuery) AllX

func (mq *MountQuery) AllX(ctx context.Context) []*Mount

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

func (*MountQuery) Clone

func (mq *MountQuery) Clone() *MountQuery

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

func (*MountQuery) Count

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

Count returns the count of the given query.

func (*MountQuery) CountX

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

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

func (*MountQuery) Exist

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

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

func (*MountQuery) ExistX

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

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

func (*MountQuery) First

func (mq *MountQuery) First(ctx context.Context) (*Mount, error)

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

func (*MountQuery) FirstID

func (mq *MountQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MountQuery) FirstIDX

func (mq *MountQuery) FirstIDX(ctx context.Context) int

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

func (*MountQuery) FirstX

func (mq *MountQuery) FirstX(ctx context.Context) *Mount

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

func (*MountQuery) GroupBy

func (mq *MountQuery) GroupBy(field string, fields ...string) *MountGroupBy

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

client.Mount.Query().
	GroupBy(mount.FieldHost).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MountQuery) IDs

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

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

func (*MountQuery) IDsX

func (mq *MountQuery) IDsX(ctx context.Context) []int

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

func (*MountQuery) Limit

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

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

func (*MountQuery) Offset

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

Offset to start from.

func (*MountQuery) Only

func (mq *MountQuery) Only(ctx context.Context) (*Mount, error)

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

func (*MountQuery) OnlyID

func (mq *MountQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MountQuery) OnlyIDX

func (mq *MountQuery) OnlyIDX(ctx context.Context) int

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

func (*MountQuery) OnlyX

func (mq *MountQuery) OnlyX(ctx context.Context) *Mount

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

func (*MountQuery) Order

func (mq *MountQuery) Order(o ...mount.OrderOption) *MountQuery

Order specifies how the records should be ordered.

func (*MountQuery) QueryOwner

func (mq *MountQuery) QueryOwner() *ContainerQuery

QueryOwner chains the current query on the "owner" edge.

func (*MountQuery) Select

func (mq *MountQuery) Select(fields ...string) *MountSelect

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

client.Mount.Query().
	Select(mount.FieldHost).
	Scan(ctx, &v)

func (*MountQuery) Unique

func (mq *MountQuery) Unique(unique bool) *MountQuery

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

func (mq *MountQuery) Where(ps ...predicate.Mount) *MountQuery

Where adds a new predicate for the MountQuery builder.

func (*MountQuery) WithOwner

func (mq *MountQuery) WithOwner(opts ...func(*ContainerQuery)) *MountQuery

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

type MountSelect

type MountSelect struct {
	*MountQuery
	// contains filtered or unexported fields
}

MountSelect is the builder for selecting fields of Mount entities.

func (*MountSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*MountSelect) Bool

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

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

func (*MountSelect) BoolX

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

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

func (*MountSelect) Bools

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

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

func (*MountSelect) BoolsX

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

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

func (*MountSelect) Float64

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

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

func (*MountSelect) Float64X

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

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

func (*MountSelect) Float64s

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

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

func (*MountSelect) Float64sX

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

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

func (*MountSelect) Int

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

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

func (*MountSelect) IntX

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

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

func (*MountSelect) Ints

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

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

func (*MountSelect) IntsX

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

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

func (*MountSelect) Scan

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

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

func (*MountSelect) ScanX

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

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

func (*MountSelect) String

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

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

func (*MountSelect) StringX

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

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

func (*MountSelect) Strings

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

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

func (*MountSelect) StringsX

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

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

type MountUpdate

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

MountUpdate is the builder for updating Mount entities.

func (*MountUpdate) AddCreatedAt

func (mu *MountUpdate) AddCreatedAt(i int64) *MountUpdate

AddCreatedAt adds i to the "created_at" field.

func (*MountUpdate) AddOwner

func (mu *MountUpdate) AddOwner(c ...*Container) *MountUpdate

AddOwner adds the "owner" edges to the Container entity.

func (*MountUpdate) AddOwnerIDs

func (mu *MountUpdate) AddOwnerIDs(ids ...int) *MountUpdate

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*MountUpdate) AddUpdatedAt

func (mu *MountUpdate) AddUpdatedAt(i int64) *MountUpdate

AddUpdatedAt adds i to the "updated_at" field.

func (*MountUpdate) ClearOwner

func (mu *MountUpdate) ClearOwner() *MountUpdate

ClearOwner clears all "owner" edges to the Container entity.

func (*MountUpdate) Exec

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

Exec executes the query.

func (*MountUpdate) ExecX

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

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

func (*MountUpdate) Mutation

func (mu *MountUpdate) Mutation() *MountMutation

Mutation returns the MountMutation object of the builder.

func (*MountUpdate) RemoveOwner

func (mu *MountUpdate) RemoveOwner(c ...*Container) *MountUpdate

RemoveOwner removes "owner" edges to Container entities.

func (*MountUpdate) RemoveOwnerIDs

func (mu *MountUpdate) RemoveOwnerIDs(ids ...int) *MountUpdate

RemoveOwnerIDs removes the "owner" edge to Container entities by IDs.

func (*MountUpdate) Save

func (mu *MountUpdate) Save(ctx context.Context) (int, error)

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

func (*MountUpdate) SaveX

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

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

func (*MountUpdate) SetBind

func (mu *MountUpdate) SetBind(s string) *MountUpdate

SetBind sets the "bind" field.

func (*MountUpdate) SetCreatedAt

func (mu *MountUpdate) SetCreatedAt(i int64) *MountUpdate

SetCreatedAt sets the "created_at" field.

func (*MountUpdate) SetHost

func (mu *MountUpdate) SetHost(s string) *MountUpdate

SetHost sets the "host" field.

func (*MountUpdate) SetIsDir

func (mu *MountUpdate) SetIsDir(b bool) *MountUpdate

SetIsDir sets the "is_dir" field.

func (*MountUpdate) SetNillableBind

func (mu *MountUpdate) SetNillableBind(s *string) *MountUpdate

SetNillableBind sets the "bind" field if the given value is not nil.

func (*MountUpdate) SetNillableCreatedAt

func (mu *MountUpdate) SetNillableCreatedAt(i *int64) *MountUpdate

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

func (*MountUpdate) SetNillableHost

func (mu *MountUpdate) SetNillableHost(s *string) *MountUpdate

SetNillableHost sets the "host" field if the given value is not nil.

func (*MountUpdate) SetNillableIsDir

func (mu *MountUpdate) SetNillableIsDir(b *bool) *MountUpdate

SetNillableIsDir sets the "is_dir" field if the given value is not nil.

func (*MountUpdate) SetUpdatedAt

func (mu *MountUpdate) SetUpdatedAt(i int64) *MountUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MountUpdate) Where

func (mu *MountUpdate) Where(ps ...predicate.Mount) *MountUpdate

Where appends a list predicates to the MountUpdate builder.

type MountUpdateOne

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

MountUpdateOne is the builder for updating a single Mount entity.

func (*MountUpdateOne) AddCreatedAt

func (muo *MountUpdateOne) AddCreatedAt(i int64) *MountUpdateOne

AddCreatedAt adds i to the "created_at" field.

func (*MountUpdateOne) AddOwner

func (muo *MountUpdateOne) AddOwner(c ...*Container) *MountUpdateOne

AddOwner adds the "owner" edges to the Container entity.

func (*MountUpdateOne) AddOwnerIDs

func (muo *MountUpdateOne) AddOwnerIDs(ids ...int) *MountUpdateOne

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*MountUpdateOne) AddUpdatedAt

func (muo *MountUpdateOne) AddUpdatedAt(i int64) *MountUpdateOne

AddUpdatedAt adds i to the "updated_at" field.

func (*MountUpdateOne) ClearOwner

func (muo *MountUpdateOne) ClearOwner() *MountUpdateOne

ClearOwner clears all "owner" edges to the Container entity.

func (*MountUpdateOne) Exec

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

Exec executes the query on the entity.

func (*MountUpdateOne) ExecX

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

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

func (*MountUpdateOne) Mutation

func (muo *MountUpdateOne) Mutation() *MountMutation

Mutation returns the MountMutation object of the builder.

func (*MountUpdateOne) RemoveOwner

func (muo *MountUpdateOne) RemoveOwner(c ...*Container) *MountUpdateOne

RemoveOwner removes "owner" edges to Container entities.

func (*MountUpdateOne) RemoveOwnerIDs

func (muo *MountUpdateOne) RemoveOwnerIDs(ids ...int) *MountUpdateOne

RemoveOwnerIDs removes the "owner" edge to Container entities by IDs.

func (*MountUpdateOne) Save

func (muo *MountUpdateOne) Save(ctx context.Context) (*Mount, error)

Save executes the query and returns the updated Mount entity.

func (*MountUpdateOne) SaveX

func (muo *MountUpdateOne) SaveX(ctx context.Context) *Mount

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

func (*MountUpdateOne) Select

func (muo *MountUpdateOne) Select(field string, fields ...string) *MountUpdateOne

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

func (*MountUpdateOne) SetBind

func (muo *MountUpdateOne) SetBind(s string) *MountUpdateOne

SetBind sets the "bind" field.

func (*MountUpdateOne) SetCreatedAt

func (muo *MountUpdateOne) SetCreatedAt(i int64) *MountUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MountUpdateOne) SetHost

func (muo *MountUpdateOne) SetHost(s string) *MountUpdateOne

SetHost sets the "host" field.

func (*MountUpdateOne) SetIsDir

func (muo *MountUpdateOne) SetIsDir(b bool) *MountUpdateOne

SetIsDir sets the "is_dir" field.

func (*MountUpdateOne) SetNillableBind

func (muo *MountUpdateOne) SetNillableBind(s *string) *MountUpdateOne

SetNillableBind sets the "bind" field if the given value is not nil.

func (*MountUpdateOne) SetNillableCreatedAt

func (muo *MountUpdateOne) SetNillableCreatedAt(i *int64) *MountUpdateOne

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

func (*MountUpdateOne) SetNillableHost

func (muo *MountUpdateOne) SetNillableHost(s *string) *MountUpdateOne

SetNillableHost sets the "host" field if the given value is not nil.

func (*MountUpdateOne) SetNillableIsDir

func (muo *MountUpdateOne) SetNillableIsDir(b *bool) *MountUpdateOne

SetNillableIsDir sets the "is_dir" field if the given value is not nil.

func (*MountUpdateOne) SetUpdatedAt

func (muo *MountUpdateOne) SetUpdatedAt(i int64) *MountUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MountUpdateOne) Where

func (muo *MountUpdateOne) Where(ps ...predicate.Mount) *MountUpdateOne

Where appends a list predicates to the MountUpdate builder.

type Mounts

type Mounts []*Mount

Mounts is a parsable slice of Mount.

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 Node

type Node struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UID holds the value of the "uid" field.
	UID string `json:"uid,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt int64 `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NodeQuery when eager-loading is set.
	Edges NodeEdges `json:"edges"`
	// contains filtered or unexported fields
}

remote node info table

func (*Node) QueryContainers

func (n *Node) QueryContainers() *ContainerQuery

QueryContainers queries the "containers" edge of the Node entity.

func (*Node) String

func (n *Node) String() string

String implements the fmt.Stringer.

func (*Node) Unwrap

func (n *Node) Unwrap() *Node

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

func (n *Node) Update() *NodeUpdateOne

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

func (*Node) Value

func (n *Node) Value(name string) (ent.Value, error)

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

type NodeClient

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

NodeClient is a client for the Node schema.

func NewNodeClient

func NewNodeClient(c config) *NodeClient

NewNodeClient returns a client for the Node from the given config.

func (*NodeClient) Create

func (c *NodeClient) Create() *NodeCreate

Create returns a builder for creating a Node entity.

func (*NodeClient) CreateBulk

func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk

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

func (*NodeClient) Delete

func (c *NodeClient) Delete() *NodeDelete

Delete returns a delete builder for Node.

func (*NodeClient) DeleteOne

func (c *NodeClient) DeleteOne(n *Node) *NodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeClient) DeleteOneID

func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne

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

func (*NodeClient) Get

func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)

Get returns a Node entity by its id.

func (*NodeClient) GetX

func (c *NodeClient) GetX(ctx context.Context, id int) *Node

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

func (*NodeClient) Hooks

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

Hooks returns the client hooks.

func (*NodeClient) Intercept

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

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

func (*NodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NodeClient) MapCreateBulk

func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk

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

func (c *NodeClient) Query() *NodeQuery

Query returns a query builder for Node.

func (*NodeClient) QueryContainers

func (c *NodeClient) QueryContainers(n *Node) *ContainerQuery

QueryContainers queries the containers edge of a Node.

func (*NodeClient) Update

func (c *NodeClient) Update() *NodeUpdate

Update returns an update builder for Node.

func (*NodeClient) UpdateOne

func (c *NodeClient) UpdateOne(n *Node) *NodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeClient) UpdateOneID

func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeClient) Use

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

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

type NodeCreate

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

NodeCreate is the builder for creating a Node entity.

func (*NodeCreate) AddContainerIDs

func (nc *NodeCreate) AddContainerIDs(ids ...int) *NodeCreate

AddContainerIDs adds the "containers" edge to the Container entity by IDs.

func (*NodeCreate) AddContainers

func (nc *NodeCreate) AddContainers(c ...*Container) *NodeCreate

AddContainers adds the "containers" edges to the Container entity.

func (*NodeCreate) Exec

func (nc *NodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreate) ExecX

func (nc *NodeCreate) ExecX(ctx context.Context)

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

func (*NodeCreate) Mutation

func (nc *NodeCreate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeCreate) Save

func (nc *NodeCreate) Save(ctx context.Context) (*Node, error)

Save creates the Node in the database.

func (*NodeCreate) SaveX

func (nc *NodeCreate) SaveX(ctx context.Context) *Node

SaveX calls Save and panics if Save returns an error.

func (*NodeCreate) SetAddress

func (nc *NodeCreate) SetAddress(s string) *NodeCreate

SetAddress sets the "address" field.

func (*NodeCreate) SetCreatedAt

func (nc *NodeCreate) SetCreatedAt(i int64) *NodeCreate

SetCreatedAt sets the "created_at" field.

func (*NodeCreate) SetName

func (nc *NodeCreate) SetName(s string) *NodeCreate

SetName sets the "name" field.

func (*NodeCreate) SetNillableCreatedAt

func (nc *NodeCreate) SetNillableCreatedAt(i *int64) *NodeCreate

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

func (*NodeCreate) SetNillableUID

func (nc *NodeCreate) SetNillableUID(s *string) *NodeCreate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*NodeCreate) SetNillableUpdatedAt

func (nc *NodeCreate) SetNillableUpdatedAt(i *int64) *NodeCreate

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

func (*NodeCreate) SetNote

func (nc *NodeCreate) SetNote(s string) *NodeCreate

SetNote sets the "note" field.

func (*NodeCreate) SetUID

func (nc *NodeCreate) SetUID(s string) *NodeCreate

SetUID sets the "uid" field.

func (*NodeCreate) SetUpdatedAt

func (nc *NodeCreate) SetUpdatedAt(i int64) *NodeCreate

SetUpdatedAt sets the "updated_at" field.

type NodeCreateBulk

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

NodeCreateBulk is the builder for creating many Node entities in bulk.

func (*NodeCreateBulk) Exec

func (ncb *NodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreateBulk) ExecX

func (ncb *NodeCreateBulk) ExecX(ctx context.Context)

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

func (*NodeCreateBulk) Save

func (ncb *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error)

Save creates the Node entities in the database.

func (*NodeCreateBulk) SaveX

func (ncb *NodeCreateBulk) SaveX(ctx context.Context) []*Node

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

type NodeDelete

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

NodeDelete is the builder for deleting a Node entity.

func (*NodeDelete) Exec

func (nd *NodeDelete) Exec(ctx context.Context) (int, error)

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

func (*NodeDelete) ExecX

func (nd *NodeDelete) ExecX(ctx context.Context) int

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

func (*NodeDelete) Where

func (nd *NodeDelete) Where(ps ...predicate.Node) *NodeDelete

Where appends a list predicates to the NodeDelete builder.

type NodeDeleteOne

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

NodeDeleteOne is the builder for deleting a single Node entity.

func (*NodeDeleteOne) Exec

func (ndo *NodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NodeDeleteOne) ExecX

func (ndo *NodeDeleteOne) ExecX(ctx context.Context)

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

func (*NodeDeleteOne) Where

func (ndo *NodeDeleteOne) Where(ps ...predicate.Node) *NodeDeleteOne

Where appends a list predicates to the NodeDelete builder.

type NodeEdges

type NodeEdges struct {
	// Containers holds the value of the containers edge.
	Containers []*Container `json:"containers,omitempty"`
	// contains filtered or unexported fields
}

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

func (NodeEdges) ContainersOrErr

func (e NodeEdges) ContainersOrErr() ([]*Container, error)

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

type NodeGroupBy

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

NodeGroupBy is the group-by builder for Node entities.

func (*NodeGroupBy) Aggregate

func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy

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

func (*NodeGroupBy) Bool

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

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

func (*NodeGroupBy) BoolX

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

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

func (*NodeGroupBy) Bools

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

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

func (*NodeGroupBy) BoolsX

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

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

func (*NodeGroupBy) Float64

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

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

func (*NodeGroupBy) Float64X

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

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

func (*NodeGroupBy) Float64s

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

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

func (*NodeGroupBy) Float64sX

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

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

func (*NodeGroupBy) Int

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

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

func (*NodeGroupBy) IntX

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

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

func (*NodeGroupBy) Ints

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

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

func (*NodeGroupBy) IntsX

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

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

func (*NodeGroupBy) Scan

func (ngb *NodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*NodeGroupBy) ScanX

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

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

func (*NodeGroupBy) String

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

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

func (*NodeGroupBy) StringX

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

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

func (*NodeGroupBy) Strings

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

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

func (*NodeGroupBy) StringsX

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

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

type NodeMutation

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

NodeMutation represents an operation that mutates the Node nodes in the graph.

func (*NodeMutation) AddContainerIDs

func (m *NodeMutation) AddContainerIDs(ids ...int)

AddContainerIDs adds the "containers" edge to the Container entity by ids.

func (*NodeMutation) AddCreatedAt

func (m *NodeMutation) AddCreatedAt(i int64)

AddCreatedAt adds i to the "created_at" field.

func (*NodeMutation) AddField

func (m *NodeMutation) 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 (*NodeMutation) AddUpdatedAt

func (m *NodeMutation) AddUpdatedAt(i int64)

AddUpdatedAt adds i to the "updated_at" field.

func (*NodeMutation) AddedCreatedAt

func (m *NodeMutation) AddedCreatedAt() (r int64, exists bool)

AddedCreatedAt returns the value that was added to the "created_at" field in this mutation.

func (*NodeMutation) AddedEdges

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

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

func (*NodeMutation) AddedField

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

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

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

func (*NodeMutation) AddedIDs

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

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

func (*NodeMutation) AddedUpdatedAt

func (m *NodeMutation) AddedUpdatedAt() (r int64, exists bool)

AddedUpdatedAt returns the value that was added to the "updated_at" field in this mutation.

func (*NodeMutation) Address

func (m *NodeMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*NodeMutation) ClearContainers

func (m *NodeMutation) ClearContainers()

ClearContainers clears the "containers" edge to the Container entity.

func (*NodeMutation) ClearEdge

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

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

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

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

func (*NodeMutation) ClearedFields

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

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

func (NodeMutation) Client

func (m NodeMutation) 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 (*NodeMutation) ContainersCleared

func (m *NodeMutation) ContainersCleared() bool

ContainersCleared reports if the "containers" edge to the Container entity was cleared.

func (*NodeMutation) ContainersIDs

func (m *NodeMutation) ContainersIDs() (ids []int)

ContainersIDs returns the "containers" edge IDs in the mutation.

func (*NodeMutation) CreatedAt

func (m *NodeMutation) CreatedAt() (r int64, exists bool)

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

func (*NodeMutation) EdgeCleared

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

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

func (*NodeMutation) Field

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

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

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

func (*NodeMutation) Fields

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

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

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

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

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

func (*NodeMutation) Note

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

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

func (*NodeMutation) OldAddress

func (m *NodeMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the Node entity. If the Node 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 (*NodeMutation) OldCreatedAt

func (m *NodeMutation) OldCreatedAt(ctx context.Context) (v int64, err error)

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

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

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

OldName returns the old "name" field's value of the Node entity. If the Node 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 (*NodeMutation) OldNote

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

OldNote returns the old "note" field's value of the Node entity. If the Node 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 (*NodeMutation) OldUID

func (m *NodeMutation) OldUID(ctx context.Context) (v string, err error)

OldUID returns the old "uid" field's value of the Node entity. If the Node 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 (*NodeMutation) OldUpdatedAt

func (m *NodeMutation) OldUpdatedAt(ctx context.Context) (v int64, err error)

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

func (m *NodeMutation) Op() Op

Op returns the operation name.

func (*NodeMutation) RemoveContainerIDs

func (m *NodeMutation) RemoveContainerIDs(ids ...int)

RemoveContainerIDs removes the "containers" edge to the Container entity by IDs.

func (*NodeMutation) RemovedContainersIDs

func (m *NodeMutation) RemovedContainersIDs() (ids []int)

RemovedContainers returns the removed IDs of the "containers" edge to the Container entity.

func (*NodeMutation) RemovedEdges

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

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

func (*NodeMutation) RemovedIDs

func (m *NodeMutation) 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 (*NodeMutation) ResetAddress

func (m *NodeMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*NodeMutation) ResetContainers

func (m *NodeMutation) ResetContainers()

ResetContainers resets all changes to the "containers" edge.

func (*NodeMutation) ResetCreatedAt

func (m *NodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NodeMutation) ResetEdge

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

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

func (m *NodeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NodeMutation) ResetNote

func (m *NodeMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*NodeMutation) ResetUID

func (m *NodeMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*NodeMutation) ResetUpdatedAt

func (m *NodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NodeMutation) SetAddress

func (m *NodeMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*NodeMutation) SetCreatedAt

func (m *NodeMutation) SetCreatedAt(i int64)

SetCreatedAt sets the "created_at" field.

func (*NodeMutation) SetField

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

func (m *NodeMutation) SetName(s string)

SetName sets the "name" field.

func (*NodeMutation) SetNote

func (m *NodeMutation) SetNote(s string)

SetNote sets the "note" field.

func (*NodeMutation) SetOp

func (m *NodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NodeMutation) SetUID

func (m *NodeMutation) SetUID(s string)

SetUID sets the "uid" field.

func (*NodeMutation) SetUpdatedAt

func (m *NodeMutation) SetUpdatedAt(i int64)

SetUpdatedAt sets the "updated_at" field.

func (NodeMutation) Tx

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

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

func (*NodeMutation) Type

func (m *NodeMutation) Type() string

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

func (*NodeMutation) UID

func (m *NodeMutation) UID() (r string, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*NodeMutation) UpdatedAt

func (m *NodeMutation) UpdatedAt() (r int64, exists bool)

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

func (*NodeMutation) Where

func (m *NodeMutation) Where(ps ...predicate.Node)

Where appends a list predicates to the NodeMutation builder.

func (*NodeMutation) WhereP

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

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

type NodeQuery

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

NodeQuery is the builder for querying Node entities.

func (*NodeQuery) Aggregate

func (nq *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate returns a NodeSelect configured with the given aggregations.

func (*NodeQuery) All

func (nq *NodeQuery) All(ctx context.Context) ([]*Node, error)

All executes the query and returns a list of Nodes.

func (*NodeQuery) AllX

func (nq *NodeQuery) AllX(ctx context.Context) []*Node

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

func (*NodeQuery) Clone

func (nq *NodeQuery) Clone() *NodeQuery

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

func (*NodeQuery) Count

func (nq *NodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NodeQuery) CountX

func (nq *NodeQuery) CountX(ctx context.Context) int

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

func (*NodeQuery) Exist

func (nq *NodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*NodeQuery) ExistX

func (nq *NodeQuery) ExistX(ctx context.Context) bool

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

func (*NodeQuery) First

func (nq *NodeQuery) First(ctx context.Context) (*Node, error)

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

func (*NodeQuery) FirstID

func (nq *NodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) FirstIDX

func (nq *NodeQuery) FirstIDX(ctx context.Context) int

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

func (*NodeQuery) FirstX

func (nq *NodeQuery) FirstX(ctx context.Context) *Node

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

func (*NodeQuery) GroupBy

func (nq *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy

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

client.Node.Query().
	GroupBy(node.FieldUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NodeQuery) IDs

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

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

func (*NodeQuery) IDsX

func (nq *NodeQuery) IDsX(ctx context.Context) []int

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

func (*NodeQuery) Limit

func (nq *NodeQuery) Limit(limit int) *NodeQuery

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

func (*NodeQuery) Offset

func (nq *NodeQuery) Offset(offset int) *NodeQuery

Offset to start from.

func (*NodeQuery) Only

func (nq *NodeQuery) Only(ctx context.Context) (*Node, error)

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

func (*NodeQuery) OnlyID

func (nq *NodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) OnlyIDX

func (nq *NodeQuery) OnlyIDX(ctx context.Context) int

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

func (*NodeQuery) OnlyX

func (nq *NodeQuery) OnlyX(ctx context.Context) *Node

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

func (*NodeQuery) Order

func (nq *NodeQuery) Order(o ...node.OrderOption) *NodeQuery

Order specifies how the records should be ordered.

func (*NodeQuery) QueryContainers

func (nq *NodeQuery) QueryContainers() *ContainerQuery

QueryContainers chains the current query on the "containers" edge.

func (*NodeQuery) Select

func (nq *NodeQuery) Select(fields ...string) *NodeSelect

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

client.Node.Query().
	Select(node.FieldUID).
	Scan(ctx, &v)

func (*NodeQuery) Unique

func (nq *NodeQuery) Unique(unique bool) *NodeQuery

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

func (nq *NodeQuery) Where(ps ...predicate.Node) *NodeQuery

Where adds a new predicate for the NodeQuery builder.

func (*NodeQuery) WithContainers

func (nq *NodeQuery) WithContainers(opts ...func(*ContainerQuery)) *NodeQuery

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

type NodeSelect

type NodeSelect struct {
	*NodeQuery
	// contains filtered or unexported fields
}

NodeSelect is the builder for selecting fields of Node entities.

func (*NodeSelect) Aggregate

func (ns *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NodeSelect) Bool

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

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

func (*NodeSelect) BoolX

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

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

func (*NodeSelect) Bools

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

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

func (*NodeSelect) BoolsX

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

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

func (*NodeSelect) Float64

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

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

func (*NodeSelect) Float64X

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

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

func (*NodeSelect) Float64s

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

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

func (*NodeSelect) Float64sX

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

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

func (*NodeSelect) Int

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

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

func (*NodeSelect) IntX

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

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

func (*NodeSelect) Ints

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

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

func (*NodeSelect) IntsX

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

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

func (*NodeSelect) Scan

func (ns *NodeSelect) Scan(ctx context.Context, v any) error

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

func (*NodeSelect) ScanX

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

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

func (*NodeSelect) String

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

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

func (*NodeSelect) StringX

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

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

func (*NodeSelect) Strings

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

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

func (*NodeSelect) StringsX

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

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

type NodeUpdate

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

NodeUpdate is the builder for updating Node entities.

func (*NodeUpdate) AddContainerIDs

func (nu *NodeUpdate) AddContainerIDs(ids ...int) *NodeUpdate

AddContainerIDs adds the "containers" edge to the Container entity by IDs.

func (*NodeUpdate) AddContainers

func (nu *NodeUpdate) AddContainers(c ...*Container) *NodeUpdate

AddContainers adds the "containers" edges to the Container entity.

func (*NodeUpdate) AddCreatedAt

func (nu *NodeUpdate) AddCreatedAt(i int64) *NodeUpdate

AddCreatedAt adds i to the "created_at" field.

func (*NodeUpdate) AddUpdatedAt

func (nu *NodeUpdate) AddUpdatedAt(i int64) *NodeUpdate

AddUpdatedAt adds i to the "updated_at" field.

func (*NodeUpdate) ClearContainers

func (nu *NodeUpdate) ClearContainers() *NodeUpdate

ClearContainers clears all "containers" edges to the Container entity.

func (*NodeUpdate) Exec

func (nu *NodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpdate) ExecX

func (nu *NodeUpdate) ExecX(ctx context.Context)

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

func (*NodeUpdate) Mutation

func (nu *NodeUpdate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdate) RemoveContainerIDs

func (nu *NodeUpdate) RemoveContainerIDs(ids ...int) *NodeUpdate

RemoveContainerIDs removes the "containers" edge to Container entities by IDs.

func (*NodeUpdate) RemoveContainers

func (nu *NodeUpdate) RemoveContainers(c ...*Container) *NodeUpdate

RemoveContainers removes "containers" edges to Container entities.

func (*NodeUpdate) Save

func (nu *NodeUpdate) Save(ctx context.Context) (int, error)

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

func (*NodeUpdate) SaveX

func (nu *NodeUpdate) SaveX(ctx context.Context) int

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

func (*NodeUpdate) SetAddress

func (nu *NodeUpdate) SetAddress(s string) *NodeUpdate

SetAddress sets the "address" field.

func (*NodeUpdate) SetCreatedAt

func (nu *NodeUpdate) SetCreatedAt(i int64) *NodeUpdate

SetCreatedAt sets the "created_at" field.

func (*NodeUpdate) SetName

func (nu *NodeUpdate) SetName(s string) *NodeUpdate

SetName sets the "name" field.

func (*NodeUpdate) SetNillableAddress

func (nu *NodeUpdate) SetNillableAddress(s *string) *NodeUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*NodeUpdate) SetNillableCreatedAt

func (nu *NodeUpdate) SetNillableCreatedAt(i *int64) *NodeUpdate

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

func (*NodeUpdate) SetNillableName

func (nu *NodeUpdate) SetNillableName(s *string) *NodeUpdate

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

func (*NodeUpdate) SetNillableNote

func (nu *NodeUpdate) SetNillableNote(s *string) *NodeUpdate

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

func (*NodeUpdate) SetNillableUID

func (nu *NodeUpdate) SetNillableUID(s *string) *NodeUpdate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*NodeUpdate) SetNote

func (nu *NodeUpdate) SetNote(s string) *NodeUpdate

SetNote sets the "note" field.

func (*NodeUpdate) SetUID

func (nu *NodeUpdate) SetUID(s string) *NodeUpdate

SetUID sets the "uid" field.

func (*NodeUpdate) SetUpdatedAt

func (nu *NodeUpdate) SetUpdatedAt(i int64) *NodeUpdate

SetUpdatedAt sets the "updated_at" field.

func (*NodeUpdate) Where

func (nu *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate

Where appends a list predicates to the NodeUpdate builder.

type NodeUpdateOne

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

NodeUpdateOne is the builder for updating a single Node entity.

func (*NodeUpdateOne) AddContainerIDs

func (nuo *NodeUpdateOne) AddContainerIDs(ids ...int) *NodeUpdateOne

AddContainerIDs adds the "containers" edge to the Container entity by IDs.

func (*NodeUpdateOne) AddContainers

func (nuo *NodeUpdateOne) AddContainers(c ...*Container) *NodeUpdateOne

AddContainers adds the "containers" edges to the Container entity.

func (*NodeUpdateOne) AddCreatedAt

func (nuo *NodeUpdateOne) AddCreatedAt(i int64) *NodeUpdateOne

AddCreatedAt adds i to the "created_at" field.

func (*NodeUpdateOne) AddUpdatedAt

func (nuo *NodeUpdateOne) AddUpdatedAt(i int64) *NodeUpdateOne

AddUpdatedAt adds i to the "updated_at" field.

func (*NodeUpdateOne) ClearContainers

func (nuo *NodeUpdateOne) ClearContainers() *NodeUpdateOne

ClearContainers clears all "containers" edges to the Container entity.

func (*NodeUpdateOne) Exec

func (nuo *NodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NodeUpdateOne) ExecX

func (nuo *NodeUpdateOne) ExecX(ctx context.Context)

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

func (*NodeUpdateOne) Mutation

func (nuo *NodeUpdateOne) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdateOne) RemoveContainerIDs

func (nuo *NodeUpdateOne) RemoveContainerIDs(ids ...int) *NodeUpdateOne

RemoveContainerIDs removes the "containers" edge to Container entities by IDs.

func (*NodeUpdateOne) RemoveContainers

func (nuo *NodeUpdateOne) RemoveContainers(c ...*Container) *NodeUpdateOne

RemoveContainers removes "containers" edges to Container entities.

func (*NodeUpdateOne) Save

func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error)

Save executes the query and returns the updated Node entity.

func (*NodeUpdateOne) SaveX

func (nuo *NodeUpdateOne) SaveX(ctx context.Context) *Node

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

func (*NodeUpdateOne) Select

func (nuo *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne

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

func (*NodeUpdateOne) SetAddress

func (nuo *NodeUpdateOne) SetAddress(s string) *NodeUpdateOne

SetAddress sets the "address" field.

func (*NodeUpdateOne) SetCreatedAt

func (nuo *NodeUpdateOne) SetCreatedAt(i int64) *NodeUpdateOne

SetCreatedAt sets the "created_at" field.

func (*NodeUpdateOne) SetName

func (nuo *NodeUpdateOne) SetName(s string) *NodeUpdateOne

SetName sets the "name" field.

func (*NodeUpdateOne) SetNillableAddress

func (nuo *NodeUpdateOne) SetNillableAddress(s *string) *NodeUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableCreatedAt

func (nuo *NodeUpdateOne) SetNillableCreatedAt(i *int64) *NodeUpdateOne

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

func (*NodeUpdateOne) SetNillableName

func (nuo *NodeUpdateOne) SetNillableName(s *string) *NodeUpdateOne

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

func (*NodeUpdateOne) SetNillableNote

func (nuo *NodeUpdateOne) SetNillableNote(s *string) *NodeUpdateOne

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

func (*NodeUpdateOne) SetNillableUID

func (nuo *NodeUpdateOne) SetNillableUID(s *string) *NodeUpdateOne

SetNillableUID sets the "uid" field if the given value is not nil.

func (*NodeUpdateOne) SetNote

func (nuo *NodeUpdateOne) SetNote(s string) *NodeUpdateOne

SetNote sets the "note" field.

func (*NodeUpdateOne) SetUID

func (nuo *NodeUpdateOne) SetUID(s string) *NodeUpdateOne

SetUID sets the "uid" field.

func (*NodeUpdateOne) SetUpdatedAt

func (nuo *NodeUpdateOne) SetUpdatedAt(i int64) *NodeUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*NodeUpdateOne) Where

func (nuo *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne

Where appends a list predicates to the NodeUpdate builder.

type Nodes

type Nodes []*Node

Nodes is a parsable slice of Node.

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Port

type Port struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Host holds the value of the "host" field.
	Host int `json:"host,omitempty"`
	// bind port in container
	Bind int `json:"bind,omitempty"`
	// network protocol
	Protocol int `json:"protocol,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt int64 `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PortQuery when eager-loading is set.
	Edges PortEdges `json:"edges"`
	// contains filtered or unexported fields
}

container ports bind info table

func (*Port) QueryOwner

func (po *Port) QueryOwner() *ContainerQuery

QueryOwner queries the "owner" edge of the Port entity.

func (*Port) String

func (po *Port) String() string

String implements the fmt.Stringer.

func (*Port) Unwrap

func (po *Port) Unwrap() *Port

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

func (po *Port) Update() *PortUpdateOne

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

func (*Port) Value

func (po *Port) Value(name string) (ent.Value, error)

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

type PortClient

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

PortClient is a client for the Port schema.

func NewPortClient

func NewPortClient(c config) *PortClient

NewPortClient returns a client for the Port from the given config.

func (*PortClient) Create

func (c *PortClient) Create() *PortCreate

Create returns a builder for creating a Port entity.

func (*PortClient) CreateBulk

func (c *PortClient) CreateBulk(builders ...*PortCreate) *PortCreateBulk

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

func (*PortClient) Delete

func (c *PortClient) Delete() *PortDelete

Delete returns a delete builder for Port.

func (*PortClient) DeleteOne

func (c *PortClient) DeleteOne(po *Port) *PortDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PortClient) DeleteOneID

func (c *PortClient) DeleteOneID(id int) *PortDeleteOne

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

func (*PortClient) Get

func (c *PortClient) Get(ctx context.Context, id int) (*Port, error)

Get returns a Port entity by its id.

func (*PortClient) GetX

func (c *PortClient) GetX(ctx context.Context, id int) *Port

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

func (*PortClient) Hooks

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

Hooks returns the client hooks.

func (*PortClient) Intercept

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

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

func (*PortClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PortClient) MapCreateBulk

func (c *PortClient) MapCreateBulk(slice any, setFunc func(*PortCreate, int)) *PortCreateBulk

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

func (c *PortClient) Query() *PortQuery

Query returns a query builder for Port.

func (*PortClient) QueryOwner

func (c *PortClient) QueryOwner(po *Port) *ContainerQuery

QueryOwner queries the owner edge of a Port.

func (*PortClient) Update

func (c *PortClient) Update() *PortUpdate

Update returns an update builder for Port.

func (*PortClient) UpdateOne

func (c *PortClient) UpdateOne(po *Port) *PortUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PortClient) UpdateOneID

func (c *PortClient) UpdateOneID(id int) *PortUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PortClient) Use

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

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

type PortCreate

type PortCreate struct {
	// contains filtered or unexported fields
}

PortCreate is the builder for creating a Port entity.

func (*PortCreate) AddOwner

func (pc *PortCreate) AddOwner(c ...*Container) *PortCreate

AddOwner adds the "owner" edges to the Container entity.

func (*PortCreate) AddOwnerIDs

func (pc *PortCreate) AddOwnerIDs(ids ...int) *PortCreate

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*PortCreate) Exec

func (pc *PortCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PortCreate) ExecX

func (pc *PortCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PortCreate) Mutation

func (pc *PortCreate) Mutation() *PortMutation

Mutation returns the PortMutation object of the builder.

func (*PortCreate) Save

func (pc *PortCreate) Save(ctx context.Context) (*Port, error)

Save creates the Port in the database.

func (*PortCreate) SaveX

func (pc *PortCreate) SaveX(ctx context.Context) *Port

SaveX calls Save and panics if Save returns an error.

func (*PortCreate) SetBind

func (pc *PortCreate) SetBind(i int) *PortCreate

SetBind sets the "bind" field.

func (*PortCreate) SetCreatedAt

func (pc *PortCreate) SetCreatedAt(i int64) *PortCreate

SetCreatedAt sets the "created_at" field.

func (*PortCreate) SetHost

func (pc *PortCreate) SetHost(i int) *PortCreate

SetHost sets the "host" field.

func (*PortCreate) SetNillableCreatedAt

func (pc *PortCreate) SetNillableCreatedAt(i *int64) *PortCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PortCreate) SetNillableUpdatedAt

func (pc *PortCreate) SetNillableUpdatedAt(i *int64) *PortCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PortCreate) SetProtocol

func (pc *PortCreate) SetProtocol(i int) *PortCreate

SetProtocol sets the "protocol" field.

func (*PortCreate) SetUpdatedAt

func (pc *PortCreate) SetUpdatedAt(i int64) *PortCreate

SetUpdatedAt sets the "updated_at" field.

type PortCreateBulk

type PortCreateBulk struct {
	// contains filtered or unexported fields
}

PortCreateBulk is the builder for creating many Port entities in bulk.

func (*PortCreateBulk) Exec

func (pcb *PortCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PortCreateBulk) ExecX

func (pcb *PortCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PortCreateBulk) Save

func (pcb *PortCreateBulk) Save(ctx context.Context) ([]*Port, error)

Save creates the Port entities in the database.

func (*PortCreateBulk) SaveX

func (pcb *PortCreateBulk) SaveX(ctx context.Context) []*Port

SaveX is like Save, but panics if an error occurs.

type PortDelete

type PortDelete struct {
	// contains filtered or unexported fields
}

PortDelete is the builder for deleting a Port entity.

func (*PortDelete) Exec

func (pd *PortDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PortDelete) ExecX

func (pd *PortDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PortDelete) Where

func (pd *PortDelete) Where(ps ...predicate.Port) *PortDelete

Where appends a list predicates to the PortDelete builder.

type PortDeleteOne

type PortDeleteOne struct {
	// contains filtered or unexported fields
}

PortDeleteOne is the builder for deleting a single Port entity.

func (*PortDeleteOne) Exec

func (pdo *PortDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PortDeleteOne) ExecX

func (pdo *PortDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PortDeleteOne) Where

func (pdo *PortDeleteOne) Where(ps ...predicate.Port) *PortDeleteOne

Where appends a list predicates to the PortDelete builder.

type PortEdges

type PortEdges struct {
	// Owner holds the value of the owner edge.
	Owner []*Container `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

PortEdges holds the relations/edges for other nodes in the graph.

func (PortEdges) OwnerOrErr

func (e PortEdges) OwnerOrErr() ([]*Container, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading.

type PortGroupBy

type PortGroupBy struct {
	// contains filtered or unexported fields
}

PortGroupBy is the group-by builder for Port entities.

func (*PortGroupBy) Aggregate

func (pgb *PortGroupBy) Aggregate(fns ...AggregateFunc) *PortGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PortGroupBy) Bool

func (s *PortGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) BoolX

func (s *PortGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PortGroupBy) Bools

func (s *PortGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) BoolsX

func (s *PortGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PortGroupBy) Float64

func (s *PortGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) Float64X

func (s *PortGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PortGroupBy) Float64s

func (s *PortGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) Float64sX

func (s *PortGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PortGroupBy) Int

func (s *PortGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) IntX

func (s *PortGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PortGroupBy) Ints

func (s *PortGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) IntsX

func (s *PortGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PortGroupBy) Scan

func (pgb *PortGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PortGroupBy) ScanX

func (s *PortGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PortGroupBy) String

func (s *PortGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) StringX

func (s *PortGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PortGroupBy) Strings

func (s *PortGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PortGroupBy) StringsX

func (s *PortGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PortMutation

type PortMutation struct {
	// contains filtered or unexported fields
}

PortMutation represents an operation that mutates the Port nodes in the graph.

func (*PortMutation) AddBind

func (m *PortMutation) AddBind(i int)

AddBind adds i to the "bind" field.

func (*PortMutation) AddCreatedAt

func (m *PortMutation) AddCreatedAt(i int64)

AddCreatedAt adds i to the "created_at" field.

func (*PortMutation) AddField

func (m *PortMutation) 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 (*PortMutation) AddHost

func (m *PortMutation) AddHost(i int)

AddHost adds i to the "host" field.

func (*PortMutation) AddOwnerIDs

func (m *PortMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the Container entity by ids.

func (*PortMutation) AddProtocol

func (m *PortMutation) AddProtocol(i int)

AddProtocol adds i to the "protocol" field.

func (*PortMutation) AddUpdatedAt

func (m *PortMutation) AddUpdatedAt(i int64)

AddUpdatedAt adds i to the "updated_at" field.

func (*PortMutation) AddedBind

func (m *PortMutation) AddedBind() (r int, exists bool)

AddedBind returns the value that was added to the "bind" field in this mutation.

func (*PortMutation) AddedCreatedAt

func (m *PortMutation) AddedCreatedAt() (r int64, exists bool)

AddedCreatedAt returns the value that was added to the "created_at" field in this mutation.

func (*PortMutation) AddedEdges

func (m *PortMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PortMutation) AddedField

func (m *PortMutation) 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 (*PortMutation) AddedFields

func (m *PortMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PortMutation) AddedHost

func (m *PortMutation) AddedHost() (r int, exists bool)

AddedHost returns the value that was added to the "host" field in this mutation.

func (*PortMutation) AddedIDs

func (m *PortMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PortMutation) AddedProtocol

func (m *PortMutation) AddedProtocol() (r int, exists bool)

AddedProtocol returns the value that was added to the "protocol" field in this mutation.

func (*PortMutation) AddedUpdatedAt

func (m *PortMutation) AddedUpdatedAt() (r int64, exists bool)

AddedUpdatedAt returns the value that was added to the "updated_at" field in this mutation.

func (*PortMutation) Bind

func (m *PortMutation) Bind() (r int, exists bool)

Bind returns the value of the "bind" field in the mutation.

func (*PortMutation) ClearEdge

func (m *PortMutation) 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 (*PortMutation) ClearField

func (m *PortMutation) 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 (*PortMutation) ClearOwner

func (m *PortMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Container entity.

func (*PortMutation) ClearedEdges

func (m *PortMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PortMutation) ClearedFields

func (m *PortMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PortMutation) Client

func (m PortMutation) 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 (*PortMutation) CreatedAt

func (m *PortMutation) CreatedAt() (r int64, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PortMutation) EdgeCleared

func (m *PortMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PortMutation) Field

func (m *PortMutation) 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 (*PortMutation) FieldCleared

func (m *PortMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PortMutation) Fields

func (m *PortMutation) 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 (*PortMutation) Host

func (m *PortMutation) Host() (r int, exists bool)

Host returns the value of the "host" field in the mutation.

func (*PortMutation) ID

func (m *PortMutation) 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 (*PortMutation) IDs

func (m *PortMutation) 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 (*PortMutation) OldBind

func (m *PortMutation) OldBind(ctx context.Context) (v int, err error)

OldBind returns the old "bind" field's value of the Port entity. If the Port 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 (*PortMutation) OldCreatedAt

func (m *PortMutation) OldCreatedAt(ctx context.Context) (v int64, err error)

OldCreatedAt returns the old "created_at" field's value of the Port entity. If the Port 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 (*PortMutation) OldField

func (m *PortMutation) 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 (*PortMutation) OldHost

func (m *PortMutation) OldHost(ctx context.Context) (v int, err error)

OldHost returns the old "host" field's value of the Port entity. If the Port 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 (*PortMutation) OldProtocol

func (m *PortMutation) OldProtocol(ctx context.Context) (v int, err error)

OldProtocol returns the old "protocol" field's value of the Port entity. If the Port 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 (*PortMutation) OldUpdatedAt

func (m *PortMutation) OldUpdatedAt(ctx context.Context) (v int64, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Port entity. If the Port 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 (*PortMutation) Op

func (m *PortMutation) Op() Op

Op returns the operation name.

func (*PortMutation) OwnerCleared

func (m *PortMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Container entity was cleared.

func (*PortMutation) OwnerIDs

func (m *PortMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*PortMutation) Protocol

func (m *PortMutation) Protocol() (r int, exists bool)

Protocol returns the value of the "protocol" field in the mutation.

func (*PortMutation) RemoveOwnerIDs

func (m *PortMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the Container entity by IDs.

func (*PortMutation) RemovedEdges

func (m *PortMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PortMutation) RemovedIDs

func (m *PortMutation) 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 (*PortMutation) RemovedOwnerIDs

func (m *PortMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the Container entity.

func (*PortMutation) ResetBind

func (m *PortMutation) ResetBind()

ResetBind resets all changes to the "bind" field.

func (*PortMutation) ResetCreatedAt

func (m *PortMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PortMutation) ResetEdge

func (m *PortMutation) 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 (*PortMutation) ResetField

func (m *PortMutation) 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 (*PortMutation) ResetHost

func (m *PortMutation) ResetHost()

ResetHost resets all changes to the "host" field.

func (*PortMutation) ResetOwner

func (m *PortMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*PortMutation) ResetProtocol

func (m *PortMutation) ResetProtocol()

ResetProtocol resets all changes to the "protocol" field.

func (*PortMutation) ResetUpdatedAt

func (m *PortMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PortMutation) SetBind

func (m *PortMutation) SetBind(i int)

SetBind sets the "bind" field.

func (*PortMutation) SetCreatedAt

func (m *PortMutation) SetCreatedAt(i int64)

SetCreatedAt sets the "created_at" field.

func (*PortMutation) SetField

func (m *PortMutation) 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 (*PortMutation) SetHost

func (m *PortMutation) SetHost(i int)

SetHost sets the "host" field.

func (*PortMutation) SetOp

func (m *PortMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PortMutation) SetProtocol

func (m *PortMutation) SetProtocol(i int)

SetProtocol sets the "protocol" field.

func (*PortMutation) SetUpdatedAt

func (m *PortMutation) SetUpdatedAt(i int64)

SetUpdatedAt sets the "updated_at" field.

func (PortMutation) Tx

func (m PortMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PortMutation) Type

func (m *PortMutation) Type() string

Type returns the node type of this mutation (Port).

func (*PortMutation) UpdatedAt

func (m *PortMutation) UpdatedAt() (r int64, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PortMutation) Where

func (m *PortMutation) Where(ps ...predicate.Port)

Where appends a list predicates to the PortMutation builder.

func (*PortMutation) WhereP

func (m *PortMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PortMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PortQuery

type PortQuery struct {
	// contains filtered or unexported fields
}

PortQuery is the builder for querying Port entities.

func (*PortQuery) Aggregate

func (pq *PortQuery) Aggregate(fns ...AggregateFunc) *PortSelect

Aggregate returns a PortSelect configured with the given aggregations.

func (*PortQuery) All

func (pq *PortQuery) All(ctx context.Context) ([]*Port, error)

All executes the query and returns a list of Ports.

func (*PortQuery) AllX

func (pq *PortQuery) AllX(ctx context.Context) []*Port

AllX is like All, but panics if an error occurs.

func (*PortQuery) Clone

func (pq *PortQuery) Clone() *PortQuery

Clone returns a duplicate of the PortQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PortQuery) Count

func (pq *PortQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PortQuery) CountX

func (pq *PortQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PortQuery) Exist

func (pq *PortQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PortQuery) ExistX

func (pq *PortQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PortQuery) First

func (pq *PortQuery) First(ctx context.Context) (*Port, error)

First returns the first Port entity from the query. Returns a *NotFoundError when no Port was found.

func (*PortQuery) FirstID

func (pq *PortQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Port ID from the query. Returns a *NotFoundError when no Port ID was found.

func (*PortQuery) FirstIDX

func (pq *PortQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PortQuery) FirstX

func (pq *PortQuery) FirstX(ctx context.Context) *Port

FirstX is like First, but panics if an error occurs.

func (*PortQuery) GroupBy

func (pq *PortQuery) GroupBy(field string, fields ...string) *PortGroupBy

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 {
	Host int `json:"host,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Port.Query().
	GroupBy(port.FieldHost).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PortQuery) IDs

func (pq *PortQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Port IDs.

func (*PortQuery) IDsX

func (pq *PortQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PortQuery) Limit

func (pq *PortQuery) Limit(limit int) *PortQuery

Limit the number of records to be returned by this query.

func (*PortQuery) Offset

func (pq *PortQuery) Offset(offset int) *PortQuery

Offset to start from.

func (*PortQuery) Only

func (pq *PortQuery) Only(ctx context.Context) (*Port, error)

Only returns a single Port entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Port entity is found. Returns a *NotFoundError when no Port entities are found.

func (*PortQuery) OnlyID

func (pq *PortQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Port ID in the query. Returns a *NotSingularError when more than one Port ID is found. Returns a *NotFoundError when no entities are found.

func (*PortQuery) OnlyIDX

func (pq *PortQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PortQuery) OnlyX

func (pq *PortQuery) OnlyX(ctx context.Context) *Port

OnlyX is like Only, but panics if an error occurs.

func (*PortQuery) Order

func (pq *PortQuery) Order(o ...port.OrderOption) *PortQuery

Order specifies how the records should be ordered.

func (*PortQuery) QueryOwner

func (pq *PortQuery) QueryOwner() *ContainerQuery

QueryOwner chains the current query on the "owner" edge.

func (*PortQuery) Select

func (pq *PortQuery) Select(fields ...string) *PortSelect

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 {
	Host int `json:"host,omitempty"`
}

client.Port.Query().
	Select(port.FieldHost).
	Scan(ctx, &v)

func (*PortQuery) Unique

func (pq *PortQuery) Unique(unique bool) *PortQuery

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 (*PortQuery) Where

func (pq *PortQuery) Where(ps ...predicate.Port) *PortQuery

Where adds a new predicate for the PortQuery builder.

func (*PortQuery) WithOwner

func (pq *PortQuery) WithOwner(opts ...func(*ContainerQuery)) *PortQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type PortSelect

type PortSelect struct {
	*PortQuery
	// contains filtered or unexported fields
}

PortSelect is the builder for selecting fields of Port entities.

func (*PortSelect) Aggregate

func (ps *PortSelect) Aggregate(fns ...AggregateFunc) *PortSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PortSelect) Bool

func (s *PortSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PortSelect) BoolX

func (s *PortSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PortSelect) Bools

func (s *PortSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PortSelect) BoolsX

func (s *PortSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PortSelect) Float64

func (s *PortSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PortSelect) Float64X

func (s *PortSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PortSelect) Float64s

func (s *PortSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PortSelect) Float64sX

func (s *PortSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PortSelect) Int

func (s *PortSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PortSelect) IntX

func (s *PortSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PortSelect) Ints

func (s *PortSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PortSelect) IntsX

func (s *PortSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PortSelect) Scan

func (ps *PortSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PortSelect) ScanX

func (s *PortSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PortSelect) String

func (s *PortSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PortSelect) StringX

func (s *PortSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PortSelect) Strings

func (s *PortSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PortSelect) StringsX

func (s *PortSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PortUpdate

type PortUpdate struct {
	// contains filtered or unexported fields
}

PortUpdate is the builder for updating Port entities.

func (*PortUpdate) AddBind

func (pu *PortUpdate) AddBind(i int) *PortUpdate

AddBind adds i to the "bind" field.

func (*PortUpdate) AddCreatedAt

func (pu *PortUpdate) AddCreatedAt(i int64) *PortUpdate

AddCreatedAt adds i to the "created_at" field.

func (*PortUpdate) AddHost

func (pu *PortUpdate) AddHost(i int) *PortUpdate

AddHost adds i to the "host" field.

func (*PortUpdate) AddOwner

func (pu *PortUpdate) AddOwner(c ...*Container) *PortUpdate

AddOwner adds the "owner" edges to the Container entity.

func (*PortUpdate) AddOwnerIDs

func (pu *PortUpdate) AddOwnerIDs(ids ...int) *PortUpdate

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*PortUpdate) AddProtocol

func (pu *PortUpdate) AddProtocol(i int) *PortUpdate

AddProtocol adds i to the "protocol" field.

func (*PortUpdate) AddUpdatedAt

func (pu *PortUpdate) AddUpdatedAt(i int64) *PortUpdate

AddUpdatedAt adds i to the "updated_at" field.

func (*PortUpdate) ClearOwner

func (pu *PortUpdate) ClearOwner() *PortUpdate

ClearOwner clears all "owner" edges to the Container entity.

func (*PortUpdate) Exec

func (pu *PortUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PortUpdate) ExecX

func (pu *PortUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PortUpdate) Mutation

func (pu *PortUpdate) Mutation() *PortMutation

Mutation returns the PortMutation object of the builder.

func (*PortUpdate) RemoveOwner

func (pu *PortUpdate) RemoveOwner(c ...*Container) *PortUpdate

RemoveOwner removes "owner" edges to Container entities.

func (*PortUpdate) RemoveOwnerIDs

func (pu *PortUpdate) RemoveOwnerIDs(ids ...int) *PortUpdate

RemoveOwnerIDs removes the "owner" edge to Container entities by IDs.

func (*PortUpdate) Save

func (pu *PortUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PortUpdate) SaveX

func (pu *PortUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PortUpdate) SetBind

func (pu *PortUpdate) SetBind(i int) *PortUpdate

SetBind sets the "bind" field.

func (*PortUpdate) SetCreatedAt

func (pu *PortUpdate) SetCreatedAt(i int64) *PortUpdate

SetCreatedAt sets the "created_at" field.

func (*PortUpdate) SetHost

func (pu *PortUpdate) SetHost(i int) *PortUpdate

SetHost sets the "host" field.

func (*PortUpdate) SetNillableBind

func (pu *PortUpdate) SetNillableBind(i *int) *PortUpdate

SetNillableBind sets the "bind" field if the given value is not nil.

func (*PortUpdate) SetNillableCreatedAt

func (pu *PortUpdate) SetNillableCreatedAt(i *int64) *PortUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PortUpdate) SetNillableHost

func (pu *PortUpdate) SetNillableHost(i *int) *PortUpdate

SetNillableHost sets the "host" field if the given value is not nil.

func (*PortUpdate) SetNillableProtocol

func (pu *PortUpdate) SetNillableProtocol(i *int) *PortUpdate

SetNillableProtocol sets the "protocol" field if the given value is not nil.

func (*PortUpdate) SetProtocol

func (pu *PortUpdate) SetProtocol(i int) *PortUpdate

SetProtocol sets the "protocol" field.

func (*PortUpdate) SetUpdatedAt

func (pu *PortUpdate) SetUpdatedAt(i int64) *PortUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PortUpdate) Where

func (pu *PortUpdate) Where(ps ...predicate.Port) *PortUpdate

Where appends a list predicates to the PortUpdate builder.

type PortUpdateOne

type PortUpdateOne struct {
	// contains filtered or unexported fields
}

PortUpdateOne is the builder for updating a single Port entity.

func (*PortUpdateOne) AddBind

func (puo *PortUpdateOne) AddBind(i int) *PortUpdateOne

AddBind adds i to the "bind" field.

func (*PortUpdateOne) AddCreatedAt

func (puo *PortUpdateOne) AddCreatedAt(i int64) *PortUpdateOne

AddCreatedAt adds i to the "created_at" field.

func (*PortUpdateOne) AddHost

func (puo *PortUpdateOne) AddHost(i int) *PortUpdateOne

AddHost adds i to the "host" field.

func (*PortUpdateOne) AddOwner

func (puo *PortUpdateOne) AddOwner(c ...*Container) *PortUpdateOne

AddOwner adds the "owner" edges to the Container entity.

func (*PortUpdateOne) AddOwnerIDs

func (puo *PortUpdateOne) AddOwnerIDs(ids ...int) *PortUpdateOne

AddOwnerIDs adds the "owner" edge to the Container entity by IDs.

func (*PortUpdateOne) AddProtocol

func (puo *PortUpdateOne) AddProtocol(i int) *PortUpdateOne

AddProtocol adds i to the "protocol" field.

func (*PortUpdateOne) AddUpdatedAt

func (puo *PortUpdateOne) AddUpdatedAt(i int64) *PortUpdateOne

AddUpdatedAt adds i to the "updated_at" field.

func (*PortUpdateOne) ClearOwner

func (puo *PortUpdateOne) ClearOwner() *PortUpdateOne

ClearOwner clears all "owner" edges to the Container entity.

func (*PortUpdateOne) Exec

func (puo *PortUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PortUpdateOne) ExecX

func (puo *PortUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PortUpdateOne) Mutation

func (puo *PortUpdateOne) Mutation() *PortMutation

Mutation returns the PortMutation object of the builder.

func (*PortUpdateOne) RemoveOwner

func (puo *PortUpdateOne) RemoveOwner(c ...*Container) *PortUpdateOne

RemoveOwner removes "owner" edges to Container entities.

func (*PortUpdateOne) RemoveOwnerIDs

func (puo *PortUpdateOne) RemoveOwnerIDs(ids ...int) *PortUpdateOne

RemoveOwnerIDs removes the "owner" edge to Container entities by IDs.

func (*PortUpdateOne) Save

func (puo *PortUpdateOne) Save(ctx context.Context) (*Port, error)

Save executes the query and returns the updated Port entity.

func (*PortUpdateOne) SaveX

func (puo *PortUpdateOne) SaveX(ctx context.Context) *Port

SaveX is like Save, but panics if an error occurs.

func (*PortUpdateOne) Select

func (puo *PortUpdateOne) Select(field string, fields ...string) *PortUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PortUpdateOne) SetBind

func (puo *PortUpdateOne) SetBind(i int) *PortUpdateOne

SetBind sets the "bind" field.

func (*PortUpdateOne) SetCreatedAt

func (puo *PortUpdateOne) SetCreatedAt(i int64) *PortUpdateOne

SetCreatedAt sets the "created_at" field.

func (*PortUpdateOne) SetHost

func (puo *PortUpdateOne) SetHost(i int) *PortUpdateOne

SetHost sets the "host" field.

func (*PortUpdateOne) SetNillableBind

func (puo *PortUpdateOne) SetNillableBind(i *int) *PortUpdateOne

SetNillableBind sets the "bind" field if the given value is not nil.

func (*PortUpdateOne) SetNillableCreatedAt

func (puo *PortUpdateOne) SetNillableCreatedAt(i *int64) *PortUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PortUpdateOne) SetNillableHost

func (puo *PortUpdateOne) SetNillableHost(i *int) *PortUpdateOne

SetNillableHost sets the "host" field if the given value is not nil.

func (*PortUpdateOne) SetNillableProtocol

func (puo *PortUpdateOne) SetNillableProtocol(i *int) *PortUpdateOne

SetNillableProtocol sets the "protocol" field if the given value is not nil.

func (*PortUpdateOne) SetProtocol

func (puo *PortUpdateOne) SetProtocol(i int) *PortUpdateOne

SetProtocol sets the "protocol" field.

func (*PortUpdateOne) SetUpdatedAt

func (puo *PortUpdateOne) SetUpdatedAt(i int64) *PortUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PortUpdateOne) Where

func (puo *PortUpdateOne) Where(ps ...predicate.Port) *PortUpdateOne

Where appends a list predicates to the PortUpdate builder.

type Ports

type Ports []*Port

Ports is a parsable slice of Port.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Container is the client for interacting with the Container builders.
	Container *ContainerClient
	// Job is the client for interacting with the Job builders.
	Job *JobClient
	// Mount is the client for interacting with the Mount builders.
	Mount *MountClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// Port is the client for interacting with the Port builders.
	Port *PortClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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 User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UID holds the value of the "uid" field.
	UID string `json:"uid,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt int64 `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

user info table

func (*User) QueryContainers

func (u *User) QueryContainers() *ContainerQuery

QueryContainers queries the "containers" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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 (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryContainers

func (c *UserClient) QueryContainers(u *User) *ContainerQuery

QueryContainers queries the containers edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddContainerIDs

func (uc *UserCreate) AddContainerIDs(ids ...int) *UserCreate

AddContainerIDs adds the "containers" edge to the Container entity by IDs.

func (*UserCreate) AddContainers

func (uc *UserCreate) AddContainers(c ...*Container) *UserCreate

AddContainers adds the "containers" edges to the Container entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(i int64) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(i *int64) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableUID

func (uc *UserCreate) SetNillableUID(s *string) *UserCreate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(i *int64) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetUID

func (uc *UserCreate) SetUID(s string) *UserCreate

SetUID sets the "uid" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(i int64) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Containers holds the value of the containers edge.
	Containers []*Container `json:"containers,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) ContainersOrErr

func (e UserEdges) ContainersOrErr() ([]*Container, error)

ContainersOrErr returns the Containers value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddContainerIDs

func (m *UserMutation) AddContainerIDs(ids ...int)

AddContainerIDs adds the "containers" edge to the Container entity by ids.

func (*UserMutation) AddCreatedAt

func (m *UserMutation) AddCreatedAt(i int64)

AddCreatedAt adds i to the "created_at" field.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddUpdatedAt

func (m *UserMutation) AddUpdatedAt(i int64)

AddUpdatedAt adds i to the "updated_at" field.

func (*UserMutation) AddedCreatedAt

func (m *UserMutation) AddedCreatedAt() (r int64, exists bool)

AddedCreatedAt returns the value that was added to the "created_at" field in this mutation.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AddedUpdatedAt

func (m *UserMutation) AddedUpdatedAt() (r int64, exists bool)

AddedUpdatedAt returns the value that was added to the "updated_at" field in this mutation.

func (*UserMutation) ClearContainers

func (m *UserMutation) ClearContainers()

ClearContainers clears the "containers" edge to the Container entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) ContainersCleared

func (m *UserMutation) ContainersCleared() bool

ContainersCleared reports if the "containers" edge to the Container entity was cleared.

func (*UserMutation) ContainersIDs

func (m *UserMutation) ContainersIDs() (ids []int)

ContainersIDs returns the "containers" edge IDs in the mutation.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r int64, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) ID

func (m *UserMutation) 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 (*UserMutation) IDs

func (m *UserMutation) 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 (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v int64, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User 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 (*UserMutation) OldUID

func (m *UserMutation) OldUID(ctx context.Context) (v string, err error)

OldUID returns the old "uid" field's value of the User entity. If the User 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 (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v int64, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User 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 (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RemoveContainerIDs

func (m *UserMutation) RemoveContainerIDs(ids ...int)

RemoveContainerIDs removes the "containers" edge to the Container entity by IDs.

func (*UserMutation) RemovedContainersIDs

func (m *UserMutation) RemovedContainersIDs() (ids []int)

RemovedContainers returns the removed IDs of the "containers" edge to the Container entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) ResetContainers

func (m *UserMutation) ResetContainers()

ResetContainers resets all changes to the "containers" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetUID

func (m *UserMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(i int64)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetUID

func (m *UserMutation) SetUID(s string)

SetUID sets the "uid" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(i int64)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UID

func (m *UserMutation) UID() (r string, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r int64, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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 {
	UID string `json:"uid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryContainers

func (uq *UserQuery) QueryContainers() *ContainerQuery

QueryContainers chains the current query on the "containers" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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 {
	UID string `json:"uid,omitempty"`
}

client.User.Query().
	Select(user.FieldUID).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithContainers

func (uq *UserQuery) WithContainers(opts ...func(*ContainerQuery)) *UserQuery

WithContainers tells the query-builder to eager-load the nodes that are connected to the "containers" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddContainerIDs

func (uu *UserUpdate) AddContainerIDs(ids ...int) *UserUpdate

AddContainerIDs adds the "containers" edge to the Container entity by IDs.

func (*UserUpdate) AddContainers

func (uu *UserUpdate) AddContainers(c ...*Container) *UserUpdate

AddContainers adds the "containers" edges to the Container entity.

func (*UserUpdate) AddCreatedAt

func (uu *UserUpdate) AddCreatedAt(i int64) *UserUpdate

AddCreatedAt adds i to the "created_at" field.

func (*UserUpdate) AddUpdatedAt

func (uu *UserUpdate) AddUpdatedAt(i int64) *UserUpdate

AddUpdatedAt adds i to the "updated_at" field.

func (*UserUpdate) ClearContainers

func (uu *UserUpdate) ClearContainers() *UserUpdate

ClearContainers clears all "containers" edges to the Container entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveContainerIDs

func (uu *UserUpdate) RemoveContainerIDs(ids ...int) *UserUpdate

RemoveContainerIDs removes the "containers" edge to Container entities by IDs.

func (*UserUpdate) RemoveContainers

func (uu *UserUpdate) RemoveContainers(c ...*Container) *UserUpdate

RemoveContainers removes "containers" edges to Container entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetCreatedAt

func (uu *UserUpdate) SetCreatedAt(i int64) *UserUpdate

SetCreatedAt sets the "created_at" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNillableCreatedAt

func (uu *UserUpdate) SetNillableCreatedAt(i *int64) *UserUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableUID

func (uu *UserUpdate) SetNillableUID(s *string) *UserUpdate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUID

func (uu *UserUpdate) SetUID(s string) *UserUpdate

SetUID sets the "uid" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(i int64) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddContainerIDs

func (uuo *UserUpdateOne) AddContainerIDs(ids ...int) *UserUpdateOne

AddContainerIDs adds the "containers" edge to the Container entity by IDs.

func (*UserUpdateOne) AddContainers

func (uuo *UserUpdateOne) AddContainers(c ...*Container) *UserUpdateOne

AddContainers adds the "containers" edges to the Container entity.

func (*UserUpdateOne) AddCreatedAt

func (uuo *UserUpdateOne) AddCreatedAt(i int64) *UserUpdateOne

AddCreatedAt adds i to the "created_at" field.

func (*UserUpdateOne) AddUpdatedAt

func (uuo *UserUpdateOne) AddUpdatedAt(i int64) *UserUpdateOne

AddUpdatedAt adds i to the "updated_at" field.

func (*UserUpdateOne) ClearContainers

func (uuo *UserUpdateOne) ClearContainers() *UserUpdateOne

ClearContainers clears all "containers" edges to the Container entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveContainerIDs

func (uuo *UserUpdateOne) RemoveContainerIDs(ids ...int) *UserUpdateOne

RemoveContainerIDs removes the "containers" edge to Container entities by IDs.

func (*UserUpdateOne) RemoveContainers

func (uuo *UserUpdateOne) RemoveContainers(c ...*Container) *UserUpdateOne

RemoveContainers removes "containers" edges to Container entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetCreatedAt

func (uuo *UserUpdateOne) SetCreatedAt(i int64) *UserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNillableCreatedAt

func (uuo *UserUpdateOne) SetNillableCreatedAt(i *int64) *UserUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUID

func (uuo *UserUpdateOne) SetNillableUID(s *string) *UserUpdateOne

SetNillableUID sets the "uid" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUID

func (uuo *UserUpdateOne) SetUID(s string) *UserUpdateOne

SetUID sets the "uid" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(i int64) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL