ent

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeAgent                 = "Agent"
	TypeComputeImage          = "ComputeImage"
	TypeComputeInstance       = "ComputeInstance"
	TypeComputeSpec           = "ComputeSpec"
	TypeEmployee              = "Employee"
	TypeScript                = "Script"
	TypeScriptExecutionRecord = "ScriptExecutionRecord"
	TypeStorage               = "Storage"
	TypeUser                  = "User"
)

Variables

This section is empty.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Agent

type Agent struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// PeerID holds the value of the "peer_id" field.
	PeerID string `json:"peer_id,omitempty"`
	// 是否活动
	Active bool `json:"active,omitempty"`
	// 最后更新时间
	LastUpdateTime time.Time `json:"last_update_time,omitempty"`
	// contains filtered or unexported fields
}

Agent is the model entity for the Agent schema.

func (*Agent) String

func (a *Agent) String() string

String implements the fmt.Stringer.

func (*Agent) Unwrap

func (a *Agent) Unwrap() *Agent

Unwrap unwraps the Agent entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Agent) Update

func (a *Agent) Update() *AgentUpdateOne

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

func (*Agent) Value

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

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

type AgentClient

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

AgentClient is a client for the Agent schema.

func NewAgentClient

func NewAgentClient(c config) *AgentClient

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

func (*AgentClient) Create

func (c *AgentClient) Create() *AgentCreate

Create returns a builder for creating a Agent entity.

func (*AgentClient) CreateBulk

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

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

func (*AgentClient) Delete

func (c *AgentClient) Delete() *AgentDelete

Delete returns a delete builder for Agent.

func (*AgentClient) DeleteOne

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

DeleteOne returns a builder for deleting the given entity.

func (*AgentClient) DeleteOneID

func (c *AgentClient) DeleteOneID(id uuid.UUID) *AgentDeleteOne

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

func (*AgentClient) Get

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

Get returns a Agent entity by its id.

func (*AgentClient) GetX

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

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

func (*AgentClient) Hooks

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

Hooks returns the client hooks.

func (*AgentClient) Intercept

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

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

func (*AgentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AgentClient) Query

func (c *AgentClient) Query() *AgentQuery

Query returns a query builder for Agent.

func (*AgentClient) Update

func (c *AgentClient) Update() *AgentUpdate

Update returns an update builder for Agent.

func (*AgentClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*AgentClient) UpdateOneID

func (c *AgentClient) UpdateOneID(id uuid.UUID) *AgentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AgentClient) Use

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

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

type AgentCreate

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

AgentCreate is the builder for creating a Agent entity.

func (*AgentCreate) Exec

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

Exec executes the query.

func (*AgentCreate) ExecX

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

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

func (*AgentCreate) Mutation

func (ac *AgentCreate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentCreate) Save

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

Save creates the Agent in the database.

func (*AgentCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*AgentCreate) SetActive added in v0.0.2

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

SetActive sets the "active" field.

func (*AgentCreate) SetID

func (ac *AgentCreate) SetID(u uuid.UUID) *AgentCreate

SetID sets the "id" field.

func (*AgentCreate) SetLastUpdateTime added in v0.0.2

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

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentCreate) SetNillableActive added in v0.0.2

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

SetNillableActive sets the "active" field if the given value is not nil.

func (*AgentCreate) SetNillableID

func (ac *AgentCreate) SetNillableID(u *uuid.UUID) *AgentCreate

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

func (*AgentCreate) SetNillableLastUpdateTime added in v0.0.2

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

SetNillableLastUpdateTime sets the "last_update_time" field if the given value is not nil.

func (*AgentCreate) SetPeerID added in v0.0.2

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

SetPeerID sets the "peer_id" field.

type AgentCreateBulk

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

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

func (*AgentCreateBulk) Exec

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

Exec executes the query.

func (*AgentCreateBulk) ExecX

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

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

func (*AgentCreateBulk) Save

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

Save creates the Agent entities in the database.

func (*AgentCreateBulk) SaveX

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

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

type AgentDelete

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

AgentDelete is the builder for deleting a Agent entity.

func (*AgentDelete) Exec

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

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

func (*AgentDelete) ExecX

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

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

func (*AgentDelete) Where

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

Where appends a list predicates to the AgentDelete builder.

type AgentDeleteOne

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

AgentDeleteOne is the builder for deleting a single Agent entity.

func (*AgentDeleteOne) Exec

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

Exec executes the deletion query.

func (*AgentDeleteOne) ExecX

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

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

func (*AgentDeleteOne) Where

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

Where appends a list predicates to the AgentDelete builder.

type AgentGroupBy

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

AgentGroupBy is the group-by builder for Agent entities.

func (*AgentGroupBy) Aggregate

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

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

func (*AgentGroupBy) Bool

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

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

func (*AgentGroupBy) BoolX

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

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

func (*AgentGroupBy) Bools

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

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

func (*AgentGroupBy) BoolsX

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

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

func (*AgentGroupBy) Float64

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

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

func (*AgentGroupBy) Float64X

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

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

func (*AgentGroupBy) Float64s

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

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

func (*AgentGroupBy) Float64sX

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

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

func (*AgentGroupBy) Int

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

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

func (*AgentGroupBy) IntX

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

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

func (*AgentGroupBy) Ints

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

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

func (*AgentGroupBy) IntsX

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

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

func (*AgentGroupBy) Scan

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

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

func (*AgentGroupBy) ScanX

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

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

func (*AgentGroupBy) String

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

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

func (*AgentGroupBy) StringX

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

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

func (*AgentGroupBy) Strings

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

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

func (*AgentGroupBy) StringsX

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

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

type AgentMutation

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

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

func (*AgentMutation) Active added in v0.0.2

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

Active returns the value of the "active" field in the mutation.

func (*AgentMutation) AddField

func (m *AgentMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AgentMutation) AddedEdges

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

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

func (*AgentMutation) AddedField

func (m *AgentMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AgentMutation) AddedFields

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

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

func (*AgentMutation) AddedIDs

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

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

func (*AgentMutation) ClearEdge

func (m *AgentMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*AgentMutation) ClearField

func (m *AgentMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*AgentMutation) ClearedEdges

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

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

func (*AgentMutation) ClearedFields

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

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

func (AgentMutation) Client

func (m AgentMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*AgentMutation) EdgeCleared

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

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

func (*AgentMutation) Field

func (m *AgentMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AgentMutation) FieldCleared

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

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

func (*AgentMutation) Fields

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

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*AgentMutation) ID

func (m *AgentMutation) ID() (id uuid.UUID, exists bool)

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

func (*AgentMutation) IDs

func (m *AgentMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*AgentMutation) LastUpdateTime added in v0.0.2

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

LastUpdateTime returns the value of the "last_update_time" field in the mutation.

func (*AgentMutation) OldActive added in v0.0.2

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

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

func (*AgentMutation) OldField

func (m *AgentMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*AgentMutation) OldLastUpdateTime added in v0.0.2

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

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

func (*AgentMutation) OldPeerID added in v0.0.2

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

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

func (*AgentMutation) Op

func (m *AgentMutation) Op() Op

Op returns the operation name.

func (*AgentMutation) PeerID added in v0.0.2

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

PeerID returns the value of the "peer_id" field in the mutation.

func (*AgentMutation) RemovedEdges

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

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

func (*AgentMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*AgentMutation) ResetActive added in v0.0.2

func (m *AgentMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*AgentMutation) ResetEdge

func (m *AgentMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*AgentMutation) ResetField

func (m *AgentMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*AgentMutation) ResetLastUpdateTime added in v0.0.2

func (m *AgentMutation) ResetLastUpdateTime()

ResetLastUpdateTime resets all changes to the "last_update_time" field.

func (*AgentMutation) ResetPeerID added in v0.0.2

func (m *AgentMutation) ResetPeerID()

ResetPeerID resets all changes to the "peer_id" field.

func (*AgentMutation) SetActive added in v0.0.2

func (m *AgentMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*AgentMutation) SetField

func (m *AgentMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AgentMutation) SetID

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

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

func (*AgentMutation) SetLastUpdateTime added in v0.0.2

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

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentMutation) SetOp

func (m *AgentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentMutation) SetPeerID added in v0.0.2

func (m *AgentMutation) SetPeerID(s string)

SetPeerID sets the "peer_id" field.

func (AgentMutation) Tx

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

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

func (*AgentMutation) Type

func (m *AgentMutation) Type() string

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

func (*AgentMutation) Where

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

Where appends a list predicates to the AgentMutation builder.

func (*AgentMutation) WhereP

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

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

type AgentQuery

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

AgentQuery is the builder for querying Agent entities.

func (*AgentQuery) Aggregate

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

Aggregate returns a AgentSelect configured with the given aggregations.

func (*AgentQuery) All

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

All executes the query and returns a list of Agents.

func (*AgentQuery) AllX

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

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

func (*AgentQuery) Clone

func (aq *AgentQuery) Clone() *AgentQuery

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

func (*AgentQuery) Count

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

Count returns the count of the given query.

func (*AgentQuery) CountX

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

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

func (*AgentQuery) Exist

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

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

func (*AgentQuery) ExistX

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

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

func (*AgentQuery) First

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

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

func (*AgentQuery) FirstID

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

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

func (*AgentQuery) FirstIDX

func (aq *AgentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AgentQuery) FirstX

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

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

func (*AgentQuery) GroupBy

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

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

Example:

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

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

func (*AgentQuery) IDs

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

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

func (*AgentQuery) IDsX

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

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

func (*AgentQuery) Limit

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

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

func (*AgentQuery) Offset

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

Offset to start from.

func (*AgentQuery) Only

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

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

func (*AgentQuery) OnlyID

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

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

func (*AgentQuery) OnlyIDX

func (aq *AgentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AgentQuery) OnlyX

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

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

func (*AgentQuery) Order

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

Order specifies how the records should be ordered.

func (*AgentQuery) Select

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

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

Example:

var v []struct {
	PeerID string `json:"peer_id,omitempty"`
}

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

func (*AgentQuery) Unique

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

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*AgentQuery) Where

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

Where adds a new predicate for the AgentQuery builder.

type AgentSelect

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

AgentSelect is the builder for selecting fields of Agent entities.

func (*AgentSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AgentSelect) Bool

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

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

func (*AgentSelect) BoolX

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

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

func (*AgentSelect) Bools

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

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

func (*AgentSelect) BoolsX

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

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

func (*AgentSelect) Float64

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

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

func (*AgentSelect) Float64X

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

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

func (*AgentSelect) Float64s

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

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

func (*AgentSelect) Float64sX

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

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

func (*AgentSelect) Int

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

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

func (*AgentSelect) IntX

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

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

func (*AgentSelect) Ints

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

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

func (*AgentSelect) IntsX

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

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

func (*AgentSelect) Scan

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

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

func (*AgentSelect) ScanX

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

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

func (*AgentSelect) String

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

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

func (*AgentSelect) StringX

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

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

func (*AgentSelect) Strings

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

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

func (*AgentSelect) StringsX

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

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

type AgentUpdate

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

AgentUpdate is the builder for updating Agent entities.

func (*AgentUpdate) Exec

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

Exec executes the query.

func (*AgentUpdate) ExecX

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

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

func (*AgentUpdate) Mutation

func (au *AgentUpdate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdate) Save

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

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

func (*AgentUpdate) SaveX

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

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

func (*AgentUpdate) SetActive added in v0.0.2

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

SetActive sets the "active" field.

func (*AgentUpdate) SetLastUpdateTime added in v0.0.2

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

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentUpdate) SetNillableActive added in v0.0.2

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

SetNillableActive sets the "active" field if the given value is not nil.

func (*AgentUpdate) SetPeerID added in v0.0.2

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

SetPeerID sets the "peer_id" field.

func (*AgentUpdate) Where

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

Where appends a list predicates to the AgentUpdate builder.

type AgentUpdateOne

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

AgentUpdateOne is the builder for updating a single Agent entity.

func (*AgentUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AgentUpdateOne) ExecX

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

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

func (*AgentUpdateOne) Mutation

func (auo *AgentUpdateOne) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdateOne) Save

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

Save executes the query and returns the updated Agent entity.

func (*AgentUpdateOne) SaveX

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

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

func (*AgentUpdateOne) Select

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

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

func (*AgentUpdateOne) SetActive added in v0.0.2

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

SetActive sets the "active" field.

func (*AgentUpdateOne) SetLastUpdateTime added in v0.0.2

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

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentUpdateOne) SetNillableActive added in v0.0.2

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

SetNillableActive sets the "active" field if the given value is not nil.

func (*AgentUpdateOne) SetPeerID added in v0.0.2

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

SetPeerID sets the "peer_id" field.

func (*AgentUpdateOne) Where

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

Where appends a list predicates to the AgentUpdate builder.

type Agents

type Agents []*Agent

Agents is a parsable slice of Agent.

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// ComputeImage is the client for interacting with the ComputeImage builders.
	ComputeImage *ComputeImageClient
	// ComputeInstance is the client for interacting with the ComputeInstance builders.
	ComputeInstance *ComputeInstanceClient
	// ComputeSpec is the client for interacting with the ComputeSpec builders.
	ComputeSpec *ComputeSpecClient
	// Employee is the client for interacting with the Employee builders.
	Employee *EmployeeClient
	// Script is the client for interacting with the Script builders.
	Script *ScriptClient
	// ScriptExecutionRecord is the client for interacting with the ScriptExecutionRecord builders.
	ScriptExecutionRecord *ScriptExecutionRecordClient
	// Storage is the client for interacting with the Storage builders.
	Storage *StorageClient
	// 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().
	Agent.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ComputeImage

type ComputeImage struct {

	// ID of the ent.
	ID int32 `json:"id,omitempty"`
	// 显示名
	Name string `json:"name,omitempty"`
	// 镜像名
	Image string `json:"image,omitempty"`
	// 版本名
	Tag string `json:"tag,omitempty"`
	// 端口号
	Port int32 `json:"port,omitempty"`
	// 容器命令
	Command string `json:"command,omitempty"`
	// contains filtered or unexported fields
}

ComputeImage is the model entity for the ComputeImage schema.

func (*ComputeImage) String

func (ci *ComputeImage) String() string

String implements the fmt.Stringer.

func (*ComputeImage) Unwrap

func (ci *ComputeImage) Unwrap() *ComputeImage

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

func (ci *ComputeImage) Update() *ComputeImageUpdateOne

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

func (*ComputeImage) Value

func (ci *ComputeImage) Value(name string) (ent.Value, error)

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

type ComputeImageClient

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

ComputeImageClient is a client for the ComputeImage schema.

func NewComputeImageClient

func NewComputeImageClient(c config) *ComputeImageClient

NewComputeImageClient returns a client for the ComputeImage from the given config.

func (*ComputeImageClient) Create

Create returns a builder for creating a ComputeImage entity.

func (*ComputeImageClient) CreateBulk

func (c *ComputeImageClient) CreateBulk(builders ...*ComputeImageCreate) *ComputeImageCreateBulk

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

func (*ComputeImageClient) Delete

Delete returns a delete builder for ComputeImage.

func (*ComputeImageClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ComputeImageClient) DeleteOneID

func (c *ComputeImageClient) DeleteOneID(id int32) *ComputeImageDeleteOne

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

func (*ComputeImageClient) Get

Get returns a ComputeImage entity by its id.

func (*ComputeImageClient) GetX

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

func (*ComputeImageClient) Hooks

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

Hooks returns the client hooks.

func (*ComputeImageClient) Intercept

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

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

func (*ComputeImageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ComputeImageClient) Query

Query returns a query builder for ComputeImage.

func (*ComputeImageClient) Update

Update returns an update builder for ComputeImage.

func (*ComputeImageClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ComputeImageClient) UpdateOneID

func (c *ComputeImageClient) UpdateOneID(id int32) *ComputeImageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ComputeImageClient) Use

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

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

type ComputeImageCreate

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

ComputeImageCreate is the builder for creating a ComputeImage entity.

func (*ComputeImageCreate) Exec

func (cic *ComputeImageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeImageCreate) ExecX

func (cic *ComputeImageCreate) ExecX(ctx context.Context)

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

func (*ComputeImageCreate) Mutation

func (cic *ComputeImageCreate) Mutation() *ComputeImageMutation

Mutation returns the ComputeImageMutation object of the builder.

func (*ComputeImageCreate) Save

Save creates the ComputeImage in the database.

func (*ComputeImageCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ComputeImageCreate) SetCommand added in v0.0.3

func (cic *ComputeImageCreate) SetCommand(s string) *ComputeImageCreate

SetCommand sets the "command" field.

func (*ComputeImageCreate) SetID

SetID sets the "id" field.

func (*ComputeImageCreate) SetImage

func (cic *ComputeImageCreate) SetImage(s string) *ComputeImageCreate

SetImage sets the "image" field.

func (*ComputeImageCreate) SetName

func (cic *ComputeImageCreate) SetName(s string) *ComputeImageCreate

SetName sets the "name" field.

func (*ComputeImageCreate) SetPort

func (cic *ComputeImageCreate) SetPort(i int32) *ComputeImageCreate

SetPort sets the "port" field.

func (*ComputeImageCreate) SetTag

SetTag sets the "tag" field.

type ComputeImageCreateBulk

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

ComputeImageCreateBulk is the builder for creating many ComputeImage entities in bulk.

func (*ComputeImageCreateBulk) Exec

func (cicb *ComputeImageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeImageCreateBulk) ExecX

func (cicb *ComputeImageCreateBulk) ExecX(ctx context.Context)

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

func (*ComputeImageCreateBulk) Save

Save creates the ComputeImage entities in the database.

func (*ComputeImageCreateBulk) SaveX

func (cicb *ComputeImageCreateBulk) SaveX(ctx context.Context) []*ComputeImage

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

type ComputeImageDelete

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

ComputeImageDelete is the builder for deleting a ComputeImage entity.

func (*ComputeImageDelete) Exec

func (cid *ComputeImageDelete) Exec(ctx context.Context) (int, error)

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

func (*ComputeImageDelete) ExecX

func (cid *ComputeImageDelete) ExecX(ctx context.Context) int

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

func (*ComputeImageDelete) Where

Where appends a list predicates to the ComputeImageDelete builder.

type ComputeImageDeleteOne

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

ComputeImageDeleteOne is the builder for deleting a single ComputeImage entity.

func (*ComputeImageDeleteOne) Exec

func (cido *ComputeImageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ComputeImageDeleteOne) ExecX

func (cido *ComputeImageDeleteOne) ExecX(ctx context.Context)

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

func (*ComputeImageDeleteOne) Where

Where appends a list predicates to the ComputeImageDelete builder.

type ComputeImageGroupBy

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

ComputeImageGroupBy is the group-by builder for ComputeImage entities.

func (*ComputeImageGroupBy) Aggregate

func (cigb *ComputeImageGroupBy) Aggregate(fns ...AggregateFunc) *ComputeImageGroupBy

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

func (*ComputeImageGroupBy) Bool

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

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

func (*ComputeImageGroupBy) BoolX

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

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

func (*ComputeImageGroupBy) Bools

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

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

func (*ComputeImageGroupBy) BoolsX

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

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

func (*ComputeImageGroupBy) Float64

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

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

func (*ComputeImageGroupBy) Float64X

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

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

func (*ComputeImageGroupBy) Float64s

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

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

func (*ComputeImageGroupBy) Float64sX

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

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

func (*ComputeImageGroupBy) Int

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

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

func (*ComputeImageGroupBy) IntX

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

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

func (*ComputeImageGroupBy) Ints

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

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

func (*ComputeImageGroupBy) IntsX

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

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

func (*ComputeImageGroupBy) Scan

func (cigb *ComputeImageGroupBy) Scan(ctx context.Context, v any) error

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

func (*ComputeImageGroupBy) ScanX

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

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

func (*ComputeImageGroupBy) String

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

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

func (*ComputeImageGroupBy) StringX

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

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

func (*ComputeImageGroupBy) Strings

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

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

func (*ComputeImageGroupBy) StringsX

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

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

type ComputeImageMutation

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

ComputeImageMutation represents an operation that mutates the ComputeImage nodes in the graph.

func (*ComputeImageMutation) AddField

func (m *ComputeImageMutation) 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 (*ComputeImageMutation) AddPort

func (m *ComputeImageMutation) AddPort(i int32)

AddPort adds i to the "port" field.

func (*ComputeImageMutation) AddedEdges

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

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

func (*ComputeImageMutation) AddedField

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

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

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

func (*ComputeImageMutation) AddedIDs

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

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

func (*ComputeImageMutation) AddedPort

func (m *ComputeImageMutation) AddedPort() (r int32, exists bool)

AddedPort returns the value that was added to the "port" field in this mutation.

func (*ComputeImageMutation) ClearEdge

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

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

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

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

func (*ComputeImageMutation) ClearedFields

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

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

func (ComputeImageMutation) Client

func (m ComputeImageMutation) 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 (*ComputeImageMutation) Command added in v0.0.3

func (m *ComputeImageMutation) Command() (r string, exists bool)

Command returns the value of the "command" field in the mutation.

func (*ComputeImageMutation) EdgeCleared

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

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

func (*ComputeImageMutation) Field

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

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

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

func (*ComputeImageMutation) Fields

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

func (m *ComputeImageMutation) ID() (id int32, 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 (*ComputeImageMutation) IDs

func (m *ComputeImageMutation) IDs(ctx context.Context) ([]int32, 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 (*ComputeImageMutation) Image

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

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

func (*ComputeImageMutation) Name

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

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

func (*ComputeImageMutation) OldCommand added in v0.0.3

func (m *ComputeImageMutation) OldCommand(ctx context.Context) (v string, err error)

OldCommand returns the old "command" field's value of the ComputeImage entity. If the ComputeImage 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 (*ComputeImageMutation) OldField

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

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

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

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

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

func (m *ComputeImageMutation) OldPort(ctx context.Context) (v int32, err error)

OldPort returns the old "port" field's value of the ComputeImage entity. If the ComputeImage 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 (*ComputeImageMutation) OldTag

func (m *ComputeImageMutation) OldTag(ctx context.Context) (v string, err error)

OldTag returns the old "tag" field's value of the ComputeImage entity. If the ComputeImage 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 (*ComputeImageMutation) Op

func (m *ComputeImageMutation) Op() Op

Op returns the operation name.

func (*ComputeImageMutation) Port

func (m *ComputeImageMutation) Port() (r int32, exists bool)

Port returns the value of the "port" field in the mutation.

func (*ComputeImageMutation) RemovedEdges

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

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

func (*ComputeImageMutation) RemovedIDs

func (m *ComputeImageMutation) 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 (*ComputeImageMutation) ResetCommand added in v0.0.3

func (m *ComputeImageMutation) ResetCommand()

ResetCommand resets all changes to the "command" field.

func (*ComputeImageMutation) ResetEdge

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

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

func (m *ComputeImageMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*ComputeImageMutation) ResetName

func (m *ComputeImageMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ComputeImageMutation) ResetPort

func (m *ComputeImageMutation) ResetPort()

ResetPort resets all changes to the "port" field.

func (*ComputeImageMutation) ResetTag

func (m *ComputeImageMutation) ResetTag()

ResetTag resets all changes to the "tag" field.

func (*ComputeImageMutation) SetCommand added in v0.0.3

func (m *ComputeImageMutation) SetCommand(s string)

SetCommand sets the "command" field.

func (*ComputeImageMutation) SetField

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

func (m *ComputeImageMutation) SetID(id int32)

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

func (*ComputeImageMutation) SetImage

func (m *ComputeImageMutation) SetImage(s string)

SetImage sets the "image" field.

func (*ComputeImageMutation) SetName

func (m *ComputeImageMutation) SetName(s string)

SetName sets the "name" field.

func (*ComputeImageMutation) SetOp

func (m *ComputeImageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ComputeImageMutation) SetPort

func (m *ComputeImageMutation) SetPort(i int32)

SetPort sets the "port" field.

func (*ComputeImageMutation) SetTag

func (m *ComputeImageMutation) SetTag(s string)

SetTag sets the "tag" field.

func (*ComputeImageMutation) Tag

func (m *ComputeImageMutation) Tag() (r string, exists bool)

Tag returns the value of the "tag" field in the mutation.

func (ComputeImageMutation) Tx

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

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

func (*ComputeImageMutation) Type

func (m *ComputeImageMutation) Type() string

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

func (*ComputeImageMutation) Where

Where appends a list predicates to the ComputeImageMutation builder.

func (*ComputeImageMutation) WhereP

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

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

type ComputeImageQuery

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

ComputeImageQuery is the builder for querying ComputeImage entities.

func (*ComputeImageQuery) Aggregate

func (ciq *ComputeImageQuery) Aggregate(fns ...AggregateFunc) *ComputeImageSelect

Aggregate returns a ComputeImageSelect configured with the given aggregations.

func (*ComputeImageQuery) All

func (ciq *ComputeImageQuery) All(ctx context.Context) ([]*ComputeImage, error)

All executes the query and returns a list of ComputeImages.

func (*ComputeImageQuery) AllX

func (ciq *ComputeImageQuery) AllX(ctx context.Context) []*ComputeImage

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

func (*ComputeImageQuery) Clone

func (ciq *ComputeImageQuery) Clone() *ComputeImageQuery

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

func (*ComputeImageQuery) Count

func (ciq *ComputeImageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComputeImageQuery) CountX

func (ciq *ComputeImageQuery) CountX(ctx context.Context) int

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

func (*ComputeImageQuery) Exist

func (ciq *ComputeImageQuery) Exist(ctx context.Context) (bool, error)

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

func (*ComputeImageQuery) ExistX

func (ciq *ComputeImageQuery) ExistX(ctx context.Context) bool

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

func (*ComputeImageQuery) First

func (ciq *ComputeImageQuery) First(ctx context.Context) (*ComputeImage, error)

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

func (*ComputeImageQuery) FirstID

func (ciq *ComputeImageQuery) FirstID(ctx context.Context) (id int32, err error)

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

func (*ComputeImageQuery) FirstIDX

func (ciq *ComputeImageQuery) FirstIDX(ctx context.Context) int32

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

func (*ComputeImageQuery) FirstX

func (ciq *ComputeImageQuery) FirstX(ctx context.Context) *ComputeImage

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

func (*ComputeImageQuery) GroupBy

func (ciq *ComputeImageQuery) GroupBy(field string, fields ...string) *ComputeImageGroupBy

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

func (*ComputeImageQuery) IDs

func (ciq *ComputeImageQuery) IDs(ctx context.Context) (ids []int32, err error)

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

func (*ComputeImageQuery) IDsX

func (ciq *ComputeImageQuery) IDsX(ctx context.Context) []int32

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

func (*ComputeImageQuery) Limit

func (ciq *ComputeImageQuery) Limit(limit int) *ComputeImageQuery

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

func (*ComputeImageQuery) Offset

func (ciq *ComputeImageQuery) Offset(offset int) *ComputeImageQuery

Offset to start from.

func (*ComputeImageQuery) Only

func (ciq *ComputeImageQuery) Only(ctx context.Context) (*ComputeImage, error)

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

func (*ComputeImageQuery) OnlyID

func (ciq *ComputeImageQuery) OnlyID(ctx context.Context) (id int32, err error)

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

func (*ComputeImageQuery) OnlyIDX

func (ciq *ComputeImageQuery) OnlyIDX(ctx context.Context) int32

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

func (*ComputeImageQuery) OnlyX

func (ciq *ComputeImageQuery) OnlyX(ctx context.Context) *ComputeImage

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

func (*ComputeImageQuery) Order

Order specifies how the records should be ordered.

func (*ComputeImageQuery) Select

func (ciq *ComputeImageQuery) Select(fields ...string) *ComputeImageSelect

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

func (*ComputeImageQuery) Unique

func (ciq *ComputeImageQuery) Unique(unique bool) *ComputeImageQuery

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

Where adds a new predicate for the ComputeImageQuery builder.

type ComputeImageSelect

type ComputeImageSelect struct {
	*ComputeImageQuery
	// contains filtered or unexported fields
}

ComputeImageSelect is the builder for selecting fields of ComputeImage entities.

func (*ComputeImageSelect) Aggregate

func (cis *ComputeImageSelect) Aggregate(fns ...AggregateFunc) *ComputeImageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ComputeImageSelect) Bool

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

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

func (*ComputeImageSelect) BoolX

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

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

func (*ComputeImageSelect) Bools

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

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

func (*ComputeImageSelect) BoolsX

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

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

func (*ComputeImageSelect) Float64

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

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

func (*ComputeImageSelect) Float64X

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

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

func (*ComputeImageSelect) Float64s

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

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

func (*ComputeImageSelect) Float64sX

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

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

func (*ComputeImageSelect) Int

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

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

func (*ComputeImageSelect) IntX

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

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

func (*ComputeImageSelect) Ints

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

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

func (*ComputeImageSelect) IntsX

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

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

func (*ComputeImageSelect) Scan

func (cis *ComputeImageSelect) Scan(ctx context.Context, v any) error

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

func (*ComputeImageSelect) ScanX

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

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

func (*ComputeImageSelect) String

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

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

func (*ComputeImageSelect) StringX

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

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

func (*ComputeImageSelect) Strings

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

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

func (*ComputeImageSelect) StringsX

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

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

type ComputeImageUpdate

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

ComputeImageUpdate is the builder for updating ComputeImage entities.

func (*ComputeImageUpdate) AddPort

func (ciu *ComputeImageUpdate) AddPort(i int32) *ComputeImageUpdate

AddPort adds i to the "port" field.

func (*ComputeImageUpdate) Exec

func (ciu *ComputeImageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeImageUpdate) ExecX

func (ciu *ComputeImageUpdate) ExecX(ctx context.Context)

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

func (*ComputeImageUpdate) Mutation

func (ciu *ComputeImageUpdate) Mutation() *ComputeImageMutation

Mutation returns the ComputeImageMutation object of the builder.

func (*ComputeImageUpdate) Save

func (ciu *ComputeImageUpdate) Save(ctx context.Context) (int, error)

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

func (*ComputeImageUpdate) SaveX

func (ciu *ComputeImageUpdate) SaveX(ctx context.Context) int

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

func (*ComputeImageUpdate) SetCommand added in v0.0.3

func (ciu *ComputeImageUpdate) SetCommand(s string) *ComputeImageUpdate

SetCommand sets the "command" field.

func (*ComputeImageUpdate) SetImage

func (ciu *ComputeImageUpdate) SetImage(s string) *ComputeImageUpdate

SetImage sets the "image" field.

func (*ComputeImageUpdate) SetName

func (ciu *ComputeImageUpdate) SetName(s string) *ComputeImageUpdate

SetName sets the "name" field.

func (*ComputeImageUpdate) SetPort

func (ciu *ComputeImageUpdate) SetPort(i int32) *ComputeImageUpdate

SetPort sets the "port" field.

func (*ComputeImageUpdate) SetTag

SetTag sets the "tag" field.

func (*ComputeImageUpdate) Where

Where appends a list predicates to the ComputeImageUpdate builder.

type ComputeImageUpdateOne

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

ComputeImageUpdateOne is the builder for updating a single ComputeImage entity.

func (*ComputeImageUpdateOne) AddPort

AddPort adds i to the "port" field.

func (*ComputeImageUpdateOne) Exec

func (ciuo *ComputeImageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ComputeImageUpdateOne) ExecX

func (ciuo *ComputeImageUpdateOne) ExecX(ctx context.Context)

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

func (*ComputeImageUpdateOne) Mutation

func (ciuo *ComputeImageUpdateOne) Mutation() *ComputeImageMutation

Mutation returns the ComputeImageMutation object of the builder.

func (*ComputeImageUpdateOne) Save

Save executes the query and returns the updated ComputeImage entity.

func (*ComputeImageUpdateOne) SaveX

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

func (*ComputeImageUpdateOne) Select

func (ciuo *ComputeImageUpdateOne) Select(field string, fields ...string) *ComputeImageUpdateOne

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

func (*ComputeImageUpdateOne) SetCommand added in v0.0.3

func (ciuo *ComputeImageUpdateOne) SetCommand(s string) *ComputeImageUpdateOne

SetCommand sets the "command" field.

func (*ComputeImageUpdateOne) SetImage

SetImage sets the "image" field.

func (*ComputeImageUpdateOne) SetName

SetName sets the "name" field.

func (*ComputeImageUpdateOne) SetPort

SetPort sets the "port" field.

func (*ComputeImageUpdateOne) SetTag

SetTag sets the "tag" field.

func (*ComputeImageUpdateOne) Where

Where appends a list predicates to the ComputeImageUpdate builder.

type ComputeImages

type ComputeImages []*ComputeImage

ComputeImages is a parsable slice of ComputeImage.

type ComputeInstance

type ComputeInstance struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Owner holds the value of the "owner" field.
	Owner string `json:"owner,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Core holds the value of the "core" field.
	Core string `json:"core,omitempty"`
	// Memory holds the value of the "memory" field.
	Memory string `json:"memory,omitempty"`
	// Image holds the value of the "image" field.
	Image string `json:"image,omitempty"`
	// 容器端口
	Port string `json:"port,omitempty"`
	// ExpirationTime holds the value of the "expiration_time" field.
	ExpirationTime time.Time `json:"expiration_time,omitempty"`
	// 0: 启动中,1:运行中,2:连接中断, 3:过期
	Status int8 `json:"status,omitempty"`
	// 容器id
	ContainerID string `json:"container_id,omitempty"`
	// p2p agent Id
	PeerID string `json:"peer_id,omitempty"`
	// 容器启动命令
	Command string `json:"command,omitempty"`
	// contains filtered or unexported fields
}

ComputeInstance is the model entity for the ComputeInstance schema.

func (*ComputeInstance) String

func (ci *ComputeInstance) String() string

String implements the fmt.Stringer.

func (*ComputeInstance) Unwrap

func (ci *ComputeInstance) Unwrap() *ComputeInstance

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

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

func (*ComputeInstance) Value

func (ci *ComputeInstance) Value(name string) (ent.Value, error)

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

type ComputeInstanceClient

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

ComputeInstanceClient is a client for the ComputeInstance schema.

func NewComputeInstanceClient

func NewComputeInstanceClient(c config) *ComputeInstanceClient

NewComputeInstanceClient returns a client for the ComputeInstance from the given config.

func (*ComputeInstanceClient) Create

Create returns a builder for creating a ComputeInstance entity.

func (*ComputeInstanceClient) CreateBulk

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

func (*ComputeInstanceClient) Delete

Delete returns a delete builder for ComputeInstance.

func (*ComputeInstanceClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ComputeInstanceClient) DeleteOneID

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

func (*ComputeInstanceClient) Get

Get returns a ComputeInstance entity by its id.

func (*ComputeInstanceClient) GetX

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

func (*ComputeInstanceClient) Hooks

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

Hooks returns the client hooks.

func (*ComputeInstanceClient) Intercept

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

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

func (*ComputeInstanceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ComputeInstanceClient) Query

Query returns a query builder for ComputeInstance.

func (*ComputeInstanceClient) Update

Update returns an update builder for ComputeInstance.

func (*ComputeInstanceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ComputeInstanceClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ComputeInstanceClient) Use

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

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

type ComputeInstanceCreate

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

ComputeInstanceCreate is the builder for creating a ComputeInstance entity.

func (*ComputeInstanceCreate) Exec

func (cic *ComputeInstanceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeInstanceCreate) ExecX

func (cic *ComputeInstanceCreate) ExecX(ctx context.Context)

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

func (*ComputeInstanceCreate) Mutation

Mutation returns the ComputeInstanceMutation object of the builder.

func (*ComputeInstanceCreate) Save

Save creates the ComputeInstance in the database.

func (*ComputeInstanceCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ComputeInstanceCreate) SetCommand added in v0.0.3

SetCommand sets the "command" field.

func (*ComputeInstanceCreate) SetContainerID

func (cic *ComputeInstanceCreate) SetContainerID(s string) *ComputeInstanceCreate

SetContainerID sets the "container_id" field.

func (*ComputeInstanceCreate) SetCore

SetCore sets the "core" field.

func (*ComputeInstanceCreate) SetExpirationTime

func (cic *ComputeInstanceCreate) SetExpirationTime(t time.Time) *ComputeInstanceCreate

SetExpirationTime sets the "expiration_time" field.

func (*ComputeInstanceCreate) SetID

SetID sets the "id" field.

func (*ComputeInstanceCreate) SetImage

SetImage sets the "image" field.

func (*ComputeInstanceCreate) SetMemory

SetMemory sets the "memory" field.

func (*ComputeInstanceCreate) SetName

SetName sets the "name" field.

func (*ComputeInstanceCreate) SetNillableCommand added in v0.0.3

func (cic *ComputeInstanceCreate) SetNillableCommand(s *string) *ComputeInstanceCreate

SetNillableCommand sets the "command" field if the given value is not nil.

func (*ComputeInstanceCreate) SetNillableContainerID

func (cic *ComputeInstanceCreate) SetNillableContainerID(s *string) *ComputeInstanceCreate

SetNillableContainerID sets the "container_id" field if the given value is not nil.

func (*ComputeInstanceCreate) SetNillableID

func (cic *ComputeInstanceCreate) SetNillableID(u *uuid.UUID) *ComputeInstanceCreate

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

func (*ComputeInstanceCreate) SetNillablePeerID

func (cic *ComputeInstanceCreate) SetNillablePeerID(s *string) *ComputeInstanceCreate

SetNillablePeerID sets the "peer_id" field if the given value is not nil.

func (*ComputeInstanceCreate) SetNillablePort added in v0.0.2

func (cic *ComputeInstanceCreate) SetNillablePort(s *string) *ComputeInstanceCreate

SetNillablePort sets the "port" field if the given value is not nil.

func (*ComputeInstanceCreate) SetOwner

SetOwner sets the "owner" field.

func (*ComputeInstanceCreate) SetPeerID

SetPeerID sets the "peer_id" field.

func (*ComputeInstanceCreate) SetPort added in v0.0.2

SetPort sets the "port" field.

func (*ComputeInstanceCreate) SetStatus

SetStatus sets the "status" field.

type ComputeInstanceCreateBulk

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

ComputeInstanceCreateBulk is the builder for creating many ComputeInstance entities in bulk.

func (*ComputeInstanceCreateBulk) Exec

Exec executes the query.

func (*ComputeInstanceCreateBulk) ExecX

func (cicb *ComputeInstanceCreateBulk) ExecX(ctx context.Context)

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

func (*ComputeInstanceCreateBulk) Save

Save creates the ComputeInstance entities in the database.

func (*ComputeInstanceCreateBulk) SaveX

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

type ComputeInstanceDelete

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

ComputeInstanceDelete is the builder for deleting a ComputeInstance entity.

func (*ComputeInstanceDelete) Exec

func (cid *ComputeInstanceDelete) Exec(ctx context.Context) (int, error)

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

func (*ComputeInstanceDelete) ExecX

func (cid *ComputeInstanceDelete) ExecX(ctx context.Context) int

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

func (*ComputeInstanceDelete) Where

Where appends a list predicates to the ComputeInstanceDelete builder.

type ComputeInstanceDeleteOne

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

ComputeInstanceDeleteOne is the builder for deleting a single ComputeInstance entity.

func (*ComputeInstanceDeleteOne) Exec

Exec executes the deletion query.

func (*ComputeInstanceDeleteOne) ExecX

func (cido *ComputeInstanceDeleteOne) ExecX(ctx context.Context)

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

func (*ComputeInstanceDeleteOne) Where

Where appends a list predicates to the ComputeInstanceDelete builder.

type ComputeInstanceGroupBy

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

ComputeInstanceGroupBy is the group-by builder for ComputeInstance entities.

func (*ComputeInstanceGroupBy) Aggregate

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

func (*ComputeInstanceGroupBy) Bool

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

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

func (*ComputeInstanceGroupBy) BoolX

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

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

func (*ComputeInstanceGroupBy) Bools

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

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

func (*ComputeInstanceGroupBy) BoolsX

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

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

func (*ComputeInstanceGroupBy) Float64

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

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

func (*ComputeInstanceGroupBy) Float64X

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

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

func (*ComputeInstanceGroupBy) Float64s

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

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

func (*ComputeInstanceGroupBy) Float64sX

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

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

func (*ComputeInstanceGroupBy) Int

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

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

func (*ComputeInstanceGroupBy) IntX

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

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

func (*ComputeInstanceGroupBy) Ints

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

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

func (*ComputeInstanceGroupBy) IntsX

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

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

func (*ComputeInstanceGroupBy) Scan

func (cigb *ComputeInstanceGroupBy) Scan(ctx context.Context, v any) error

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

func (*ComputeInstanceGroupBy) ScanX

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

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

func (*ComputeInstanceGroupBy) String

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

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

func (*ComputeInstanceGroupBy) StringX

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

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

func (*ComputeInstanceGroupBy) Strings

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

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

func (*ComputeInstanceGroupBy) StringsX

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

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

type ComputeInstanceMutation

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

ComputeInstanceMutation represents an operation that mutates the ComputeInstance nodes in the graph.

func (*ComputeInstanceMutation) AddField

func (m *ComputeInstanceMutation) 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 (*ComputeInstanceMutation) AddStatus

func (m *ComputeInstanceMutation) AddStatus(i int8)

AddStatus adds i to the "status" field.

func (*ComputeInstanceMutation) AddedEdges

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

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

func (*ComputeInstanceMutation) AddedField

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

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

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

func (*ComputeInstanceMutation) AddedIDs

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

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

func (*ComputeInstanceMutation) AddedStatus

func (m *ComputeInstanceMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*ComputeInstanceMutation) ClearCommand added in v0.0.3

func (m *ComputeInstanceMutation) ClearCommand()

ClearCommand clears the value of the "command" field.

func (*ComputeInstanceMutation) ClearContainerID

func (m *ComputeInstanceMutation) ClearContainerID()

ClearContainerID clears the value of the "container_id" field.

func (*ComputeInstanceMutation) ClearEdge

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

func (m *ComputeInstanceMutation) 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 (*ComputeInstanceMutation) ClearPeerID

func (m *ComputeInstanceMutation) ClearPeerID()

ClearPeerID clears the value of the "peer_id" field.

func (*ComputeInstanceMutation) ClearPort added in v0.0.2

func (m *ComputeInstanceMutation) ClearPort()

ClearPort clears the value of the "port" field.

func (*ComputeInstanceMutation) ClearedEdges

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

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

func (*ComputeInstanceMutation) ClearedFields

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

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

func (ComputeInstanceMutation) Client

func (m ComputeInstanceMutation) 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 (*ComputeInstanceMutation) Command added in v0.0.3

func (m *ComputeInstanceMutation) Command() (r string, exists bool)

Command returns the value of the "command" field in the mutation.

func (*ComputeInstanceMutation) CommandCleared added in v0.0.3

func (m *ComputeInstanceMutation) CommandCleared() bool

CommandCleared returns if the "command" field was cleared in this mutation.

func (*ComputeInstanceMutation) ContainerID

func (m *ComputeInstanceMutation) ContainerID() (r string, exists bool)

ContainerID returns the value of the "container_id" field in the mutation.

func (*ComputeInstanceMutation) ContainerIDCleared

func (m *ComputeInstanceMutation) ContainerIDCleared() bool

ContainerIDCleared returns if the "container_id" field was cleared in this mutation.

func (*ComputeInstanceMutation) Core

func (m *ComputeInstanceMutation) Core() (r string, exists bool)

Core returns the value of the "core" field in the mutation.

func (*ComputeInstanceMutation) EdgeCleared

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

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

func (*ComputeInstanceMutation) ExpirationTime

func (m *ComputeInstanceMutation) ExpirationTime() (r time.Time, exists bool)

ExpirationTime returns the value of the "expiration_time" field in the mutation.

func (*ComputeInstanceMutation) Field

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

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

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

func (*ComputeInstanceMutation) Fields

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

func (m *ComputeInstanceMutation) ID() (id uuid.UUID, exists bool)

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

func (*ComputeInstanceMutation) IDs

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 (*ComputeInstanceMutation) Image

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

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

func (*ComputeInstanceMutation) Memory

func (m *ComputeInstanceMutation) Memory() (r string, exists bool)

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

func (*ComputeInstanceMutation) Name

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

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

func (*ComputeInstanceMutation) OldCommand added in v0.0.3

func (m *ComputeInstanceMutation) OldCommand(ctx context.Context) (v string, err error)

OldCommand returns the old "command" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) OldContainerID

func (m *ComputeInstanceMutation) OldContainerID(ctx context.Context) (v string, err error)

OldContainerID returns the old "container_id" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) OldCore

func (m *ComputeInstanceMutation) OldCore(ctx context.Context) (v string, err error)

OldCore returns the old "core" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) OldExpirationTime

func (m *ComputeInstanceMutation) OldExpirationTime(ctx context.Context) (v time.Time, err error)

OldExpirationTime returns the old "expiration_time" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) OldField

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

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

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

func (m *ComputeInstanceMutation) OldMemory(ctx context.Context) (v string, err error)

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

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

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

func (m *ComputeInstanceMutation) OldOwner(ctx context.Context) (v string, err error)

OldOwner returns the old "owner" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) OldPeerID

func (m *ComputeInstanceMutation) OldPeerID(ctx context.Context) (v string, err error)

OldPeerID returns the old "peer_id" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) OldPort added in v0.0.2

func (m *ComputeInstanceMutation) OldPort(ctx context.Context) (v string, err error)

OldPort returns the old "port" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) OldStatus

func (m *ComputeInstanceMutation) OldStatus(ctx context.Context) (v int8, err error)

OldStatus returns the old "status" field's value of the ComputeInstance entity. If the ComputeInstance 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 (*ComputeInstanceMutation) Op

func (m *ComputeInstanceMutation) Op() Op

Op returns the operation name.

func (*ComputeInstanceMutation) Owner

func (m *ComputeInstanceMutation) Owner() (r string, exists bool)

Owner returns the value of the "owner" field in the mutation.

func (*ComputeInstanceMutation) PeerID

func (m *ComputeInstanceMutation) PeerID() (r string, exists bool)

PeerID returns the value of the "peer_id" field in the mutation.

func (*ComputeInstanceMutation) PeerIDCleared

func (m *ComputeInstanceMutation) PeerIDCleared() bool

PeerIDCleared returns if the "peer_id" field was cleared in this mutation.

func (*ComputeInstanceMutation) Port added in v0.0.2

func (m *ComputeInstanceMutation) Port() (r string, exists bool)

Port returns the value of the "port" field in the mutation.

func (*ComputeInstanceMutation) PortCleared added in v0.0.2

func (m *ComputeInstanceMutation) PortCleared() bool

PortCleared returns if the "port" field was cleared in this mutation.

func (*ComputeInstanceMutation) RemovedEdges

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

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

func (*ComputeInstanceMutation) RemovedIDs

func (m *ComputeInstanceMutation) 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 (*ComputeInstanceMutation) ResetCommand added in v0.0.3

func (m *ComputeInstanceMutation) ResetCommand()

ResetCommand resets all changes to the "command" field.

func (*ComputeInstanceMutation) ResetContainerID

func (m *ComputeInstanceMutation) ResetContainerID()

ResetContainerID resets all changes to the "container_id" field.

func (*ComputeInstanceMutation) ResetCore

func (m *ComputeInstanceMutation) ResetCore()

ResetCore resets all changes to the "core" field.

func (*ComputeInstanceMutation) ResetEdge

func (m *ComputeInstanceMutation) 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 (*ComputeInstanceMutation) ResetExpirationTime

func (m *ComputeInstanceMutation) ResetExpirationTime()

ResetExpirationTime resets all changes to the "expiration_time" field.

func (*ComputeInstanceMutation) ResetField

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

func (m *ComputeInstanceMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*ComputeInstanceMutation) ResetMemory

func (m *ComputeInstanceMutation) ResetMemory()

ResetMemory resets all changes to the "memory" field.

func (*ComputeInstanceMutation) ResetName

func (m *ComputeInstanceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ComputeInstanceMutation) ResetOwner

func (m *ComputeInstanceMutation) ResetOwner()

ResetOwner resets all changes to the "owner" field.

func (*ComputeInstanceMutation) ResetPeerID

func (m *ComputeInstanceMutation) ResetPeerID()

ResetPeerID resets all changes to the "peer_id" field.

func (*ComputeInstanceMutation) ResetPort added in v0.0.2

func (m *ComputeInstanceMutation) ResetPort()

ResetPort resets all changes to the "port" field.

func (*ComputeInstanceMutation) ResetStatus

func (m *ComputeInstanceMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*ComputeInstanceMutation) SetCommand added in v0.0.3

func (m *ComputeInstanceMutation) SetCommand(s string)

SetCommand sets the "command" field.

func (*ComputeInstanceMutation) SetContainerID

func (m *ComputeInstanceMutation) SetContainerID(s string)

SetContainerID sets the "container_id" field.

func (*ComputeInstanceMutation) SetCore

func (m *ComputeInstanceMutation) SetCore(s string)

SetCore sets the "core" field.

func (*ComputeInstanceMutation) SetExpirationTime

func (m *ComputeInstanceMutation) SetExpirationTime(t time.Time)

SetExpirationTime sets the "expiration_time" field.

func (*ComputeInstanceMutation) SetField

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

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

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

func (*ComputeInstanceMutation) SetImage

func (m *ComputeInstanceMutation) SetImage(s string)

SetImage sets the "image" field.

func (*ComputeInstanceMutation) SetMemory

func (m *ComputeInstanceMutation) SetMemory(s string)

SetMemory sets the "memory" field.

func (*ComputeInstanceMutation) SetName

func (m *ComputeInstanceMutation) SetName(s string)

SetName sets the "name" field.

func (*ComputeInstanceMutation) SetOp

func (m *ComputeInstanceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ComputeInstanceMutation) SetOwner

func (m *ComputeInstanceMutation) SetOwner(s string)

SetOwner sets the "owner" field.

func (*ComputeInstanceMutation) SetPeerID

func (m *ComputeInstanceMutation) SetPeerID(s string)

SetPeerID sets the "peer_id" field.

func (*ComputeInstanceMutation) SetPort added in v0.0.2

func (m *ComputeInstanceMutation) SetPort(s string)

SetPort sets the "port" field.

func (*ComputeInstanceMutation) SetStatus

func (m *ComputeInstanceMutation) SetStatus(i int8)

SetStatus sets the "status" field.

func (*ComputeInstanceMutation) Status

func (m *ComputeInstanceMutation) Status() (r int8, exists bool)

Status returns the value of the "status" field in the mutation.

func (ComputeInstanceMutation) Tx

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

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

func (*ComputeInstanceMutation) Type

func (m *ComputeInstanceMutation) Type() string

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

func (*ComputeInstanceMutation) Where

Where appends a list predicates to the ComputeInstanceMutation builder.

func (*ComputeInstanceMutation) WhereP

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

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

type ComputeInstanceQuery

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

ComputeInstanceQuery is the builder for querying ComputeInstance entities.

func (*ComputeInstanceQuery) Aggregate

Aggregate returns a ComputeInstanceSelect configured with the given aggregations.

func (*ComputeInstanceQuery) All

All executes the query and returns a list of ComputeInstances.

func (*ComputeInstanceQuery) AllX

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

func (*ComputeInstanceQuery) Clone

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

func (*ComputeInstanceQuery) Count

func (ciq *ComputeInstanceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComputeInstanceQuery) CountX

func (ciq *ComputeInstanceQuery) CountX(ctx context.Context) int

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

func (*ComputeInstanceQuery) Exist

func (ciq *ComputeInstanceQuery) Exist(ctx context.Context) (bool, error)

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

func (*ComputeInstanceQuery) ExistX

func (ciq *ComputeInstanceQuery) ExistX(ctx context.Context) bool

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

func (*ComputeInstanceQuery) First

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

func (*ComputeInstanceQuery) FirstID

func (ciq *ComputeInstanceQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ComputeInstanceQuery) FirstIDX

func (ciq *ComputeInstanceQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ComputeInstanceQuery) FirstX

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

func (*ComputeInstanceQuery) GroupBy

func (ciq *ComputeInstanceQuery) GroupBy(field string, fields ...string) *ComputeInstanceGroupBy

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

client.ComputeInstance.Query().
	GroupBy(computeinstance.FieldOwner).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ComputeInstanceQuery) IDs

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

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

func (*ComputeInstanceQuery) IDsX

func (ciq *ComputeInstanceQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ComputeInstanceQuery) Limit

func (ciq *ComputeInstanceQuery) Limit(limit int) *ComputeInstanceQuery

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

func (*ComputeInstanceQuery) Offset

func (ciq *ComputeInstanceQuery) Offset(offset int) *ComputeInstanceQuery

Offset to start from.

func (*ComputeInstanceQuery) Only

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

func (*ComputeInstanceQuery) OnlyID

func (ciq *ComputeInstanceQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ComputeInstanceQuery) OnlyIDX

func (ciq *ComputeInstanceQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ComputeInstanceQuery) OnlyX

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

func (*ComputeInstanceQuery) Order

Order specifies how the records should be ordered.

func (*ComputeInstanceQuery) Select

func (ciq *ComputeInstanceQuery) Select(fields ...string) *ComputeInstanceSelect

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

client.ComputeInstance.Query().
	Select(computeinstance.FieldOwner).
	Scan(ctx, &v)

func (*ComputeInstanceQuery) Unique

func (ciq *ComputeInstanceQuery) Unique(unique bool) *ComputeInstanceQuery

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

Where adds a new predicate for the ComputeInstanceQuery builder.

type ComputeInstanceSelect

type ComputeInstanceSelect struct {
	*ComputeInstanceQuery
	// contains filtered or unexported fields
}

ComputeInstanceSelect is the builder for selecting fields of ComputeInstance entities.

func (*ComputeInstanceSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ComputeInstanceSelect) Bool

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

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

func (*ComputeInstanceSelect) BoolX

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

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

func (*ComputeInstanceSelect) Bools

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

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

func (*ComputeInstanceSelect) BoolsX

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

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

func (*ComputeInstanceSelect) Float64

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

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

func (*ComputeInstanceSelect) Float64X

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

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

func (*ComputeInstanceSelect) Float64s

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

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

func (*ComputeInstanceSelect) Float64sX

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

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

func (*ComputeInstanceSelect) Int

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

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

func (*ComputeInstanceSelect) IntX

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

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

func (*ComputeInstanceSelect) Ints

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

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

func (*ComputeInstanceSelect) IntsX

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

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

func (*ComputeInstanceSelect) Scan

func (cis *ComputeInstanceSelect) Scan(ctx context.Context, v any) error

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

func (*ComputeInstanceSelect) ScanX

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

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

func (*ComputeInstanceSelect) String

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

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

func (*ComputeInstanceSelect) StringX

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

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

func (*ComputeInstanceSelect) Strings

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

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

func (*ComputeInstanceSelect) StringsX

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

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

type ComputeInstanceUpdate

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

ComputeInstanceUpdate is the builder for updating ComputeInstance entities.

func (*ComputeInstanceUpdate) AddStatus

AddStatus adds i to the "status" field.

func (*ComputeInstanceUpdate) ClearCommand added in v0.0.3

func (ciu *ComputeInstanceUpdate) ClearCommand() *ComputeInstanceUpdate

ClearCommand clears the value of the "command" field.

func (*ComputeInstanceUpdate) ClearContainerID

func (ciu *ComputeInstanceUpdate) ClearContainerID() *ComputeInstanceUpdate

ClearContainerID clears the value of the "container_id" field.

func (*ComputeInstanceUpdate) ClearPeerID

func (ciu *ComputeInstanceUpdate) ClearPeerID() *ComputeInstanceUpdate

ClearPeerID clears the value of the "peer_id" field.

func (*ComputeInstanceUpdate) ClearPort added in v0.0.2

func (ciu *ComputeInstanceUpdate) ClearPort() *ComputeInstanceUpdate

ClearPort clears the value of the "port" field.

func (*ComputeInstanceUpdate) Exec

func (ciu *ComputeInstanceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeInstanceUpdate) ExecX

func (ciu *ComputeInstanceUpdate) ExecX(ctx context.Context)

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

func (*ComputeInstanceUpdate) Mutation

Mutation returns the ComputeInstanceMutation object of the builder.

func (*ComputeInstanceUpdate) Save

func (ciu *ComputeInstanceUpdate) Save(ctx context.Context) (int, error)

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

func (*ComputeInstanceUpdate) SaveX

func (ciu *ComputeInstanceUpdate) SaveX(ctx context.Context) int

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

func (*ComputeInstanceUpdate) SetCommand added in v0.0.3

SetCommand sets the "command" field.

func (*ComputeInstanceUpdate) SetContainerID

func (ciu *ComputeInstanceUpdate) SetContainerID(s string) *ComputeInstanceUpdate

SetContainerID sets the "container_id" field.

func (*ComputeInstanceUpdate) SetCore

SetCore sets the "core" field.

func (*ComputeInstanceUpdate) SetExpirationTime

func (ciu *ComputeInstanceUpdate) SetExpirationTime(t time.Time) *ComputeInstanceUpdate

SetExpirationTime sets the "expiration_time" field.

func (*ComputeInstanceUpdate) SetImage

SetImage sets the "image" field.

func (*ComputeInstanceUpdate) SetMemory

SetMemory sets the "memory" field.

func (*ComputeInstanceUpdate) SetName

SetName sets the "name" field.

func (*ComputeInstanceUpdate) SetNillableCommand added in v0.0.3

func (ciu *ComputeInstanceUpdate) SetNillableCommand(s *string) *ComputeInstanceUpdate

SetNillableCommand sets the "command" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableContainerID

func (ciu *ComputeInstanceUpdate) SetNillableContainerID(s *string) *ComputeInstanceUpdate

SetNillableContainerID sets the "container_id" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillablePeerID

func (ciu *ComputeInstanceUpdate) SetNillablePeerID(s *string) *ComputeInstanceUpdate

SetNillablePeerID sets the "peer_id" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillablePort added in v0.0.2

func (ciu *ComputeInstanceUpdate) SetNillablePort(s *string) *ComputeInstanceUpdate

SetNillablePort sets the "port" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetOwner

SetOwner sets the "owner" field.

func (*ComputeInstanceUpdate) SetPeerID

SetPeerID sets the "peer_id" field.

func (*ComputeInstanceUpdate) SetPort added in v0.0.2

SetPort sets the "port" field.

func (*ComputeInstanceUpdate) SetStatus

SetStatus sets the "status" field.

func (*ComputeInstanceUpdate) Where

Where appends a list predicates to the ComputeInstanceUpdate builder.

type ComputeInstanceUpdateOne

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

ComputeInstanceUpdateOne is the builder for updating a single ComputeInstance entity.

func (*ComputeInstanceUpdateOne) AddStatus

AddStatus adds i to the "status" field.

func (*ComputeInstanceUpdateOne) ClearCommand added in v0.0.3

func (ciuo *ComputeInstanceUpdateOne) ClearCommand() *ComputeInstanceUpdateOne

ClearCommand clears the value of the "command" field.

func (*ComputeInstanceUpdateOne) ClearContainerID

func (ciuo *ComputeInstanceUpdateOne) ClearContainerID() *ComputeInstanceUpdateOne

ClearContainerID clears the value of the "container_id" field.

func (*ComputeInstanceUpdateOne) ClearPeerID

ClearPeerID clears the value of the "peer_id" field.

func (*ComputeInstanceUpdateOne) ClearPort added in v0.0.2

ClearPort clears the value of the "port" field.

func (*ComputeInstanceUpdateOne) Exec

Exec executes the query on the entity.

func (*ComputeInstanceUpdateOne) ExecX

func (ciuo *ComputeInstanceUpdateOne) ExecX(ctx context.Context)

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

func (*ComputeInstanceUpdateOne) Mutation

Mutation returns the ComputeInstanceMutation object of the builder.

func (*ComputeInstanceUpdateOne) Save

Save executes the query and returns the updated ComputeInstance entity.

func (*ComputeInstanceUpdateOne) SaveX

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

func (*ComputeInstanceUpdateOne) Select

func (ciuo *ComputeInstanceUpdateOne) Select(field string, fields ...string) *ComputeInstanceUpdateOne

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

func (*ComputeInstanceUpdateOne) SetCommand added in v0.0.3

SetCommand sets the "command" field.

func (*ComputeInstanceUpdateOne) SetContainerID

func (ciuo *ComputeInstanceUpdateOne) SetContainerID(s string) *ComputeInstanceUpdateOne

SetContainerID sets the "container_id" field.

func (*ComputeInstanceUpdateOne) SetCore

SetCore sets the "core" field.

func (*ComputeInstanceUpdateOne) SetExpirationTime

func (ciuo *ComputeInstanceUpdateOne) SetExpirationTime(t time.Time) *ComputeInstanceUpdateOne

SetExpirationTime sets the "expiration_time" field.

func (*ComputeInstanceUpdateOne) SetImage

SetImage sets the "image" field.

func (*ComputeInstanceUpdateOne) SetMemory

SetMemory sets the "memory" field.

func (*ComputeInstanceUpdateOne) SetName

SetName sets the "name" field.

func (*ComputeInstanceUpdateOne) SetNillableCommand added in v0.0.3

func (ciuo *ComputeInstanceUpdateOne) SetNillableCommand(s *string) *ComputeInstanceUpdateOne

SetNillableCommand sets the "command" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableContainerID

func (ciuo *ComputeInstanceUpdateOne) SetNillableContainerID(s *string) *ComputeInstanceUpdateOne

SetNillableContainerID sets the "container_id" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillablePeerID

func (ciuo *ComputeInstanceUpdateOne) SetNillablePeerID(s *string) *ComputeInstanceUpdateOne

SetNillablePeerID sets the "peer_id" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillablePort added in v0.0.2

func (ciuo *ComputeInstanceUpdateOne) SetNillablePort(s *string) *ComputeInstanceUpdateOne

SetNillablePort sets the "port" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetOwner

SetOwner sets the "owner" field.

func (*ComputeInstanceUpdateOne) SetPeerID

SetPeerID sets the "peer_id" field.

func (*ComputeInstanceUpdateOne) SetPort added in v0.0.2

SetPort sets the "port" field.

func (*ComputeInstanceUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*ComputeInstanceUpdateOne) Where

Where appends a list predicates to the ComputeInstanceUpdate builder.

type ComputeInstances

type ComputeInstances []*ComputeInstance

ComputeInstances is a parsable slice of ComputeInstance.

type ComputeSpec

type ComputeSpec struct {

	// ID of the ent.
	ID int32 `json:"id,omitempty"`
	// Core holds the value of the "core" field.
	Core string `json:"core,omitempty"`
	// Memory holds the value of the "memory" field.
	Memory string `json:"memory,omitempty"`
	// contains filtered or unexported fields
}

ComputeSpec is the model entity for the ComputeSpec schema.

func (*ComputeSpec) String

func (cs *ComputeSpec) String() string

String implements the fmt.Stringer.

func (*ComputeSpec) Unwrap

func (cs *ComputeSpec) Unwrap() *ComputeSpec

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

func (cs *ComputeSpec) Update() *ComputeSpecUpdateOne

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

func (*ComputeSpec) Value

func (cs *ComputeSpec) Value(name string) (ent.Value, error)

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

type ComputeSpecClient

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

ComputeSpecClient is a client for the ComputeSpec schema.

func NewComputeSpecClient

func NewComputeSpecClient(c config) *ComputeSpecClient

NewComputeSpecClient returns a client for the ComputeSpec from the given config.

func (*ComputeSpecClient) Create

func (c *ComputeSpecClient) Create() *ComputeSpecCreate

Create returns a builder for creating a ComputeSpec entity.

func (*ComputeSpecClient) CreateBulk

func (c *ComputeSpecClient) CreateBulk(builders ...*ComputeSpecCreate) *ComputeSpecCreateBulk

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

func (*ComputeSpecClient) Delete

func (c *ComputeSpecClient) Delete() *ComputeSpecDelete

Delete returns a delete builder for ComputeSpec.

func (*ComputeSpecClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ComputeSpecClient) DeleteOneID

func (c *ComputeSpecClient) DeleteOneID(id int32) *ComputeSpecDeleteOne

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

func (*ComputeSpecClient) Get

Get returns a ComputeSpec entity by its id.

func (*ComputeSpecClient) GetX

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

func (*ComputeSpecClient) Hooks

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

Hooks returns the client hooks.

func (*ComputeSpecClient) Intercept

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

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

func (*ComputeSpecClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ComputeSpecClient) Query

func (c *ComputeSpecClient) Query() *ComputeSpecQuery

Query returns a query builder for ComputeSpec.

func (*ComputeSpecClient) Update

func (c *ComputeSpecClient) Update() *ComputeSpecUpdate

Update returns an update builder for ComputeSpec.

func (*ComputeSpecClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ComputeSpecClient) UpdateOneID

func (c *ComputeSpecClient) UpdateOneID(id int32) *ComputeSpecUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ComputeSpecClient) Use

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

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

type ComputeSpecCreate

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

ComputeSpecCreate is the builder for creating a ComputeSpec entity.

func (*ComputeSpecCreate) Exec

func (csc *ComputeSpecCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeSpecCreate) ExecX

func (csc *ComputeSpecCreate) ExecX(ctx context.Context)

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

func (*ComputeSpecCreate) Mutation

func (csc *ComputeSpecCreate) Mutation() *ComputeSpecMutation

Mutation returns the ComputeSpecMutation object of the builder.

func (*ComputeSpecCreate) Save

func (csc *ComputeSpecCreate) Save(ctx context.Context) (*ComputeSpec, error)

Save creates the ComputeSpec in the database.

func (*ComputeSpecCreate) SaveX

func (csc *ComputeSpecCreate) SaveX(ctx context.Context) *ComputeSpec

SaveX calls Save and panics if Save returns an error.

func (*ComputeSpecCreate) SetCore

func (csc *ComputeSpecCreate) SetCore(s string) *ComputeSpecCreate

SetCore sets the "core" field.

func (*ComputeSpecCreate) SetID

func (csc *ComputeSpecCreate) SetID(i int32) *ComputeSpecCreate

SetID sets the "id" field.

func (*ComputeSpecCreate) SetMemory

func (csc *ComputeSpecCreate) SetMemory(s string) *ComputeSpecCreate

SetMemory sets the "memory" field.

type ComputeSpecCreateBulk

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

ComputeSpecCreateBulk is the builder for creating many ComputeSpec entities in bulk.

func (*ComputeSpecCreateBulk) Exec

func (cscb *ComputeSpecCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeSpecCreateBulk) ExecX

func (cscb *ComputeSpecCreateBulk) ExecX(ctx context.Context)

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

func (*ComputeSpecCreateBulk) Save

func (cscb *ComputeSpecCreateBulk) Save(ctx context.Context) ([]*ComputeSpec, error)

Save creates the ComputeSpec entities in the database.

func (*ComputeSpecCreateBulk) SaveX

func (cscb *ComputeSpecCreateBulk) SaveX(ctx context.Context) []*ComputeSpec

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

type ComputeSpecDelete

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

ComputeSpecDelete is the builder for deleting a ComputeSpec entity.

func (*ComputeSpecDelete) Exec

func (csd *ComputeSpecDelete) Exec(ctx context.Context) (int, error)

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

func (*ComputeSpecDelete) ExecX

func (csd *ComputeSpecDelete) ExecX(ctx context.Context) int

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

func (*ComputeSpecDelete) Where

Where appends a list predicates to the ComputeSpecDelete builder.

type ComputeSpecDeleteOne

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

ComputeSpecDeleteOne is the builder for deleting a single ComputeSpec entity.

func (*ComputeSpecDeleteOne) Exec

func (csdo *ComputeSpecDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ComputeSpecDeleteOne) ExecX

func (csdo *ComputeSpecDeleteOne) ExecX(ctx context.Context)

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

func (*ComputeSpecDeleteOne) Where

Where appends a list predicates to the ComputeSpecDelete builder.

type ComputeSpecGroupBy

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

ComputeSpecGroupBy is the group-by builder for ComputeSpec entities.

func (*ComputeSpecGroupBy) Aggregate

func (csgb *ComputeSpecGroupBy) Aggregate(fns ...AggregateFunc) *ComputeSpecGroupBy

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

func (*ComputeSpecGroupBy) Bool

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

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

func (*ComputeSpecGroupBy) BoolX

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

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

func (*ComputeSpecGroupBy) Bools

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

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

func (*ComputeSpecGroupBy) BoolsX

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

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

func (*ComputeSpecGroupBy) Float64

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

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

func (*ComputeSpecGroupBy) Float64X

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

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

func (*ComputeSpecGroupBy) Float64s

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

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

func (*ComputeSpecGroupBy) Float64sX

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

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

func (*ComputeSpecGroupBy) Int

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

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

func (*ComputeSpecGroupBy) IntX

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

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

func (*ComputeSpecGroupBy) Ints

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

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

func (*ComputeSpecGroupBy) IntsX

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

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

func (*ComputeSpecGroupBy) Scan

func (csgb *ComputeSpecGroupBy) Scan(ctx context.Context, v any) error

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

func (*ComputeSpecGroupBy) ScanX

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

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

func (*ComputeSpecGroupBy) String

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

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

func (*ComputeSpecGroupBy) StringX

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

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

func (*ComputeSpecGroupBy) Strings

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

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

func (*ComputeSpecGroupBy) StringsX

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

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

type ComputeSpecMutation

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

ComputeSpecMutation represents an operation that mutates the ComputeSpec nodes in the graph.

func (*ComputeSpecMutation) AddField

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

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

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

func (*ComputeSpecMutation) AddedField

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

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

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

func (*ComputeSpecMutation) AddedIDs

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

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

func (*ComputeSpecMutation) ClearEdge

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

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

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

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

func (*ComputeSpecMutation) ClearedFields

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

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

func (ComputeSpecMutation) Client

func (m ComputeSpecMutation) 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 (*ComputeSpecMutation) Core

func (m *ComputeSpecMutation) Core() (r string, exists bool)

Core returns the value of the "core" field in the mutation.

func (*ComputeSpecMutation) EdgeCleared

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

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

func (*ComputeSpecMutation) Field

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

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

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

func (*ComputeSpecMutation) Fields

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

func (m *ComputeSpecMutation) ID() (id int32, 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 (*ComputeSpecMutation) IDs

func (m *ComputeSpecMutation) IDs(ctx context.Context) ([]int32, 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 (*ComputeSpecMutation) Memory

func (m *ComputeSpecMutation) Memory() (r string, exists bool)

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

func (*ComputeSpecMutation) OldCore

func (m *ComputeSpecMutation) OldCore(ctx context.Context) (v string, err error)

OldCore returns the old "core" field's value of the ComputeSpec entity. If the ComputeSpec 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 (*ComputeSpecMutation) OldField

func (m *ComputeSpecMutation) 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 (*ComputeSpecMutation) OldMemory

func (m *ComputeSpecMutation) OldMemory(ctx context.Context) (v string, err error)

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

func (m *ComputeSpecMutation) Op() Op

Op returns the operation name.

func (*ComputeSpecMutation) RemovedEdges

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

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

func (*ComputeSpecMutation) RemovedIDs

func (m *ComputeSpecMutation) 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 (*ComputeSpecMutation) ResetCore

func (m *ComputeSpecMutation) ResetCore()

ResetCore resets all changes to the "core" field.

func (*ComputeSpecMutation) ResetEdge

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

func (m *ComputeSpecMutation) 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 (*ComputeSpecMutation) ResetMemory

func (m *ComputeSpecMutation) ResetMemory()

ResetMemory resets all changes to the "memory" field.

func (*ComputeSpecMutation) SetCore

func (m *ComputeSpecMutation) SetCore(s string)

SetCore sets the "core" field.

func (*ComputeSpecMutation) SetField

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

func (m *ComputeSpecMutation) SetID(id int32)

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

func (*ComputeSpecMutation) SetMemory

func (m *ComputeSpecMutation) SetMemory(s string)

SetMemory sets the "memory" field.

func (*ComputeSpecMutation) SetOp

func (m *ComputeSpecMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ComputeSpecMutation) Tx

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

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

func (*ComputeSpecMutation) Type

func (m *ComputeSpecMutation) Type() string

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

func (*ComputeSpecMutation) Where

func (m *ComputeSpecMutation) Where(ps ...predicate.ComputeSpec)

Where appends a list predicates to the ComputeSpecMutation builder.

func (*ComputeSpecMutation) WhereP

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

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

type ComputeSpecQuery

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

ComputeSpecQuery is the builder for querying ComputeSpec entities.

func (*ComputeSpecQuery) Aggregate

func (csq *ComputeSpecQuery) Aggregate(fns ...AggregateFunc) *ComputeSpecSelect

Aggregate returns a ComputeSpecSelect configured with the given aggregations.

func (*ComputeSpecQuery) All

func (csq *ComputeSpecQuery) All(ctx context.Context) ([]*ComputeSpec, error)

All executes the query and returns a list of ComputeSpecs.

func (*ComputeSpecQuery) AllX

func (csq *ComputeSpecQuery) AllX(ctx context.Context) []*ComputeSpec

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

func (*ComputeSpecQuery) Clone

func (csq *ComputeSpecQuery) Clone() *ComputeSpecQuery

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

func (*ComputeSpecQuery) Count

func (csq *ComputeSpecQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComputeSpecQuery) CountX

func (csq *ComputeSpecQuery) CountX(ctx context.Context) int

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

func (*ComputeSpecQuery) Exist

func (csq *ComputeSpecQuery) Exist(ctx context.Context) (bool, error)

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

func (*ComputeSpecQuery) ExistX

func (csq *ComputeSpecQuery) ExistX(ctx context.Context) bool

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

func (*ComputeSpecQuery) First

func (csq *ComputeSpecQuery) First(ctx context.Context) (*ComputeSpec, error)

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

func (*ComputeSpecQuery) FirstID

func (csq *ComputeSpecQuery) FirstID(ctx context.Context) (id int32, err error)

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

func (*ComputeSpecQuery) FirstIDX

func (csq *ComputeSpecQuery) FirstIDX(ctx context.Context) int32

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

func (*ComputeSpecQuery) FirstX

func (csq *ComputeSpecQuery) FirstX(ctx context.Context) *ComputeSpec

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

func (*ComputeSpecQuery) GroupBy

func (csq *ComputeSpecQuery) GroupBy(field string, fields ...string) *ComputeSpecGroupBy

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

client.ComputeSpec.Query().
	GroupBy(computespec.FieldCore).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ComputeSpecQuery) IDs

func (csq *ComputeSpecQuery) IDs(ctx context.Context) (ids []int32, err error)

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

func (*ComputeSpecQuery) IDsX

func (csq *ComputeSpecQuery) IDsX(ctx context.Context) []int32

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

func (*ComputeSpecQuery) Limit

func (csq *ComputeSpecQuery) Limit(limit int) *ComputeSpecQuery

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

func (*ComputeSpecQuery) Offset

func (csq *ComputeSpecQuery) Offset(offset int) *ComputeSpecQuery

Offset to start from.

func (*ComputeSpecQuery) Only

func (csq *ComputeSpecQuery) Only(ctx context.Context) (*ComputeSpec, error)

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

func (*ComputeSpecQuery) OnlyID

func (csq *ComputeSpecQuery) OnlyID(ctx context.Context) (id int32, err error)

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

func (*ComputeSpecQuery) OnlyIDX

func (csq *ComputeSpecQuery) OnlyIDX(ctx context.Context) int32

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

func (*ComputeSpecQuery) OnlyX

func (csq *ComputeSpecQuery) OnlyX(ctx context.Context) *ComputeSpec

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

func (*ComputeSpecQuery) Order

Order specifies how the records should be ordered.

func (*ComputeSpecQuery) Select

func (csq *ComputeSpecQuery) Select(fields ...string) *ComputeSpecSelect

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

client.ComputeSpec.Query().
	Select(computespec.FieldCore).
	Scan(ctx, &v)

func (*ComputeSpecQuery) Unique

func (csq *ComputeSpecQuery) Unique(unique bool) *ComputeSpecQuery

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

Where adds a new predicate for the ComputeSpecQuery builder.

type ComputeSpecSelect

type ComputeSpecSelect struct {
	*ComputeSpecQuery
	// contains filtered or unexported fields
}

ComputeSpecSelect is the builder for selecting fields of ComputeSpec entities.

func (*ComputeSpecSelect) Aggregate

func (css *ComputeSpecSelect) Aggregate(fns ...AggregateFunc) *ComputeSpecSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ComputeSpecSelect) Bool

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

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

func (*ComputeSpecSelect) BoolX

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

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

func (*ComputeSpecSelect) Bools

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

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

func (*ComputeSpecSelect) BoolsX

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

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

func (*ComputeSpecSelect) Float64

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

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

func (*ComputeSpecSelect) Float64X

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

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

func (*ComputeSpecSelect) Float64s

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

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

func (*ComputeSpecSelect) Float64sX

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

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

func (*ComputeSpecSelect) Int

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

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

func (*ComputeSpecSelect) IntX

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

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

func (*ComputeSpecSelect) Ints

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

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

func (*ComputeSpecSelect) IntsX

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

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

func (*ComputeSpecSelect) Scan

func (css *ComputeSpecSelect) Scan(ctx context.Context, v any) error

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

func (*ComputeSpecSelect) ScanX

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

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

func (*ComputeSpecSelect) String

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

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

func (*ComputeSpecSelect) StringX

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

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

func (*ComputeSpecSelect) Strings

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

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

func (*ComputeSpecSelect) StringsX

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

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

type ComputeSpecUpdate

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

ComputeSpecUpdate is the builder for updating ComputeSpec entities.

func (*ComputeSpecUpdate) Exec

func (csu *ComputeSpecUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeSpecUpdate) ExecX

func (csu *ComputeSpecUpdate) ExecX(ctx context.Context)

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

func (*ComputeSpecUpdate) Mutation

func (csu *ComputeSpecUpdate) Mutation() *ComputeSpecMutation

Mutation returns the ComputeSpecMutation object of the builder.

func (*ComputeSpecUpdate) Save

func (csu *ComputeSpecUpdate) Save(ctx context.Context) (int, error)

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

func (*ComputeSpecUpdate) SaveX

func (csu *ComputeSpecUpdate) SaveX(ctx context.Context) int

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

func (*ComputeSpecUpdate) SetCore

func (csu *ComputeSpecUpdate) SetCore(s string) *ComputeSpecUpdate

SetCore sets the "core" field.

func (*ComputeSpecUpdate) SetMemory

func (csu *ComputeSpecUpdate) SetMemory(s string) *ComputeSpecUpdate

SetMemory sets the "memory" field.

func (*ComputeSpecUpdate) Where

Where appends a list predicates to the ComputeSpecUpdate builder.

type ComputeSpecUpdateOne

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

ComputeSpecUpdateOne is the builder for updating a single ComputeSpec entity.

func (*ComputeSpecUpdateOne) Exec

func (csuo *ComputeSpecUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ComputeSpecUpdateOne) ExecX

func (csuo *ComputeSpecUpdateOne) ExecX(ctx context.Context)

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

func (*ComputeSpecUpdateOne) Mutation

func (csuo *ComputeSpecUpdateOne) Mutation() *ComputeSpecMutation

Mutation returns the ComputeSpecMutation object of the builder.

func (*ComputeSpecUpdateOne) Save

Save executes the query and returns the updated ComputeSpec entity.

func (*ComputeSpecUpdateOne) SaveX

func (csuo *ComputeSpecUpdateOne) SaveX(ctx context.Context) *ComputeSpec

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

func (*ComputeSpecUpdateOne) Select

func (csuo *ComputeSpecUpdateOne) Select(field string, fields ...string) *ComputeSpecUpdateOne

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

func (*ComputeSpecUpdateOne) SetCore

SetCore sets the "core" field.

func (*ComputeSpecUpdateOne) SetMemory

func (csuo *ComputeSpecUpdateOne) SetMemory(s string) *ComputeSpecUpdateOne

SetMemory sets the "memory" field.

func (*ComputeSpecUpdateOne) Where

Where appends a list predicates to the ComputeSpecUpdate builder.

type ComputeSpecs

type ComputeSpecs []*ComputeSpec

ComputeSpecs is a parsable slice of ComputeSpec.

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 Employee

type Employee struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Age holds the value of the "age" field.
	Age int32 `json:"age,omitempty"`
	// contains filtered or unexported fields
}

Employee is the model entity for the Employee schema.

func (*Employee) String

func (e *Employee) String() string

String implements the fmt.Stringer.

func (*Employee) Unwrap

func (e *Employee) Unwrap() *Employee

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

func (e *Employee) Update() *EmployeeUpdateOne

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

func (*Employee) Value

func (e *Employee) Value(name string) (ent.Value, error)

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

type EmployeeClient

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

EmployeeClient is a client for the Employee schema.

func NewEmployeeClient

func NewEmployeeClient(c config) *EmployeeClient

NewEmployeeClient returns a client for the Employee from the given config.

func (*EmployeeClient) Create

func (c *EmployeeClient) Create() *EmployeeCreate

Create returns a builder for creating a Employee entity.

func (*EmployeeClient) CreateBulk

func (c *EmployeeClient) CreateBulk(builders ...*EmployeeCreate) *EmployeeCreateBulk

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

func (*EmployeeClient) Delete

func (c *EmployeeClient) Delete() *EmployeeDelete

Delete returns a delete builder for Employee.

func (*EmployeeClient) DeleteOne

func (c *EmployeeClient) DeleteOne(e *Employee) *EmployeeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EmployeeClient) DeleteOneID

func (c *EmployeeClient) DeleteOneID(id int) *EmployeeDeleteOne

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

func (*EmployeeClient) Get

func (c *EmployeeClient) Get(ctx context.Context, id int) (*Employee, error)

Get returns a Employee entity by its id.

func (*EmployeeClient) GetX

func (c *EmployeeClient) GetX(ctx context.Context, id int) *Employee

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

func (*EmployeeClient) Hooks

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

Hooks returns the client hooks.

func (*EmployeeClient) Intercept

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

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

func (*EmployeeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*EmployeeClient) Query

func (c *EmployeeClient) Query() *EmployeeQuery

Query returns a query builder for Employee.

func (*EmployeeClient) Update

func (c *EmployeeClient) Update() *EmployeeUpdate

Update returns an update builder for Employee.

func (*EmployeeClient) UpdateOne

func (c *EmployeeClient) UpdateOne(e *Employee) *EmployeeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EmployeeClient) UpdateOneID

func (c *EmployeeClient) UpdateOneID(id int) *EmployeeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EmployeeClient) Use

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

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

type EmployeeCreate

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

EmployeeCreate is the builder for creating a Employee entity.

func (*EmployeeCreate) Exec

func (ec *EmployeeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmployeeCreate) ExecX

func (ec *EmployeeCreate) ExecX(ctx context.Context)

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

func (*EmployeeCreate) Mutation

func (ec *EmployeeCreate) Mutation() *EmployeeMutation

Mutation returns the EmployeeMutation object of the builder.

func (*EmployeeCreate) Save

func (ec *EmployeeCreate) Save(ctx context.Context) (*Employee, error)

Save creates the Employee in the database.

func (*EmployeeCreate) SaveX

func (ec *EmployeeCreate) SaveX(ctx context.Context) *Employee

SaveX calls Save and panics if Save returns an error.

func (*EmployeeCreate) SetAge

func (ec *EmployeeCreate) SetAge(i int32) *EmployeeCreate

SetAge sets the "age" field.

func (*EmployeeCreate) SetName

func (ec *EmployeeCreate) SetName(s string) *EmployeeCreate

SetName sets the "name" field.

func (*EmployeeCreate) SetNillableAge

func (ec *EmployeeCreate) SetNillableAge(i *int32) *EmployeeCreate

SetNillableAge sets the "age" field if the given value is not nil.

type EmployeeCreateBulk

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

EmployeeCreateBulk is the builder for creating many Employee entities in bulk.

func (*EmployeeCreateBulk) Exec

func (ecb *EmployeeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EmployeeCreateBulk) ExecX

func (ecb *EmployeeCreateBulk) ExecX(ctx context.Context)

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

func (*EmployeeCreateBulk) Save

func (ecb *EmployeeCreateBulk) Save(ctx context.Context) ([]*Employee, error)

Save creates the Employee entities in the database.

func (*EmployeeCreateBulk) SaveX

func (ecb *EmployeeCreateBulk) SaveX(ctx context.Context) []*Employee

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

type EmployeeDelete

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

EmployeeDelete is the builder for deleting a Employee entity.

func (*EmployeeDelete) Exec

func (ed *EmployeeDelete) Exec(ctx context.Context) (int, error)

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

func (*EmployeeDelete) ExecX

func (ed *EmployeeDelete) ExecX(ctx context.Context) int

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

func (*EmployeeDelete) Where

func (ed *EmployeeDelete) Where(ps ...predicate.Employee) *EmployeeDelete

Where appends a list predicates to the EmployeeDelete builder.

type EmployeeDeleteOne

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

EmployeeDeleteOne is the builder for deleting a single Employee entity.

func (*EmployeeDeleteOne) Exec

func (edo *EmployeeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EmployeeDeleteOne) ExecX

func (edo *EmployeeDeleteOne) ExecX(ctx context.Context)

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

func (*EmployeeDeleteOne) Where

Where appends a list predicates to the EmployeeDelete builder.

type EmployeeGroupBy

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

EmployeeGroupBy is the group-by builder for Employee entities.

func (*EmployeeGroupBy) Aggregate

func (egb *EmployeeGroupBy) Aggregate(fns ...AggregateFunc) *EmployeeGroupBy

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

func (*EmployeeGroupBy) Bool

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

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

func (*EmployeeGroupBy) BoolX

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

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

func (*EmployeeGroupBy) Bools

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

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

func (*EmployeeGroupBy) BoolsX

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

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

func (*EmployeeGroupBy) Float64

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

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

func (*EmployeeGroupBy) Float64X

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

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

func (*EmployeeGroupBy) Float64s

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

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

func (*EmployeeGroupBy) Float64sX

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

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

func (*EmployeeGroupBy) Int

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

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

func (*EmployeeGroupBy) IntX

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

IntX is like Int, but panics if an error occurs.

func (*EmployeeGroupBy) Ints

func (s *EmployeeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EmployeeGroupBy) IntsX

func (s *EmployeeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EmployeeGroupBy) Scan

func (egb *EmployeeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EmployeeGroupBy) ScanX

func (s *EmployeeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EmployeeGroupBy) String

func (s *EmployeeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EmployeeGroupBy) StringX

func (s *EmployeeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EmployeeGroupBy) Strings

func (s *EmployeeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EmployeeGroupBy) StringsX

func (s *EmployeeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EmployeeMutation

type EmployeeMutation struct {
	// contains filtered or unexported fields
}

EmployeeMutation represents an operation that mutates the Employee nodes in the graph.

func (*EmployeeMutation) AddAge

func (m *EmployeeMutation) AddAge(i int32)

AddAge adds i to the "age" field.

func (*EmployeeMutation) AddField

func (m *EmployeeMutation) 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 (*EmployeeMutation) AddedAge

func (m *EmployeeMutation) AddedAge() (r int32, exists bool)

AddedAge returns the value that was added to the "age" field in this mutation.

func (*EmployeeMutation) AddedEdges

func (m *EmployeeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EmployeeMutation) AddedField

func (m *EmployeeMutation) 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 (*EmployeeMutation) AddedFields

func (m *EmployeeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EmployeeMutation) AddedIDs

func (m *EmployeeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EmployeeMutation) Age

func (m *EmployeeMutation) Age() (r int32, exists bool)

Age returns the value of the "age" field in the mutation.

func (*EmployeeMutation) AgeCleared

func (m *EmployeeMutation) AgeCleared() bool

AgeCleared returns if the "age" field was cleared in this mutation.

func (*EmployeeMutation) ClearAge

func (m *EmployeeMutation) ClearAge()

ClearAge clears the value of the "age" field.

func (*EmployeeMutation) ClearEdge

func (m *EmployeeMutation) 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 (*EmployeeMutation) ClearField

func (m *EmployeeMutation) 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 (*EmployeeMutation) ClearedEdges

func (m *EmployeeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EmployeeMutation) ClearedFields

func (m *EmployeeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EmployeeMutation) Client

func (m EmployeeMutation) 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 (*EmployeeMutation) EdgeCleared

func (m *EmployeeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EmployeeMutation) Field

func (m *EmployeeMutation) 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 (*EmployeeMutation) FieldCleared

func (m *EmployeeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EmployeeMutation) Fields

func (m *EmployeeMutation) 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 (*EmployeeMutation) ID

func (m *EmployeeMutation) 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 (*EmployeeMutation) IDs

func (m *EmployeeMutation) 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 (*EmployeeMutation) Name

func (m *EmployeeMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*EmployeeMutation) OldAge

func (m *EmployeeMutation) OldAge(ctx context.Context) (v int32, err error)

OldAge returns the old "age" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) OldField

func (m *EmployeeMutation) 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 (*EmployeeMutation) OldName

func (m *EmployeeMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) Op

func (m *EmployeeMutation) Op() Op

Op returns the operation name.

func (*EmployeeMutation) RemovedEdges

func (m *EmployeeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EmployeeMutation) RemovedIDs

func (m *EmployeeMutation) 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 (*EmployeeMutation) ResetAge

func (m *EmployeeMutation) ResetAge()

ResetAge resets all changes to the "age" field.

func (*EmployeeMutation) ResetEdge

func (m *EmployeeMutation) 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 (*EmployeeMutation) ResetField

func (m *EmployeeMutation) 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 (*EmployeeMutation) ResetName

func (m *EmployeeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EmployeeMutation) SetAge

func (m *EmployeeMutation) SetAge(i int32)

SetAge sets the "age" field.

func (*EmployeeMutation) SetField

func (m *EmployeeMutation) 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 (*EmployeeMutation) SetName

func (m *EmployeeMutation) SetName(s string)

SetName sets the "name" field.

func (*EmployeeMutation) SetOp

func (m *EmployeeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (EmployeeMutation) Tx

func (m EmployeeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EmployeeMutation) Type

func (m *EmployeeMutation) Type() string

Type returns the node type of this mutation (Employee).

func (*EmployeeMutation) Where

func (m *EmployeeMutation) Where(ps ...predicate.Employee)

Where appends a list predicates to the EmployeeMutation builder.

func (*EmployeeMutation) WhereP

func (m *EmployeeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EmployeeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EmployeeQuery

type EmployeeQuery struct {
	// contains filtered or unexported fields
}

EmployeeQuery is the builder for querying Employee entities.

func (*EmployeeQuery) Aggregate

func (eq *EmployeeQuery) Aggregate(fns ...AggregateFunc) *EmployeeSelect

Aggregate returns a EmployeeSelect configured with the given aggregations.

func (*EmployeeQuery) All

func (eq *EmployeeQuery) All(ctx context.Context) ([]*Employee, error)

All executes the query and returns a list of Employees.

func (*EmployeeQuery) AllX

func (eq *EmployeeQuery) AllX(ctx context.Context) []*Employee

AllX is like All, but panics if an error occurs.

func (*EmployeeQuery) Clone

func (eq *EmployeeQuery) Clone() *EmployeeQuery

Clone returns a duplicate of the EmployeeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EmployeeQuery) Count

func (eq *EmployeeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EmployeeQuery) CountX

func (eq *EmployeeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EmployeeQuery) Exist

func (eq *EmployeeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EmployeeQuery) ExistX

func (eq *EmployeeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EmployeeQuery) First

func (eq *EmployeeQuery) First(ctx context.Context) (*Employee, error)

First returns the first Employee entity from the query. Returns a *NotFoundError when no Employee was found.

func (*EmployeeQuery) FirstID

func (eq *EmployeeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Employee ID from the query. Returns a *NotFoundError when no Employee ID was found.

func (*EmployeeQuery) FirstIDX

func (eq *EmployeeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EmployeeQuery) FirstX

func (eq *EmployeeQuery) FirstX(ctx context.Context) *Employee

FirstX is like First, but panics if an error occurs.

func (*EmployeeQuery) GroupBy

func (eq *EmployeeQuery) GroupBy(field string, fields ...string) *EmployeeGroupBy

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.Employee.Query().
	GroupBy(employee.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EmployeeQuery) IDs

func (eq *EmployeeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Employee IDs.

func (*EmployeeQuery) IDsX

func (eq *EmployeeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EmployeeQuery) Limit

func (eq *EmployeeQuery) Limit(limit int) *EmployeeQuery

Limit the number of records to be returned by this query.

func (*EmployeeQuery) Offset

func (eq *EmployeeQuery) Offset(offset int) *EmployeeQuery

Offset to start from.

func (*EmployeeQuery) Only

func (eq *EmployeeQuery) Only(ctx context.Context) (*Employee, error)

Only returns a single Employee entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Employee entity is found. Returns a *NotFoundError when no Employee entities are found.

func (*EmployeeQuery) OnlyID

func (eq *EmployeeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Employee ID in the query. Returns a *NotSingularError when more than one Employee ID is found. Returns a *NotFoundError when no entities are found.

func (*EmployeeQuery) OnlyIDX

func (eq *EmployeeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EmployeeQuery) OnlyX

func (eq *EmployeeQuery) OnlyX(ctx context.Context) *Employee

OnlyX is like Only, but panics if an error occurs.

func (*EmployeeQuery) Order

Order specifies how the records should be ordered.

func (*EmployeeQuery) Select

func (eq *EmployeeQuery) Select(fields ...string) *EmployeeSelect

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.Employee.Query().
	Select(employee.FieldName).
	Scan(ctx, &v)

func (*EmployeeQuery) Unique

func (eq *EmployeeQuery) Unique(unique bool) *EmployeeQuery

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 (*EmployeeQuery) Where

func (eq *EmployeeQuery) Where(ps ...predicate.Employee) *EmployeeQuery

Where adds a new predicate for the EmployeeQuery builder.

type EmployeeSelect

type EmployeeSelect struct {
	*EmployeeQuery
	// contains filtered or unexported fields
}

EmployeeSelect is the builder for selecting fields of Employee entities.

func (*EmployeeSelect) Aggregate

func (es *EmployeeSelect) Aggregate(fns ...AggregateFunc) *EmployeeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EmployeeSelect) Bool

func (s *EmployeeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) BoolX

func (s *EmployeeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EmployeeSelect) Bools

func (s *EmployeeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) BoolsX

func (s *EmployeeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EmployeeSelect) Float64

func (s *EmployeeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) Float64X

func (s *EmployeeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EmployeeSelect) Float64s

func (s *EmployeeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) Float64sX

func (s *EmployeeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EmployeeSelect) Int

func (s *EmployeeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) IntX

func (s *EmployeeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EmployeeSelect) Ints

func (s *EmployeeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) IntsX

func (s *EmployeeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EmployeeSelect) Scan

func (es *EmployeeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EmployeeSelect) ScanX

func (s *EmployeeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EmployeeSelect) String

func (s *EmployeeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) StringX

func (s *EmployeeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EmployeeSelect) Strings

func (s *EmployeeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EmployeeSelect) StringsX

func (s *EmployeeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EmployeeUpdate

type EmployeeUpdate struct {
	// contains filtered or unexported fields
}

EmployeeUpdate is the builder for updating Employee entities.

func (*EmployeeUpdate) AddAge

func (eu *EmployeeUpdate) AddAge(i int32) *EmployeeUpdate

AddAge adds i to the "age" field.

func (*EmployeeUpdate) ClearAge

func (eu *EmployeeUpdate) ClearAge() *EmployeeUpdate

ClearAge clears the value of the "age" field.

func (*EmployeeUpdate) Exec

func (eu *EmployeeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmployeeUpdate) ExecX

func (eu *EmployeeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EmployeeUpdate) Mutation

func (eu *EmployeeUpdate) Mutation() *EmployeeMutation

Mutation returns the EmployeeMutation object of the builder.

func (*EmployeeUpdate) Save

func (eu *EmployeeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EmployeeUpdate) SaveX

func (eu *EmployeeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EmployeeUpdate) SetAge

func (eu *EmployeeUpdate) SetAge(i int32) *EmployeeUpdate

SetAge sets the "age" field.

func (*EmployeeUpdate) SetName

func (eu *EmployeeUpdate) SetName(s string) *EmployeeUpdate

SetName sets the "name" field.

func (*EmployeeUpdate) SetNillableAge

func (eu *EmployeeUpdate) SetNillableAge(i *int32) *EmployeeUpdate

SetNillableAge sets the "age" field if the given value is not nil.

func (*EmployeeUpdate) Where

func (eu *EmployeeUpdate) Where(ps ...predicate.Employee) *EmployeeUpdate

Where appends a list predicates to the EmployeeUpdate builder.

type EmployeeUpdateOne

type EmployeeUpdateOne struct {
	// contains filtered or unexported fields
}

EmployeeUpdateOne is the builder for updating a single Employee entity.

func (*EmployeeUpdateOne) AddAge

func (euo *EmployeeUpdateOne) AddAge(i int32) *EmployeeUpdateOne

AddAge adds i to the "age" field.

func (*EmployeeUpdateOne) ClearAge

func (euo *EmployeeUpdateOne) ClearAge() *EmployeeUpdateOne

ClearAge clears the value of the "age" field.

func (*EmployeeUpdateOne) Exec

func (euo *EmployeeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EmployeeUpdateOne) ExecX

func (euo *EmployeeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EmployeeUpdateOne) Mutation

func (euo *EmployeeUpdateOne) Mutation() *EmployeeMutation

Mutation returns the EmployeeMutation object of the builder.

func (*EmployeeUpdateOne) Save

func (euo *EmployeeUpdateOne) Save(ctx context.Context) (*Employee, error)

Save executes the query and returns the updated Employee entity.

func (*EmployeeUpdateOne) SaveX

func (euo *EmployeeUpdateOne) SaveX(ctx context.Context) *Employee

SaveX is like Save, but panics if an error occurs.

func (*EmployeeUpdateOne) Select

func (euo *EmployeeUpdateOne) Select(field string, fields ...string) *EmployeeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EmployeeUpdateOne) SetAge

func (euo *EmployeeUpdateOne) SetAge(i int32) *EmployeeUpdateOne

SetAge sets the "age" field.

func (*EmployeeUpdateOne) SetName

func (euo *EmployeeUpdateOne) SetName(s string) *EmployeeUpdateOne

SetName sets the "name" field.

func (*EmployeeUpdateOne) SetNillableAge

func (euo *EmployeeUpdateOne) SetNillableAge(i *int32) *EmployeeUpdateOne

SetNillableAge sets the "age" field if the given value is not nil.

func (*EmployeeUpdateOne) Where

Where appends a list predicates to the EmployeeUpdate builder.

type Employees

type Employees []*Employee

Employees is a parsable slice of Employee.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type 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 Script added in v0.0.3

type Script struct {

	// ID of the ent.
	ID int32 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// TaskNumber holds the value of the "task_number" field.
	TaskNumber int32 `json:"task_number,omitempty"`
	// ScriptName holds the value of the "script_name" field.
	ScriptName string `json:"script_name,omitempty"`
	// FileAddress holds the value of the "file_address" field.
	FileAddress string `json:"file_address,omitempty"`
	// ScriptContent holds the value of the "script_content" field.
	ScriptContent string `json:"script_content,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ScriptQuery when eager-loading is set.
	Edges ScriptEdges `json:"edges"`
	// contains filtered or unexported fields
}

Script is the model entity for the Script schema.

func (*Script) QueryScriptExecutionRecords added in v0.0.3

func (s *Script) QueryScriptExecutionRecords() *ScriptExecutionRecordQuery

QueryScriptExecutionRecords queries the "scriptExecutionRecords" edge of the Script entity.

func (*Script) String added in v0.0.3

func (s *Script) String() string

String implements the fmt.Stringer.

func (*Script) Unwrap added in v0.0.3

func (s *Script) Unwrap() *Script

Unwrap unwraps the Script 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 (*Script) Update added in v0.0.3

func (s *Script) Update() *ScriptUpdateOne

Update returns a builder for updating this Script. Note that you need to call Script.Unwrap() before calling this method if this Script was returned from a transaction, and the transaction was committed or rolled back.

func (*Script) Value added in v0.0.3

func (s *Script) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Script. This includes values selected through modifiers, order, etc.

type ScriptClient added in v0.0.3

type ScriptClient struct {
	// contains filtered or unexported fields
}

ScriptClient is a client for the Script schema.

func NewScriptClient added in v0.0.3

func NewScriptClient(c config) *ScriptClient

NewScriptClient returns a client for the Script from the given config.

func (*ScriptClient) Create added in v0.0.3

func (c *ScriptClient) Create() *ScriptCreate

Create returns a builder for creating a Script entity.

func (*ScriptClient) CreateBulk added in v0.0.3

func (c *ScriptClient) CreateBulk(builders ...*ScriptCreate) *ScriptCreateBulk

CreateBulk returns a builder for creating a bulk of Script entities.

func (*ScriptClient) Delete added in v0.0.3

func (c *ScriptClient) Delete() *ScriptDelete

Delete returns a delete builder for Script.

func (*ScriptClient) DeleteOne added in v0.0.3

func (c *ScriptClient) DeleteOne(s *Script) *ScriptDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ScriptClient) DeleteOneID added in v0.0.3

func (c *ScriptClient) DeleteOneID(id int32) *ScriptDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ScriptClient) Get added in v0.0.3

func (c *ScriptClient) Get(ctx context.Context, id int32) (*Script, error)

Get returns a Script entity by its id.

func (*ScriptClient) GetX added in v0.0.3

func (c *ScriptClient) GetX(ctx context.Context, id int32) *Script

GetX is like Get, but panics if an error occurs.

func (*ScriptClient) Hooks added in v0.0.3

func (c *ScriptClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScriptClient) Intercept added in v0.0.3

func (c *ScriptClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `script.Intercept(f(g(h())))`.

func (*ScriptClient) Interceptors added in v0.0.3

func (c *ScriptClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ScriptClient) Query added in v0.0.3

func (c *ScriptClient) Query() *ScriptQuery

Query returns a query builder for Script.

func (*ScriptClient) QueryScriptExecutionRecords added in v0.0.3

func (c *ScriptClient) QueryScriptExecutionRecords(s *Script) *ScriptExecutionRecordQuery

QueryScriptExecutionRecords queries the scriptExecutionRecords edge of a Script.

func (*ScriptClient) Update added in v0.0.3

func (c *ScriptClient) Update() *ScriptUpdate

Update returns an update builder for Script.

func (*ScriptClient) UpdateOne added in v0.0.3

func (c *ScriptClient) UpdateOne(s *Script) *ScriptUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScriptClient) UpdateOneID added in v0.0.3

func (c *ScriptClient) UpdateOneID(id int32) *ScriptUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ScriptClient) Use added in v0.0.3

func (c *ScriptClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `script.Hooks(f(g(h())))`.

type ScriptCreate added in v0.0.3

type ScriptCreate struct {
	// contains filtered or unexported fields
}

ScriptCreate is the builder for creating a Script entity.

func (*ScriptCreate) AddScriptExecutionRecordIDs added in v0.0.3

func (sc *ScriptCreate) AddScriptExecutionRecordIDs(ids ...int32) *ScriptCreate

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptCreate) AddScriptExecutionRecords added in v0.0.3

func (sc *ScriptCreate) AddScriptExecutionRecords(s ...*ScriptExecutionRecord) *ScriptCreate

AddScriptExecutionRecords adds the "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptCreate) Exec added in v0.0.3

func (sc *ScriptCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptCreate) ExecX added in v0.0.3

func (sc *ScriptCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptCreate) Mutation added in v0.0.3

func (sc *ScriptCreate) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptCreate) Save added in v0.0.3

func (sc *ScriptCreate) Save(ctx context.Context) (*Script, error)

Save creates the Script in the database.

func (*ScriptCreate) SaveX added in v0.0.3

func (sc *ScriptCreate) SaveX(ctx context.Context) *Script

SaveX calls Save and panics if Save returns an error.

func (*ScriptCreate) SetCreateTime added in v0.0.3

func (sc *ScriptCreate) SetCreateTime(t time.Time) *ScriptCreate

SetCreateTime sets the "create_time" field.

func (*ScriptCreate) SetFileAddress added in v0.0.3

func (sc *ScriptCreate) SetFileAddress(s string) *ScriptCreate

SetFileAddress sets the "file_address" field.

func (*ScriptCreate) SetID added in v0.0.3

func (sc *ScriptCreate) SetID(i int32) *ScriptCreate

SetID sets the "id" field.

func (*ScriptCreate) SetNillableCreateTime added in v0.0.3

func (sc *ScriptCreate) SetNillableCreateTime(t *time.Time) *ScriptCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptCreate) SetNillableUpdateTime added in v0.0.3

func (sc *ScriptCreate) SetNillableUpdateTime(t *time.Time) *ScriptCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptCreate) SetScriptContent added in v0.0.3

func (sc *ScriptCreate) SetScriptContent(s string) *ScriptCreate

SetScriptContent sets the "script_content" field.

func (*ScriptCreate) SetScriptName added in v0.0.3

func (sc *ScriptCreate) SetScriptName(s string) *ScriptCreate

SetScriptName sets the "script_name" field.

func (*ScriptCreate) SetTaskNumber added in v0.0.3

func (sc *ScriptCreate) SetTaskNumber(i int32) *ScriptCreate

SetTaskNumber sets the "task_number" field.

func (*ScriptCreate) SetUpdateTime added in v0.0.3

func (sc *ScriptCreate) SetUpdateTime(t time.Time) *ScriptCreate

SetUpdateTime sets the "update_time" field.

func (*ScriptCreate) SetUserID added in v0.0.3

func (sc *ScriptCreate) SetUserID(s string) *ScriptCreate

SetUserID sets the "user_id" field.

type ScriptCreateBulk added in v0.0.3

type ScriptCreateBulk struct {
	// contains filtered or unexported fields
}

ScriptCreateBulk is the builder for creating many Script entities in bulk.

func (*ScriptCreateBulk) Exec added in v0.0.3

func (scb *ScriptCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptCreateBulk) ExecX added in v0.0.3

func (scb *ScriptCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptCreateBulk) Save added in v0.0.3

func (scb *ScriptCreateBulk) Save(ctx context.Context) ([]*Script, error)

Save creates the Script entities in the database.

func (*ScriptCreateBulk) SaveX added in v0.0.3

func (scb *ScriptCreateBulk) SaveX(ctx context.Context) []*Script

SaveX is like Save, but panics if an error occurs.

type ScriptDelete added in v0.0.3

type ScriptDelete struct {
	// contains filtered or unexported fields
}

ScriptDelete is the builder for deleting a Script entity.

func (*ScriptDelete) Exec added in v0.0.3

func (sd *ScriptDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScriptDelete) ExecX added in v0.0.3

func (sd *ScriptDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ScriptDelete) Where added in v0.0.3

func (sd *ScriptDelete) Where(ps ...predicate.Script) *ScriptDelete

Where appends a list predicates to the ScriptDelete builder.

type ScriptDeleteOne added in v0.0.3

type ScriptDeleteOne struct {
	// contains filtered or unexported fields
}

ScriptDeleteOne is the builder for deleting a single Script entity.

func (*ScriptDeleteOne) Exec added in v0.0.3

func (sdo *ScriptDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ScriptDeleteOne) ExecX added in v0.0.3

func (sdo *ScriptDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptDeleteOne) Where added in v0.0.3

func (sdo *ScriptDeleteOne) Where(ps ...predicate.Script) *ScriptDeleteOne

Where appends a list predicates to the ScriptDelete builder.

type ScriptEdges added in v0.0.3

type ScriptEdges struct {
	// ScriptExecutionRecords holds the value of the scriptExecutionRecords edge.
	ScriptExecutionRecords []*ScriptExecutionRecord `json:"scriptExecutionRecords,omitempty"`
	// contains filtered or unexported fields
}

ScriptEdges holds the relations/edges for other nodes in the graph.

func (ScriptEdges) ScriptExecutionRecordsOrErr added in v0.0.3

func (e ScriptEdges) ScriptExecutionRecordsOrErr() ([]*ScriptExecutionRecord, error)

ScriptExecutionRecordsOrErr returns the ScriptExecutionRecords value or an error if the edge was not loaded in eager-loading.

type ScriptExecutionRecord added in v0.0.3

type ScriptExecutionRecord struct {

	// ID of the ent.
	ID int32 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// FkScriptID holds the value of the "fk_script_id" field.
	FkScriptID int32 `json:"fk_script_id,omitempty"`
	// ScriptContent holds the value of the "script_content" field.
	ScriptContent string `json:"script_content,omitempty"`
	// TaskNumber holds the value of the "task_number" field.
	TaskNumber int32 `json:"task_number,omitempty"`
	// ScriptName holds the value of the "script_name" field.
	ScriptName string `json:"script_name,omitempty"`
	// FileAddress holds the value of the "file_address" field.
	FileAddress string `json:"file_address,omitempty"`
	// ExecuteState holds the value of the "execute_state" field.
	ExecuteState int32 `json:"execute_state,omitempty"`
	// ExecuteResult holds the value of the "execute_result" field.
	ExecuteResult string `json:"execute_result,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ScriptExecutionRecordQuery when eager-loading is set.
	Edges ScriptExecutionRecordEdges `json:"edges"`
	// contains filtered or unexported fields
}

ScriptExecutionRecord is the model entity for the ScriptExecutionRecord schema.

func (*ScriptExecutionRecord) QueryScript added in v0.0.3

func (ser *ScriptExecutionRecord) QueryScript() *ScriptQuery

QueryScript queries the "script" edge of the ScriptExecutionRecord entity.

func (*ScriptExecutionRecord) String added in v0.0.3

func (ser *ScriptExecutionRecord) String() string

String implements the fmt.Stringer.

func (*ScriptExecutionRecord) Unwrap added in v0.0.3

Unwrap unwraps the ScriptExecutionRecord 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 (*ScriptExecutionRecord) Update added in v0.0.3

Update returns a builder for updating this ScriptExecutionRecord. Note that you need to call ScriptExecutionRecord.Unwrap() before calling this method if this ScriptExecutionRecord was returned from a transaction, and the transaction was committed or rolled back.

func (*ScriptExecutionRecord) Value added in v0.0.3

func (ser *ScriptExecutionRecord) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ScriptExecutionRecord. This includes values selected through modifiers, order, etc.

type ScriptExecutionRecordClient added in v0.0.3

type ScriptExecutionRecordClient struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordClient is a client for the ScriptExecutionRecord schema.

func NewScriptExecutionRecordClient added in v0.0.3

func NewScriptExecutionRecordClient(c config) *ScriptExecutionRecordClient

NewScriptExecutionRecordClient returns a client for the ScriptExecutionRecord from the given config.

func (*ScriptExecutionRecordClient) Create added in v0.0.3

Create returns a builder for creating a ScriptExecutionRecord entity.

func (*ScriptExecutionRecordClient) CreateBulk added in v0.0.3

CreateBulk returns a builder for creating a bulk of ScriptExecutionRecord entities.

func (*ScriptExecutionRecordClient) Delete added in v0.0.3

Delete returns a delete builder for ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) DeleteOne added in v0.0.3

DeleteOne returns a builder for deleting the given entity.

func (*ScriptExecutionRecordClient) DeleteOneID added in v0.0.3

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ScriptExecutionRecordClient) Get added in v0.0.3

Get returns a ScriptExecutionRecord entity by its id.

func (*ScriptExecutionRecordClient) GetX added in v0.0.3

GetX is like Get, but panics if an error occurs.

func (*ScriptExecutionRecordClient) Hooks added in v0.0.3

func (c *ScriptExecutionRecordClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScriptExecutionRecordClient) Intercept added in v0.0.3

func (c *ScriptExecutionRecordClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `scriptexecutionrecord.Intercept(f(g(h())))`.

func (*ScriptExecutionRecordClient) Interceptors added in v0.0.3

func (c *ScriptExecutionRecordClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ScriptExecutionRecordClient) Query added in v0.0.3

Query returns a query builder for ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) QueryScript added in v0.0.3

QueryScript queries the script edge of a ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) Update added in v0.0.3

Update returns an update builder for ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) UpdateOne added in v0.0.3

UpdateOne returns an update builder for the given entity.

func (*ScriptExecutionRecordClient) UpdateOneID added in v0.0.3

UpdateOneID returns an update builder for the given id.

func (*ScriptExecutionRecordClient) Use added in v0.0.3

func (c *ScriptExecutionRecordClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `scriptexecutionrecord.Hooks(f(g(h())))`.

type ScriptExecutionRecordCreate added in v0.0.3

type ScriptExecutionRecordCreate struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordCreate is the builder for creating a ScriptExecutionRecord entity.

func (*ScriptExecutionRecordCreate) Exec added in v0.0.3

Exec executes the query.

func (*ScriptExecutionRecordCreate) ExecX added in v0.0.3

func (serc *ScriptExecutionRecordCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordCreate) Mutation added in v0.0.3

Mutation returns the ScriptExecutionRecordMutation object of the builder.

func (*ScriptExecutionRecordCreate) Save added in v0.0.3

Save creates the ScriptExecutionRecord in the database.

func (*ScriptExecutionRecordCreate) SaveX added in v0.0.3

SaveX calls Save and panics if Save returns an error.

func (*ScriptExecutionRecordCreate) SetCreateTime added in v0.0.3

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordCreate) SetExecuteResult added in v0.0.3

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordCreate) SetExecuteState added in v0.0.3

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordCreate) SetFileAddress added in v0.0.5

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordCreate) SetFkScriptID added in v0.0.3

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordCreate) SetID added in v0.0.3

SetID sets the "id" field.

func (*ScriptExecutionRecordCreate) SetNillableCreateTime added in v0.0.3

func (serc *ScriptExecutionRecordCreate) SetNillableCreateTime(t *time.Time) *ScriptExecutionRecordCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptExecutionRecordCreate) SetNillableScriptID added in v0.0.3

func (serc *ScriptExecutionRecordCreate) SetNillableScriptID(id *int32) *ScriptExecutionRecordCreate

SetNillableScriptID sets the "script" edge to the Script entity by ID if the given value is not nil.

func (*ScriptExecutionRecordCreate) SetNillableUpdateTime added in v0.0.3

func (serc *ScriptExecutionRecordCreate) SetNillableUpdateTime(t *time.Time) *ScriptExecutionRecordCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptExecutionRecordCreate) SetScript added in v0.0.3

SetScript sets the "script" edge to the Script entity.

func (*ScriptExecutionRecordCreate) SetScriptContent added in v0.0.3

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordCreate) SetScriptID added in v0.0.3

SetScriptID sets the "script" edge to the Script entity by ID.

func (*ScriptExecutionRecordCreate) SetScriptName added in v0.0.5

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordCreate) SetTaskNumber added in v0.0.5

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordCreate) SetUpdateTime added in v0.0.3

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordCreate) SetUserID added in v0.0.3

SetUserID sets the "user_id" field.

type ScriptExecutionRecordCreateBulk added in v0.0.3

type ScriptExecutionRecordCreateBulk struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordCreateBulk is the builder for creating many ScriptExecutionRecord entities in bulk.

func (*ScriptExecutionRecordCreateBulk) Exec added in v0.0.3

Exec executes the query.

func (*ScriptExecutionRecordCreateBulk) ExecX added in v0.0.3

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordCreateBulk) Save added in v0.0.3

Save creates the ScriptExecutionRecord entities in the database.

func (*ScriptExecutionRecordCreateBulk) SaveX added in v0.0.3

SaveX is like Save, but panics if an error occurs.

type ScriptExecutionRecordDelete added in v0.0.3

type ScriptExecutionRecordDelete struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordDelete is the builder for deleting a ScriptExecutionRecord entity.

func (*ScriptExecutionRecordDelete) Exec added in v0.0.3

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScriptExecutionRecordDelete) ExecX added in v0.0.3

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordDelete) Where added in v0.0.3

Where appends a list predicates to the ScriptExecutionRecordDelete builder.

type ScriptExecutionRecordDeleteOne added in v0.0.3

type ScriptExecutionRecordDeleteOne struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordDeleteOne is the builder for deleting a single ScriptExecutionRecord entity.

func (*ScriptExecutionRecordDeleteOne) Exec added in v0.0.3

Exec executes the deletion query.

func (*ScriptExecutionRecordDeleteOne) ExecX added in v0.0.3

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordDeleteOne) Where added in v0.0.3

Where appends a list predicates to the ScriptExecutionRecordDelete builder.

type ScriptExecutionRecordEdges added in v0.0.3

type ScriptExecutionRecordEdges struct {
	// Script holds the value of the script edge.
	Script *Script `json:"script,omitempty"`
	// contains filtered or unexported fields
}

ScriptExecutionRecordEdges holds the relations/edges for other nodes in the graph.

func (ScriptExecutionRecordEdges) ScriptOrErr added in v0.0.3

func (e ScriptExecutionRecordEdges) ScriptOrErr() (*Script, error)

ScriptOrErr returns the Script value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ScriptExecutionRecordGroupBy added in v0.0.3

type ScriptExecutionRecordGroupBy struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordGroupBy is the group-by builder for ScriptExecutionRecord entities.

func (*ScriptExecutionRecordGroupBy) Aggregate added in v0.0.3

Aggregate adds the given aggregation functions to the group-by query.

func (*ScriptExecutionRecordGroupBy) Bool added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) BoolX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Bools added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) BoolsX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Float64 added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) Float64X added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Float64s added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) Float64sX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Int added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) IntX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Ints added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) IntsX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Scan added in v0.0.3

Scan applies the selector query and scans the result into the given value.

func (*ScriptExecutionRecordGroupBy) ScanX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) String added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) StringX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Strings added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordGroupBy) StringsX added in v0.0.3

func (s *ScriptExecutionRecordGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptExecutionRecordMutation added in v0.0.3

type ScriptExecutionRecordMutation struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordMutation represents an operation that mutates the ScriptExecutionRecord nodes in the graph.

func (*ScriptExecutionRecordMutation) AddExecuteState added in v0.0.3

func (m *ScriptExecutionRecordMutation) AddExecuteState(i int32)

AddExecuteState adds i to the "execute_state" field.

func (*ScriptExecutionRecordMutation) AddField added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) AddFkScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) AddFkScriptID(i int32)

AddFkScriptID adds i to the "fk_script_id" field.

func (*ScriptExecutionRecordMutation) AddTaskNumber added in v0.0.5

func (m *ScriptExecutionRecordMutation) AddTaskNumber(i int32)

AddTaskNumber adds i to the "task_number" field.

func (*ScriptExecutionRecordMutation) AddedEdges added in v0.0.3

func (m *ScriptExecutionRecordMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScriptExecutionRecordMutation) AddedExecuteState added in v0.0.3

func (m *ScriptExecutionRecordMutation) AddedExecuteState() (r int32, exists bool)

AddedExecuteState returns the value that was added to the "execute_state" field in this mutation.

func (*ScriptExecutionRecordMutation) AddedField added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) AddedFields added in v0.0.3

func (m *ScriptExecutionRecordMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScriptExecutionRecordMutation) AddedFkScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) AddedFkScriptID() (r int32, exists bool)

AddedFkScriptID returns the value that was added to the "fk_script_id" field in this mutation.

func (*ScriptExecutionRecordMutation) AddedIDs added in v0.0.3

func (m *ScriptExecutionRecordMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ScriptExecutionRecordMutation) AddedTaskNumber added in v0.0.5

func (m *ScriptExecutionRecordMutation) AddedTaskNumber() (r int32, exists bool)

AddedTaskNumber returns the value that was added to the "task_number" field in this mutation.

func (*ScriptExecutionRecordMutation) ClearEdge added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) ClearField added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) ClearScript added in v0.0.3

func (m *ScriptExecutionRecordMutation) ClearScript()

ClearScript clears the "script" edge to the Script entity.

func (*ScriptExecutionRecordMutation) ClearedEdges added in v0.0.3

func (m *ScriptExecutionRecordMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScriptExecutionRecordMutation) ClearedFields added in v0.0.3

func (m *ScriptExecutionRecordMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScriptExecutionRecordMutation) Client added in v0.0.3

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 (*ScriptExecutionRecordMutation) CreateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ScriptExecutionRecordMutation) EdgeCleared added in v0.0.3

func (m *ScriptExecutionRecordMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ScriptExecutionRecordMutation) ExecuteResult added in v0.0.3

func (m *ScriptExecutionRecordMutation) ExecuteResult() (r string, exists bool)

ExecuteResult returns the value of the "execute_result" field in the mutation.

func (*ScriptExecutionRecordMutation) ExecuteState added in v0.0.3

func (m *ScriptExecutionRecordMutation) ExecuteState() (r int32, exists bool)

ExecuteState returns the value of the "execute_state" field in the mutation.

func (*ScriptExecutionRecordMutation) Field added in v0.0.3

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 (*ScriptExecutionRecordMutation) FieldCleared added in v0.0.3

func (m *ScriptExecutionRecordMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ScriptExecutionRecordMutation) Fields added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) FileAddress added in v0.0.5

func (m *ScriptExecutionRecordMutation) FileAddress() (r string, exists bool)

FileAddress returns the value of the "file_address" field in the mutation.

func (*ScriptExecutionRecordMutation) FkScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) FkScriptID() (r int32, exists bool)

FkScriptID returns the value of the "fk_script_id" field in the mutation.

func (*ScriptExecutionRecordMutation) ID added in v0.0.3

func (m *ScriptExecutionRecordMutation) ID() (id int32, 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 (*ScriptExecutionRecordMutation) IDs added in v0.0.3

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 (*ScriptExecutionRecordMutation) OldCreateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldExecuteResult added in v0.0.3

func (m *ScriptExecutionRecordMutation) OldExecuteResult(ctx context.Context) (v string, err error)

OldExecuteResult returns the old "execute_result" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldExecuteState added in v0.0.3

func (m *ScriptExecutionRecordMutation) OldExecuteState(ctx context.Context) (v int32, err error)

OldExecuteState returns the old "execute_state" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldField added in v0.0.3

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 (*ScriptExecutionRecordMutation) OldFileAddress added in v0.0.5

func (m *ScriptExecutionRecordMutation) OldFileAddress(ctx context.Context) (v string, err error)

OldFileAddress returns the old "file_address" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldFkScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) OldFkScriptID(ctx context.Context) (v int32, err error)

OldFkScriptID returns the old "fk_script_id" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldScriptContent added in v0.0.3

func (m *ScriptExecutionRecordMutation) OldScriptContent(ctx context.Context) (v string, err error)

OldScriptContent returns the old "script_content" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldScriptName added in v0.0.5

func (m *ScriptExecutionRecordMutation) OldScriptName(ctx context.Context) (v string, err error)

OldScriptName returns the old "script_name" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldTaskNumber added in v0.0.5

func (m *ScriptExecutionRecordMutation) OldTaskNumber(ctx context.Context) (v int32, err error)

OldTaskNumber returns the old "task_number" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldUpdateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) OldUserID added in v0.0.3

func (m *ScriptExecutionRecordMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the ScriptExecutionRecord entity. If the ScriptExecutionRecord 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 (*ScriptExecutionRecordMutation) Op added in v0.0.3

Op returns the operation name.

func (*ScriptExecutionRecordMutation) RemovedEdges added in v0.0.3

func (m *ScriptExecutionRecordMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScriptExecutionRecordMutation) RemovedIDs added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) ResetCreateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ScriptExecutionRecordMutation) ResetEdge added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) ResetExecuteResult added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetExecuteResult()

ResetExecuteResult resets all changes to the "execute_result" field.

func (*ScriptExecutionRecordMutation) ResetExecuteState added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetExecuteState()

ResetExecuteState resets all changes to the "execute_state" field.

func (*ScriptExecutionRecordMutation) ResetField added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) ResetFileAddress added in v0.0.5

func (m *ScriptExecutionRecordMutation) ResetFileAddress()

ResetFileAddress resets all changes to the "file_address" field.

func (*ScriptExecutionRecordMutation) ResetFkScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetFkScriptID()

ResetFkScriptID resets all changes to the "fk_script_id" field.

func (*ScriptExecutionRecordMutation) ResetScript added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetScript()

ResetScript resets all changes to the "script" edge.

func (*ScriptExecutionRecordMutation) ResetScriptContent added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetScriptContent()

ResetScriptContent resets all changes to the "script_content" field.

func (*ScriptExecutionRecordMutation) ResetScriptName added in v0.0.5

func (m *ScriptExecutionRecordMutation) ResetScriptName()

ResetScriptName resets all changes to the "script_name" field.

func (*ScriptExecutionRecordMutation) ResetTaskNumber added in v0.0.5

func (m *ScriptExecutionRecordMutation) ResetTaskNumber()

ResetTaskNumber resets all changes to the "task_number" field.

func (*ScriptExecutionRecordMutation) ResetUpdateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ScriptExecutionRecordMutation) ResetUserID added in v0.0.3

func (m *ScriptExecutionRecordMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ScriptExecutionRecordMutation) ScriptCleared added in v0.0.3

func (m *ScriptExecutionRecordMutation) ScriptCleared() bool

ScriptCleared reports if the "script" edge to the Script entity was cleared.

func (*ScriptExecutionRecordMutation) ScriptContent added in v0.0.3

func (m *ScriptExecutionRecordMutation) ScriptContent() (r string, exists bool)

ScriptContent returns the value of the "script_content" field in the mutation.

func (*ScriptExecutionRecordMutation) ScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) ScriptID() (id int32, exists bool)

ScriptID returns the "script" edge ID in the mutation.

func (*ScriptExecutionRecordMutation) ScriptIDs added in v0.0.3

func (m *ScriptExecutionRecordMutation) ScriptIDs() (ids []int32)

ScriptIDs returns the "script" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ScriptID instead. It exists only for internal usage by the builders.

func (*ScriptExecutionRecordMutation) ScriptName added in v0.0.5

func (m *ScriptExecutionRecordMutation) ScriptName() (r string, exists bool)

ScriptName returns the value of the "script_name" field in the mutation.

func (*ScriptExecutionRecordMutation) SetCreateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordMutation) SetExecuteResult added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetExecuteResult(s string)

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordMutation) SetExecuteState added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetExecuteState(i int32)

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordMutation) SetField added in v0.0.3

func (m *ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) SetFileAddress added in v0.0.5

func (m *ScriptExecutionRecordMutation) SetFileAddress(s string)

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordMutation) SetFkScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetFkScriptID(i int32)

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordMutation) SetID added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetID(id int32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ScriptExecutionRecord entities.

func (*ScriptExecutionRecordMutation) SetOp added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ScriptExecutionRecordMutation) SetScriptContent added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetScriptContent(s string)

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordMutation) SetScriptID added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetScriptID(id int32)

SetScriptID sets the "script" edge to the Script entity by id.

func (*ScriptExecutionRecordMutation) SetScriptName added in v0.0.5

func (m *ScriptExecutionRecordMutation) SetScriptName(s string)

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordMutation) SetTaskNumber added in v0.0.5

func (m *ScriptExecutionRecordMutation) SetTaskNumber(i int32)

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordMutation) SetUpdateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordMutation) SetUserID added in v0.0.3

func (m *ScriptExecutionRecordMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*ScriptExecutionRecordMutation) TaskNumber added in v0.0.5

func (m *ScriptExecutionRecordMutation) TaskNumber() (r int32, exists bool)

TaskNumber returns the value of the "task_number" field in the mutation.

func (ScriptExecutionRecordMutation) Tx added in v0.0.3

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScriptExecutionRecordMutation) Type added in v0.0.3

Type returns the node type of this mutation (ScriptExecutionRecord).

func (*ScriptExecutionRecordMutation) UpdateTime added in v0.0.3

func (m *ScriptExecutionRecordMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ScriptExecutionRecordMutation) UserID added in v0.0.3

func (m *ScriptExecutionRecordMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ScriptExecutionRecordMutation) Where added in v0.0.3

Where appends a list predicates to the ScriptExecutionRecordMutation builder.

func (*ScriptExecutionRecordMutation) WhereP added in v0.0.3

func (m *ScriptExecutionRecordMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ScriptExecutionRecordMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ScriptExecutionRecordQuery added in v0.0.3

type ScriptExecutionRecordQuery struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordQuery is the builder for querying ScriptExecutionRecord entities.

func (*ScriptExecutionRecordQuery) Aggregate added in v0.0.3

Aggregate returns a ScriptExecutionRecordSelect configured with the given aggregations.

func (*ScriptExecutionRecordQuery) All added in v0.0.3

All executes the query and returns a list of ScriptExecutionRecords.

func (*ScriptExecutionRecordQuery) AllX added in v0.0.3

AllX is like All, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Clone added in v0.0.3

Clone returns a duplicate of the ScriptExecutionRecordQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ScriptExecutionRecordQuery) Count added in v0.0.3

func (serq *ScriptExecutionRecordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScriptExecutionRecordQuery) CountX added in v0.0.3

func (serq *ScriptExecutionRecordQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Exist added in v0.0.3

func (serq *ScriptExecutionRecordQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScriptExecutionRecordQuery) ExistX added in v0.0.3

func (serq *ScriptExecutionRecordQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) First added in v0.0.3

First returns the first ScriptExecutionRecord entity from the query. Returns a *NotFoundError when no ScriptExecutionRecord was found.

func (*ScriptExecutionRecordQuery) FirstID added in v0.0.3

func (serq *ScriptExecutionRecordQuery) FirstID(ctx context.Context) (id int32, err error)

FirstID returns the first ScriptExecutionRecord ID from the query. Returns a *NotFoundError when no ScriptExecutionRecord ID was found.

func (*ScriptExecutionRecordQuery) FirstIDX added in v0.0.3

func (serq *ScriptExecutionRecordQuery) FirstIDX(ctx context.Context) int32

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) FirstX added in v0.0.3

FirstX is like First, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) GroupBy added in v0.0.3

func (serq *ScriptExecutionRecordQuery) GroupBy(field string, fields ...string) *ScriptExecutionRecordGroupBy

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 {
	UserID string `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ScriptExecutionRecord.Query().
	GroupBy(scriptexecutionrecord.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ScriptExecutionRecordQuery) IDs added in v0.0.3

func (serq *ScriptExecutionRecordQuery) IDs(ctx context.Context) (ids []int32, err error)

IDs executes the query and returns a list of ScriptExecutionRecord IDs.

func (*ScriptExecutionRecordQuery) IDsX added in v0.0.3

func (serq *ScriptExecutionRecordQuery) IDsX(ctx context.Context) []int32

IDsX is like IDs, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Limit added in v0.0.3

Limit the number of records to be returned by this query.

func (*ScriptExecutionRecordQuery) Offset added in v0.0.3

Offset to start from.

func (*ScriptExecutionRecordQuery) Only added in v0.0.3

Only returns a single ScriptExecutionRecord entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ScriptExecutionRecord entity is found. Returns a *NotFoundError when no ScriptExecutionRecord entities are found.

func (*ScriptExecutionRecordQuery) OnlyID added in v0.0.3

func (serq *ScriptExecutionRecordQuery) OnlyID(ctx context.Context) (id int32, err error)

OnlyID is like Only, but returns the only ScriptExecutionRecord ID in the query. Returns a *NotSingularError when more than one ScriptExecutionRecord ID is found. Returns a *NotFoundError when no entities are found.

func (*ScriptExecutionRecordQuery) OnlyIDX added in v0.0.3

func (serq *ScriptExecutionRecordQuery) OnlyIDX(ctx context.Context) int32

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) OnlyX added in v0.0.3

OnlyX is like Only, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Order added in v0.0.3

Order specifies how the records should be ordered.

func (*ScriptExecutionRecordQuery) QueryScript added in v0.0.3

func (serq *ScriptExecutionRecordQuery) QueryScript() *ScriptQuery

QueryScript chains the current query on the "script" edge.

func (*ScriptExecutionRecordQuery) Select added in v0.0.3

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 {
	UserID string `json:"user_id,omitempty"`
}

client.ScriptExecutionRecord.Query().
	Select(scriptexecutionrecord.FieldUserID).
	Scan(ctx, &v)

func (*ScriptExecutionRecordQuery) Unique added in v0.0.3

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 (*ScriptExecutionRecordQuery) Where added in v0.0.3

Where adds a new predicate for the ScriptExecutionRecordQuery builder.

func (*ScriptExecutionRecordQuery) WithScript added in v0.0.3

func (serq *ScriptExecutionRecordQuery) WithScript(opts ...func(*ScriptQuery)) *ScriptExecutionRecordQuery

WithScript tells the query-builder to eager-load the nodes that are connected to the "script" edge. The optional arguments are used to configure the query builder of the edge.

type ScriptExecutionRecordSelect added in v0.0.3

type ScriptExecutionRecordSelect struct {
	*ScriptExecutionRecordQuery
	// contains filtered or unexported fields
}

ScriptExecutionRecordSelect is the builder for selecting fields of ScriptExecutionRecord entities.

func (*ScriptExecutionRecordSelect) Aggregate added in v0.0.3

Aggregate adds the given aggregation functions to the selector query.

func (*ScriptExecutionRecordSelect) Bool added in v0.0.3

func (s *ScriptExecutionRecordSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) BoolX added in v0.0.3

func (s *ScriptExecutionRecordSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Bools added in v0.0.3

func (s *ScriptExecutionRecordSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) BoolsX added in v0.0.3

func (s *ScriptExecutionRecordSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Float64 added in v0.0.3

func (s *ScriptExecutionRecordSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) Float64X added in v0.0.3

func (s *ScriptExecutionRecordSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Float64s added in v0.0.3

func (s *ScriptExecutionRecordSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) Float64sX added in v0.0.3

func (s *ScriptExecutionRecordSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Int added in v0.0.3

func (s *ScriptExecutionRecordSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) IntX added in v0.0.3

func (s *ScriptExecutionRecordSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Ints added in v0.0.3

func (s *ScriptExecutionRecordSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) IntsX added in v0.0.3

func (s *ScriptExecutionRecordSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Scan added in v0.0.3

Scan applies the selector query and scans the result into the given value.

func (*ScriptExecutionRecordSelect) ScanX added in v0.0.3

func (s *ScriptExecutionRecordSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) String added in v0.0.3

func (s *ScriptExecutionRecordSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) StringX added in v0.0.3

func (s *ScriptExecutionRecordSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Strings added in v0.0.3

func (s *ScriptExecutionRecordSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptExecutionRecordSelect) StringsX added in v0.0.3

func (s *ScriptExecutionRecordSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptExecutionRecordUpdate added in v0.0.3

type ScriptExecutionRecordUpdate struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordUpdate is the builder for updating ScriptExecutionRecord entities.

func (*ScriptExecutionRecordUpdate) AddExecuteState added in v0.0.3

AddExecuteState adds i to the "execute_state" field.

func (*ScriptExecutionRecordUpdate) AddFkScriptID added in v0.0.3

AddFkScriptID adds i to the "fk_script_id" field.

func (*ScriptExecutionRecordUpdate) AddTaskNumber added in v0.0.5

AddTaskNumber adds i to the "task_number" field.

func (*ScriptExecutionRecordUpdate) ClearScript added in v0.0.3

ClearScript clears the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdate) Exec added in v0.0.3

Exec executes the query.

func (*ScriptExecutionRecordUpdate) ExecX added in v0.0.3

func (seru *ScriptExecutionRecordUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordUpdate) Mutation added in v0.0.3

Mutation returns the ScriptExecutionRecordMutation object of the builder.

func (*ScriptExecutionRecordUpdate) Save added in v0.0.3

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScriptExecutionRecordUpdate) SaveX added in v0.0.3

SaveX is like Save, but panics if an error occurs.

func (*ScriptExecutionRecordUpdate) SetCreateTime added in v0.0.3

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordUpdate) SetExecuteResult added in v0.0.3

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordUpdate) SetExecuteState added in v0.0.3

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordUpdate) SetFileAddress added in v0.0.5

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordUpdate) SetFkScriptID added in v0.0.3

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordUpdate) SetNillableCreateTime added in v0.0.3

func (seru *ScriptExecutionRecordUpdate) SetNillableCreateTime(t *time.Time) *ScriptExecutionRecordUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableScriptID added in v0.0.3

func (seru *ScriptExecutionRecordUpdate) SetNillableScriptID(id *int32) *ScriptExecutionRecordUpdate

SetNillableScriptID sets the "script" edge to the Script entity by ID if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableUpdateTime added in v0.0.3

func (seru *ScriptExecutionRecordUpdate) SetNillableUpdateTime(t *time.Time) *ScriptExecutionRecordUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetScript added in v0.0.3

SetScript sets the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdate) SetScriptContent added in v0.0.3

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordUpdate) SetScriptID added in v0.0.3

SetScriptID sets the "script" edge to the Script entity by ID.

func (*ScriptExecutionRecordUpdate) SetScriptName added in v0.0.5

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordUpdate) SetTaskNumber added in v0.0.5

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordUpdate) SetUpdateTime added in v0.0.3

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordUpdate) SetUserID added in v0.0.3

SetUserID sets the "user_id" field.

func (*ScriptExecutionRecordUpdate) Where added in v0.0.3

Where appends a list predicates to the ScriptExecutionRecordUpdate builder.

type ScriptExecutionRecordUpdateOne added in v0.0.3

type ScriptExecutionRecordUpdateOne struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordUpdateOne is the builder for updating a single ScriptExecutionRecord entity.

func (*ScriptExecutionRecordUpdateOne) AddExecuteState added in v0.0.3

AddExecuteState adds i to the "execute_state" field.

func (*ScriptExecutionRecordUpdateOne) AddFkScriptID added in v0.0.3

AddFkScriptID adds i to the "fk_script_id" field.

func (*ScriptExecutionRecordUpdateOne) AddTaskNumber added in v0.0.5

AddTaskNumber adds i to the "task_number" field.

func (*ScriptExecutionRecordUpdateOne) ClearScript added in v0.0.3

ClearScript clears the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdateOne) Exec added in v0.0.3

Exec executes the query on the entity.

func (*ScriptExecutionRecordUpdateOne) ExecX added in v0.0.3

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordUpdateOne) Mutation added in v0.0.3

Mutation returns the ScriptExecutionRecordMutation object of the builder.

func (*ScriptExecutionRecordUpdateOne) Save added in v0.0.3

Save executes the query and returns the updated ScriptExecutionRecord entity.

func (*ScriptExecutionRecordUpdateOne) SaveX added in v0.0.3

SaveX is like Save, but panics if an error occurs.

func (*ScriptExecutionRecordUpdateOne) Select added in v0.0.3

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ScriptExecutionRecordUpdateOne) SetCreateTime added in v0.0.3

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordUpdateOne) SetExecuteResult added in v0.0.3

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordUpdateOne) SetExecuteState added in v0.0.3

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordUpdateOne) SetFileAddress added in v0.0.5

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordUpdateOne) SetFkScriptID added in v0.0.3

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordUpdateOne) SetNillableCreateTime added in v0.0.3

func (seruo *ScriptExecutionRecordUpdateOne) SetNillableCreateTime(t *time.Time) *ScriptExecutionRecordUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableScriptID added in v0.0.3

func (seruo *ScriptExecutionRecordUpdateOne) SetNillableScriptID(id *int32) *ScriptExecutionRecordUpdateOne

SetNillableScriptID sets the "script" edge to the Script entity by ID if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableUpdateTime added in v0.0.3

func (seruo *ScriptExecutionRecordUpdateOne) SetNillableUpdateTime(t *time.Time) *ScriptExecutionRecordUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetScript added in v0.0.3

SetScript sets the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdateOne) SetScriptContent added in v0.0.3

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordUpdateOne) SetScriptID added in v0.0.3

SetScriptID sets the "script" edge to the Script entity by ID.

func (*ScriptExecutionRecordUpdateOne) SetScriptName added in v0.0.5

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordUpdateOne) SetTaskNumber added in v0.0.5

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordUpdateOne) SetUpdateTime added in v0.0.3

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordUpdateOne) SetUserID added in v0.0.3

SetUserID sets the "user_id" field.

func (*ScriptExecutionRecordUpdateOne) Where added in v0.0.3

Where appends a list predicates to the ScriptExecutionRecordUpdate builder.

type ScriptExecutionRecords added in v0.0.3

type ScriptExecutionRecords []*ScriptExecutionRecord

ScriptExecutionRecords is a parsable slice of ScriptExecutionRecord.

type ScriptGroupBy added in v0.0.3

type ScriptGroupBy struct {
	// contains filtered or unexported fields
}

ScriptGroupBy is the group-by builder for Script entities.

func (*ScriptGroupBy) Aggregate added in v0.0.3

func (sgb *ScriptGroupBy) Aggregate(fns ...AggregateFunc) *ScriptGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ScriptGroupBy) Bool added in v0.0.3

func (s *ScriptGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) BoolX added in v0.0.3

func (s *ScriptGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptGroupBy) Bools added in v0.0.3

func (s *ScriptGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) BoolsX added in v0.0.3

func (s *ScriptGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptGroupBy) Float64 added in v0.0.3

func (s *ScriptGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) Float64X added in v0.0.3

func (s *ScriptGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptGroupBy) Float64s added in v0.0.3

func (s *ScriptGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) Float64sX added in v0.0.3

func (s *ScriptGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptGroupBy) Int added in v0.0.3

func (s *ScriptGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) IntX added in v0.0.3

func (s *ScriptGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptGroupBy) Ints added in v0.0.3

func (s *ScriptGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) IntsX added in v0.0.3

func (s *ScriptGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptGroupBy) Scan added in v0.0.3

func (sgb *ScriptGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptGroupBy) ScanX added in v0.0.3

func (s *ScriptGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptGroupBy) String added in v0.0.3

func (s *ScriptGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) StringX added in v0.0.3

func (s *ScriptGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptGroupBy) Strings added in v0.0.3

func (s *ScriptGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) StringsX added in v0.0.3

func (s *ScriptGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptMutation added in v0.0.3

type ScriptMutation struct {
	// contains filtered or unexported fields
}

ScriptMutation represents an operation that mutates the Script nodes in the graph.

func (*ScriptMutation) AddField added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) AddScriptExecutionRecordIDs added in v0.0.3

func (m *ScriptMutation) AddScriptExecutionRecordIDs(ids ...int32)

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by ids.

func (*ScriptMutation) AddTaskNumber added in v0.0.3

func (m *ScriptMutation) AddTaskNumber(i int32)

AddTaskNumber adds i to the "task_number" field.

func (*ScriptMutation) AddedEdges added in v0.0.3

func (m *ScriptMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScriptMutation) AddedField added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) AddedFields added in v0.0.3

func (m *ScriptMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScriptMutation) AddedIDs added in v0.0.3

func (m *ScriptMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ScriptMutation) AddedTaskNumber added in v0.0.3

func (m *ScriptMutation) AddedTaskNumber() (r int32, exists bool)

AddedTaskNumber returns the value that was added to the "task_number" field in this mutation.

func (*ScriptMutation) ClearEdge added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) ClearField added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) ClearScriptExecutionRecords added in v0.0.3

func (m *ScriptMutation) ClearScriptExecutionRecords()

ClearScriptExecutionRecords clears the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity.

func (*ScriptMutation) ClearedEdges added in v0.0.3

func (m *ScriptMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScriptMutation) ClearedFields added in v0.0.3

func (m *ScriptMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScriptMutation) Client added in v0.0.3

func (m ScriptMutation) 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 (*ScriptMutation) CreateTime added in v0.0.3

func (m *ScriptMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ScriptMutation) EdgeCleared added in v0.0.3

func (m *ScriptMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ScriptMutation) Field added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) FieldCleared added in v0.0.3

func (m *ScriptMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ScriptMutation) Fields added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) FileAddress added in v0.0.3

func (m *ScriptMutation) FileAddress() (r string, exists bool)

FileAddress returns the value of the "file_address" field in the mutation.

func (*ScriptMutation) ID added in v0.0.3

func (m *ScriptMutation) ID() (id int32, 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 (*ScriptMutation) IDs added in v0.0.3

func (m *ScriptMutation) IDs(ctx context.Context) ([]int32, 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 (*ScriptMutation) OldCreateTime added in v0.0.3

func (m *ScriptMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Script entity. If the Script 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 (*ScriptMutation) OldField added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) OldFileAddress added in v0.0.3

func (m *ScriptMutation) OldFileAddress(ctx context.Context) (v string, err error)

OldFileAddress returns the old "file_address" field's value of the Script entity. If the Script 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 (*ScriptMutation) OldScriptContent added in v0.0.3

func (m *ScriptMutation) OldScriptContent(ctx context.Context) (v string, err error)

OldScriptContent returns the old "script_content" field's value of the Script entity. If the Script 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 (*ScriptMutation) OldScriptName added in v0.0.3

func (m *ScriptMutation) OldScriptName(ctx context.Context) (v string, err error)

OldScriptName returns the old "script_name" field's value of the Script entity. If the Script 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 (*ScriptMutation) OldTaskNumber added in v0.0.3

func (m *ScriptMutation) OldTaskNumber(ctx context.Context) (v int32, err error)

OldTaskNumber returns the old "task_number" field's value of the Script entity. If the Script 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 (*ScriptMutation) OldUpdateTime added in v0.0.3

func (m *ScriptMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Script entity. If the Script 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 (*ScriptMutation) OldUserID added in v0.0.3

func (m *ScriptMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the Script entity. If the Script 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 (*ScriptMutation) Op added in v0.0.3

func (m *ScriptMutation) Op() Op

Op returns the operation name.

func (*ScriptMutation) RemoveScriptExecutionRecordIDs added in v0.0.3

func (m *ScriptMutation) RemoveScriptExecutionRecordIDs(ids ...int32)

RemoveScriptExecutionRecordIDs removes the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptMutation) RemovedEdges added in v0.0.3

func (m *ScriptMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScriptMutation) RemovedIDs added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) RemovedScriptExecutionRecordsIDs added in v0.0.3

func (m *ScriptMutation) RemovedScriptExecutionRecordsIDs() (ids []int32)

RemovedScriptExecutionRecords returns the removed IDs of the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity.

func (*ScriptMutation) ResetCreateTime added in v0.0.3

func (m *ScriptMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ScriptMutation) ResetEdge added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) ResetField added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) ResetFileAddress added in v0.0.3

func (m *ScriptMutation) ResetFileAddress()

ResetFileAddress resets all changes to the "file_address" field.

func (*ScriptMutation) ResetScriptContent added in v0.0.3

func (m *ScriptMutation) ResetScriptContent()

ResetScriptContent resets all changes to the "script_content" field.

func (*ScriptMutation) ResetScriptExecutionRecords added in v0.0.3

func (m *ScriptMutation) ResetScriptExecutionRecords()

ResetScriptExecutionRecords resets all changes to the "scriptExecutionRecords" edge.

func (*ScriptMutation) ResetScriptName added in v0.0.3

func (m *ScriptMutation) ResetScriptName()

ResetScriptName resets all changes to the "script_name" field.

func (*ScriptMutation) ResetTaskNumber added in v0.0.3

func (m *ScriptMutation) ResetTaskNumber()

ResetTaskNumber resets all changes to the "task_number" field.

func (*ScriptMutation) ResetUpdateTime added in v0.0.3

func (m *ScriptMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ScriptMutation) ResetUserID added in v0.0.3

func (m *ScriptMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ScriptMutation) ScriptContent added in v0.0.3

func (m *ScriptMutation) ScriptContent() (r string, exists bool)

ScriptContent returns the value of the "script_content" field in the mutation.

func (*ScriptMutation) ScriptExecutionRecordsCleared added in v0.0.3

func (m *ScriptMutation) ScriptExecutionRecordsCleared() bool

ScriptExecutionRecordsCleared reports if the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity was cleared.

func (*ScriptMutation) ScriptExecutionRecordsIDs added in v0.0.3

func (m *ScriptMutation) ScriptExecutionRecordsIDs() (ids []int32)

ScriptExecutionRecordsIDs returns the "scriptExecutionRecords" edge IDs in the mutation.

func (*ScriptMutation) ScriptName added in v0.0.3

func (m *ScriptMutation) ScriptName() (r string, exists bool)

ScriptName returns the value of the "script_name" field in the mutation.

func (*ScriptMutation) SetCreateTime added in v0.0.3

func (m *ScriptMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ScriptMutation) SetField added in v0.0.3

func (m *ScriptMutation) 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 (*ScriptMutation) SetFileAddress added in v0.0.3

func (m *ScriptMutation) SetFileAddress(s string)

SetFileAddress sets the "file_address" field.

func (*ScriptMutation) SetID added in v0.0.3

func (m *ScriptMutation) SetID(id int32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Script entities.

func (*ScriptMutation) SetOp added in v0.0.3

func (m *ScriptMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ScriptMutation) SetScriptContent added in v0.0.3

func (m *ScriptMutation) SetScriptContent(s string)

SetScriptContent sets the "script_content" field.

func (*ScriptMutation) SetScriptName added in v0.0.3

func (m *ScriptMutation) SetScriptName(s string)

SetScriptName sets the "script_name" field.

func (*ScriptMutation) SetTaskNumber added in v0.0.3

func (m *ScriptMutation) SetTaskNumber(i int32)

SetTaskNumber sets the "task_number" field.

func (*ScriptMutation) SetUpdateTime added in v0.0.3

func (m *ScriptMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ScriptMutation) SetUserID added in v0.0.3

func (m *ScriptMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*ScriptMutation) TaskNumber added in v0.0.3

func (m *ScriptMutation) TaskNumber() (r int32, exists bool)

TaskNumber returns the value of the "task_number" field in the mutation.

func (ScriptMutation) Tx added in v0.0.3

func (m ScriptMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScriptMutation) Type added in v0.0.3

func (m *ScriptMutation) Type() string

Type returns the node type of this mutation (Script).

func (*ScriptMutation) UpdateTime added in v0.0.3

func (m *ScriptMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ScriptMutation) UserID added in v0.0.3

func (m *ScriptMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ScriptMutation) Where added in v0.0.3

func (m *ScriptMutation) Where(ps ...predicate.Script)

Where appends a list predicates to the ScriptMutation builder.

func (*ScriptMutation) WhereP added in v0.0.3

func (m *ScriptMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ScriptMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ScriptQuery added in v0.0.3

type ScriptQuery struct {
	// contains filtered or unexported fields
}

ScriptQuery is the builder for querying Script entities.

func (*ScriptQuery) Aggregate added in v0.0.3

func (sq *ScriptQuery) Aggregate(fns ...AggregateFunc) *ScriptSelect

Aggregate returns a ScriptSelect configured with the given aggregations.

func (*ScriptQuery) All added in v0.0.3

func (sq *ScriptQuery) All(ctx context.Context) ([]*Script, error)

All executes the query and returns a list of Scripts.

func (*ScriptQuery) AllX added in v0.0.3

func (sq *ScriptQuery) AllX(ctx context.Context) []*Script

AllX is like All, but panics if an error occurs.

func (*ScriptQuery) Clone added in v0.0.3

func (sq *ScriptQuery) Clone() *ScriptQuery

Clone returns a duplicate of the ScriptQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ScriptQuery) Count added in v0.0.3

func (sq *ScriptQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScriptQuery) CountX added in v0.0.3

func (sq *ScriptQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScriptQuery) Exist added in v0.0.3

func (sq *ScriptQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScriptQuery) ExistX added in v0.0.3

func (sq *ScriptQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScriptQuery) First added in v0.0.3

func (sq *ScriptQuery) First(ctx context.Context) (*Script, error)

First returns the first Script entity from the query. Returns a *NotFoundError when no Script was found.

func (*ScriptQuery) FirstID added in v0.0.3

func (sq *ScriptQuery) FirstID(ctx context.Context) (id int32, err error)

FirstID returns the first Script ID from the query. Returns a *NotFoundError when no Script ID was found.

func (*ScriptQuery) FirstIDX added in v0.0.3

func (sq *ScriptQuery) FirstIDX(ctx context.Context) int32

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScriptQuery) FirstX added in v0.0.3

func (sq *ScriptQuery) FirstX(ctx context.Context) *Script

FirstX is like First, but panics if an error occurs.

func (*ScriptQuery) GroupBy added in v0.0.3

func (sq *ScriptQuery) GroupBy(field string, fields ...string) *ScriptGroupBy

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 {
	UserID string `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Script.Query().
	GroupBy(script.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ScriptQuery) IDs added in v0.0.3

func (sq *ScriptQuery) IDs(ctx context.Context) (ids []int32, err error)

IDs executes the query and returns a list of Script IDs.

func (*ScriptQuery) IDsX added in v0.0.3

func (sq *ScriptQuery) IDsX(ctx context.Context) []int32

IDsX is like IDs, but panics if an error occurs.

func (*ScriptQuery) Limit added in v0.0.3

func (sq *ScriptQuery) Limit(limit int) *ScriptQuery

Limit the number of records to be returned by this query.

func (*ScriptQuery) Offset added in v0.0.3

func (sq *ScriptQuery) Offset(offset int) *ScriptQuery

Offset to start from.

func (*ScriptQuery) Only added in v0.0.3

func (sq *ScriptQuery) Only(ctx context.Context) (*Script, error)

Only returns a single Script entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Script entity is found. Returns a *NotFoundError when no Script entities are found.

func (*ScriptQuery) OnlyID added in v0.0.3

func (sq *ScriptQuery) OnlyID(ctx context.Context) (id int32, err error)

OnlyID is like Only, but returns the only Script ID in the query. Returns a *NotSingularError when more than one Script ID is found. Returns a *NotFoundError when no entities are found.

func (*ScriptQuery) OnlyIDX added in v0.0.3

func (sq *ScriptQuery) OnlyIDX(ctx context.Context) int32

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScriptQuery) OnlyX added in v0.0.3

func (sq *ScriptQuery) OnlyX(ctx context.Context) *Script

OnlyX is like Only, but panics if an error occurs.

func (*ScriptQuery) Order added in v0.0.3

func (sq *ScriptQuery) Order(o ...script.OrderOption) *ScriptQuery

Order specifies how the records should be ordered.

func (*ScriptQuery) QueryScriptExecutionRecords added in v0.0.3

func (sq *ScriptQuery) QueryScriptExecutionRecords() *ScriptExecutionRecordQuery

QueryScriptExecutionRecords chains the current query on the "scriptExecutionRecords" edge.

func (*ScriptQuery) Select added in v0.0.3

func (sq *ScriptQuery) Select(fields ...string) *ScriptSelect

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 {
	UserID string `json:"user_id,omitempty"`
}

client.Script.Query().
	Select(script.FieldUserID).
	Scan(ctx, &v)

func (*ScriptQuery) Unique added in v0.0.3

func (sq *ScriptQuery) Unique(unique bool) *ScriptQuery

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 (*ScriptQuery) Where added in v0.0.3

func (sq *ScriptQuery) Where(ps ...predicate.Script) *ScriptQuery

Where adds a new predicate for the ScriptQuery builder.

func (*ScriptQuery) WithScriptExecutionRecords added in v0.0.3

func (sq *ScriptQuery) WithScriptExecutionRecords(opts ...func(*ScriptExecutionRecordQuery)) *ScriptQuery

WithScriptExecutionRecords tells the query-builder to eager-load the nodes that are connected to the "scriptExecutionRecords" edge. The optional arguments are used to configure the query builder of the edge.

type ScriptSelect added in v0.0.3

type ScriptSelect struct {
	*ScriptQuery
	// contains filtered or unexported fields
}

ScriptSelect is the builder for selecting fields of Script entities.

func (*ScriptSelect) Aggregate added in v0.0.3

func (ss *ScriptSelect) Aggregate(fns ...AggregateFunc) *ScriptSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ScriptSelect) Bool added in v0.0.3

func (s *ScriptSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) BoolX added in v0.0.3

func (s *ScriptSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptSelect) Bools added in v0.0.3

func (s *ScriptSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) BoolsX added in v0.0.3

func (s *ScriptSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptSelect) Float64 added in v0.0.3

func (s *ScriptSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) Float64X added in v0.0.3

func (s *ScriptSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptSelect) Float64s added in v0.0.3

func (s *ScriptSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) Float64sX added in v0.0.3

func (s *ScriptSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptSelect) Int added in v0.0.3

func (s *ScriptSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) IntX added in v0.0.3

func (s *ScriptSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptSelect) Ints added in v0.0.3

func (s *ScriptSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) IntsX added in v0.0.3

func (s *ScriptSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptSelect) Scan added in v0.0.3

func (ss *ScriptSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptSelect) ScanX added in v0.0.3

func (s *ScriptSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptSelect) String added in v0.0.3

func (s *ScriptSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) StringX added in v0.0.3

func (s *ScriptSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptSelect) Strings added in v0.0.3

func (s *ScriptSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) StringsX added in v0.0.3

func (s *ScriptSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptUpdate added in v0.0.3

type ScriptUpdate struct {
	// contains filtered or unexported fields
}

ScriptUpdate is the builder for updating Script entities.

func (*ScriptUpdate) AddScriptExecutionRecordIDs added in v0.0.3

func (su *ScriptUpdate) AddScriptExecutionRecordIDs(ids ...int32) *ScriptUpdate

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptUpdate) AddScriptExecutionRecords added in v0.0.3

func (su *ScriptUpdate) AddScriptExecutionRecords(s ...*ScriptExecutionRecord) *ScriptUpdate

AddScriptExecutionRecords adds the "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdate) AddTaskNumber added in v0.0.3

func (su *ScriptUpdate) AddTaskNumber(i int32) *ScriptUpdate

AddTaskNumber adds i to the "task_number" field.

func (*ScriptUpdate) ClearScriptExecutionRecords added in v0.0.3

func (su *ScriptUpdate) ClearScriptExecutionRecords() *ScriptUpdate

ClearScriptExecutionRecords clears all "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdate) Exec added in v0.0.3

func (su *ScriptUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptUpdate) ExecX added in v0.0.3

func (su *ScriptUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptUpdate) Mutation added in v0.0.3

func (su *ScriptUpdate) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptUpdate) RemoveScriptExecutionRecordIDs added in v0.0.3

func (su *ScriptUpdate) RemoveScriptExecutionRecordIDs(ids ...int32) *ScriptUpdate

RemoveScriptExecutionRecordIDs removes the "scriptExecutionRecords" edge to ScriptExecutionRecord entities by IDs.

func (*ScriptUpdate) RemoveScriptExecutionRecords added in v0.0.3

func (su *ScriptUpdate) RemoveScriptExecutionRecords(s ...*ScriptExecutionRecord) *ScriptUpdate

RemoveScriptExecutionRecords removes "scriptExecutionRecords" edges to ScriptExecutionRecord entities.

func (*ScriptUpdate) Save added in v0.0.3

func (su *ScriptUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScriptUpdate) SaveX added in v0.0.3

func (su *ScriptUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ScriptUpdate) SetCreateTime added in v0.0.3

func (su *ScriptUpdate) SetCreateTime(t time.Time) *ScriptUpdate

SetCreateTime sets the "create_time" field.

func (*ScriptUpdate) SetFileAddress added in v0.0.3

func (su *ScriptUpdate) SetFileAddress(s string) *ScriptUpdate

SetFileAddress sets the "file_address" field.

func (*ScriptUpdate) SetNillableCreateTime added in v0.0.3

func (su *ScriptUpdate) SetNillableCreateTime(t *time.Time) *ScriptUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptUpdate) SetNillableUpdateTime added in v0.0.3

func (su *ScriptUpdate) SetNillableUpdateTime(t *time.Time) *ScriptUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptUpdate) SetScriptContent added in v0.0.3

func (su *ScriptUpdate) SetScriptContent(s string) *ScriptUpdate

SetScriptContent sets the "script_content" field.

func (*ScriptUpdate) SetScriptName added in v0.0.3

func (su *ScriptUpdate) SetScriptName(s string) *ScriptUpdate

SetScriptName sets the "script_name" field.

func (*ScriptUpdate) SetTaskNumber added in v0.0.3

func (su *ScriptUpdate) SetTaskNumber(i int32) *ScriptUpdate

SetTaskNumber sets the "task_number" field.

func (*ScriptUpdate) SetUpdateTime added in v0.0.3

func (su *ScriptUpdate) SetUpdateTime(t time.Time) *ScriptUpdate

SetUpdateTime sets the "update_time" field.

func (*ScriptUpdate) SetUserID added in v0.0.3

func (su *ScriptUpdate) SetUserID(s string) *ScriptUpdate

SetUserID sets the "user_id" field.

func (*ScriptUpdate) Where added in v0.0.3

func (su *ScriptUpdate) Where(ps ...predicate.Script) *ScriptUpdate

Where appends a list predicates to the ScriptUpdate builder.

type ScriptUpdateOne added in v0.0.3

type ScriptUpdateOne struct {
	// contains filtered or unexported fields
}

ScriptUpdateOne is the builder for updating a single Script entity.

func (*ScriptUpdateOne) AddScriptExecutionRecordIDs added in v0.0.3

func (suo *ScriptUpdateOne) AddScriptExecutionRecordIDs(ids ...int32) *ScriptUpdateOne

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptUpdateOne) AddScriptExecutionRecords added in v0.0.3

func (suo *ScriptUpdateOne) AddScriptExecutionRecords(s ...*ScriptExecutionRecord) *ScriptUpdateOne

AddScriptExecutionRecords adds the "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdateOne) AddTaskNumber added in v0.0.3

func (suo *ScriptUpdateOne) AddTaskNumber(i int32) *ScriptUpdateOne

AddTaskNumber adds i to the "task_number" field.

func (*ScriptUpdateOne) ClearScriptExecutionRecords added in v0.0.3

func (suo *ScriptUpdateOne) ClearScriptExecutionRecords() *ScriptUpdateOne

ClearScriptExecutionRecords clears all "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdateOne) Exec added in v0.0.3

func (suo *ScriptUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ScriptUpdateOne) ExecX added in v0.0.3

func (suo *ScriptUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptUpdateOne) Mutation added in v0.0.3

func (suo *ScriptUpdateOne) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptUpdateOne) RemoveScriptExecutionRecordIDs added in v0.0.3

func (suo *ScriptUpdateOne) RemoveScriptExecutionRecordIDs(ids ...int32) *ScriptUpdateOne

RemoveScriptExecutionRecordIDs removes the "scriptExecutionRecords" edge to ScriptExecutionRecord entities by IDs.

func (*ScriptUpdateOne) RemoveScriptExecutionRecords added in v0.0.3

func (suo *ScriptUpdateOne) RemoveScriptExecutionRecords(s ...*ScriptExecutionRecord) *ScriptUpdateOne

RemoveScriptExecutionRecords removes "scriptExecutionRecords" edges to ScriptExecutionRecord entities.

func (*ScriptUpdateOne) Save added in v0.0.3

func (suo *ScriptUpdateOne) Save(ctx context.Context) (*Script, error)

Save executes the query and returns the updated Script entity.

func (*ScriptUpdateOne) SaveX added in v0.0.3

func (suo *ScriptUpdateOne) SaveX(ctx context.Context) *Script

SaveX is like Save, but panics if an error occurs.

func (*ScriptUpdateOne) Select added in v0.0.3

func (suo *ScriptUpdateOne) Select(field string, fields ...string) *ScriptUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ScriptUpdateOne) SetCreateTime added in v0.0.3

func (suo *ScriptUpdateOne) SetCreateTime(t time.Time) *ScriptUpdateOne

SetCreateTime sets the "create_time" field.

func (*ScriptUpdateOne) SetFileAddress added in v0.0.3

func (suo *ScriptUpdateOne) SetFileAddress(s string) *ScriptUpdateOne

SetFileAddress sets the "file_address" field.

func (*ScriptUpdateOne) SetNillableCreateTime added in v0.0.3

func (suo *ScriptUpdateOne) SetNillableCreateTime(t *time.Time) *ScriptUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableUpdateTime added in v0.0.3

func (suo *ScriptUpdateOne) SetNillableUpdateTime(t *time.Time) *ScriptUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptUpdateOne) SetScriptContent added in v0.0.3

func (suo *ScriptUpdateOne) SetScriptContent(s string) *ScriptUpdateOne

SetScriptContent sets the "script_content" field.

func (*ScriptUpdateOne) SetScriptName added in v0.0.3

func (suo *ScriptUpdateOne) SetScriptName(s string) *ScriptUpdateOne

SetScriptName sets the "script_name" field.

func (*ScriptUpdateOne) SetTaskNumber added in v0.0.3

func (suo *ScriptUpdateOne) SetTaskNumber(i int32) *ScriptUpdateOne

SetTaskNumber sets the "task_number" field.

func (*ScriptUpdateOne) SetUpdateTime added in v0.0.3

func (suo *ScriptUpdateOne) SetUpdateTime(t time.Time) *ScriptUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ScriptUpdateOne) SetUserID added in v0.0.3

func (suo *ScriptUpdateOne) SetUserID(s string) *ScriptUpdateOne

SetUserID sets the "user_id" field.

func (*ScriptUpdateOne) Where added in v0.0.3

func (suo *ScriptUpdateOne) Where(ps ...predicate.Script) *ScriptUpdateOne

Where appends a list predicates to the ScriptUpdate builder.

type Scripts added in v0.0.3

type Scripts []*Script

Scripts is a parsable slice of Script.

type Storage

type Storage struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Owner holds the value of the "owner" field.
	Owner string `json:"owner,omitempty"`
	// 0: DIR, 1:file
	Type int32 `json:"type,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"`
	// size
	Size int32 `json:"size,omitempty"`
	// LastModify holds the value of the "last_modify" field.
	LastModify time.Time `json:"last_modify,omitempty"`
	// ParentID holds the value of the "parent_id" field.
	ParentID string `json:"parent_id,omitempty"`
	// contains filtered or unexported fields
}

Storage is the model entity for the Storage schema.

func (*Storage) String

func (s *Storage) String() string

String implements the fmt.Stringer.

func (*Storage) Unwrap

func (s *Storage) Unwrap() *Storage

Unwrap unwraps the Storage 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 (*Storage) Update

func (s *Storage) Update() *StorageUpdateOne

Update returns a builder for updating this Storage. Note that you need to call Storage.Unwrap() before calling this method if this Storage was returned from a transaction, and the transaction was committed or rolled back.

func (*Storage) Value

func (s *Storage) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Storage. This includes values selected through modifiers, order, etc.

type StorageClient

type StorageClient struct {
	// contains filtered or unexported fields
}

StorageClient is a client for the Storage schema.

func NewStorageClient

func NewStorageClient(c config) *StorageClient

NewStorageClient returns a client for the Storage from the given config.

func (*StorageClient) Create

func (c *StorageClient) Create() *StorageCreate

Create returns a builder for creating a Storage entity.

func (*StorageClient) CreateBulk

func (c *StorageClient) CreateBulk(builders ...*StorageCreate) *StorageCreateBulk

CreateBulk returns a builder for creating a bulk of Storage entities.

func (*StorageClient) Delete

func (c *StorageClient) Delete() *StorageDelete

Delete returns a delete builder for Storage.

func (*StorageClient) DeleteOne

func (c *StorageClient) DeleteOne(s *Storage) *StorageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StorageClient) DeleteOneID

func (c *StorageClient) DeleteOneID(id uuid.UUID) *StorageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*StorageClient) Get

func (c *StorageClient) Get(ctx context.Context, id uuid.UUID) (*Storage, error)

Get returns a Storage entity by its id.

func (*StorageClient) GetX

func (c *StorageClient) GetX(ctx context.Context, id uuid.UUID) *Storage

GetX is like Get, but panics if an error occurs.

func (*StorageClient) Hooks

func (c *StorageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*StorageClient) Intercept

func (c *StorageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `storage.Intercept(f(g(h())))`.

func (*StorageClient) Interceptors

func (c *StorageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*StorageClient) Query

func (c *StorageClient) Query() *StorageQuery

Query returns a query builder for Storage.

func (*StorageClient) Update

func (c *StorageClient) Update() *StorageUpdate

Update returns an update builder for Storage.

func (*StorageClient) UpdateOne

func (c *StorageClient) UpdateOne(s *Storage) *StorageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*StorageClient) UpdateOneID

func (c *StorageClient) UpdateOneID(id uuid.UUID) *StorageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*StorageClient) Use

func (c *StorageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `storage.Hooks(f(g(h())))`.

type StorageCreate

type StorageCreate struct {
	// contains filtered or unexported fields
}

StorageCreate is the builder for creating a Storage entity.

func (*StorageCreate) Exec

func (sc *StorageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageCreate) ExecX

func (sc *StorageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageCreate) Mutation

func (sc *StorageCreate) Mutation() *StorageMutation

Mutation returns the StorageMutation object of the builder.

func (*StorageCreate) Save

func (sc *StorageCreate) Save(ctx context.Context) (*Storage, error)

Save creates the Storage in the database.

func (*StorageCreate) SaveX

func (sc *StorageCreate) SaveX(ctx context.Context) *Storage

SaveX calls Save and panics if Save returns an error.

func (*StorageCreate) SetCid

func (sc *StorageCreate) SetCid(s string) *StorageCreate

SetCid sets the "cid" field.

func (*StorageCreate) SetID

func (sc *StorageCreate) SetID(u uuid.UUID) *StorageCreate

SetID sets the "id" field.

func (*StorageCreate) SetLastModify

func (sc *StorageCreate) SetLastModify(t time.Time) *StorageCreate

SetLastModify sets the "last_modify" field.

func (*StorageCreate) SetName

func (sc *StorageCreate) SetName(s string) *StorageCreate

SetName sets the "name" field.

func (*StorageCreate) SetNillableID

func (sc *StorageCreate) SetNillableID(u *uuid.UUID) *StorageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*StorageCreate) SetNillableLastModify

func (sc *StorageCreate) SetNillableLastModify(t *time.Time) *StorageCreate

SetNillableLastModify sets the "last_modify" field if the given value is not nil.

func (*StorageCreate) SetNillableType

func (sc *StorageCreate) SetNillableType(i *int32) *StorageCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*StorageCreate) SetOwner

func (sc *StorageCreate) SetOwner(s string) *StorageCreate

SetOwner sets the "owner" field.

func (*StorageCreate) SetParentID

func (sc *StorageCreate) SetParentID(s string) *StorageCreate

SetParentID sets the "parent_id" field.

func (*StorageCreate) SetSize

func (sc *StorageCreate) SetSize(i int32) *StorageCreate

SetSize sets the "size" field.

func (*StorageCreate) SetType

func (sc *StorageCreate) SetType(i int32) *StorageCreate

SetType sets the "type" field.

type StorageCreateBulk

type StorageCreateBulk struct {
	// contains filtered or unexported fields
}

StorageCreateBulk is the builder for creating many Storage entities in bulk.

func (*StorageCreateBulk) Exec

func (scb *StorageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageCreateBulk) ExecX

func (scb *StorageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageCreateBulk) Save

func (scb *StorageCreateBulk) Save(ctx context.Context) ([]*Storage, error)

Save creates the Storage entities in the database.

func (*StorageCreateBulk) SaveX

func (scb *StorageCreateBulk) SaveX(ctx context.Context) []*Storage

SaveX is like Save, but panics if an error occurs.

type StorageDelete

type StorageDelete struct {
	// contains filtered or unexported fields
}

StorageDelete is the builder for deleting a Storage entity.

func (*StorageDelete) Exec

func (sd *StorageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StorageDelete) ExecX

func (sd *StorageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StorageDelete) Where

func (sd *StorageDelete) Where(ps ...predicate.Storage) *StorageDelete

Where appends a list predicates to the StorageDelete builder.

type StorageDeleteOne

type StorageDeleteOne struct {
	// contains filtered or unexported fields
}

StorageDeleteOne is the builder for deleting a single Storage entity.

func (*StorageDeleteOne) Exec

func (sdo *StorageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*StorageDeleteOne) ExecX

func (sdo *StorageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageDeleteOne) Where

Where appends a list predicates to the StorageDelete builder.

type StorageGroupBy

type StorageGroupBy struct {
	// contains filtered or unexported fields
}

StorageGroupBy is the group-by builder for Storage entities.

func (*StorageGroupBy) Aggregate

func (sgb *StorageGroupBy) Aggregate(fns ...AggregateFunc) *StorageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*StorageGroupBy) Bool

func (s *StorageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) BoolX

func (s *StorageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StorageGroupBy) Bools

func (s *StorageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) BoolsX

func (s *StorageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StorageGroupBy) Float64

func (s *StorageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) Float64X

func (s *StorageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StorageGroupBy) Float64s

func (s *StorageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) Float64sX

func (s *StorageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StorageGroupBy) Int

func (s *StorageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) IntX

func (s *StorageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StorageGroupBy) Ints

func (s *StorageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) IntsX

func (s *StorageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StorageGroupBy) Scan

func (sgb *StorageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StorageGroupBy) ScanX

func (s *StorageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StorageGroupBy) String

func (s *StorageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) StringX

func (s *StorageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StorageGroupBy) Strings

func (s *StorageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StorageGroupBy) StringsX

func (s *StorageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StorageMutation

type StorageMutation struct {
	// contains filtered or unexported fields
}

StorageMutation represents an operation that mutates the Storage nodes in the graph.

func (*StorageMutation) AddField

func (m *StorageMutation) 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 (*StorageMutation) AddSize

func (m *StorageMutation) AddSize(i int32)

AddSize adds i to the "size" field.

func (*StorageMutation) AddType

func (m *StorageMutation) AddType(i int32)

AddType adds i to the "type" field.

func (*StorageMutation) AddedEdges

func (m *StorageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*StorageMutation) AddedField

func (m *StorageMutation) 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 (*StorageMutation) AddedFields

func (m *StorageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*StorageMutation) AddedIDs

func (m *StorageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*StorageMutation) AddedSize

func (m *StorageMutation) AddedSize() (r int32, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*StorageMutation) AddedType

func (m *StorageMutation) AddedType() (r int32, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*StorageMutation) Cid

func (m *StorageMutation) Cid() (r string, exists bool)

Cid returns the value of the "cid" field in the mutation.

func (*StorageMutation) ClearEdge

func (m *StorageMutation) 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 (*StorageMutation) ClearField

func (m *StorageMutation) 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 (*StorageMutation) ClearedEdges

func (m *StorageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*StorageMutation) ClearedFields

func (m *StorageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (StorageMutation) Client

func (m StorageMutation) 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 (*StorageMutation) EdgeCleared

func (m *StorageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*StorageMutation) Field

func (m *StorageMutation) 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 (*StorageMutation) FieldCleared

func (m *StorageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*StorageMutation) Fields

func (m *StorageMutation) 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 (*StorageMutation) GetType

func (m *StorageMutation) GetType() (r int32, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*StorageMutation) ID

func (m *StorageMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*StorageMutation) IDs

func (m *StorageMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*StorageMutation) LastModify

func (m *StorageMutation) LastModify() (r time.Time, exists bool)

LastModify returns the value of the "last_modify" field in the mutation.

func (*StorageMutation) Name

func (m *StorageMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*StorageMutation) OldCid

func (m *StorageMutation) OldCid(ctx context.Context) (v *string, err error)

OldCid returns the old "cid" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldField

func (m *StorageMutation) 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 (*StorageMutation) OldLastModify

func (m *StorageMutation) OldLastModify(ctx context.Context) (v time.Time, err error)

OldLastModify returns the old "last_modify" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldName

func (m *StorageMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldOwner

func (m *StorageMutation) OldOwner(ctx context.Context) (v string, err error)

OldOwner returns the old "owner" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldParentID

func (m *StorageMutation) OldParentID(ctx context.Context) (v string, err error)

OldParentID returns the old "parent_id" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldSize

func (m *StorageMutation) OldSize(ctx context.Context) (v int32, err error)

OldSize returns the old "size" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldType

func (m *StorageMutation) OldType(ctx context.Context) (v int32, err error)

OldType returns the old "type" field's value of the Storage entity. If the Storage 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 (*StorageMutation) Op

func (m *StorageMutation) Op() Op

Op returns the operation name.

func (*StorageMutation) Owner

func (m *StorageMutation) Owner() (r string, exists bool)

Owner returns the value of the "owner" field in the mutation.

func (*StorageMutation) ParentID

func (m *StorageMutation) ParentID() (r string, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*StorageMutation) RemovedEdges

func (m *StorageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*StorageMutation) RemovedIDs

func (m *StorageMutation) 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 (*StorageMutation) ResetCid

func (m *StorageMutation) ResetCid()

ResetCid resets all changes to the "cid" field.

func (*StorageMutation) ResetEdge

func (m *StorageMutation) 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 (*StorageMutation) ResetField

func (m *StorageMutation) 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 (*StorageMutation) ResetLastModify

func (m *StorageMutation) ResetLastModify()

ResetLastModify resets all changes to the "last_modify" field.

func (*StorageMutation) ResetName

func (m *StorageMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*StorageMutation) ResetOwner

func (m *StorageMutation) ResetOwner()

ResetOwner resets all changes to the "owner" field.

func (*StorageMutation) ResetParentID

func (m *StorageMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*StorageMutation) ResetSize

func (m *StorageMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*StorageMutation) ResetType

func (m *StorageMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*StorageMutation) SetCid

func (m *StorageMutation) SetCid(s string)

SetCid sets the "cid" field.

func (*StorageMutation) SetField

func (m *StorageMutation) 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 (*StorageMutation) SetID

func (m *StorageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Storage entities.

func (*StorageMutation) SetLastModify

func (m *StorageMutation) SetLastModify(t time.Time)

SetLastModify sets the "last_modify" field.

func (*StorageMutation) SetName

func (m *StorageMutation) SetName(s string)

SetName sets the "name" field.

func (*StorageMutation) SetOp

func (m *StorageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*StorageMutation) SetOwner

func (m *StorageMutation) SetOwner(s string)

SetOwner sets the "owner" field.

func (*StorageMutation) SetParentID

func (m *StorageMutation) SetParentID(s string)

SetParentID sets the "parent_id" field.

func (*StorageMutation) SetSize

func (m *StorageMutation) SetSize(i int32)

SetSize sets the "size" field.

func (*StorageMutation) SetType

func (m *StorageMutation) SetType(i int32)

SetType sets the "type" field.

func (*StorageMutation) Size

func (m *StorageMutation) Size() (r int32, exists bool)

Size returns the value of the "size" field in the mutation.

func (StorageMutation) Tx

func (m StorageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*StorageMutation) Type

func (m *StorageMutation) Type() string

Type returns the node type of this mutation (Storage).

func (*StorageMutation) Where

func (m *StorageMutation) Where(ps ...predicate.Storage)

Where appends a list predicates to the StorageMutation builder.

func (*StorageMutation) WhereP

func (m *StorageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the StorageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type StorageQuery

type StorageQuery struct {
	// contains filtered or unexported fields
}

StorageQuery is the builder for querying Storage entities.

func (*StorageQuery) Aggregate

func (sq *StorageQuery) Aggregate(fns ...AggregateFunc) *StorageSelect

Aggregate returns a StorageSelect configured with the given aggregations.

func (*StorageQuery) All

func (sq *StorageQuery) All(ctx context.Context) ([]*Storage, error)

All executes the query and returns a list of Storages.

func (*StorageQuery) AllX

func (sq *StorageQuery) AllX(ctx context.Context) []*Storage

AllX is like All, but panics if an error occurs.

func (*StorageQuery) Clone

func (sq *StorageQuery) Clone() *StorageQuery

Clone returns a duplicate of the StorageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*StorageQuery) Count

func (sq *StorageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StorageQuery) CountX

func (sq *StorageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StorageQuery) Exist

func (sq *StorageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StorageQuery) ExistX

func (sq *StorageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StorageQuery) First

func (sq *StorageQuery) First(ctx context.Context) (*Storage, error)

First returns the first Storage entity from the query. Returns a *NotFoundError when no Storage was found.

func (*StorageQuery) FirstID

func (sq *StorageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Storage ID from the query. Returns a *NotFoundError when no Storage ID was found.

func (*StorageQuery) FirstIDX

func (sq *StorageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*StorageQuery) FirstX

func (sq *StorageQuery) FirstX(ctx context.Context) *Storage

FirstX is like First, but panics if an error occurs.

func (*StorageQuery) GroupBy

func (sq *StorageQuery) GroupBy(field string, fields ...string) *StorageGroupBy

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 {
	Owner string `json:"owner,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Storage.Query().
	GroupBy(storage.FieldOwner).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*StorageQuery) IDs

func (sq *StorageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Storage IDs.

func (*StorageQuery) IDsX

func (sq *StorageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*StorageQuery) Limit

func (sq *StorageQuery) Limit(limit int) *StorageQuery

Limit the number of records to be returned by this query.

func (*StorageQuery) Offset

func (sq *StorageQuery) Offset(offset int) *StorageQuery

Offset to start from.

func (*StorageQuery) Only

func (sq *StorageQuery) Only(ctx context.Context) (*Storage, error)

Only returns a single Storage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Storage entity is found. Returns a *NotFoundError when no Storage entities are found.

func (*StorageQuery) OnlyID

func (sq *StorageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Storage ID in the query. Returns a *NotSingularError when more than one Storage ID is found. Returns a *NotFoundError when no entities are found.

func (*StorageQuery) OnlyIDX

func (sq *StorageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StorageQuery) OnlyX

func (sq *StorageQuery) OnlyX(ctx context.Context) *Storage

OnlyX is like Only, but panics if an error occurs.

func (*StorageQuery) Order

func (sq *StorageQuery) Order(o ...storage.OrderOption) *StorageQuery

Order specifies how the records should be ordered.

func (*StorageQuery) Select

func (sq *StorageQuery) Select(fields ...string) *StorageSelect

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 {
	Owner string `json:"owner,omitempty"`
}

client.Storage.Query().
	Select(storage.FieldOwner).
	Scan(ctx, &v)

func (*StorageQuery) Unique

func (sq *StorageQuery) Unique(unique bool) *StorageQuery

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 (*StorageQuery) Where

func (sq *StorageQuery) Where(ps ...predicate.Storage) *StorageQuery

Where adds a new predicate for the StorageQuery builder.

type StorageSelect

type StorageSelect struct {
	*StorageQuery
	// contains filtered or unexported fields
}

StorageSelect is the builder for selecting fields of Storage entities.

func (*StorageSelect) Aggregate

func (ss *StorageSelect) Aggregate(fns ...AggregateFunc) *StorageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*StorageSelect) Bool

func (s *StorageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StorageSelect) BoolX

func (s *StorageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StorageSelect) Bools

func (s *StorageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StorageSelect) BoolsX

func (s *StorageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StorageSelect) Float64

func (s *StorageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StorageSelect) Float64X

func (s *StorageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StorageSelect) Float64s

func (s *StorageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StorageSelect) Float64sX

func (s *StorageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StorageSelect) Int

func (s *StorageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StorageSelect) IntX

func (s *StorageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StorageSelect) Ints

func (s *StorageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StorageSelect) IntsX

func (s *StorageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StorageSelect) Scan

func (ss *StorageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StorageSelect) ScanX

func (s *StorageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StorageSelect) String

func (s *StorageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StorageSelect) StringX

func (s *StorageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StorageSelect) Strings

func (s *StorageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StorageSelect) StringsX

func (s *StorageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StorageUpdate

type StorageUpdate struct {
	// contains filtered or unexported fields
}

StorageUpdate is the builder for updating Storage entities.

func (*StorageUpdate) AddSize

func (su *StorageUpdate) AddSize(i int32) *StorageUpdate

AddSize adds i to the "size" field.

func (*StorageUpdate) AddType

func (su *StorageUpdate) AddType(i int32) *StorageUpdate

AddType adds i to the "type" field.

func (*StorageUpdate) Exec

func (su *StorageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageUpdate) ExecX

func (su *StorageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageUpdate) Mutation

func (su *StorageUpdate) Mutation() *StorageMutation

Mutation returns the StorageMutation object of the builder.

func (*StorageUpdate) Save

func (su *StorageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*StorageUpdate) SaveX

func (su *StorageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StorageUpdate) SetCid

func (su *StorageUpdate) SetCid(s string) *StorageUpdate

SetCid sets the "cid" field.

func (*StorageUpdate) SetLastModify

func (su *StorageUpdate) SetLastModify(t time.Time) *StorageUpdate

SetLastModify sets the "last_modify" field.

func (*StorageUpdate) SetName

func (su *StorageUpdate) SetName(s string) *StorageUpdate

SetName sets the "name" field.

func (*StorageUpdate) SetNillableLastModify

func (su *StorageUpdate) SetNillableLastModify(t *time.Time) *StorageUpdate

SetNillableLastModify sets the "last_modify" field if the given value is not nil.

func (*StorageUpdate) SetNillableType

func (su *StorageUpdate) SetNillableType(i *int32) *StorageUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*StorageUpdate) SetOwner

func (su *StorageUpdate) SetOwner(s string) *StorageUpdate

SetOwner sets the "owner" field.

func (*StorageUpdate) SetParentID

func (su *StorageUpdate) SetParentID(s string) *StorageUpdate

SetParentID sets the "parent_id" field.

func (*StorageUpdate) SetSize

func (su *StorageUpdate) SetSize(i int32) *StorageUpdate

SetSize sets the "size" field.

func (*StorageUpdate) SetType

func (su *StorageUpdate) SetType(i int32) *StorageUpdate

SetType sets the "type" field.

func (*StorageUpdate) Where

func (su *StorageUpdate) Where(ps ...predicate.Storage) *StorageUpdate

Where appends a list predicates to the StorageUpdate builder.

type StorageUpdateOne

type StorageUpdateOne struct {
	// contains filtered or unexported fields
}

StorageUpdateOne is the builder for updating a single Storage entity.

func (*StorageUpdateOne) AddSize

func (suo *StorageUpdateOne) AddSize(i int32) *StorageUpdateOne

AddSize adds i to the "size" field.

func (*StorageUpdateOne) AddType

func (suo *StorageUpdateOne) AddType(i int32) *StorageUpdateOne

AddType adds i to the "type" field.

func (*StorageUpdateOne) Exec

func (suo *StorageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*StorageUpdateOne) ExecX

func (suo *StorageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageUpdateOne) Mutation

func (suo *StorageUpdateOne) Mutation() *StorageMutation

Mutation returns the StorageMutation object of the builder.

func (*StorageUpdateOne) Save

func (suo *StorageUpdateOne) Save(ctx context.Context) (*Storage, error)

Save executes the query and returns the updated Storage entity.

func (*StorageUpdateOne) SaveX

func (suo *StorageUpdateOne) SaveX(ctx context.Context) *Storage

SaveX is like Save, but panics if an error occurs.

func (*StorageUpdateOne) Select

func (suo *StorageUpdateOne) Select(field string, fields ...string) *StorageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*StorageUpdateOne) SetCid

func (suo *StorageUpdateOne) SetCid(s string) *StorageUpdateOne

SetCid sets the "cid" field.

func (*StorageUpdateOne) SetLastModify

func (suo *StorageUpdateOne) SetLastModify(t time.Time) *StorageUpdateOne

SetLastModify sets the "last_modify" field.

func (*StorageUpdateOne) SetName

func (suo *StorageUpdateOne) SetName(s string) *StorageUpdateOne

SetName sets the "name" field.

func (*StorageUpdateOne) SetNillableLastModify

func (suo *StorageUpdateOne) SetNillableLastModify(t *time.Time) *StorageUpdateOne

SetNillableLastModify sets the "last_modify" field if the given value is not nil.

func (*StorageUpdateOne) SetNillableType

func (suo *StorageUpdateOne) SetNillableType(i *int32) *StorageUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*StorageUpdateOne) SetOwner

func (suo *StorageUpdateOne) SetOwner(s string) *StorageUpdateOne

SetOwner sets the "owner" field.

func (*StorageUpdateOne) SetParentID

func (suo *StorageUpdateOne) SetParentID(s string) *StorageUpdateOne

SetParentID sets the "parent_id" field.

func (*StorageUpdateOne) SetSize

func (suo *StorageUpdateOne) SetSize(i int32) *StorageUpdateOne

SetSize sets the "size" field.

func (*StorageUpdateOne) SetType

func (suo *StorageUpdateOne) SetType(i int32) *StorageUpdateOne

SetType sets the "type" field.

func (*StorageUpdateOne) Where

Where appends a list predicates to the StorageUpdate builder.

type Storages

type Storages []*Storage

Storages is a parsable slice of Storage.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// ComputeImage is the client for interacting with the ComputeImage builders.
	ComputeImage *ComputeImageClient
	// ComputeInstance is the client for interacting with the ComputeInstance builders.
	ComputeInstance *ComputeInstanceClient
	// ComputeSpec is the client for interacting with the ComputeSpec builders.
	ComputeSpec *ComputeSpecClient
	// Employee is the client for interacting with the Employee builders.
	Employee *EmployeeClient
	// Script is the client for interacting with the Script builders.
	Script *ScriptClient
	// ScriptExecutionRecord is the client for interacting with the ScriptExecutionRecord builders.
	ScriptExecutionRecord *ScriptExecutionRecordClient
	// Storage is the client for interacting with the Storage builders.
	Storage *StorageClient
	// 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 uuid.UUID `json:"id,omitempty"`
	// CountryCallCoding holds the value of the "country_call_coding" field.
	CountryCallCoding string `json:"country_call_coding,omitempty"`
	// TelephoneNumber holds the value of the "telephone_number" field.
	TelephoneNumber string `json:"telephone_number,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// CreateDate holds the value of the "create_date" field.
	CreateDate time.Time `json:"create_date,omitempty"`
	// LastLoginDate holds the value of the "last_login_date" field.
	LastLoginDate time.Time `json:"last_login_date,omitempty"`
	// 用户名
	Name string `json:"name,omitempty"`
	// 头像地址
	Icon string `json:"icon,omitempty"`
	// 是否配置过密码
	PwdConfig bool `json:"pwd_config,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

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 uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *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) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for 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 uuid.UUID) *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) 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) SetCountryCallCoding

func (uc *UserCreate) SetCountryCallCoding(s string) *UserCreate

SetCountryCallCoding sets the "country_call_coding" field.

func (*UserCreate) SetCreateDate

func (uc *UserCreate) SetCreateDate(t time.Time) *UserCreate

SetCreateDate sets the "create_date" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIcon

func (uc *UserCreate) SetIcon(s string) *UserCreate

SetIcon sets the "icon" field.

func (*UserCreate) SetLastLoginDate

func (uc *UserCreate) SetLastLoginDate(t time.Time) *UserCreate

SetLastLoginDate sets the "last_login_date" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableCreateDate

func (uc *UserCreate) SetNillableCreateDate(t *time.Time) *UserCreate

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableLastLoginDate

func (uc *UserCreate) SetNillableLastLoginDate(t *time.Time) *UserCreate

SetNillableLastLoginDate sets the "last_login_date" field if the given value is not nil.

func (*UserCreate) SetNillablePwdConfig added in v0.0.3

func (uc *UserCreate) SetNillablePwdConfig(b *bool) *UserCreate

SetNillablePwdConfig sets the "pwd_config" 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) SetPwdConfig added in v0.0.3

func (uc *UserCreate) SetPwdConfig(b bool) *UserCreate

SetPwdConfig sets the "pwd_config" field.

func (*UserCreate) SetTelephoneNumber

func (uc *UserCreate) SetTelephoneNumber(s string) *UserCreate

SetTelephoneNumber sets the "telephone_number" 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 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) 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) 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) 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) CountryCallCoding

func (m *UserMutation) CountryCallCoding() (r string, exists bool)

CountryCallCoding returns the value of the "country_call_coding" field in the mutation.

func (*UserMutation) CreateDate

func (m *UserMutation) CreateDate() (r time.Time, exists bool)

CreateDate returns the value of the "create_date" 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) 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 uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Icon

func (m *UserMutation) Icon() (r string, exists bool)

Icon returns the value of the "icon" field in the mutation.

func (*UserMutation) LastLoginDate

func (m *UserMutation) LastLoginDate() (r time.Time, exists bool)

LastLoginDate returns the value of the "last_login_date" field in the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldCountryCallCoding

func (m *UserMutation) OldCountryCallCoding(ctx context.Context) (v string, err error)

OldCountryCallCoding returns the old "country_call_coding" 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) OldCreateDate

func (m *UserMutation) OldCreateDate(ctx context.Context) (v time.Time, err error)

OldCreateDate returns the old "create_date" 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) OldIcon

func (m *UserMutation) OldIcon(ctx context.Context) (v string, err error)

OldIcon returns the old "icon" 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) OldLastLoginDate

func (m *UserMutation) OldLastLoginDate(ctx context.Context) (v time.Time, err error)

OldLastLoginDate returns the old "last_login_date" 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) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" 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) 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) OldPwdConfig added in v0.0.3

func (m *UserMutation) OldPwdConfig(ctx context.Context) (v bool, err error)

OldPwdConfig returns the old "pwd_config" 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) OldTelephoneNumber

func (m *UserMutation) OldTelephoneNumber(ctx context.Context) (v string, err error)

OldTelephoneNumber returns the old "telephone_number" 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) PwdConfig added in v0.0.3

func (m *UserMutation) PwdConfig() (r bool, exists bool)

PwdConfig returns the value of the "pwd_config" field in the mutation.

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) ResetCountryCallCoding

func (m *UserMutation) ResetCountryCallCoding()

ResetCountryCallCoding resets all changes to the "country_call_coding" field.

func (*UserMutation) ResetCreateDate

func (m *UserMutation) ResetCreateDate()

ResetCreateDate resets all changes to the "create_date" 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) 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) ResetIcon

func (m *UserMutation) ResetIcon()

ResetIcon resets all changes to the "icon" field.

func (*UserMutation) ResetLastLoginDate

func (m *UserMutation) ResetLastLoginDate()

ResetLastLoginDate resets all changes to the "last_login_date" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPwdConfig added in v0.0.3

func (m *UserMutation) ResetPwdConfig()

ResetPwdConfig resets all changes to the "pwd_config" field.

func (*UserMutation) ResetTelephoneNumber

func (m *UserMutation) ResetTelephoneNumber()

ResetTelephoneNumber resets all changes to the "telephone_number" field.

func (*UserMutation) SetCountryCallCoding

func (m *UserMutation) SetCountryCallCoding(s string)

SetCountryCallCoding sets the "country_call_coding" field.

func (*UserMutation) SetCreateDate

func (m *UserMutation) SetCreateDate(t time.Time)

SetCreateDate sets the "create_date" 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) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetIcon

func (m *UserMutation) SetIcon(s string)

SetIcon sets the "icon" field.

func (*UserMutation) SetLastLoginDate

func (m *UserMutation) SetLastLoginDate(t time.Time)

SetLastLoginDate sets the "last_login_date" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

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) SetPwdConfig added in v0.0.3

func (m *UserMutation) SetPwdConfig(b bool)

SetPwdConfig sets the "pwd_config" field.

func (*UserMutation) SetTelephoneNumber

func (m *UserMutation) SetTelephoneNumber(s string)

SetTelephoneNumber sets the "telephone_number" field.

func (*UserMutation) TelephoneNumber

func (m *UserMutation) TelephoneNumber() (r string, exists bool)

TelephoneNumber returns the value of the "telephone_number" field in the mutation.

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) 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 uuid.UUID, 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) uuid.UUID

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 {
	CountryCallCoding string `json:"country_call_coding,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCountryCallCoding).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

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 uuid.UUID, 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) uuid.UUID

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) 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 {
	CountryCallCoding string `json:"country_call_coding,omitempty"`
}

client.User.Query().
	Select(user.FieldCountryCallCoding).
	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.

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) 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) 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) SetCountryCallCoding

func (uu *UserUpdate) SetCountryCallCoding(s string) *UserUpdate

SetCountryCallCoding sets the "country_call_coding" field.

func (*UserUpdate) SetCreateDate

func (uu *UserUpdate) SetCreateDate(t time.Time) *UserUpdate

SetCreateDate sets the "create_date" field.

func (*UserUpdate) SetIcon

func (uu *UserUpdate) SetIcon(s string) *UserUpdate

SetIcon sets the "icon" field.

func (*UserUpdate) SetLastLoginDate

func (uu *UserUpdate) SetLastLoginDate(t time.Time) *UserUpdate

SetLastLoginDate sets the "last_login_date" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableCreateDate

func (uu *UserUpdate) SetNillableCreateDate(t *time.Time) *UserUpdate

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserUpdate) SetNillableLastLoginDate

func (uu *UserUpdate) SetNillableLastLoginDate(t *time.Time) *UserUpdate

SetNillableLastLoginDate sets the "last_login_date" field if the given value is not nil.

func (*UserUpdate) SetNillablePwdConfig added in v0.0.3

func (uu *UserUpdate) SetNillablePwdConfig(b *bool) *UserUpdate

SetNillablePwdConfig sets the "pwd_config" 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) SetPwdConfig added in v0.0.3

func (uu *UserUpdate) SetPwdConfig(b bool) *UserUpdate

SetPwdConfig sets the "pwd_config" field.

func (*UserUpdate) SetTelephoneNumber

func (uu *UserUpdate) SetTelephoneNumber(s string) *UserUpdate

SetTelephoneNumber sets the "telephone_number" 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) 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) 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) SetCountryCallCoding

func (uuo *UserUpdateOne) SetCountryCallCoding(s string) *UserUpdateOne

SetCountryCallCoding sets the "country_call_coding" field.

func (*UserUpdateOne) SetCreateDate

func (uuo *UserUpdateOne) SetCreateDate(t time.Time) *UserUpdateOne

SetCreateDate sets the "create_date" field.

func (*UserUpdateOne) SetIcon

func (uuo *UserUpdateOne) SetIcon(s string) *UserUpdateOne

SetIcon sets the "icon" field.

func (*UserUpdateOne) SetLastLoginDate

func (uuo *UserUpdateOne) SetLastLoginDate(t time.Time) *UserUpdateOne

SetLastLoginDate sets the "last_login_date" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableCreateDate

func (uuo *UserUpdateOne) SetNillableCreateDate(t *time.Time) *UserUpdateOne

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastLoginDate

func (uuo *UserUpdateOne) SetNillableLastLoginDate(t *time.Time) *UserUpdateOne

SetNillableLastLoginDate sets the "last_login_date" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePwdConfig added in v0.0.3

func (uuo *UserUpdateOne) SetNillablePwdConfig(b *bool) *UserUpdateOne

SetNillablePwdConfig sets the "pwd_config" 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) SetPwdConfig added in v0.0.3

func (uuo *UserUpdateOne) SetPwdConfig(b bool) *UserUpdateOne

SetPwdConfig sets the "pwd_config" field.

func (*UserUpdateOne) SetTelephoneNumber

func (uuo *UserUpdateOne) SetTelephoneNumber(s string) *UserUpdateOne

SetTelephoneNumber sets the "telephone_number" 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL