ent

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 47 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"
	TypeAlipayOrderRollback   = "AlipayOrderRollback"
	TypeComputeImage          = "ComputeImage"
	TypeComputeInstance       = "ComputeInstance"
	TypeComputeSpec           = "ComputeSpec"
	TypeComputeSpecPrice      = "ComputeSpecPrice"
	TypeCycle                 = "Cycle"
	TypeCycleOrder            = "CycleOrder"
	TypeCycleRecharge         = "CycleRecharge"
	TypeCycleRedeemCode       = "CycleRedeemCode"
	TypeCycleRenewal          = "CycleRenewal"
	TypeCycleTransaction      = "CycleTransaction"
	TypeDomainBinding         = "DomainBinding"
	TypeEmployee              = "Employee"
	TypeGateway               = "Gateway"
	TypeGatewayPort           = "GatewayPort"
	TypeNetworkMapping        = "NetworkMapping"
	TypeS3Bucket              = "S3Bucket"
	TypeS3User                = "S3User"
	TypeScript                = "Script"
	TypeScriptExecutionRecord = "ScriptExecutionRecord"
	TypeStorage               = "Storage"
	TypeStorageProvider       = "StorageProvider"
	TypeTask                  = "Task"
	TypeUser                  = "User"
	TypeUserResourceLimit     = "UserResourceLimit"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Agent

type Agent struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// mac 网卡地址
	MAC string `json:"mac,omitempty"`
	// 是否活动
	Active bool `json:"active,omitempty"`
	// 最后更新时间
	LastUpdateTime time.Time `json:"last_update_time,omitempty"`
	// 主机名
	Hostname string `json:"hostname,omitempty"`
	// 计算机架构
	Arch string `json:"arch,omitempty"`
	// 总cpu数
	TotalCPU int32 `json:"total_cpu,omitempty"`
	// 总内存数
	TotalMemory int32 `json:"total_memory,omitempty"`
	// 占用的cpu
	OccupiedCPU int32 `json:"occupied_cpu,omitempty"`
	// 占用的内存
	OccupiedMemory int32 `json:"occupied_memory,omitempty"`
	// ip地址
	IP string `json:"ip,omitempty"`
	// contains filtered or unexported fields
}

Agent is the model entity for the Agent schema.

func (*Agent) String

func (_m *Agent) String() string

String implements the fmt.Stringer.

func (*Agent) Unwrap

func (_m *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 (_m *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 (_m *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(_m *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) MapCreateBulk

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

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

func (*AgentClient) Query

func (c *AgentClient) Query() *AgentQuery

Query returns a query builder for Agent.

func (*AgentClient) Update

func (c *AgentClient) Update() *AgentUpdate

Update returns an update builder for Agent.

func (*AgentClient) UpdateOne

func (c *AgentClient) UpdateOne(_m *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 (_c *AgentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentCreate) ExecX

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

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

func (*AgentCreate) Mutation

func (_c *AgentCreate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentCreate) Save

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

Save creates the Agent in the database.

func (*AgentCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*AgentCreate) SetActive

func (_c *AgentCreate) SetActive(v bool) *AgentCreate

SetActive sets the "active" field.

func (*AgentCreate) SetArch

func (_c *AgentCreate) SetArch(v string) *AgentCreate

SetArch sets the "arch" field.

func (*AgentCreate) SetHostname

func (_c *AgentCreate) SetHostname(v string) *AgentCreate

SetHostname sets the "hostname" field.

func (*AgentCreate) SetID

func (_c *AgentCreate) SetID(v uuid.UUID) *AgentCreate

SetID sets the "id" field.

func (*AgentCreate) SetIP

func (_c *AgentCreate) SetIP(v string) *AgentCreate

SetIP sets the "ip" field.

func (*AgentCreate) SetLastUpdateTime

func (_c *AgentCreate) SetLastUpdateTime(v time.Time) *AgentCreate

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentCreate) SetMAC

func (_c *AgentCreate) SetMAC(v string) *AgentCreate

SetMAC sets the "mac" field.

func (*AgentCreate) SetNillableActive

func (_c *AgentCreate) SetNillableActive(v *bool) *AgentCreate

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

func (*AgentCreate) SetNillableID

func (_c *AgentCreate) SetNillableID(v *uuid.UUID) *AgentCreate

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

func (*AgentCreate) SetNillableLastUpdateTime

func (_c *AgentCreate) SetNillableLastUpdateTime(v *time.Time) *AgentCreate

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

func (*AgentCreate) SetOccupiedCPU

func (_c *AgentCreate) SetOccupiedCPU(v int32) *AgentCreate

SetOccupiedCPU sets the "occupied_cpu" field.

func (*AgentCreate) SetOccupiedMemory

func (_c *AgentCreate) SetOccupiedMemory(v int32) *AgentCreate

SetOccupiedMemory sets the "occupied_memory" field.

func (*AgentCreate) SetTotalCPU

func (_c *AgentCreate) SetTotalCPU(v int32) *AgentCreate

SetTotalCPU sets the "total_cpu" field.

func (*AgentCreate) SetTotalMemory

func (_c *AgentCreate) SetTotalMemory(v int32) *AgentCreate

SetTotalMemory sets the "total_memory" 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 (_c *AgentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentCreateBulk) ExecX

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

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

func (*AgentCreateBulk) Save

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

Save creates the Agent entities in the database.

func (*AgentCreateBulk) SaveX

func (_c *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 (_d *AgentDelete) Exec(ctx context.Context) (int, error)

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

func (*AgentDelete) ExecX

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

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

func (*AgentDelete) Where

func (_d *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 (_d *AgentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AgentDeleteOne) ExecX

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

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

func (*AgentDeleteOne) Where

func (_d *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 (_g *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 (_g *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

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

func (m *AgentMutation) AddOccupiedCPU(i int32)

AddOccupiedCPU adds i to the "occupied_cpu" field.

func (*AgentMutation) AddOccupiedMemory

func (m *AgentMutation) AddOccupiedMemory(i int32)

AddOccupiedMemory adds i to the "occupied_memory" field.

func (*AgentMutation) AddTotalCPU

func (m *AgentMutation) AddTotalCPU(i int32)

AddTotalCPU adds i to the "total_cpu" field.

func (*AgentMutation) AddTotalMemory

func (m *AgentMutation) AddTotalMemory(i int32)

AddTotalMemory adds i to the "total_memory" field.

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

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

AddedOccupiedCPU returns the value that was added to the "occupied_cpu" field in this mutation.

func (*AgentMutation) AddedOccupiedMemory

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

AddedOccupiedMemory returns the value that was added to the "occupied_memory" field in this mutation.

func (*AgentMutation) AddedTotalCPU

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

AddedTotalCPU returns the value that was added to the "total_cpu" field in this mutation.

func (*AgentMutation) AddedTotalMemory

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

AddedTotalMemory returns the value that was added to the "total_memory" field in this mutation.

func (*AgentMutation) Arch

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

Arch returns the value of the "arch" field in the 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) Hostname

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

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

func (*AgentMutation) ID

func (m *AgentMutation) ID() (id 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) IP

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

IP returns the value of the "ip" field in the mutation.

func (*AgentMutation) LastUpdateTime

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

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

func (*AgentMutation) MAC

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

MAC returns the value of the "mac" field in the mutation.

func (*AgentMutation) OccupiedCPU

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

OccupiedCPU returns the value of the "occupied_cpu" field in the mutation.

func (*AgentMutation) OccupiedMemory

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

OccupiedMemory returns the value of the "occupied_memory" field in the mutation.

func (*AgentMutation) OldActive

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

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

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

func (*AgentMutation) OldField

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

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

func (*AgentMutation) OldHostname

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

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

func (*AgentMutation) OldIP

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

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

func (*AgentMutation) OldLastUpdateTime

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

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

OldMAC returns the old "mac" 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) OldOccupiedCPU

func (m *AgentMutation) OldOccupiedCPU(ctx context.Context) (v int32, err error)

OldOccupiedCPU returns the old "occupied_cpu" 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) OldOccupiedMemory

func (m *AgentMutation) OldOccupiedMemory(ctx context.Context) (v int32, err error)

OldOccupiedMemory returns the old "occupied_memory" 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) OldTotalCPU

func (m *AgentMutation) OldTotalCPU(ctx context.Context) (v int32, err error)

OldTotalCPU returns the old "total_cpu" 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) OldTotalMemory

func (m *AgentMutation) OldTotalMemory(ctx context.Context) (v int32, err error)

OldTotalMemory returns the old "total_memory" 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) 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

func (m *AgentMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*AgentMutation) ResetArch

func (m *AgentMutation) ResetArch()

ResetArch resets all changes to the "arch" field.

func (*AgentMutation) ResetEdge

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

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

func (*AgentMutation) ResetField

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

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

func (*AgentMutation) ResetHostname

func (m *AgentMutation) ResetHostname()

ResetHostname resets all changes to the "hostname" field.

func (*AgentMutation) ResetIP

func (m *AgentMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*AgentMutation) ResetLastUpdateTime

func (m *AgentMutation) ResetLastUpdateTime()

ResetLastUpdateTime resets all changes to the "last_update_time" field.

func (*AgentMutation) ResetMAC

func (m *AgentMutation) ResetMAC()

ResetMAC resets all changes to the "mac" field.

func (*AgentMutation) ResetOccupiedCPU

func (m *AgentMutation) ResetOccupiedCPU()

ResetOccupiedCPU resets all changes to the "occupied_cpu" field.

func (*AgentMutation) ResetOccupiedMemory

func (m *AgentMutation) ResetOccupiedMemory()

ResetOccupiedMemory resets all changes to the "occupied_memory" field.

func (*AgentMutation) ResetTotalCPU

func (m *AgentMutation) ResetTotalCPU()

ResetTotalCPU resets all changes to the "total_cpu" field.

func (*AgentMutation) ResetTotalMemory

func (m *AgentMutation) ResetTotalMemory()

ResetTotalMemory resets all changes to the "total_memory" field.

func (*AgentMutation) SetActive

func (m *AgentMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*AgentMutation) SetArch

func (m *AgentMutation) SetArch(s string)

SetArch sets the "arch" field.

func (*AgentMutation) SetField

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

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

func (*AgentMutation) SetHostname

func (m *AgentMutation) SetHostname(s string)

SetHostname sets the "hostname" field.

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

func (m *AgentMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*AgentMutation) SetLastUpdateTime

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

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentMutation) SetMAC

func (m *AgentMutation) SetMAC(s string)

SetMAC sets the "mac" field.

func (*AgentMutation) SetOccupiedCPU

func (m *AgentMutation) SetOccupiedCPU(i int32)

SetOccupiedCPU sets the "occupied_cpu" field.

func (*AgentMutation) SetOccupiedMemory

func (m *AgentMutation) SetOccupiedMemory(i int32)

SetOccupiedMemory sets the "occupied_memory" field.

func (*AgentMutation) SetOp

func (m *AgentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentMutation) SetTotalCPU

func (m *AgentMutation) SetTotalCPU(i int32)

SetTotalCPU sets the "total_cpu" field.

func (*AgentMutation) SetTotalMemory

func (m *AgentMutation) SetTotalMemory(i int32)

SetTotalMemory sets the "total_memory" field.

func (*AgentMutation) TotalCPU

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

TotalCPU returns the value of the "total_cpu" field in the mutation.

func (*AgentMutation) TotalMemory

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

TotalMemory returns the value of the "total_memory" field in the mutation.

func (AgentMutation) Tx

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

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

func (*AgentMutation) Type

func (m *AgentMutation) Type() string

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

func (*AgentMutation) Where

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

Where appends a list predicates to the AgentMutation builder.

func (*AgentMutation) WhereP

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

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

type AgentQuery

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

AgentQuery is the builder for querying Agent entities.

func (*AgentQuery) Aggregate

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

Aggregate returns a AgentSelect configured with the given aggregations.

func (*AgentQuery) All

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

All executes the query and returns a list of Agents.

func (*AgentQuery) AllX

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

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

func (*AgentQuery) Clone

func (_q *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 (_q *AgentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AgentQuery) CountX

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

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

func (*AgentQuery) Exist

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

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

func (*AgentQuery) ExistX

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

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

func (*AgentQuery) First

func (_q *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 (_q *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 (_q *AgentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AgentQuery) FirstX

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

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

func (*AgentQuery) GroupBy

func (_q *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 {
	MAC string `json:"mac,omitempty"`
	Count int `json:"count,omitempty"`
}

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

func (*AgentQuery) IDs

func (_q *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 (_q *AgentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AgentQuery) Limit

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

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

func (*AgentQuery) Offset

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

Offset to start from.

func (*AgentQuery) Only

func (_q *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 (_q *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 (_q *AgentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AgentQuery) OnlyX

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

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

func (*AgentQuery) Order

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

Order specifies how the records should be ordered.

func (*AgentQuery) Select

func (_q *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 {
	MAC string `json:"mac,omitempty"`
}

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

func (*AgentQuery) Unique

func (_q *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 (_q *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 (_s *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 (_s *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) AddOccupiedCPU

func (_u *AgentUpdate) AddOccupiedCPU(v int32) *AgentUpdate

AddOccupiedCPU adds value to the "occupied_cpu" field.

func (*AgentUpdate) AddOccupiedMemory

func (_u *AgentUpdate) AddOccupiedMemory(v int32) *AgentUpdate

AddOccupiedMemory adds value to the "occupied_memory" field.

func (*AgentUpdate) AddTotalCPU

func (_u *AgentUpdate) AddTotalCPU(v int32) *AgentUpdate

AddTotalCPU adds value to the "total_cpu" field.

func (*AgentUpdate) AddTotalMemory

func (_u *AgentUpdate) AddTotalMemory(v int32) *AgentUpdate

AddTotalMemory adds value to the "total_memory" field.

func (*AgentUpdate) Exec

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

Exec executes the query.

func (*AgentUpdate) ExecX

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

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

func (*AgentUpdate) Mutation

func (_u *AgentUpdate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdate) Save

func (_u *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 (_u *AgentUpdate) SaveX(ctx context.Context) int

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

func (*AgentUpdate) SetActive

func (_u *AgentUpdate) SetActive(v bool) *AgentUpdate

SetActive sets the "active" field.

func (*AgentUpdate) SetArch

func (_u *AgentUpdate) SetArch(v string) *AgentUpdate

SetArch sets the "arch" field.

func (*AgentUpdate) SetHostname

func (_u *AgentUpdate) SetHostname(v string) *AgentUpdate

SetHostname sets the "hostname" field.

func (*AgentUpdate) SetIP

func (_u *AgentUpdate) SetIP(v string) *AgentUpdate

SetIP sets the "ip" field.

func (*AgentUpdate) SetLastUpdateTime

func (_u *AgentUpdate) SetLastUpdateTime(v time.Time) *AgentUpdate

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentUpdate) SetMAC

func (_u *AgentUpdate) SetMAC(v string) *AgentUpdate

SetMAC sets the "mac" field.

func (*AgentUpdate) SetNillableActive

func (_u *AgentUpdate) SetNillableActive(v *bool) *AgentUpdate

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

func (*AgentUpdate) SetNillableArch

func (_u *AgentUpdate) SetNillableArch(v *string) *AgentUpdate

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

func (*AgentUpdate) SetNillableHostname

func (_u *AgentUpdate) SetNillableHostname(v *string) *AgentUpdate

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

func (*AgentUpdate) SetNillableIP

func (_u *AgentUpdate) SetNillableIP(v *string) *AgentUpdate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*AgentUpdate) SetNillableMAC

func (_u *AgentUpdate) SetNillableMAC(v *string) *AgentUpdate

SetNillableMAC sets the "mac" field if the given value is not nil.

func (*AgentUpdate) SetNillableOccupiedCPU

func (_u *AgentUpdate) SetNillableOccupiedCPU(v *int32) *AgentUpdate

SetNillableOccupiedCPU sets the "occupied_cpu" field if the given value is not nil.

func (*AgentUpdate) SetNillableOccupiedMemory

func (_u *AgentUpdate) SetNillableOccupiedMemory(v *int32) *AgentUpdate

SetNillableOccupiedMemory sets the "occupied_memory" field if the given value is not nil.

func (*AgentUpdate) SetNillableTotalCPU

func (_u *AgentUpdate) SetNillableTotalCPU(v *int32) *AgentUpdate

SetNillableTotalCPU sets the "total_cpu" field if the given value is not nil.

func (*AgentUpdate) SetNillableTotalMemory

func (_u *AgentUpdate) SetNillableTotalMemory(v *int32) *AgentUpdate

SetNillableTotalMemory sets the "total_memory" field if the given value is not nil.

func (*AgentUpdate) SetOccupiedCPU

func (_u *AgentUpdate) SetOccupiedCPU(v int32) *AgentUpdate

SetOccupiedCPU sets the "occupied_cpu" field.

func (*AgentUpdate) SetOccupiedMemory

func (_u *AgentUpdate) SetOccupiedMemory(v int32) *AgentUpdate

SetOccupiedMemory sets the "occupied_memory" field.

func (*AgentUpdate) SetTotalCPU

func (_u *AgentUpdate) SetTotalCPU(v int32) *AgentUpdate

SetTotalCPU sets the "total_cpu" field.

func (*AgentUpdate) SetTotalMemory

func (_u *AgentUpdate) SetTotalMemory(v int32) *AgentUpdate

SetTotalMemory sets the "total_memory" field.

func (*AgentUpdate) Where

func (_u *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) AddOccupiedCPU

func (_u *AgentUpdateOne) AddOccupiedCPU(v int32) *AgentUpdateOne

AddOccupiedCPU adds value to the "occupied_cpu" field.

func (*AgentUpdateOne) AddOccupiedMemory

func (_u *AgentUpdateOne) AddOccupiedMemory(v int32) *AgentUpdateOne

AddOccupiedMemory adds value to the "occupied_memory" field.

func (*AgentUpdateOne) AddTotalCPU

func (_u *AgentUpdateOne) AddTotalCPU(v int32) *AgentUpdateOne

AddTotalCPU adds value to the "total_cpu" field.

func (*AgentUpdateOne) AddTotalMemory

func (_u *AgentUpdateOne) AddTotalMemory(v int32) *AgentUpdateOne

AddTotalMemory adds value to the "total_memory" field.

func (*AgentUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AgentUpdateOne) ExecX

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

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

func (*AgentUpdateOne) Mutation

func (_u *AgentUpdateOne) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdateOne) Save

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

Save executes the query and returns the updated Agent entity.

func (*AgentUpdateOne) SaveX

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

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

func (*AgentUpdateOne) Select

func (_u *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

func (_u *AgentUpdateOne) SetActive(v bool) *AgentUpdateOne

SetActive sets the "active" field.

func (*AgentUpdateOne) SetArch

func (_u *AgentUpdateOne) SetArch(v string) *AgentUpdateOne

SetArch sets the "arch" field.

func (*AgentUpdateOne) SetHostname

func (_u *AgentUpdateOne) SetHostname(v string) *AgentUpdateOne

SetHostname sets the "hostname" field.

func (*AgentUpdateOne) SetIP

func (_u *AgentUpdateOne) SetIP(v string) *AgentUpdateOne

SetIP sets the "ip" field.

func (*AgentUpdateOne) SetLastUpdateTime

func (_u *AgentUpdateOne) SetLastUpdateTime(v time.Time) *AgentUpdateOne

SetLastUpdateTime sets the "last_update_time" field.

func (*AgentUpdateOne) SetMAC

func (_u *AgentUpdateOne) SetMAC(v string) *AgentUpdateOne

SetMAC sets the "mac" field.

func (*AgentUpdateOne) SetNillableActive

func (_u *AgentUpdateOne) SetNillableActive(v *bool) *AgentUpdateOne

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

func (*AgentUpdateOne) SetNillableArch

func (_u *AgentUpdateOne) SetNillableArch(v *string) *AgentUpdateOne

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

func (*AgentUpdateOne) SetNillableHostname

func (_u *AgentUpdateOne) SetNillableHostname(v *string) *AgentUpdateOne

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

func (*AgentUpdateOne) SetNillableIP

func (_u *AgentUpdateOne) SetNillableIP(v *string) *AgentUpdateOne

SetNillableIP sets the "ip" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableMAC

func (_u *AgentUpdateOne) SetNillableMAC(v *string) *AgentUpdateOne

SetNillableMAC sets the "mac" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableOccupiedCPU

func (_u *AgentUpdateOne) SetNillableOccupiedCPU(v *int32) *AgentUpdateOne

SetNillableOccupiedCPU sets the "occupied_cpu" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableOccupiedMemory

func (_u *AgentUpdateOne) SetNillableOccupiedMemory(v *int32) *AgentUpdateOne

SetNillableOccupiedMemory sets the "occupied_memory" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableTotalCPU

func (_u *AgentUpdateOne) SetNillableTotalCPU(v *int32) *AgentUpdateOne

SetNillableTotalCPU sets the "total_cpu" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableTotalMemory

func (_u *AgentUpdateOne) SetNillableTotalMemory(v *int32) *AgentUpdateOne

SetNillableTotalMemory sets the "total_memory" field if the given value is not nil.

func (*AgentUpdateOne) SetOccupiedCPU

func (_u *AgentUpdateOne) SetOccupiedCPU(v int32) *AgentUpdateOne

SetOccupiedCPU sets the "occupied_cpu" field.

func (*AgentUpdateOne) SetOccupiedMemory

func (_u *AgentUpdateOne) SetOccupiedMemory(v int32) *AgentUpdateOne

SetOccupiedMemory sets the "occupied_memory" field.

func (*AgentUpdateOne) SetTotalCPU

func (_u *AgentUpdateOne) SetTotalCPU(v int32) *AgentUpdateOne

SetTotalCPU sets the "total_cpu" field.

func (*AgentUpdateOne) SetTotalMemory

func (_u *AgentUpdateOne) SetTotalMemory(v int32) *AgentUpdateOne

SetTotalMemory sets the "total_memory" field.

func (*AgentUpdateOne) Where

func (_u *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 AlipayOrderRollback

type AlipayOrderRollback struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 通知校验ID
	NotifyID string `json:"notify_id,omitempty"`
	// 通知类型
	NotifyType string `json:"notify_type,omitempty"`
	// 通知时间
	NotifyTime string `json:"notify_time,omitempty"`
	// 编码格式,如 utf-8、gbk、gb2312 等
	Charset string `json:"charset,omitempty"`
	// 调用的接口版本,固定为:1.0
	Version string `json:"version,omitempty"`
	// 签名类型
	SignType string `json:"sign_type,omitempty"`
	// 签名
	Sign string `json:"sign,omitempty"`
	// 支付成功的各个渠道金额信息。详情可查看 资金明细信息说明
	FundBillList string `json:"fund_bill_list,omitempty"`
	// 实收金额
	ReceiptAmount string `json:"receipt_amount,omitempty"`
	// 用户在交易中支付的可开发票的金额
	InvoiceAmount string `json:"invoice_amount,omitempty"`
	// 付款金额
	BuyerPayAmount string `json:"buyer_pay_amount,omitempty"`
	// 集分宝金额
	PointAmount string `json:"point_amount,omitempty"`
	// 本交易支付时所有优惠券信息,详情可查看 优惠券信息说明
	VoucherDetailList string `json:"voucher_detail_list,omitempty"`
	// 公共回传参数,如果请求时传递了该参数,则返回给商家时会在异步通知时将该参数原样返回。本参数必须进行 UrlEncode 之后才可以发送给支付宝。
	PassbackParams string `json:"passback_params,omitempty"`
	// 支付宝交易号
	TradeNo string `json:"trade_no,omitempty"`
	// 开发者id
	AppID string `json:"app_id,omitempty"`
	// 商户订单号
	OutTradeNo string `json:"out_trade_no,omitempty"`
	// 商户业务号
	OutBizNo string `json:"out_biz_no,omitempty"`
	// 买家支付宝ID
	BuyerID string `json:"buyer_id,omitempty"`
	// 卖家支付宝id
	SellerID string `json:"seller_id,omitempty"`
	// 交易状态
	TradeStatus string `json:"trade_status,omitempty"`
	// 订单金额
	TotalAmount string `json:"total_amount,omitempty"`
	// 总退款金额
	RefundFee string `json:"refund_fee,omitempty"`
	// 订单标题
	Subject string `json:"subject,omitempty"`
	// 订单的备注、描述、明细等。对应请求时的 body 参数,原样通知回来
	Body string `json:"body,omitempty"`
	// 交易创建时间
	GmtCreate string `json:"gmt_create,omitempty"`
	// 交易付款时间
	GmtPayment string `json:"gmt_payment,omitempty"`
	// 交易关闭时间
	GmtClose string `json:"gmt_close,omitempty"`
	// 创建时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// 更新时间
	UpdateTime time.Time `json:"update_time,omitempty"`
	// contains filtered or unexported fields
}

AlipayOrderRollback is the model entity for the AlipayOrderRollback schema.

func (*AlipayOrderRollback) String

func (_m *AlipayOrderRollback) String() string

String implements the fmt.Stringer.

func (*AlipayOrderRollback) Unwrap

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

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

func (*AlipayOrderRollback) Value

func (_m *AlipayOrderRollback) Value(name string) (ent.Value, error)

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

type AlipayOrderRollbackClient

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

AlipayOrderRollbackClient is a client for the AlipayOrderRollback schema.

func NewAlipayOrderRollbackClient

func NewAlipayOrderRollbackClient(c config) *AlipayOrderRollbackClient

NewAlipayOrderRollbackClient returns a client for the AlipayOrderRollback from the given config.

func (*AlipayOrderRollbackClient) Create

Create returns a builder for creating a AlipayOrderRollback entity.

func (*AlipayOrderRollbackClient) CreateBulk

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

func (*AlipayOrderRollbackClient) Delete

Delete returns a delete builder for AlipayOrderRollback.

func (*AlipayOrderRollbackClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AlipayOrderRollbackClient) DeleteOneID

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

func (*AlipayOrderRollbackClient) Get

Get returns a AlipayOrderRollback entity by its id.

func (*AlipayOrderRollbackClient) GetX

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

func (*AlipayOrderRollbackClient) Hooks

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

Hooks returns the client hooks.

func (*AlipayOrderRollbackClient) Intercept

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

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

func (*AlipayOrderRollbackClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AlipayOrderRollbackClient) MapCreateBulk

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

func (*AlipayOrderRollbackClient) Query

Query returns a query builder for AlipayOrderRollback.

func (*AlipayOrderRollbackClient) Update

Update returns an update builder for AlipayOrderRollback.

func (*AlipayOrderRollbackClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AlipayOrderRollbackClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*AlipayOrderRollbackClient) Use

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

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

type AlipayOrderRollbackCreate

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

AlipayOrderRollbackCreate is the builder for creating a AlipayOrderRollback entity.

func (*AlipayOrderRollbackCreate) Exec

Exec executes the query.

func (*AlipayOrderRollbackCreate) ExecX

func (_c *AlipayOrderRollbackCreate) ExecX(ctx context.Context)

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

func (*AlipayOrderRollbackCreate) Mutation

Mutation returns the AlipayOrderRollbackMutation object of the builder.

func (*AlipayOrderRollbackCreate) Save

Save creates the AlipayOrderRollback in the database.

func (*AlipayOrderRollbackCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AlipayOrderRollbackCreate) SetAppID

SetAppID sets the "app_id" field.

func (*AlipayOrderRollbackCreate) SetBody

SetBody sets the "body" field.

func (*AlipayOrderRollbackCreate) SetBuyerID

SetBuyerID sets the "buyer_id" field.

func (*AlipayOrderRollbackCreate) SetBuyerPayAmount

SetBuyerPayAmount sets the "buyer_pay_amount" field.

func (*AlipayOrderRollbackCreate) SetCharset

SetCharset sets the "charset" field.

func (*AlipayOrderRollbackCreate) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*AlipayOrderRollbackCreate) SetFundBillList

SetFundBillList sets the "fund_bill_list" field.

func (*AlipayOrderRollbackCreate) SetGmtClose

SetGmtClose sets the "gmt_close" field.

func (*AlipayOrderRollbackCreate) SetGmtCreate

SetGmtCreate sets the "gmt_create" field.

func (*AlipayOrderRollbackCreate) SetGmtPayment

SetGmtPayment sets the "gmt_payment" field.

func (*AlipayOrderRollbackCreate) SetInvoiceAmount

SetInvoiceAmount sets the "invoice_amount" field.

func (*AlipayOrderRollbackCreate) SetNotifyID

SetNotifyID sets the "notify_id" field.

func (*AlipayOrderRollbackCreate) SetNotifyTime

SetNotifyTime sets the "notify_time" field.

func (*AlipayOrderRollbackCreate) SetNotifyType

SetNotifyType sets the "notify_type" field.

func (*AlipayOrderRollbackCreate) SetOutBizNo

SetOutBizNo sets the "out_biz_no" field.

func (*AlipayOrderRollbackCreate) SetOutTradeNo

SetOutTradeNo sets the "out_trade_no" field.

func (*AlipayOrderRollbackCreate) SetPassbackParams

SetPassbackParams sets the "passback_params" field.

func (*AlipayOrderRollbackCreate) SetPointAmount

SetPointAmount sets the "point_amount" field.

func (*AlipayOrderRollbackCreate) SetReceiptAmount

SetReceiptAmount sets the "receipt_amount" field.

func (*AlipayOrderRollbackCreate) SetRefundFee

SetRefundFee sets the "refund_fee" field.

func (*AlipayOrderRollbackCreate) SetSellerID

SetSellerID sets the "seller_id" field.

func (*AlipayOrderRollbackCreate) SetSign

SetSign sets the "sign" field.

func (*AlipayOrderRollbackCreate) SetSignType

SetSignType sets the "sign_type" field.

func (*AlipayOrderRollbackCreate) SetSubject

SetSubject sets the "subject" field.

func (*AlipayOrderRollbackCreate) SetTotalAmount

SetTotalAmount sets the "total_amount" field.

func (*AlipayOrderRollbackCreate) SetTradeNo

SetTradeNo sets the "trade_no" field.

func (*AlipayOrderRollbackCreate) SetTradeStatus

SetTradeStatus sets the "trade_status" field.

func (*AlipayOrderRollbackCreate) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*AlipayOrderRollbackCreate) SetVersion

SetVersion sets the "version" field.

func (*AlipayOrderRollbackCreate) SetVoucherDetailList

func (_c *AlipayOrderRollbackCreate) SetVoucherDetailList(v string) *AlipayOrderRollbackCreate

SetVoucherDetailList sets the "voucher_detail_list" field.

type AlipayOrderRollbackCreateBulk

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

AlipayOrderRollbackCreateBulk is the builder for creating many AlipayOrderRollback entities in bulk.

func (*AlipayOrderRollbackCreateBulk) Exec

Exec executes the query.

func (*AlipayOrderRollbackCreateBulk) ExecX

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

func (*AlipayOrderRollbackCreateBulk) Save

Save creates the AlipayOrderRollback entities in the database.

func (*AlipayOrderRollbackCreateBulk) SaveX

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

type AlipayOrderRollbackDelete

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

AlipayOrderRollbackDelete is the builder for deleting a AlipayOrderRollback entity.

func (*AlipayOrderRollbackDelete) Exec

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

func (*AlipayOrderRollbackDelete) ExecX

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

func (*AlipayOrderRollbackDelete) Where

Where appends a list predicates to the AlipayOrderRollbackDelete builder.

type AlipayOrderRollbackDeleteOne

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

AlipayOrderRollbackDeleteOne is the builder for deleting a single AlipayOrderRollback entity.

func (*AlipayOrderRollbackDeleteOne) Exec

Exec executes the deletion query.

func (*AlipayOrderRollbackDeleteOne) ExecX

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

func (*AlipayOrderRollbackDeleteOne) Where

Where appends a list predicates to the AlipayOrderRollbackDelete builder.

type AlipayOrderRollbackGroupBy

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

AlipayOrderRollbackGroupBy is the group-by builder for AlipayOrderRollback entities.

func (*AlipayOrderRollbackGroupBy) Aggregate

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

func (*AlipayOrderRollbackGroupBy) Bool

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

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

func (*AlipayOrderRollbackGroupBy) BoolX

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

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

func (*AlipayOrderRollbackGroupBy) Bools

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

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

func (*AlipayOrderRollbackGroupBy) BoolsX

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

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

func (*AlipayOrderRollbackGroupBy) Float64

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

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

func (*AlipayOrderRollbackGroupBy) Float64X

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

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

func (*AlipayOrderRollbackGroupBy) Float64s

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

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

func (*AlipayOrderRollbackGroupBy) Float64sX

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

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

func (*AlipayOrderRollbackGroupBy) Int

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

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

func (*AlipayOrderRollbackGroupBy) IntX

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

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

func (*AlipayOrderRollbackGroupBy) Ints

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

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

func (*AlipayOrderRollbackGroupBy) IntsX

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

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

func (*AlipayOrderRollbackGroupBy) Scan

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

func (*AlipayOrderRollbackGroupBy) ScanX

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

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

func (*AlipayOrderRollbackGroupBy) String

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

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

func (*AlipayOrderRollbackGroupBy) StringX

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

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

func (*AlipayOrderRollbackGroupBy) Strings

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

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

func (*AlipayOrderRollbackGroupBy) StringsX

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

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

type AlipayOrderRollbackMutation

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

AlipayOrderRollbackMutation represents an operation that mutates the AlipayOrderRollback nodes in the graph.

func (*AlipayOrderRollbackMutation) AddField

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

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

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

func (*AlipayOrderRollbackMutation) AddedField

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

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

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

func (*AlipayOrderRollbackMutation) AddedIDs

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

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

func (*AlipayOrderRollbackMutation) AppID

func (m *AlipayOrderRollbackMutation) AppID() (r string, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*AlipayOrderRollbackMutation) Body

func (m *AlipayOrderRollbackMutation) Body() (r string, exists bool)

Body returns the value of the "body" field in the mutation.

func (*AlipayOrderRollbackMutation) BuyerID

func (m *AlipayOrderRollbackMutation) BuyerID() (r string, exists bool)

BuyerID returns the value of the "buyer_id" field in the mutation.

func (*AlipayOrderRollbackMutation) BuyerPayAmount

func (m *AlipayOrderRollbackMutation) BuyerPayAmount() (r string, exists bool)

BuyerPayAmount returns the value of the "buyer_pay_amount" field in the mutation.

func (*AlipayOrderRollbackMutation) Charset

func (m *AlipayOrderRollbackMutation) Charset() (r string, exists bool)

Charset returns the value of the "charset" field in the mutation.

func (*AlipayOrderRollbackMutation) ClearEdge

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

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

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

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

func (*AlipayOrderRollbackMutation) ClearedFields

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

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

func (AlipayOrderRollbackMutation) Client

func (m AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) CreateTime

func (m *AlipayOrderRollbackMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*AlipayOrderRollbackMutation) EdgeCleared

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

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

func (*AlipayOrderRollbackMutation) Field

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

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

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

func (*AlipayOrderRollbackMutation) Fields

func (m *AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) FundBillList

func (m *AlipayOrderRollbackMutation) FundBillList() (r string, exists bool)

FundBillList returns the value of the "fund_bill_list" field in the mutation.

func (*AlipayOrderRollbackMutation) GmtClose

func (m *AlipayOrderRollbackMutation) GmtClose() (r string, exists bool)

GmtClose returns the value of the "gmt_close" field in the mutation.

func (*AlipayOrderRollbackMutation) GmtCreate

func (m *AlipayOrderRollbackMutation) GmtCreate() (r string, exists bool)

GmtCreate returns the value of the "gmt_create" field in the mutation.

func (*AlipayOrderRollbackMutation) GmtPayment

func (m *AlipayOrderRollbackMutation) GmtPayment() (r string, exists bool)

GmtPayment returns the value of the "gmt_payment" field in the mutation.

func (*AlipayOrderRollbackMutation) ID

func (m *AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) InvoiceAmount

func (m *AlipayOrderRollbackMutation) InvoiceAmount() (r string, exists bool)

InvoiceAmount returns the value of the "invoice_amount" field in the mutation.

func (*AlipayOrderRollbackMutation) NotifyID

func (m *AlipayOrderRollbackMutation) NotifyID() (r string, exists bool)

NotifyID returns the value of the "notify_id" field in the mutation.

func (*AlipayOrderRollbackMutation) NotifyTime

func (m *AlipayOrderRollbackMutation) NotifyTime() (r string, exists bool)

NotifyTime returns the value of the "notify_time" field in the mutation.

func (*AlipayOrderRollbackMutation) NotifyType

func (m *AlipayOrderRollbackMutation) NotifyType() (r string, exists bool)

NotifyType returns the value of the "notify_type" field in the mutation.

func (*AlipayOrderRollbackMutation) OldAppID

func (m *AlipayOrderRollbackMutation) OldAppID(ctx context.Context) (v string, err error)

OldAppID returns the old "app_id" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldBody

func (m *AlipayOrderRollbackMutation) OldBody(ctx context.Context) (v string, err error)

OldBody returns the old "body" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldBuyerID

func (m *AlipayOrderRollbackMutation) OldBuyerID(ctx context.Context) (v string, err error)

OldBuyerID returns the old "buyer_id" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldBuyerPayAmount

func (m *AlipayOrderRollbackMutation) OldBuyerPayAmount(ctx context.Context) (v string, err error)

OldBuyerPayAmount returns the old "buyer_pay_amount" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldCharset

func (m *AlipayOrderRollbackMutation) OldCharset(ctx context.Context) (v string, err error)

OldCharset returns the old "charset" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldCreateTime

func (m *AlipayOrderRollbackMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldField

func (m *AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) OldFundBillList

func (m *AlipayOrderRollbackMutation) OldFundBillList(ctx context.Context) (v string, err error)

OldFundBillList returns the old "fund_bill_list" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldGmtClose

func (m *AlipayOrderRollbackMutation) OldGmtClose(ctx context.Context) (v string, err error)

OldGmtClose returns the old "gmt_close" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldGmtCreate

func (m *AlipayOrderRollbackMutation) OldGmtCreate(ctx context.Context) (v string, err error)

OldGmtCreate returns the old "gmt_create" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldGmtPayment

func (m *AlipayOrderRollbackMutation) OldGmtPayment(ctx context.Context) (v string, err error)

OldGmtPayment returns the old "gmt_payment" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldInvoiceAmount

func (m *AlipayOrderRollbackMutation) OldInvoiceAmount(ctx context.Context) (v string, err error)

OldInvoiceAmount returns the old "invoice_amount" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldNotifyID

func (m *AlipayOrderRollbackMutation) OldNotifyID(ctx context.Context) (v string, err error)

OldNotifyID returns the old "notify_id" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldNotifyTime

func (m *AlipayOrderRollbackMutation) OldNotifyTime(ctx context.Context) (v string, err error)

OldNotifyTime returns the old "notify_time" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldNotifyType

func (m *AlipayOrderRollbackMutation) OldNotifyType(ctx context.Context) (v string, err error)

OldNotifyType returns the old "notify_type" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldOutBizNo

func (m *AlipayOrderRollbackMutation) OldOutBizNo(ctx context.Context) (v string, err error)

OldOutBizNo returns the old "out_biz_no" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldOutTradeNo

func (m *AlipayOrderRollbackMutation) OldOutTradeNo(ctx context.Context) (v string, err error)

OldOutTradeNo returns the old "out_trade_no" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldPassbackParams

func (m *AlipayOrderRollbackMutation) OldPassbackParams(ctx context.Context) (v string, err error)

OldPassbackParams returns the old "passback_params" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldPointAmount

func (m *AlipayOrderRollbackMutation) OldPointAmount(ctx context.Context) (v string, err error)

OldPointAmount returns the old "point_amount" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldReceiptAmount

func (m *AlipayOrderRollbackMutation) OldReceiptAmount(ctx context.Context) (v string, err error)

OldReceiptAmount returns the old "receipt_amount" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldRefundFee

func (m *AlipayOrderRollbackMutation) OldRefundFee(ctx context.Context) (v string, err error)

OldRefundFee returns the old "refund_fee" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldSellerID

func (m *AlipayOrderRollbackMutation) OldSellerID(ctx context.Context) (v string, err error)

OldSellerID returns the old "seller_id" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldSign

func (m *AlipayOrderRollbackMutation) OldSign(ctx context.Context) (v string, err error)

OldSign returns the old "sign" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldSignType

func (m *AlipayOrderRollbackMutation) OldSignType(ctx context.Context) (v string, err error)

OldSignType returns the old "sign_type" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldSubject

func (m *AlipayOrderRollbackMutation) OldSubject(ctx context.Context) (v string, err error)

OldSubject returns the old "subject" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldTotalAmount

func (m *AlipayOrderRollbackMutation) OldTotalAmount(ctx context.Context) (v string, err error)

OldTotalAmount returns the old "total_amount" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldTradeNo

func (m *AlipayOrderRollbackMutation) OldTradeNo(ctx context.Context) (v string, err error)

OldTradeNo returns the old "trade_no" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldTradeStatus

func (m *AlipayOrderRollbackMutation) OldTradeStatus(ctx context.Context) (v string, err error)

OldTradeStatus returns the old "trade_status" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldUpdateTime

func (m *AlipayOrderRollbackMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldVersion

func (m *AlipayOrderRollbackMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) OldVoucherDetailList

func (m *AlipayOrderRollbackMutation) OldVoucherDetailList(ctx context.Context) (v string, err error)

OldVoucherDetailList returns the old "voucher_detail_list" field's value of the AlipayOrderRollback entity. If the AlipayOrderRollback 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 (*AlipayOrderRollbackMutation) Op

Op returns the operation name.

func (*AlipayOrderRollbackMutation) OutBizNo

func (m *AlipayOrderRollbackMutation) OutBizNo() (r string, exists bool)

OutBizNo returns the value of the "out_biz_no" field in the mutation.

func (*AlipayOrderRollbackMutation) OutTradeNo

func (m *AlipayOrderRollbackMutation) OutTradeNo() (r string, exists bool)

OutTradeNo returns the value of the "out_trade_no" field in the mutation.

func (*AlipayOrderRollbackMutation) PassbackParams

func (m *AlipayOrderRollbackMutation) PassbackParams() (r string, exists bool)

PassbackParams returns the value of the "passback_params" field in the mutation.

func (*AlipayOrderRollbackMutation) PointAmount

func (m *AlipayOrderRollbackMutation) PointAmount() (r string, exists bool)

PointAmount returns the value of the "point_amount" field in the mutation.

func (*AlipayOrderRollbackMutation) ReceiptAmount

func (m *AlipayOrderRollbackMutation) ReceiptAmount() (r string, exists bool)

ReceiptAmount returns the value of the "receipt_amount" field in the mutation.

func (*AlipayOrderRollbackMutation) RefundFee

func (m *AlipayOrderRollbackMutation) RefundFee() (r string, exists bool)

RefundFee returns the value of the "refund_fee" field in the mutation.

func (*AlipayOrderRollbackMutation) RemovedEdges

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

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

func (*AlipayOrderRollbackMutation) RemovedIDs

func (m *AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) ResetAppID

func (m *AlipayOrderRollbackMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*AlipayOrderRollbackMutation) ResetBody

func (m *AlipayOrderRollbackMutation) ResetBody()

ResetBody resets all changes to the "body" field.

func (*AlipayOrderRollbackMutation) ResetBuyerID

func (m *AlipayOrderRollbackMutation) ResetBuyerID()

ResetBuyerID resets all changes to the "buyer_id" field.

func (*AlipayOrderRollbackMutation) ResetBuyerPayAmount

func (m *AlipayOrderRollbackMutation) ResetBuyerPayAmount()

ResetBuyerPayAmount resets all changes to the "buyer_pay_amount" field.

func (*AlipayOrderRollbackMutation) ResetCharset

func (m *AlipayOrderRollbackMutation) ResetCharset()

ResetCharset resets all changes to the "charset" field.

func (*AlipayOrderRollbackMutation) ResetCreateTime

func (m *AlipayOrderRollbackMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*AlipayOrderRollbackMutation) ResetEdge

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

func (m *AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) ResetFundBillList

func (m *AlipayOrderRollbackMutation) ResetFundBillList()

ResetFundBillList resets all changes to the "fund_bill_list" field.

func (*AlipayOrderRollbackMutation) ResetGmtClose

func (m *AlipayOrderRollbackMutation) ResetGmtClose()

ResetGmtClose resets all changes to the "gmt_close" field.

func (*AlipayOrderRollbackMutation) ResetGmtCreate

func (m *AlipayOrderRollbackMutation) ResetGmtCreate()

ResetGmtCreate resets all changes to the "gmt_create" field.

func (*AlipayOrderRollbackMutation) ResetGmtPayment

func (m *AlipayOrderRollbackMutation) ResetGmtPayment()

ResetGmtPayment resets all changes to the "gmt_payment" field.

func (*AlipayOrderRollbackMutation) ResetInvoiceAmount

func (m *AlipayOrderRollbackMutation) ResetInvoiceAmount()

ResetInvoiceAmount resets all changes to the "invoice_amount" field.

func (*AlipayOrderRollbackMutation) ResetNotifyID

func (m *AlipayOrderRollbackMutation) ResetNotifyID()

ResetNotifyID resets all changes to the "notify_id" field.

func (*AlipayOrderRollbackMutation) ResetNotifyTime

func (m *AlipayOrderRollbackMutation) ResetNotifyTime()

ResetNotifyTime resets all changes to the "notify_time" field.

func (*AlipayOrderRollbackMutation) ResetNotifyType

func (m *AlipayOrderRollbackMutation) ResetNotifyType()

ResetNotifyType resets all changes to the "notify_type" field.

func (*AlipayOrderRollbackMutation) ResetOutBizNo

func (m *AlipayOrderRollbackMutation) ResetOutBizNo()

ResetOutBizNo resets all changes to the "out_biz_no" field.

func (*AlipayOrderRollbackMutation) ResetOutTradeNo

func (m *AlipayOrderRollbackMutation) ResetOutTradeNo()

ResetOutTradeNo resets all changes to the "out_trade_no" field.

func (*AlipayOrderRollbackMutation) ResetPassbackParams

func (m *AlipayOrderRollbackMutation) ResetPassbackParams()

ResetPassbackParams resets all changes to the "passback_params" field.

func (*AlipayOrderRollbackMutation) ResetPointAmount

func (m *AlipayOrderRollbackMutation) ResetPointAmount()

ResetPointAmount resets all changes to the "point_amount" field.

func (*AlipayOrderRollbackMutation) ResetReceiptAmount

func (m *AlipayOrderRollbackMutation) ResetReceiptAmount()

ResetReceiptAmount resets all changes to the "receipt_amount" field.

func (*AlipayOrderRollbackMutation) ResetRefundFee

func (m *AlipayOrderRollbackMutation) ResetRefundFee()

ResetRefundFee resets all changes to the "refund_fee" field.

func (*AlipayOrderRollbackMutation) ResetSellerID

func (m *AlipayOrderRollbackMutation) ResetSellerID()

ResetSellerID resets all changes to the "seller_id" field.

func (*AlipayOrderRollbackMutation) ResetSign

func (m *AlipayOrderRollbackMutation) ResetSign()

ResetSign resets all changes to the "sign" field.

func (*AlipayOrderRollbackMutation) ResetSignType

func (m *AlipayOrderRollbackMutation) ResetSignType()

ResetSignType resets all changes to the "sign_type" field.

func (*AlipayOrderRollbackMutation) ResetSubject

func (m *AlipayOrderRollbackMutation) ResetSubject()

ResetSubject resets all changes to the "subject" field.

func (*AlipayOrderRollbackMutation) ResetTotalAmount

func (m *AlipayOrderRollbackMutation) ResetTotalAmount()

ResetTotalAmount resets all changes to the "total_amount" field.

func (*AlipayOrderRollbackMutation) ResetTradeNo

func (m *AlipayOrderRollbackMutation) ResetTradeNo()

ResetTradeNo resets all changes to the "trade_no" field.

func (*AlipayOrderRollbackMutation) ResetTradeStatus

func (m *AlipayOrderRollbackMutation) ResetTradeStatus()

ResetTradeStatus resets all changes to the "trade_status" field.

func (*AlipayOrderRollbackMutation) ResetUpdateTime

func (m *AlipayOrderRollbackMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*AlipayOrderRollbackMutation) ResetVersion

func (m *AlipayOrderRollbackMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*AlipayOrderRollbackMutation) ResetVoucherDetailList

func (m *AlipayOrderRollbackMutation) ResetVoucherDetailList()

ResetVoucherDetailList resets all changes to the "voucher_detail_list" field.

func (*AlipayOrderRollbackMutation) SellerID

func (m *AlipayOrderRollbackMutation) SellerID() (r string, exists bool)

SellerID returns the value of the "seller_id" field in the mutation.

func (*AlipayOrderRollbackMutation) SetAppID

func (m *AlipayOrderRollbackMutation) SetAppID(s string)

SetAppID sets the "app_id" field.

func (*AlipayOrderRollbackMutation) SetBody

func (m *AlipayOrderRollbackMutation) SetBody(s string)

SetBody sets the "body" field.

func (*AlipayOrderRollbackMutation) SetBuyerID

func (m *AlipayOrderRollbackMutation) SetBuyerID(s string)

SetBuyerID sets the "buyer_id" field.

func (*AlipayOrderRollbackMutation) SetBuyerPayAmount

func (m *AlipayOrderRollbackMutation) SetBuyerPayAmount(s string)

SetBuyerPayAmount sets the "buyer_pay_amount" field.

func (*AlipayOrderRollbackMutation) SetCharset

func (m *AlipayOrderRollbackMutation) SetCharset(s string)

SetCharset sets the "charset" field.

func (*AlipayOrderRollbackMutation) SetCreateTime

func (m *AlipayOrderRollbackMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*AlipayOrderRollbackMutation) SetField

func (m *AlipayOrderRollbackMutation) 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 (*AlipayOrderRollbackMutation) SetFundBillList

func (m *AlipayOrderRollbackMutation) SetFundBillList(s string)

SetFundBillList sets the "fund_bill_list" field.

func (*AlipayOrderRollbackMutation) SetGmtClose

func (m *AlipayOrderRollbackMutation) SetGmtClose(s string)

SetGmtClose sets the "gmt_close" field.

func (*AlipayOrderRollbackMutation) SetGmtCreate

func (m *AlipayOrderRollbackMutation) SetGmtCreate(s string)

SetGmtCreate sets the "gmt_create" field.

func (*AlipayOrderRollbackMutation) SetGmtPayment

func (m *AlipayOrderRollbackMutation) SetGmtPayment(s string)

SetGmtPayment sets the "gmt_payment" field.

func (*AlipayOrderRollbackMutation) SetInvoiceAmount

func (m *AlipayOrderRollbackMutation) SetInvoiceAmount(s string)

SetInvoiceAmount sets the "invoice_amount" field.

func (*AlipayOrderRollbackMutation) SetNotifyID

func (m *AlipayOrderRollbackMutation) SetNotifyID(s string)

SetNotifyID sets the "notify_id" field.

func (*AlipayOrderRollbackMutation) SetNotifyTime

func (m *AlipayOrderRollbackMutation) SetNotifyTime(s string)

SetNotifyTime sets the "notify_time" field.

func (*AlipayOrderRollbackMutation) SetNotifyType

func (m *AlipayOrderRollbackMutation) SetNotifyType(s string)

SetNotifyType sets the "notify_type" field.

func (*AlipayOrderRollbackMutation) SetOp

func (m *AlipayOrderRollbackMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AlipayOrderRollbackMutation) SetOutBizNo

func (m *AlipayOrderRollbackMutation) SetOutBizNo(s string)

SetOutBizNo sets the "out_biz_no" field.

func (*AlipayOrderRollbackMutation) SetOutTradeNo

func (m *AlipayOrderRollbackMutation) SetOutTradeNo(s string)

SetOutTradeNo sets the "out_trade_no" field.

func (*AlipayOrderRollbackMutation) SetPassbackParams

func (m *AlipayOrderRollbackMutation) SetPassbackParams(s string)

SetPassbackParams sets the "passback_params" field.

func (*AlipayOrderRollbackMutation) SetPointAmount

func (m *AlipayOrderRollbackMutation) SetPointAmount(s string)

SetPointAmount sets the "point_amount" field.

func (*AlipayOrderRollbackMutation) SetReceiptAmount

func (m *AlipayOrderRollbackMutation) SetReceiptAmount(s string)

SetReceiptAmount sets the "receipt_amount" field.

func (*AlipayOrderRollbackMutation) SetRefundFee

func (m *AlipayOrderRollbackMutation) SetRefundFee(s string)

SetRefundFee sets the "refund_fee" field.

func (*AlipayOrderRollbackMutation) SetSellerID

func (m *AlipayOrderRollbackMutation) SetSellerID(s string)

SetSellerID sets the "seller_id" field.

func (*AlipayOrderRollbackMutation) SetSign

func (m *AlipayOrderRollbackMutation) SetSign(s string)

SetSign sets the "sign" field.

func (*AlipayOrderRollbackMutation) SetSignType

func (m *AlipayOrderRollbackMutation) SetSignType(s string)

SetSignType sets the "sign_type" field.

func (*AlipayOrderRollbackMutation) SetSubject

func (m *AlipayOrderRollbackMutation) SetSubject(s string)

SetSubject sets the "subject" field.

func (*AlipayOrderRollbackMutation) SetTotalAmount

func (m *AlipayOrderRollbackMutation) SetTotalAmount(s string)

SetTotalAmount sets the "total_amount" field.

func (*AlipayOrderRollbackMutation) SetTradeNo

func (m *AlipayOrderRollbackMutation) SetTradeNo(s string)

SetTradeNo sets the "trade_no" field.

func (*AlipayOrderRollbackMutation) SetTradeStatus

func (m *AlipayOrderRollbackMutation) SetTradeStatus(s string)

SetTradeStatus sets the "trade_status" field.

func (*AlipayOrderRollbackMutation) SetUpdateTime

func (m *AlipayOrderRollbackMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*AlipayOrderRollbackMutation) SetVersion

func (m *AlipayOrderRollbackMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (*AlipayOrderRollbackMutation) SetVoucherDetailList

func (m *AlipayOrderRollbackMutation) SetVoucherDetailList(s string)

SetVoucherDetailList sets the "voucher_detail_list" field.

func (*AlipayOrderRollbackMutation) Sign

func (m *AlipayOrderRollbackMutation) Sign() (r string, exists bool)

Sign returns the value of the "sign" field in the mutation.

func (*AlipayOrderRollbackMutation) SignType

func (m *AlipayOrderRollbackMutation) SignType() (r string, exists bool)

SignType returns the value of the "sign_type" field in the mutation.

func (*AlipayOrderRollbackMutation) Subject

func (m *AlipayOrderRollbackMutation) Subject() (r string, exists bool)

Subject returns the value of the "subject" field in the mutation.

func (*AlipayOrderRollbackMutation) TotalAmount

func (m *AlipayOrderRollbackMutation) TotalAmount() (r string, exists bool)

TotalAmount returns the value of the "total_amount" field in the mutation.

func (*AlipayOrderRollbackMutation) TradeNo

func (m *AlipayOrderRollbackMutation) TradeNo() (r string, exists bool)

TradeNo returns the value of the "trade_no" field in the mutation.

func (*AlipayOrderRollbackMutation) TradeStatus

func (m *AlipayOrderRollbackMutation) TradeStatus() (r string, exists bool)

TradeStatus returns the value of the "trade_status" field in the mutation.

func (AlipayOrderRollbackMutation) Tx

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

func (*AlipayOrderRollbackMutation) Type

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

func (*AlipayOrderRollbackMutation) UpdateTime

func (m *AlipayOrderRollbackMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*AlipayOrderRollbackMutation) Version

func (m *AlipayOrderRollbackMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*AlipayOrderRollbackMutation) VoucherDetailList

func (m *AlipayOrderRollbackMutation) VoucherDetailList() (r string, exists bool)

VoucherDetailList returns the value of the "voucher_detail_list" field in the mutation.

func (*AlipayOrderRollbackMutation) Where

Where appends a list predicates to the AlipayOrderRollbackMutation builder.

func (*AlipayOrderRollbackMutation) WhereP

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

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

type AlipayOrderRollbackQuery

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

AlipayOrderRollbackQuery is the builder for querying AlipayOrderRollback entities.

func (*AlipayOrderRollbackQuery) Aggregate

Aggregate returns a AlipayOrderRollbackSelect configured with the given aggregations.

func (*AlipayOrderRollbackQuery) All

All executes the query and returns a list of AlipayOrderRollbacks.

func (*AlipayOrderRollbackQuery) AllX

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

func (*AlipayOrderRollbackQuery) Clone

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

func (*AlipayOrderRollbackQuery) Count

func (_q *AlipayOrderRollbackQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AlipayOrderRollbackQuery) CountX

func (_q *AlipayOrderRollbackQuery) CountX(ctx context.Context) int

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

func (*AlipayOrderRollbackQuery) Exist

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

func (*AlipayOrderRollbackQuery) ExistX

func (_q *AlipayOrderRollbackQuery) ExistX(ctx context.Context) bool

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

func (*AlipayOrderRollbackQuery) First

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

func (*AlipayOrderRollbackQuery) FirstID

func (_q *AlipayOrderRollbackQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AlipayOrderRollbackQuery) FirstIDX

func (_q *AlipayOrderRollbackQuery) FirstIDX(ctx context.Context) int

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

func (*AlipayOrderRollbackQuery) FirstX

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

func (*AlipayOrderRollbackQuery) GroupBy

func (_q *AlipayOrderRollbackQuery) GroupBy(field string, fields ...string) *AlipayOrderRollbackGroupBy

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

client.AlipayOrderRollback.Query().
	GroupBy(alipayorderrollback.FieldNotifyID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AlipayOrderRollbackQuery) IDs

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

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

func (*AlipayOrderRollbackQuery) IDsX

func (_q *AlipayOrderRollbackQuery) IDsX(ctx context.Context) []int

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

func (*AlipayOrderRollbackQuery) Limit

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

func (*AlipayOrderRollbackQuery) Offset

Offset to start from.

func (*AlipayOrderRollbackQuery) Only

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

func (*AlipayOrderRollbackQuery) OnlyID

func (_q *AlipayOrderRollbackQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AlipayOrderRollbackQuery) OnlyIDX

func (_q *AlipayOrderRollbackQuery) OnlyIDX(ctx context.Context) int

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

func (*AlipayOrderRollbackQuery) OnlyX

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

func (*AlipayOrderRollbackQuery) Order

Order specifies how the records should be ordered.

func (*AlipayOrderRollbackQuery) Select

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

client.AlipayOrderRollback.Query().
	Select(alipayorderrollback.FieldNotifyID).
	Scan(ctx, &v)

func (*AlipayOrderRollbackQuery) Unique

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

Where adds a new predicate for the AlipayOrderRollbackQuery builder.

type AlipayOrderRollbackSelect

type AlipayOrderRollbackSelect struct {
	*AlipayOrderRollbackQuery
	// contains filtered or unexported fields
}

AlipayOrderRollbackSelect is the builder for selecting fields of AlipayOrderRollback entities.

func (*AlipayOrderRollbackSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*AlipayOrderRollbackSelect) Bool

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

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

func (*AlipayOrderRollbackSelect) BoolX

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

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

func (*AlipayOrderRollbackSelect) Bools

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

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

func (*AlipayOrderRollbackSelect) BoolsX

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

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

func (*AlipayOrderRollbackSelect) Float64

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

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

func (*AlipayOrderRollbackSelect) Float64X

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

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

func (*AlipayOrderRollbackSelect) Float64s

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

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

func (*AlipayOrderRollbackSelect) Float64sX

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

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

func (*AlipayOrderRollbackSelect) Int

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

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

func (*AlipayOrderRollbackSelect) IntX

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

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

func (*AlipayOrderRollbackSelect) Ints

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

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

func (*AlipayOrderRollbackSelect) IntsX

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

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

func (*AlipayOrderRollbackSelect) Scan

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

func (*AlipayOrderRollbackSelect) ScanX

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

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

func (*AlipayOrderRollbackSelect) String

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

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

func (*AlipayOrderRollbackSelect) StringX

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

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

func (*AlipayOrderRollbackSelect) Strings

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

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

func (*AlipayOrderRollbackSelect) StringsX

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

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

type AlipayOrderRollbackUpdate

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

AlipayOrderRollbackUpdate is the builder for updating AlipayOrderRollback entities.

func (*AlipayOrderRollbackUpdate) Exec

Exec executes the query.

func (*AlipayOrderRollbackUpdate) ExecX

func (_u *AlipayOrderRollbackUpdate) ExecX(ctx context.Context)

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

func (*AlipayOrderRollbackUpdate) Mutation

Mutation returns the AlipayOrderRollbackMutation object of the builder.

func (*AlipayOrderRollbackUpdate) Save

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

func (*AlipayOrderRollbackUpdate) SaveX

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

func (*AlipayOrderRollbackUpdate) SetAppID

SetAppID sets the "app_id" field.

func (*AlipayOrderRollbackUpdate) SetBody

SetBody sets the "body" field.

func (*AlipayOrderRollbackUpdate) SetBuyerID

SetBuyerID sets the "buyer_id" field.

func (*AlipayOrderRollbackUpdate) SetBuyerPayAmount

SetBuyerPayAmount sets the "buyer_pay_amount" field.

func (*AlipayOrderRollbackUpdate) SetCharset

SetCharset sets the "charset" field.

func (*AlipayOrderRollbackUpdate) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*AlipayOrderRollbackUpdate) SetFundBillList

SetFundBillList sets the "fund_bill_list" field.

func (*AlipayOrderRollbackUpdate) SetGmtClose

SetGmtClose sets the "gmt_close" field.

func (*AlipayOrderRollbackUpdate) SetGmtCreate

SetGmtCreate sets the "gmt_create" field.

func (*AlipayOrderRollbackUpdate) SetGmtPayment

SetGmtPayment sets the "gmt_payment" field.

func (*AlipayOrderRollbackUpdate) SetInvoiceAmount

SetInvoiceAmount sets the "invoice_amount" field.

func (*AlipayOrderRollbackUpdate) SetNillableAppID

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableBody

SetNillableBody sets the "body" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableBuyerID

func (_u *AlipayOrderRollbackUpdate) SetNillableBuyerID(v *string) *AlipayOrderRollbackUpdate

SetNillableBuyerID sets the "buyer_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableBuyerPayAmount

func (_u *AlipayOrderRollbackUpdate) SetNillableBuyerPayAmount(v *string) *AlipayOrderRollbackUpdate

SetNillableBuyerPayAmount sets the "buyer_pay_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableCharset

func (_u *AlipayOrderRollbackUpdate) SetNillableCharset(v *string) *AlipayOrderRollbackUpdate

SetNillableCharset sets the "charset" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableCreateTime

func (_u *AlipayOrderRollbackUpdate) SetNillableCreateTime(v *time.Time) *AlipayOrderRollbackUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableFundBillList

func (_u *AlipayOrderRollbackUpdate) SetNillableFundBillList(v *string) *AlipayOrderRollbackUpdate

SetNillableFundBillList sets the "fund_bill_list" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableGmtClose

func (_u *AlipayOrderRollbackUpdate) SetNillableGmtClose(v *string) *AlipayOrderRollbackUpdate

SetNillableGmtClose sets the "gmt_close" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableGmtCreate

func (_u *AlipayOrderRollbackUpdate) SetNillableGmtCreate(v *string) *AlipayOrderRollbackUpdate

SetNillableGmtCreate sets the "gmt_create" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableGmtPayment

func (_u *AlipayOrderRollbackUpdate) SetNillableGmtPayment(v *string) *AlipayOrderRollbackUpdate

SetNillableGmtPayment sets the "gmt_payment" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableInvoiceAmount

func (_u *AlipayOrderRollbackUpdate) SetNillableInvoiceAmount(v *string) *AlipayOrderRollbackUpdate

SetNillableInvoiceAmount sets the "invoice_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableNotifyID

func (_u *AlipayOrderRollbackUpdate) SetNillableNotifyID(v *string) *AlipayOrderRollbackUpdate

SetNillableNotifyID sets the "notify_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableNotifyTime

func (_u *AlipayOrderRollbackUpdate) SetNillableNotifyTime(v *string) *AlipayOrderRollbackUpdate

SetNillableNotifyTime sets the "notify_time" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableNotifyType

func (_u *AlipayOrderRollbackUpdate) SetNillableNotifyType(v *string) *AlipayOrderRollbackUpdate

SetNillableNotifyType sets the "notify_type" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableOutBizNo

func (_u *AlipayOrderRollbackUpdate) SetNillableOutBizNo(v *string) *AlipayOrderRollbackUpdate

SetNillableOutBizNo sets the "out_biz_no" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableOutTradeNo

func (_u *AlipayOrderRollbackUpdate) SetNillableOutTradeNo(v *string) *AlipayOrderRollbackUpdate

SetNillableOutTradeNo sets the "out_trade_no" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillablePassbackParams

func (_u *AlipayOrderRollbackUpdate) SetNillablePassbackParams(v *string) *AlipayOrderRollbackUpdate

SetNillablePassbackParams sets the "passback_params" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillablePointAmount

func (_u *AlipayOrderRollbackUpdate) SetNillablePointAmount(v *string) *AlipayOrderRollbackUpdate

SetNillablePointAmount sets the "point_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableReceiptAmount

func (_u *AlipayOrderRollbackUpdate) SetNillableReceiptAmount(v *string) *AlipayOrderRollbackUpdate

SetNillableReceiptAmount sets the "receipt_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableRefundFee

func (_u *AlipayOrderRollbackUpdate) SetNillableRefundFee(v *string) *AlipayOrderRollbackUpdate

SetNillableRefundFee sets the "refund_fee" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableSellerID

func (_u *AlipayOrderRollbackUpdate) SetNillableSellerID(v *string) *AlipayOrderRollbackUpdate

SetNillableSellerID sets the "seller_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableSign

SetNillableSign sets the "sign" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableSignType

func (_u *AlipayOrderRollbackUpdate) SetNillableSignType(v *string) *AlipayOrderRollbackUpdate

SetNillableSignType sets the "sign_type" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableSubject

func (_u *AlipayOrderRollbackUpdate) SetNillableSubject(v *string) *AlipayOrderRollbackUpdate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableTotalAmount

func (_u *AlipayOrderRollbackUpdate) SetNillableTotalAmount(v *string) *AlipayOrderRollbackUpdate

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableTradeNo

func (_u *AlipayOrderRollbackUpdate) SetNillableTradeNo(v *string) *AlipayOrderRollbackUpdate

SetNillableTradeNo sets the "trade_no" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableTradeStatus

func (_u *AlipayOrderRollbackUpdate) SetNillableTradeStatus(v *string) *AlipayOrderRollbackUpdate

SetNillableTradeStatus sets the "trade_status" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableUpdateTime

func (_u *AlipayOrderRollbackUpdate) SetNillableUpdateTime(v *time.Time) *AlipayOrderRollbackUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableVersion

func (_u *AlipayOrderRollbackUpdate) SetNillableVersion(v *string) *AlipayOrderRollbackUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNillableVoucherDetailList

func (_u *AlipayOrderRollbackUpdate) SetNillableVoucherDetailList(v *string) *AlipayOrderRollbackUpdate

SetNillableVoucherDetailList sets the "voucher_detail_list" field if the given value is not nil.

func (*AlipayOrderRollbackUpdate) SetNotifyID

SetNotifyID sets the "notify_id" field.

func (*AlipayOrderRollbackUpdate) SetNotifyTime

SetNotifyTime sets the "notify_time" field.

func (*AlipayOrderRollbackUpdate) SetNotifyType

SetNotifyType sets the "notify_type" field.

func (*AlipayOrderRollbackUpdate) SetOutBizNo

SetOutBizNo sets the "out_biz_no" field.

func (*AlipayOrderRollbackUpdate) SetOutTradeNo

SetOutTradeNo sets the "out_trade_no" field.

func (*AlipayOrderRollbackUpdate) SetPassbackParams

SetPassbackParams sets the "passback_params" field.

func (*AlipayOrderRollbackUpdate) SetPointAmount

SetPointAmount sets the "point_amount" field.

func (*AlipayOrderRollbackUpdate) SetReceiptAmount

SetReceiptAmount sets the "receipt_amount" field.

func (*AlipayOrderRollbackUpdate) SetRefundFee

SetRefundFee sets the "refund_fee" field.

func (*AlipayOrderRollbackUpdate) SetSellerID

SetSellerID sets the "seller_id" field.

func (*AlipayOrderRollbackUpdate) SetSign

SetSign sets the "sign" field.

func (*AlipayOrderRollbackUpdate) SetSignType

SetSignType sets the "sign_type" field.

func (*AlipayOrderRollbackUpdate) SetSubject

SetSubject sets the "subject" field.

func (*AlipayOrderRollbackUpdate) SetTotalAmount

SetTotalAmount sets the "total_amount" field.

func (*AlipayOrderRollbackUpdate) SetTradeNo

SetTradeNo sets the "trade_no" field.

func (*AlipayOrderRollbackUpdate) SetTradeStatus

SetTradeStatus sets the "trade_status" field.

func (*AlipayOrderRollbackUpdate) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*AlipayOrderRollbackUpdate) SetVersion

SetVersion sets the "version" field.

func (*AlipayOrderRollbackUpdate) SetVoucherDetailList

func (_u *AlipayOrderRollbackUpdate) SetVoucherDetailList(v string) *AlipayOrderRollbackUpdate

SetVoucherDetailList sets the "voucher_detail_list" field.

func (*AlipayOrderRollbackUpdate) Where

Where appends a list predicates to the AlipayOrderRollbackUpdate builder.

type AlipayOrderRollbackUpdateOne

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

AlipayOrderRollbackUpdateOne is the builder for updating a single AlipayOrderRollback entity.

func (*AlipayOrderRollbackUpdateOne) Exec

Exec executes the query on the entity.

func (*AlipayOrderRollbackUpdateOne) ExecX

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

func (*AlipayOrderRollbackUpdateOne) Mutation

Mutation returns the AlipayOrderRollbackMutation object of the builder.

func (*AlipayOrderRollbackUpdateOne) Save

Save executes the query and returns the updated AlipayOrderRollback entity.

func (*AlipayOrderRollbackUpdateOne) SaveX

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

func (*AlipayOrderRollbackUpdateOne) Select

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

func (*AlipayOrderRollbackUpdateOne) SetAppID

SetAppID sets the "app_id" field.

func (*AlipayOrderRollbackUpdateOne) SetBody

SetBody sets the "body" field.

func (*AlipayOrderRollbackUpdateOne) SetBuyerID

SetBuyerID sets the "buyer_id" field.

func (*AlipayOrderRollbackUpdateOne) SetBuyerPayAmount

SetBuyerPayAmount sets the "buyer_pay_amount" field.

func (*AlipayOrderRollbackUpdateOne) SetCharset

SetCharset sets the "charset" field.

func (*AlipayOrderRollbackUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*AlipayOrderRollbackUpdateOne) SetFundBillList

SetFundBillList sets the "fund_bill_list" field.

func (*AlipayOrderRollbackUpdateOne) SetGmtClose

SetGmtClose sets the "gmt_close" field.

func (*AlipayOrderRollbackUpdateOne) SetGmtCreate

SetGmtCreate sets the "gmt_create" field.

func (*AlipayOrderRollbackUpdateOne) SetGmtPayment

SetGmtPayment sets the "gmt_payment" field.

func (*AlipayOrderRollbackUpdateOne) SetInvoiceAmount

SetInvoiceAmount sets the "invoice_amount" field.

func (*AlipayOrderRollbackUpdateOne) SetNillableAppID

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableBody

SetNillableBody sets the "body" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableBuyerID

SetNillableBuyerID sets the "buyer_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableBuyerPayAmount

func (_u *AlipayOrderRollbackUpdateOne) SetNillableBuyerPayAmount(v *string) *AlipayOrderRollbackUpdateOne

SetNillableBuyerPayAmount sets the "buyer_pay_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableCharset

SetNillableCharset sets the "charset" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableCreateTime

func (_u *AlipayOrderRollbackUpdateOne) SetNillableCreateTime(v *time.Time) *AlipayOrderRollbackUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableFundBillList

func (_u *AlipayOrderRollbackUpdateOne) SetNillableFundBillList(v *string) *AlipayOrderRollbackUpdateOne

SetNillableFundBillList sets the "fund_bill_list" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableGmtClose

SetNillableGmtClose sets the "gmt_close" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableGmtCreate

SetNillableGmtCreate sets the "gmt_create" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableGmtPayment

func (_u *AlipayOrderRollbackUpdateOne) SetNillableGmtPayment(v *string) *AlipayOrderRollbackUpdateOne

SetNillableGmtPayment sets the "gmt_payment" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableInvoiceAmount

func (_u *AlipayOrderRollbackUpdateOne) SetNillableInvoiceAmount(v *string) *AlipayOrderRollbackUpdateOne

SetNillableInvoiceAmount sets the "invoice_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableNotifyID

SetNillableNotifyID sets the "notify_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableNotifyTime

func (_u *AlipayOrderRollbackUpdateOne) SetNillableNotifyTime(v *string) *AlipayOrderRollbackUpdateOne

SetNillableNotifyTime sets the "notify_time" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableNotifyType

func (_u *AlipayOrderRollbackUpdateOne) SetNillableNotifyType(v *string) *AlipayOrderRollbackUpdateOne

SetNillableNotifyType sets the "notify_type" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableOutBizNo

SetNillableOutBizNo sets the "out_biz_no" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableOutTradeNo

func (_u *AlipayOrderRollbackUpdateOne) SetNillableOutTradeNo(v *string) *AlipayOrderRollbackUpdateOne

SetNillableOutTradeNo sets the "out_trade_no" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillablePassbackParams

func (_u *AlipayOrderRollbackUpdateOne) SetNillablePassbackParams(v *string) *AlipayOrderRollbackUpdateOne

SetNillablePassbackParams sets the "passback_params" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillablePointAmount

func (_u *AlipayOrderRollbackUpdateOne) SetNillablePointAmount(v *string) *AlipayOrderRollbackUpdateOne

SetNillablePointAmount sets the "point_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableReceiptAmount

func (_u *AlipayOrderRollbackUpdateOne) SetNillableReceiptAmount(v *string) *AlipayOrderRollbackUpdateOne

SetNillableReceiptAmount sets the "receipt_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableRefundFee

SetNillableRefundFee sets the "refund_fee" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableSellerID

SetNillableSellerID sets the "seller_id" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableSign

SetNillableSign sets the "sign" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableSignType

SetNillableSignType sets the "sign_type" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableSubject

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableTotalAmount

func (_u *AlipayOrderRollbackUpdateOne) SetNillableTotalAmount(v *string) *AlipayOrderRollbackUpdateOne

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableTradeNo

SetNillableTradeNo sets the "trade_no" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableTradeStatus

func (_u *AlipayOrderRollbackUpdateOne) SetNillableTradeStatus(v *string) *AlipayOrderRollbackUpdateOne

SetNillableTradeStatus sets the "trade_status" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableUpdateTime

func (_u *AlipayOrderRollbackUpdateOne) SetNillableUpdateTime(v *time.Time) *AlipayOrderRollbackUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableVersion

SetNillableVersion sets the "version" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNillableVoucherDetailList

func (_u *AlipayOrderRollbackUpdateOne) SetNillableVoucherDetailList(v *string) *AlipayOrderRollbackUpdateOne

SetNillableVoucherDetailList sets the "voucher_detail_list" field if the given value is not nil.

func (*AlipayOrderRollbackUpdateOne) SetNotifyID

SetNotifyID sets the "notify_id" field.

func (*AlipayOrderRollbackUpdateOne) SetNotifyTime

SetNotifyTime sets the "notify_time" field.

func (*AlipayOrderRollbackUpdateOne) SetNotifyType

SetNotifyType sets the "notify_type" field.

func (*AlipayOrderRollbackUpdateOne) SetOutBizNo

SetOutBizNo sets the "out_biz_no" field.

func (*AlipayOrderRollbackUpdateOne) SetOutTradeNo

SetOutTradeNo sets the "out_trade_no" field.

func (*AlipayOrderRollbackUpdateOne) SetPassbackParams

SetPassbackParams sets the "passback_params" field.

func (*AlipayOrderRollbackUpdateOne) SetPointAmount

SetPointAmount sets the "point_amount" field.

func (*AlipayOrderRollbackUpdateOne) SetReceiptAmount

SetReceiptAmount sets the "receipt_amount" field.

func (*AlipayOrderRollbackUpdateOne) SetRefundFee

SetRefundFee sets the "refund_fee" field.

func (*AlipayOrderRollbackUpdateOne) SetSellerID

SetSellerID sets the "seller_id" field.

func (*AlipayOrderRollbackUpdateOne) SetSign

SetSign sets the "sign" field.

func (*AlipayOrderRollbackUpdateOne) SetSignType

SetSignType sets the "sign_type" field.

func (*AlipayOrderRollbackUpdateOne) SetSubject

SetSubject sets the "subject" field.

func (*AlipayOrderRollbackUpdateOne) SetTotalAmount

SetTotalAmount sets the "total_amount" field.

func (*AlipayOrderRollbackUpdateOne) SetTradeNo

SetTradeNo sets the "trade_no" field.

func (*AlipayOrderRollbackUpdateOne) SetTradeStatus

SetTradeStatus sets the "trade_status" field.

func (*AlipayOrderRollbackUpdateOne) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*AlipayOrderRollbackUpdateOne) SetVersion

SetVersion sets the "version" field.

func (*AlipayOrderRollbackUpdateOne) SetVoucherDetailList

SetVoucherDetailList sets the "voucher_detail_list" field.

func (*AlipayOrderRollbackUpdateOne) Where

Where appends a list predicates to the AlipayOrderRollbackUpdate builder.

type AlipayOrderRollbacks

type AlipayOrderRollbacks []*AlipayOrderRollback

AlipayOrderRollbacks is a parsable slice of AlipayOrderRollback.

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
	// AlipayOrderRollback is the client for interacting with the AlipayOrderRollback builders.
	AlipayOrderRollback *AlipayOrderRollbackClient
	// 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
	// ComputeSpecPrice is the client for interacting with the ComputeSpecPrice builders.
	ComputeSpecPrice *ComputeSpecPriceClient
	// Cycle is the client for interacting with the Cycle builders.
	Cycle *CycleClient
	// CycleOrder is the client for interacting with the CycleOrder builders.
	CycleOrder *CycleOrderClient
	// CycleRecharge is the client for interacting with the CycleRecharge builders.
	CycleRecharge *CycleRechargeClient
	// CycleRedeemCode is the client for interacting with the CycleRedeemCode builders.
	CycleRedeemCode *CycleRedeemCodeClient
	// CycleRenewal is the client for interacting with the CycleRenewal builders.
	CycleRenewal *CycleRenewalClient
	// CycleTransaction is the client for interacting with the CycleTransaction builders.
	CycleTransaction *CycleTransactionClient
	// DomainBinding is the client for interacting with the DomainBinding builders.
	DomainBinding *DomainBindingClient
	// Employee is the client for interacting with the Employee builders.
	Employee *EmployeeClient
	// Gateway is the client for interacting with the Gateway builders.
	Gateway *GatewayClient
	// GatewayPort is the client for interacting with the GatewayPort builders.
	GatewayPort *GatewayPortClient
	// NetworkMapping is the client for interacting with the NetworkMapping builders.
	NetworkMapping *NetworkMappingClient
	// S3Bucket is the client for interacting with the S3Bucket builders.
	S3Bucket *S3BucketClient
	// S3User is the client for interacting with the S3User builders.
	S3User *S3UserClient
	// 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
	// StorageProvider is the client for interacting with the StorageProvider builders.
	StorageProvider *StorageProviderClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserResourceLimit is the client for interacting with the UserResourceLimit builders.
	UserResourceLimit *UserResourceLimitClient
	// 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"`
	// 操作系统类型
	OsType string `json:"os_type,omitempty"`
	// 操作系统版本
	OsVariant string `json:"os_variant,omitempty"`
	// 镜像文件名
	Filename string `json:"filename,omitempty"`
	// 镜像下载地址
	DownloadURL string `json:"download_url,omitempty"`
	// 镜像md5
	Md5 string `json:"md5,omitempty"`
	// 排序
	Sort uint `json:"sort,omitempty"`
	// 计算机架构
	Arch string `json:"arch,omitempty"`
	// 初始化方式,iso/qcow2
	BootType string `json:"boot_type,omitempty"`
	// contains filtered or unexported fields
}

ComputeImage is the model entity for the ComputeImage schema.

func (*ComputeImage) String

func (_m *ComputeImage) String() string

String implements the fmt.Stringer.

func (*ComputeImage) Unwrap

func (_m *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 (_m *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 (_m *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) MapCreateBulk

func (c *ComputeImageClient) MapCreateBulk(slice any, setFunc func(*ComputeImageCreate, int)) *ComputeImageCreateBulk

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

func (*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 (_c *ComputeImageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeImageCreate) ExecX

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

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

func (*ComputeImageCreate) Mutation

func (_c *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) SetArch

SetArch sets the "arch" field.

func (*ComputeImageCreate) SetBootType added in v0.0.12

func (_c *ComputeImageCreate) SetBootType(v string) *ComputeImageCreate

SetBootType sets the "boot_type" field.

func (*ComputeImageCreate) SetDownloadURL

func (_c *ComputeImageCreate) SetDownloadURL(v string) *ComputeImageCreate

SetDownloadURL sets the "download_url" field.

func (*ComputeImageCreate) SetFilename

func (_c *ComputeImageCreate) SetFilename(v string) *ComputeImageCreate

SetFilename sets the "filename" field.

func (*ComputeImageCreate) SetID

SetID sets the "id" field.

func (*ComputeImageCreate) SetImage

func (_c *ComputeImageCreate) SetImage(v string) *ComputeImageCreate

SetImage sets the "image" field.

func (*ComputeImageCreate) SetMd5

SetMd5 sets the "md5" field.

func (*ComputeImageCreate) SetName

SetName sets the "name" field.

func (*ComputeImageCreate) SetNillableBootType added in v0.0.12

func (_c *ComputeImageCreate) SetNillableBootType(v *string) *ComputeImageCreate

SetNillableBootType sets the "boot_type" field if the given value is not nil.

func (*ComputeImageCreate) SetOsType

func (_c *ComputeImageCreate) SetOsType(v string) *ComputeImageCreate

SetOsType sets the "os_type" field.

func (*ComputeImageCreate) SetOsVariant

func (_c *ComputeImageCreate) SetOsVariant(v string) *ComputeImageCreate

SetOsVariant sets the "os_variant" field.

func (*ComputeImageCreate) SetSort

func (_c *ComputeImageCreate) SetSort(v uint) *ComputeImageCreate

SetSort sets the "sort" 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

Exec executes the query.

func (*ComputeImageCreateBulk) ExecX

func (_c *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

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 (_d *ComputeImageDelete) Exec(ctx context.Context) (int, error)

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

func (*ComputeImageDelete) ExecX

func (_d *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

Exec executes the deletion query.

func (*ComputeImageDeleteOne) ExecX

func (_d *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 (_g *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 (_g *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) AddSort

func (m *ComputeImageMutation) AddSort(u int)

AddSort adds u to the "sort" 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) AddedSort

func (m *ComputeImageMutation) AddedSort() (r int, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*ComputeImageMutation) Arch

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

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

func (*ComputeImageMutation) BootType added in v0.0.12

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

BootType returns the value of the "boot_type" field in the 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) DownloadURL

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

DownloadURL returns the value of the "download_url" 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) Filename

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

Filename returns the value of the "filename" field in the mutation.

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

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

Md5 returns the value of the "md5" 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) OldArch

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

OldArch returns the old "arch" 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) OldBootType added in v0.0.12

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

OldBootType returns the old "boot_type" 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) OldDownloadURL

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

OldDownloadURL returns the old "download_url" 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) OldFilename

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

OldFilename returns the old "filename" 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) 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) OldMd5

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

OldMd5 returns the old "md5" 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) OldOsType

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

OldOsType returns the old "os_type" 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) OldOsVariant

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

OldOsVariant returns the old "os_variant" 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) OldSort

func (m *ComputeImageMutation) OldSort(ctx context.Context) (v uint, err error)

OldSort returns the old "sort" 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) OsType

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

OsType returns the value of the "os_type" field in the mutation.

func (*ComputeImageMutation) OsVariant

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

OsVariant returns the value of the "os_variant" 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) ResetArch

func (m *ComputeImageMutation) ResetArch()

ResetArch resets all changes to the "arch" field.

func (*ComputeImageMutation) ResetBootType added in v0.0.12

func (m *ComputeImageMutation) ResetBootType()

ResetBootType resets all changes to the "boot_type" field.

func (*ComputeImageMutation) ResetDownloadURL

func (m *ComputeImageMutation) ResetDownloadURL()

ResetDownloadURL resets all changes to the "download_url" 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) ResetFilename

func (m *ComputeImageMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*ComputeImageMutation) ResetImage

func (m *ComputeImageMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*ComputeImageMutation) ResetMd5

func (m *ComputeImageMutation) ResetMd5()

ResetMd5 resets all changes to the "md5" field.

func (*ComputeImageMutation) ResetName

func (m *ComputeImageMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ComputeImageMutation) ResetOsType

func (m *ComputeImageMutation) ResetOsType()

ResetOsType resets all changes to the "os_type" field.

func (*ComputeImageMutation) ResetOsVariant

func (m *ComputeImageMutation) ResetOsVariant()

ResetOsVariant resets all changes to the "os_variant" field.

func (*ComputeImageMutation) ResetSort

func (m *ComputeImageMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*ComputeImageMutation) ResetTag

func (m *ComputeImageMutation) ResetTag()

ResetTag resets all changes to the "tag" field.

func (*ComputeImageMutation) SetArch

func (m *ComputeImageMutation) SetArch(s string)

SetArch sets the "arch" field.

func (*ComputeImageMutation) SetBootType added in v0.0.12

func (m *ComputeImageMutation) SetBootType(s string)

SetBootType sets the "boot_type" field.

func (*ComputeImageMutation) SetDownloadURL

func (m *ComputeImageMutation) SetDownloadURL(s string)

SetDownloadURL sets the "download_url" 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) SetFilename

func (m *ComputeImageMutation) SetFilename(s string)

SetFilename sets the "filename" field.

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

func (m *ComputeImageMutation) SetMd5(s string)

SetMd5 sets the "md5" 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) SetOsType

func (m *ComputeImageMutation) SetOsType(s string)

SetOsType sets the "os_type" field.

func (*ComputeImageMutation) SetOsVariant

func (m *ComputeImageMutation) SetOsVariant(s string)

SetOsVariant sets the "os_variant" field.

func (*ComputeImageMutation) SetSort

func (m *ComputeImageMutation) SetSort(u uint)

SetSort sets the "sort" field.

func (*ComputeImageMutation) SetTag

func (m *ComputeImageMutation) SetTag(s string)

SetTag sets the "tag" field.

func (*ComputeImageMutation) Sort

func (m *ComputeImageMutation) Sort() (r uint, exists bool)

Sort returns the value of the "sort" field in the mutation.

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 (_q *ComputeImageQuery) Aggregate(fns ...AggregateFunc) *ComputeImageSelect

Aggregate returns a ComputeImageSelect configured with the given aggregations.

func (*ComputeImageQuery) All

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

All executes the query and returns a list of ComputeImages.

func (*ComputeImageQuery) AllX

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

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

func (*ComputeImageQuery) Clone

func (_q *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 (_q *ComputeImageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComputeImageQuery) CountX

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

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

func (*ComputeImageQuery) Exist

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

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

func (*ComputeImageQuery) ExistX

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

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

func (*ComputeImageQuery) First

func (_q *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 (_q *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 (_q *ComputeImageQuery) FirstIDX(ctx context.Context) int32

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

func (*ComputeImageQuery) FirstX

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

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

func (*ComputeImageQuery) GroupBy

func (_q *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 (_q *ComputeImageQuery) IDs(ctx context.Context) (ids []int32, err error)

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

func (*ComputeImageQuery) IDsX

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

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

func (*ComputeImageQuery) Limit

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

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

func (*ComputeImageQuery) Offset

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

Offset to start from.

func (*ComputeImageQuery) Only

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 (_q *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 (_q *ComputeImageQuery) OnlyIDX(ctx context.Context) int32

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

func (*ComputeImageQuery) OnlyX

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 (_q *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 (_q *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 (_s *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 (_s *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) AddSort

func (_u *ComputeImageUpdate) AddSort(v int) *ComputeImageUpdate

AddSort adds value to the "sort" field.

func (*ComputeImageUpdate) Exec

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

Exec executes the query.

func (*ComputeImageUpdate) ExecX

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

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

func (*ComputeImageUpdate) Mutation

func (_u *ComputeImageUpdate) Mutation() *ComputeImageMutation

Mutation returns the ComputeImageMutation object of the builder.

func (*ComputeImageUpdate) Save

func (_u *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 (_u *ComputeImageUpdate) SaveX(ctx context.Context) int

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

func (*ComputeImageUpdate) SetArch

SetArch sets the "arch" field.

func (*ComputeImageUpdate) SetBootType added in v0.0.12

func (_u *ComputeImageUpdate) SetBootType(v string) *ComputeImageUpdate

SetBootType sets the "boot_type" field.

func (*ComputeImageUpdate) SetDownloadURL

func (_u *ComputeImageUpdate) SetDownloadURL(v string) *ComputeImageUpdate

SetDownloadURL sets the "download_url" field.

func (*ComputeImageUpdate) SetFilename

func (_u *ComputeImageUpdate) SetFilename(v string) *ComputeImageUpdate

SetFilename sets the "filename" field.

func (*ComputeImageUpdate) SetImage

func (_u *ComputeImageUpdate) SetImage(v string) *ComputeImageUpdate

SetImage sets the "image" field.

func (*ComputeImageUpdate) SetMd5

SetMd5 sets the "md5" field.

func (*ComputeImageUpdate) SetName

SetName sets the "name" field.

func (*ComputeImageUpdate) SetNillableArch

func (_u *ComputeImageUpdate) SetNillableArch(v *string) *ComputeImageUpdate

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

func (*ComputeImageUpdate) SetNillableBootType added in v0.0.12

func (_u *ComputeImageUpdate) SetNillableBootType(v *string) *ComputeImageUpdate

SetNillableBootType sets the "boot_type" field if the given value is not nil.

func (*ComputeImageUpdate) SetNillableDownloadURL

func (_u *ComputeImageUpdate) SetNillableDownloadURL(v *string) *ComputeImageUpdate

SetNillableDownloadURL sets the "download_url" field if the given value is not nil.

func (*ComputeImageUpdate) SetNillableFilename

func (_u *ComputeImageUpdate) SetNillableFilename(v *string) *ComputeImageUpdate

SetNillableFilename sets the "filename" field if the given value is not nil.

func (*ComputeImageUpdate) SetNillableImage

func (_u *ComputeImageUpdate) SetNillableImage(v *string) *ComputeImageUpdate

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

func (*ComputeImageUpdate) SetNillableMd5

func (_u *ComputeImageUpdate) SetNillableMd5(v *string) *ComputeImageUpdate

SetNillableMd5 sets the "md5" field if the given value is not nil.

func (*ComputeImageUpdate) SetNillableName

func (_u *ComputeImageUpdate) SetNillableName(v *string) *ComputeImageUpdate

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

func (*ComputeImageUpdate) SetNillableOsType

func (_u *ComputeImageUpdate) SetNillableOsType(v *string) *ComputeImageUpdate

SetNillableOsType sets the "os_type" field if the given value is not nil.

func (*ComputeImageUpdate) SetNillableOsVariant

func (_u *ComputeImageUpdate) SetNillableOsVariant(v *string) *ComputeImageUpdate

SetNillableOsVariant sets the "os_variant" field if the given value is not nil.

func (*ComputeImageUpdate) SetNillableSort

func (_u *ComputeImageUpdate) SetNillableSort(v *uint) *ComputeImageUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*ComputeImageUpdate) SetNillableTag

func (_u *ComputeImageUpdate) SetNillableTag(v *string) *ComputeImageUpdate

SetNillableTag sets the "tag" field if the given value is not nil.

func (*ComputeImageUpdate) SetOsType

func (_u *ComputeImageUpdate) SetOsType(v string) *ComputeImageUpdate

SetOsType sets the "os_type" field.

func (*ComputeImageUpdate) SetOsVariant

func (_u *ComputeImageUpdate) SetOsVariant(v string) *ComputeImageUpdate

SetOsVariant sets the "os_variant" field.

func (*ComputeImageUpdate) SetSort

func (_u *ComputeImageUpdate) SetSort(v uint) *ComputeImageUpdate

SetSort sets the "sort" 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) AddSort

AddSort adds value to the "sort" field.

func (*ComputeImageUpdateOne) Exec

Exec executes the query on the entity.

func (*ComputeImageUpdateOne) ExecX

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

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

func (*ComputeImageUpdateOne) Mutation

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 (_u *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) SetArch

SetArch sets the "arch" field.

func (*ComputeImageUpdateOne) SetBootType added in v0.0.12

SetBootType sets the "boot_type" field.

func (*ComputeImageUpdateOne) SetDownloadURL

func (_u *ComputeImageUpdateOne) SetDownloadURL(v string) *ComputeImageUpdateOne

SetDownloadURL sets the "download_url" field.

func (*ComputeImageUpdateOne) SetFilename

SetFilename sets the "filename" field.

func (*ComputeImageUpdateOne) SetImage

SetImage sets the "image" field.

func (*ComputeImageUpdateOne) SetMd5

SetMd5 sets the "md5" field.

func (*ComputeImageUpdateOne) SetName

SetName sets the "name" field.

func (*ComputeImageUpdateOne) SetNillableArch

func (_u *ComputeImageUpdateOne) SetNillableArch(v *string) *ComputeImageUpdateOne

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

func (*ComputeImageUpdateOne) SetNillableBootType added in v0.0.12

func (_u *ComputeImageUpdateOne) SetNillableBootType(v *string) *ComputeImageUpdateOne

SetNillableBootType sets the "boot_type" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetNillableDownloadURL

func (_u *ComputeImageUpdateOne) SetNillableDownloadURL(v *string) *ComputeImageUpdateOne

SetNillableDownloadURL sets the "download_url" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetNillableFilename

func (_u *ComputeImageUpdateOne) SetNillableFilename(v *string) *ComputeImageUpdateOne

SetNillableFilename sets the "filename" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetNillableImage

func (_u *ComputeImageUpdateOne) SetNillableImage(v *string) *ComputeImageUpdateOne

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

func (*ComputeImageUpdateOne) SetNillableMd5

func (_u *ComputeImageUpdateOne) SetNillableMd5(v *string) *ComputeImageUpdateOne

SetNillableMd5 sets the "md5" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetNillableName

func (_u *ComputeImageUpdateOne) SetNillableName(v *string) *ComputeImageUpdateOne

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

func (*ComputeImageUpdateOne) SetNillableOsType

func (_u *ComputeImageUpdateOne) SetNillableOsType(v *string) *ComputeImageUpdateOne

SetNillableOsType sets the "os_type" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetNillableOsVariant

func (_u *ComputeImageUpdateOne) SetNillableOsVariant(v *string) *ComputeImageUpdateOne

SetNillableOsVariant sets the "os_variant" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetNillableSort

func (_u *ComputeImageUpdateOne) SetNillableSort(v *uint) *ComputeImageUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetNillableTag

func (_u *ComputeImageUpdateOne) SetNillableTag(v *string) *ComputeImageUpdateOne

SetNillableTag sets the "tag" field if the given value is not nil.

func (*ComputeImageUpdateOne) SetOsType

SetOsType sets the "os_type" field.

func (*ComputeImageUpdateOne) SetOsVariant

func (_u *ComputeImageUpdateOne) SetOsVariant(v string) *ComputeImageUpdateOne

SetOsVariant sets the "os_variant" field.

func (*ComputeImageUpdateOne) SetSort

SetSort sets the "sort" 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"`
	// cpu核数
	Core int `json:"core,omitempty"`
	// 内存G
	Memory int `json:"memory,omitempty"`
	// Image holds the value of the "image" field.
	Image string `json:"image,omitempty"`
	// 镜像id
	ImageID int32 `json:"image_id,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 compute.InstanceStatus `json:"status,omitempty"`
	// 容器id
	ContainerID string `json:"container_id,omitempty"`
	// p2p agent Id
	AgentID string `json:"agent_id,omitempty"`
	// vnc 内网链接ip
	VncIP string `json:"vnc_ip,omitempty"`
	// vnc 内网链接端口号
	VncPort int32 `json:"vnc_port,omitempty"`
	// 初始化的docker容器
	DockerCompose string `json:"docker_compose,omitempty"`
	// 创建时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// 计算机架构
	Arch string `json:"arch,omitempty"`
	// 初始化方式,iso/qcow2
	BootType string `json:"boot_type,omitempty"`
	// contains filtered or unexported fields
}

ComputeInstance is the model entity for the ComputeInstance schema.

func (*ComputeInstance) String

func (_m *ComputeInstance) String() string

String implements the fmt.Stringer.

func (*ComputeInstance) Unwrap

func (_m *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 (_m *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) MapCreateBulk

func (c *ComputeInstanceClient) MapCreateBulk(slice any, setFunc func(*ComputeInstanceCreate, int)) *ComputeInstanceCreateBulk

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

func (*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

Exec executes the query.

func (*ComputeInstanceCreate) ExecX

func (_c *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) SetAgentID

SetAgentID sets the "agent_id" field.

func (*ComputeInstanceCreate) SetArch added in v0.0.12

SetArch sets the "arch" field.

func (*ComputeInstanceCreate) SetBootType added in v0.0.12

SetBootType sets the "boot_type" field.

func (*ComputeInstanceCreate) SetContainerID

func (_c *ComputeInstanceCreate) SetContainerID(v string) *ComputeInstanceCreate

SetContainerID sets the "container_id" field.

func (*ComputeInstanceCreate) SetCore

SetCore sets the "core" field.

func (*ComputeInstanceCreate) SetCreateTime

func (_c *ComputeInstanceCreate) SetCreateTime(v time.Time) *ComputeInstanceCreate

SetCreateTime sets the "create_time" field.

func (*ComputeInstanceCreate) SetDockerCompose

func (_c *ComputeInstanceCreate) SetDockerCompose(v string) *ComputeInstanceCreate

SetDockerCompose sets the "docker_compose" field.

func (*ComputeInstanceCreate) SetExpirationTime

func (_c *ComputeInstanceCreate) SetExpirationTime(v 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) SetImageID

SetImageID sets the "image_id" field.

func (*ComputeInstanceCreate) SetMemory

SetMemory sets the "memory" field.

func (*ComputeInstanceCreate) SetName

SetName sets the "name" field.

func (*ComputeInstanceCreate) SetNillableAgentID

func (_c *ComputeInstanceCreate) SetNillableAgentID(v *string) *ComputeInstanceCreate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*ComputeInstanceCreate) SetNillableBootType added in v0.0.12

func (_c *ComputeInstanceCreate) SetNillableBootType(v *string) *ComputeInstanceCreate

SetNillableBootType sets the "boot_type" field if the given value is not nil.

func (*ComputeInstanceCreate) SetNillableContainerID

func (_c *ComputeInstanceCreate) SetNillableContainerID(v *string) *ComputeInstanceCreate

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

func (*ComputeInstanceCreate) SetNillableCreateTime

func (_c *ComputeInstanceCreate) SetNillableCreateTime(v *time.Time) *ComputeInstanceCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ComputeInstanceCreate) SetNillableID

func (_c *ComputeInstanceCreate) SetNillableID(v *uuid.UUID) *ComputeInstanceCreate

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

func (*ComputeInstanceCreate) SetNillablePort

func (_c *ComputeInstanceCreate) SetNillablePort(v *string) *ComputeInstanceCreate

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

func (*ComputeInstanceCreate) SetOwner

SetOwner sets the "owner" field.

func (*ComputeInstanceCreate) SetPort

SetPort sets the "port" field.

func (*ComputeInstanceCreate) SetStatus

SetStatus sets the "status" field.

func (*ComputeInstanceCreate) SetVncIP

SetVncIP sets the "vnc_ip" field.

func (*ComputeInstanceCreate) SetVncPort

SetVncPort sets the "vnc_port" 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 (_c *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 (_d *ComputeInstanceDelete) Exec(ctx context.Context) (int, error)

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

func (*ComputeInstanceDelete) ExecX

func (_d *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 (_d *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 (_g *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) AddCore

func (m *ComputeInstanceMutation) AddCore(i int)

AddCore adds i to the "core" field.

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

func (m *ComputeInstanceMutation) AddImageID(i int32)

AddImageID adds i to the "image_id" field.

func (*ComputeInstanceMutation) AddMemory

func (m *ComputeInstanceMutation) AddMemory(i int)

AddMemory adds i to the "memory" field.

func (*ComputeInstanceMutation) AddStatus

AddStatus adds cs to the "status" field.

func (*ComputeInstanceMutation) AddVncPort

func (m *ComputeInstanceMutation) AddVncPort(i int32)

AddVncPort adds i to the "vnc_port" field.

func (*ComputeInstanceMutation) AddedCore

func (m *ComputeInstanceMutation) AddedCore() (r int, exists bool)

AddedCore returns the value that was added to the "core" field in this mutation.

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

func (m *ComputeInstanceMutation) AddedImageID() (r int32, exists bool)

AddedImageID returns the value that was added to the "image_id" field in this mutation.

func (*ComputeInstanceMutation) AddedMemory

func (m *ComputeInstanceMutation) AddedMemory() (r int, exists bool)

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

func (*ComputeInstanceMutation) AddedStatus

func (m *ComputeInstanceMutation) AddedStatus() (r compute.InstanceStatus, exists bool)

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

func (*ComputeInstanceMutation) AddedVncPort

func (m *ComputeInstanceMutation) AddedVncPort() (r int32, exists bool)

AddedVncPort returns the value that was added to the "vnc_port" field in this mutation.

func (*ComputeInstanceMutation) AgentID

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

AgentID returns the value of the "agent_id" field in the mutation.

func (*ComputeInstanceMutation) AgentIDCleared

func (m *ComputeInstanceMutation) AgentIDCleared() bool

AgentIDCleared returns if the "agent_id" field was cleared in this mutation.

func (*ComputeInstanceMutation) Arch added in v0.0.12

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

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

func (*ComputeInstanceMutation) BootType added in v0.0.12

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

BootType returns the value of the "boot_type" field in the mutation.

func (*ComputeInstanceMutation) ClearAgentID

func (m *ComputeInstanceMutation) ClearAgentID()

ClearAgentID clears the value of the "agent_id" 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) ClearPort

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) 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 int, exists bool)

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

func (*ComputeInstanceMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*ComputeInstanceMutation) DockerCompose

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

DockerCompose returns the value of the "docker_compose" 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) ImageID

func (m *ComputeInstanceMutation) ImageID() (r int32, exists bool)

ImageID returns the value of the "image_id" field in the mutation.

func (*ComputeInstanceMutation) Memory

func (m *ComputeInstanceMutation) Memory() (r int, 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) OldAgentID

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

OldAgentID returns the old "agent_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) OldArch added in v0.0.12

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

OldArch returns the old "arch" 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) OldBootType added in v0.0.12

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

OldBootType returns the old "boot_type" 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 int, 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) OldCreateTime

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

OldCreateTime returns the old "create_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) OldDockerCompose

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

OldDockerCompose returns the old "docker_compose" 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) OldImageID

func (m *ComputeInstanceMutation) OldImageID(ctx context.Context) (v int32, err error)

OldImageID returns the old "image_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) OldMemory

func (m *ComputeInstanceMutation) OldMemory(ctx context.Context) (v int, 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) OldPort

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

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

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

OldVncIP returns the old "vnc_ip" 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) OldVncPort

func (m *ComputeInstanceMutation) OldVncPort(ctx context.Context) (v int32, err error)

OldVncPort returns the old "vnc_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) 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) Port

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

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

func (*ComputeInstanceMutation) PortCleared

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

func (m *ComputeInstanceMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*ComputeInstanceMutation) ResetArch added in v0.0.12

func (m *ComputeInstanceMutation) ResetArch()

ResetArch resets all changes to the "arch" field.

func (*ComputeInstanceMutation) ResetBootType added in v0.0.12

func (m *ComputeInstanceMutation) ResetBootType()

ResetBootType resets all changes to the "boot_type" 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) ResetCreateTime

func (m *ComputeInstanceMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ComputeInstanceMutation) ResetDockerCompose

func (m *ComputeInstanceMutation) ResetDockerCompose()

ResetDockerCompose resets all changes to the "docker_compose" 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) ResetImageID

func (m *ComputeInstanceMutation) ResetImageID()

ResetImageID resets all changes to the "image_id" 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) ResetPort

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

func (m *ComputeInstanceMutation) ResetVncIP()

ResetVncIP resets all changes to the "vnc_ip" field.

func (*ComputeInstanceMutation) ResetVncPort

func (m *ComputeInstanceMutation) ResetVncPort()

ResetVncPort resets all changes to the "vnc_port" field.

func (*ComputeInstanceMutation) SetAgentID

func (m *ComputeInstanceMutation) SetAgentID(s string)

SetAgentID sets the "agent_id" field.

func (*ComputeInstanceMutation) SetArch added in v0.0.12

func (m *ComputeInstanceMutation) SetArch(s string)

SetArch sets the "arch" field.

func (*ComputeInstanceMutation) SetBootType added in v0.0.12

func (m *ComputeInstanceMutation) SetBootType(s string)

SetBootType sets the "boot_type" field.

func (*ComputeInstanceMutation) SetContainerID

func (m *ComputeInstanceMutation) SetContainerID(s string)

SetContainerID sets the "container_id" field.

func (*ComputeInstanceMutation) SetCore

func (m *ComputeInstanceMutation) SetCore(i int)

SetCore sets the "core" field.

func (*ComputeInstanceMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*ComputeInstanceMutation) SetDockerCompose

func (m *ComputeInstanceMutation) SetDockerCompose(s string)

SetDockerCompose sets the "docker_compose" 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) SetImageID

func (m *ComputeInstanceMutation) SetImageID(i int32)

SetImageID sets the "image_id" field.

func (*ComputeInstanceMutation) SetMemory

func (m *ComputeInstanceMutation) SetMemory(i int)

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

func (m *ComputeInstanceMutation) SetPort(s string)

SetPort sets the "port" field.

func (*ComputeInstanceMutation) SetStatus

SetStatus sets the "status" field.

func (*ComputeInstanceMutation) SetVncIP

func (m *ComputeInstanceMutation) SetVncIP(s string)

SetVncIP sets the "vnc_ip" field.

func (*ComputeInstanceMutation) SetVncPort

func (m *ComputeInstanceMutation) SetVncPort(i int32)

SetVncPort sets the "vnc_port" field.

func (*ComputeInstanceMutation) Status

func (m *ComputeInstanceMutation) Status() (r compute.InstanceStatus, 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) VncIP

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

VncIP returns the value of the "vnc_ip" field in the mutation.

func (*ComputeInstanceMutation) VncPort

func (m *ComputeInstanceMutation) VncPort() (r int32, exists bool)

VncPort returns the value of the "vnc_port" field in the mutation.

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 (_q *ComputeInstanceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComputeInstanceQuery) CountX

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

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

func (*ComputeInstanceQuery) Exist

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

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

func (*ComputeInstanceQuery) ExistX

func (_q *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 (_q *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 (_q *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 (_q *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 (_q *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 (_q *ComputeInstanceQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ComputeInstanceQuery) Limit

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

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

func (*ComputeInstanceQuery) Offset

func (_q *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 (_q *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 (_q *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 (_q *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 (_q *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 (_s *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) AddCore

AddCore adds value to the "core" field.

func (*ComputeInstanceUpdate) AddImageID

AddImageID adds value to the "image_id" field.

func (*ComputeInstanceUpdate) AddMemory

AddMemory adds value to the "memory" field.

func (*ComputeInstanceUpdate) AddStatus

AddStatus adds value to the "status" field.

func (*ComputeInstanceUpdate) AddVncPort

AddVncPort adds value to the "vnc_port" field.

func (*ComputeInstanceUpdate) ClearAgentID

func (_u *ComputeInstanceUpdate) ClearAgentID() *ComputeInstanceUpdate

ClearAgentID clears the value of the "agent_id" field.

func (*ComputeInstanceUpdate) ClearContainerID

func (_u *ComputeInstanceUpdate) ClearContainerID() *ComputeInstanceUpdate

ClearContainerID clears the value of the "container_id" field.

func (*ComputeInstanceUpdate) ClearPort

ClearPort clears the value of the "port" field.

func (*ComputeInstanceUpdate) Exec

Exec executes the query.

func (*ComputeInstanceUpdate) ExecX

func (_u *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 (_u *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 (_u *ComputeInstanceUpdate) SaveX(ctx context.Context) int

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

func (*ComputeInstanceUpdate) SetAgentID

SetAgentID sets the "agent_id" field.

func (*ComputeInstanceUpdate) SetArch added in v0.0.12

SetArch sets the "arch" field.

func (*ComputeInstanceUpdate) SetBootType added in v0.0.12

SetBootType sets the "boot_type" field.

func (*ComputeInstanceUpdate) SetContainerID

func (_u *ComputeInstanceUpdate) SetContainerID(v string) *ComputeInstanceUpdate

SetContainerID sets the "container_id" field.

func (*ComputeInstanceUpdate) SetCore

SetCore sets the "core" field.

func (*ComputeInstanceUpdate) SetCreateTime

func (_u *ComputeInstanceUpdate) SetCreateTime(v time.Time) *ComputeInstanceUpdate

SetCreateTime sets the "create_time" field.

func (*ComputeInstanceUpdate) SetDockerCompose

func (_u *ComputeInstanceUpdate) SetDockerCompose(v string) *ComputeInstanceUpdate

SetDockerCompose sets the "docker_compose" field.

func (*ComputeInstanceUpdate) SetExpirationTime

func (_u *ComputeInstanceUpdate) SetExpirationTime(v time.Time) *ComputeInstanceUpdate

SetExpirationTime sets the "expiration_time" field.

func (*ComputeInstanceUpdate) SetImage

SetImage sets the "image" field.

func (*ComputeInstanceUpdate) SetImageID

SetImageID sets the "image_id" field.

func (*ComputeInstanceUpdate) SetMemory

SetMemory sets the "memory" field.

func (*ComputeInstanceUpdate) SetName

SetName sets the "name" field.

func (*ComputeInstanceUpdate) SetNillableAgentID

func (_u *ComputeInstanceUpdate) SetNillableAgentID(v *string) *ComputeInstanceUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableArch added in v0.0.12

func (_u *ComputeInstanceUpdate) SetNillableArch(v *string) *ComputeInstanceUpdate

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

func (*ComputeInstanceUpdate) SetNillableBootType added in v0.0.12

func (_u *ComputeInstanceUpdate) SetNillableBootType(v *string) *ComputeInstanceUpdate

SetNillableBootType sets the "boot_type" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableContainerID

func (_u *ComputeInstanceUpdate) SetNillableContainerID(v *string) *ComputeInstanceUpdate

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

func (*ComputeInstanceUpdate) SetNillableCore

func (_u *ComputeInstanceUpdate) SetNillableCore(v *int) *ComputeInstanceUpdate

SetNillableCore sets the "core" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableCreateTime

func (_u *ComputeInstanceUpdate) SetNillableCreateTime(v *time.Time) *ComputeInstanceUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableDockerCompose

func (_u *ComputeInstanceUpdate) SetNillableDockerCompose(v *string) *ComputeInstanceUpdate

SetNillableDockerCompose sets the "docker_compose" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableExpirationTime

func (_u *ComputeInstanceUpdate) SetNillableExpirationTime(v *time.Time) *ComputeInstanceUpdate

SetNillableExpirationTime sets the "expiration_time" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableImage

func (_u *ComputeInstanceUpdate) SetNillableImage(v *string) *ComputeInstanceUpdate

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

func (*ComputeInstanceUpdate) SetNillableImageID

func (_u *ComputeInstanceUpdate) SetNillableImageID(v *int32) *ComputeInstanceUpdate

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableMemory

func (_u *ComputeInstanceUpdate) SetNillableMemory(v *int) *ComputeInstanceUpdate

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

func (*ComputeInstanceUpdate) SetNillableName

func (_u *ComputeInstanceUpdate) SetNillableName(v *string) *ComputeInstanceUpdate

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

func (*ComputeInstanceUpdate) SetNillableOwner

func (_u *ComputeInstanceUpdate) SetNillableOwner(v *string) *ComputeInstanceUpdate

SetNillableOwner sets the "owner" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillablePort

func (_u *ComputeInstanceUpdate) SetNillablePort(v *string) *ComputeInstanceUpdate

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

func (*ComputeInstanceUpdate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableVncIP

func (_u *ComputeInstanceUpdate) SetNillableVncIP(v *string) *ComputeInstanceUpdate

SetNillableVncIP sets the "vnc_ip" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetNillableVncPort

func (_u *ComputeInstanceUpdate) SetNillableVncPort(v *int32) *ComputeInstanceUpdate

SetNillableVncPort sets the "vnc_port" field if the given value is not nil.

func (*ComputeInstanceUpdate) SetOwner

SetOwner sets the "owner" field.

func (*ComputeInstanceUpdate) SetPort

SetPort sets the "port" field.

func (*ComputeInstanceUpdate) SetStatus

SetStatus sets the "status" field.

func (*ComputeInstanceUpdate) SetVncIP

SetVncIP sets the "vnc_ip" field.

func (*ComputeInstanceUpdate) SetVncPort

SetVncPort sets the "vnc_port" 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) AddCore

AddCore adds value to the "core" field.

func (*ComputeInstanceUpdateOne) AddImageID

AddImageID adds value to the "image_id" field.

func (*ComputeInstanceUpdateOne) AddMemory

AddMemory adds value to the "memory" field.

func (*ComputeInstanceUpdateOne) AddStatus

AddStatus adds value to the "status" field.

func (*ComputeInstanceUpdateOne) AddVncPort

AddVncPort adds value to the "vnc_port" field.

func (*ComputeInstanceUpdateOne) ClearAgentID

ClearAgentID clears the value of the "agent_id" field.

func (*ComputeInstanceUpdateOne) ClearContainerID

func (_u *ComputeInstanceUpdateOne) ClearContainerID() *ComputeInstanceUpdateOne

ClearContainerID clears the value of the "container_id" field.

func (*ComputeInstanceUpdateOne) ClearPort

ClearPort clears the value of the "port" field.

func (*ComputeInstanceUpdateOne) Exec

Exec executes the query on the entity.

func (*ComputeInstanceUpdateOne) ExecX

func (_u *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 (_u *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) SetAgentID

SetAgentID sets the "agent_id" field.

func (*ComputeInstanceUpdateOne) SetArch added in v0.0.12

SetArch sets the "arch" field.

func (*ComputeInstanceUpdateOne) SetBootType added in v0.0.12

SetBootType sets the "boot_type" field.

func (*ComputeInstanceUpdateOne) SetContainerID

SetContainerID sets the "container_id" field.

func (*ComputeInstanceUpdateOne) SetCore

SetCore sets the "core" field.

func (*ComputeInstanceUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*ComputeInstanceUpdateOne) SetDockerCompose

func (_u *ComputeInstanceUpdateOne) SetDockerCompose(v string) *ComputeInstanceUpdateOne

SetDockerCompose sets the "docker_compose" field.

func (*ComputeInstanceUpdateOne) SetExpirationTime

func (_u *ComputeInstanceUpdateOne) SetExpirationTime(v time.Time) *ComputeInstanceUpdateOne

SetExpirationTime sets the "expiration_time" field.

func (*ComputeInstanceUpdateOne) SetImage

SetImage sets the "image" field.

func (*ComputeInstanceUpdateOne) SetImageID

SetImageID sets the "image_id" field.

func (*ComputeInstanceUpdateOne) SetMemory

SetMemory sets the "memory" field.

func (*ComputeInstanceUpdateOne) SetName

SetName sets the "name" field.

func (*ComputeInstanceUpdateOne) SetNillableAgentID

func (_u *ComputeInstanceUpdateOne) SetNillableAgentID(v *string) *ComputeInstanceUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableArch added in v0.0.12

func (_u *ComputeInstanceUpdateOne) SetNillableArch(v *string) *ComputeInstanceUpdateOne

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

func (*ComputeInstanceUpdateOne) SetNillableBootType added in v0.0.12

func (_u *ComputeInstanceUpdateOne) SetNillableBootType(v *string) *ComputeInstanceUpdateOne

SetNillableBootType sets the "boot_type" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableContainerID

func (_u *ComputeInstanceUpdateOne) SetNillableContainerID(v *string) *ComputeInstanceUpdateOne

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

func (*ComputeInstanceUpdateOne) SetNillableCore

func (_u *ComputeInstanceUpdateOne) SetNillableCore(v *int) *ComputeInstanceUpdateOne

SetNillableCore sets the "core" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableCreateTime

func (_u *ComputeInstanceUpdateOne) SetNillableCreateTime(v *time.Time) *ComputeInstanceUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableDockerCompose

func (_u *ComputeInstanceUpdateOne) SetNillableDockerCompose(v *string) *ComputeInstanceUpdateOne

SetNillableDockerCompose sets the "docker_compose" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableExpirationTime

func (_u *ComputeInstanceUpdateOne) SetNillableExpirationTime(v *time.Time) *ComputeInstanceUpdateOne

SetNillableExpirationTime sets the "expiration_time" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableImage

func (_u *ComputeInstanceUpdateOne) SetNillableImage(v *string) *ComputeInstanceUpdateOne

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

func (*ComputeInstanceUpdateOne) SetNillableImageID

func (_u *ComputeInstanceUpdateOne) SetNillableImageID(v *int32) *ComputeInstanceUpdateOne

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableMemory

func (_u *ComputeInstanceUpdateOne) SetNillableMemory(v *int) *ComputeInstanceUpdateOne

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

func (*ComputeInstanceUpdateOne) SetNillableName

func (_u *ComputeInstanceUpdateOne) SetNillableName(v *string) *ComputeInstanceUpdateOne

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

func (*ComputeInstanceUpdateOne) SetNillableOwner

func (_u *ComputeInstanceUpdateOne) SetNillableOwner(v *string) *ComputeInstanceUpdateOne

SetNillableOwner sets the "owner" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillablePort

func (_u *ComputeInstanceUpdateOne) SetNillablePort(v *string) *ComputeInstanceUpdateOne

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

func (*ComputeInstanceUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableVncIP

func (_u *ComputeInstanceUpdateOne) SetNillableVncIP(v *string) *ComputeInstanceUpdateOne

SetNillableVncIP sets the "vnc_ip" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetNillableVncPort

func (_u *ComputeInstanceUpdateOne) SetNillableVncPort(v *int32) *ComputeInstanceUpdateOne

SetNillableVncPort sets the "vnc_port" field if the given value is not nil.

func (*ComputeInstanceUpdateOne) SetOwner

SetOwner sets the "owner" field.

func (*ComputeInstanceUpdateOne) SetPort

SetPort sets the "port" field.

func (*ComputeInstanceUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*ComputeInstanceUpdateOne) SetVncIP

SetVncIP sets the "vnc_ip" field.

func (*ComputeInstanceUpdateOne) SetVncPort

SetVncPort sets the "vnc_port" 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"`
	// cpu核数
	Core int `json:"core,omitempty"`
	// 服务器内存G
	Memory int `json:"memory,omitempty"`
	// contains filtered or unexported fields
}

ComputeSpec is the model entity for the ComputeSpec schema.

func (*ComputeSpec) String

func (_m *ComputeSpec) String() string

String implements the fmt.Stringer.

func (*ComputeSpec) Unwrap

func (_m *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 (_m *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 (_m *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) MapCreateBulk

func (c *ComputeSpecClient) MapCreateBulk(slice any, setFunc func(*ComputeSpecCreate, int)) *ComputeSpecCreateBulk

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

func (*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 (_c *ComputeSpecCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeSpecCreate) ExecX

func (_c *ComputeSpecCreate) ExecX(ctx context.Context)

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

func (*ComputeSpecCreate) Mutation

func (_c *ComputeSpecCreate) Mutation() *ComputeSpecMutation

Mutation returns the ComputeSpecMutation object of the builder.

func (*ComputeSpecCreate) Save

Save creates the ComputeSpec in the database.

func (*ComputeSpecCreate) SaveX

func (_c *ComputeSpecCreate) SaveX(ctx context.Context) *ComputeSpec

SaveX calls Save and panics if Save returns an error.

func (*ComputeSpecCreate) SetCore

func (_c *ComputeSpecCreate) SetCore(v int) *ComputeSpecCreate

SetCore sets the "core" field.

func (*ComputeSpecCreate) SetID

SetID sets the "id" field.

func (*ComputeSpecCreate) SetMemory

func (_c *ComputeSpecCreate) SetMemory(v int) *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

Exec executes the query.

func (*ComputeSpecCreateBulk) ExecX

func (_c *ComputeSpecCreateBulk) ExecX(ctx context.Context)

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

func (*ComputeSpecCreateBulk) Save

Save creates the ComputeSpec entities in the database.

func (*ComputeSpecCreateBulk) SaveX

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 (_d *ComputeSpecDelete) Exec(ctx context.Context) (int, error)

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

func (*ComputeSpecDelete) ExecX

func (_d *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 (_d *ComputeSpecDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ComputeSpecDeleteOne) ExecX

func (_d *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 (_g *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 (_g *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) AddCore

func (m *ComputeSpecMutation) AddCore(i int)

AddCore adds i to the "core" field.

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

func (m *ComputeSpecMutation) AddMemory(i int)

AddMemory adds i to the "memory" field.

func (*ComputeSpecMutation) AddedCore

func (m *ComputeSpecMutation) AddedCore() (r int, exists bool)

AddedCore returns the value that was added to the "core" field in this mutation.

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

func (m *ComputeSpecMutation) AddedMemory() (r int, exists bool)

AddedMemory returns the value that was added to the "memory" field 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 int, 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 int, exists bool)

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

func (*ComputeSpecMutation) OldCore

func (m *ComputeSpecMutation) OldCore(ctx context.Context) (v int, 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 int, 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(i int)

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(i int)

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 ComputeSpecPrice

type ComputeSpecPrice struct {

	// ID of the ent.
	ID int32 `json:"id,omitempty"`
	// 资源规格id
	FkComputeSpecID int32 `json:"fk_compute_spec_id,omitempty"`
	// 天数
	Day int32 `json:"day,omitempty"`
	// 此天数的价格
	Price float32 `json:"price,omitempty"`
	// contains filtered or unexported fields
}

ComputeSpecPrice is the model entity for the ComputeSpecPrice schema.

func (*ComputeSpecPrice) String

func (_m *ComputeSpecPrice) String() string

String implements the fmt.Stringer.

func (*ComputeSpecPrice) Unwrap

func (_m *ComputeSpecPrice) Unwrap() *ComputeSpecPrice

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

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

func (*ComputeSpecPrice) Value

func (_m *ComputeSpecPrice) Value(name string) (ent.Value, error)

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

type ComputeSpecPriceClient

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

ComputeSpecPriceClient is a client for the ComputeSpecPrice schema.

func NewComputeSpecPriceClient

func NewComputeSpecPriceClient(c config) *ComputeSpecPriceClient

NewComputeSpecPriceClient returns a client for the ComputeSpecPrice from the given config.

func (*ComputeSpecPriceClient) Create

Create returns a builder for creating a ComputeSpecPrice entity.

func (*ComputeSpecPriceClient) CreateBulk

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

func (*ComputeSpecPriceClient) Delete

Delete returns a delete builder for ComputeSpecPrice.

func (*ComputeSpecPriceClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ComputeSpecPriceClient) DeleteOneID

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

func (*ComputeSpecPriceClient) Get

Get returns a ComputeSpecPrice entity by its id.

func (*ComputeSpecPriceClient) GetX

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

func (*ComputeSpecPriceClient) Hooks

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

Hooks returns the client hooks.

func (*ComputeSpecPriceClient) Intercept

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

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

func (*ComputeSpecPriceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ComputeSpecPriceClient) MapCreateBulk

func (c *ComputeSpecPriceClient) MapCreateBulk(slice any, setFunc func(*ComputeSpecPriceCreate, int)) *ComputeSpecPriceCreateBulk

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

func (*ComputeSpecPriceClient) Query

Query returns a query builder for ComputeSpecPrice.

func (*ComputeSpecPriceClient) Update

Update returns an update builder for ComputeSpecPrice.

func (*ComputeSpecPriceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ComputeSpecPriceClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ComputeSpecPriceClient) Use

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

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

type ComputeSpecPriceCreate

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

ComputeSpecPriceCreate is the builder for creating a ComputeSpecPrice entity.

func (*ComputeSpecPriceCreate) Exec

Exec executes the query.

func (*ComputeSpecPriceCreate) ExecX

func (_c *ComputeSpecPriceCreate) ExecX(ctx context.Context)

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

func (*ComputeSpecPriceCreate) Mutation

Mutation returns the ComputeSpecPriceMutation object of the builder.

func (*ComputeSpecPriceCreate) Save

Save creates the ComputeSpecPrice in the database.

func (*ComputeSpecPriceCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ComputeSpecPriceCreate) SetDay

SetDay sets the "day" field.

func (*ComputeSpecPriceCreate) SetFkComputeSpecID

func (_c *ComputeSpecPriceCreate) SetFkComputeSpecID(v int32) *ComputeSpecPriceCreate

SetFkComputeSpecID sets the "fk_compute_spec_id" field.

func (*ComputeSpecPriceCreate) SetID

SetID sets the "id" field.

func (*ComputeSpecPriceCreate) SetNillableDay

func (_c *ComputeSpecPriceCreate) SetNillableDay(v *int32) *ComputeSpecPriceCreate

SetNillableDay sets the "day" field if the given value is not nil.

func (*ComputeSpecPriceCreate) SetNillablePrice

func (_c *ComputeSpecPriceCreate) SetNillablePrice(v *float32) *ComputeSpecPriceCreate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*ComputeSpecPriceCreate) SetPrice

SetPrice sets the "price" field.

type ComputeSpecPriceCreateBulk

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

ComputeSpecPriceCreateBulk is the builder for creating many ComputeSpecPrice entities in bulk.

func (*ComputeSpecPriceCreateBulk) Exec

Exec executes the query.

func (*ComputeSpecPriceCreateBulk) ExecX

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

func (*ComputeSpecPriceCreateBulk) Save

Save creates the ComputeSpecPrice entities in the database.

func (*ComputeSpecPriceCreateBulk) SaveX

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

type ComputeSpecPriceDelete

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

ComputeSpecPriceDelete is the builder for deleting a ComputeSpecPrice entity.

func (*ComputeSpecPriceDelete) Exec

func (_d *ComputeSpecPriceDelete) Exec(ctx context.Context) (int, error)

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

func (*ComputeSpecPriceDelete) ExecX

func (_d *ComputeSpecPriceDelete) ExecX(ctx context.Context) int

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

func (*ComputeSpecPriceDelete) Where

Where appends a list predicates to the ComputeSpecPriceDelete builder.

type ComputeSpecPriceDeleteOne

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

ComputeSpecPriceDeleteOne is the builder for deleting a single ComputeSpecPrice entity.

func (*ComputeSpecPriceDeleteOne) Exec

Exec executes the deletion query.

func (*ComputeSpecPriceDeleteOne) ExecX

func (_d *ComputeSpecPriceDeleteOne) ExecX(ctx context.Context)

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

func (*ComputeSpecPriceDeleteOne) Where

Where appends a list predicates to the ComputeSpecPriceDelete builder.

type ComputeSpecPriceGroupBy

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

ComputeSpecPriceGroupBy is the group-by builder for ComputeSpecPrice entities.

func (*ComputeSpecPriceGroupBy) Aggregate

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

func (*ComputeSpecPriceGroupBy) Bool

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

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

func (*ComputeSpecPriceGroupBy) BoolX

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

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

func (*ComputeSpecPriceGroupBy) Bools

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

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

func (*ComputeSpecPriceGroupBy) BoolsX

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

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

func (*ComputeSpecPriceGroupBy) Float64

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

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

func (*ComputeSpecPriceGroupBy) Float64X

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

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

func (*ComputeSpecPriceGroupBy) Float64s

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

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

func (*ComputeSpecPriceGroupBy) Float64sX

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

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

func (*ComputeSpecPriceGroupBy) Int

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

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

func (*ComputeSpecPriceGroupBy) IntX

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

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

func (*ComputeSpecPriceGroupBy) Ints

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

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

func (*ComputeSpecPriceGroupBy) IntsX

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

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

func (*ComputeSpecPriceGroupBy) Scan

func (_g *ComputeSpecPriceGroupBy) Scan(ctx context.Context, v any) error

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

func (*ComputeSpecPriceGroupBy) ScanX

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

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

func (*ComputeSpecPriceGroupBy) String

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

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

func (*ComputeSpecPriceGroupBy) StringX

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

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

func (*ComputeSpecPriceGroupBy) Strings

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

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

func (*ComputeSpecPriceGroupBy) StringsX

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

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

type ComputeSpecPriceMutation

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

ComputeSpecPriceMutation represents an operation that mutates the ComputeSpecPrice nodes in the graph.

func (*ComputeSpecPriceMutation) AddDay

func (m *ComputeSpecPriceMutation) AddDay(i int32)

AddDay adds i to the "day" field.

func (*ComputeSpecPriceMutation) AddField

func (m *ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) AddFkComputeSpecID

func (m *ComputeSpecPriceMutation) AddFkComputeSpecID(i int32)

AddFkComputeSpecID adds i to the "fk_compute_spec_id" field.

func (*ComputeSpecPriceMutation) AddPrice

func (m *ComputeSpecPriceMutation) AddPrice(f float32)

AddPrice adds f to the "price" field.

func (*ComputeSpecPriceMutation) AddedDay

func (m *ComputeSpecPriceMutation) AddedDay() (r int32, exists bool)

AddedDay returns the value that was added to the "day" field in this mutation.

func (*ComputeSpecPriceMutation) AddedEdges

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

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

func (*ComputeSpecPriceMutation) AddedField

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

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

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

func (*ComputeSpecPriceMutation) AddedFkComputeSpecID

func (m *ComputeSpecPriceMutation) AddedFkComputeSpecID() (r int32, exists bool)

AddedFkComputeSpecID returns the value that was added to the "fk_compute_spec_id" field in this mutation.

func (*ComputeSpecPriceMutation) AddedIDs

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

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

func (*ComputeSpecPriceMutation) AddedPrice

func (m *ComputeSpecPriceMutation) AddedPrice() (r float32, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*ComputeSpecPriceMutation) ClearEdge

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

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

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

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

func (*ComputeSpecPriceMutation) ClearedFields

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

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

func (ComputeSpecPriceMutation) Client

func (m ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) Day

func (m *ComputeSpecPriceMutation) Day() (r int32, exists bool)

Day returns the value of the "day" field in the mutation.

func (*ComputeSpecPriceMutation) EdgeCleared

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

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

func (*ComputeSpecPriceMutation) Field

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

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

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

func (*ComputeSpecPriceMutation) Fields

func (m *ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) FkComputeSpecID

func (m *ComputeSpecPriceMutation) FkComputeSpecID() (r int32, exists bool)

FkComputeSpecID returns the value of the "fk_compute_spec_id" field in the mutation.

func (*ComputeSpecPriceMutation) ID

func (m *ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) OldDay

func (m *ComputeSpecPriceMutation) OldDay(ctx context.Context) (v int32, err error)

OldDay returns the old "day" field's value of the ComputeSpecPrice entity. If the ComputeSpecPrice 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 (*ComputeSpecPriceMutation) OldField

func (m *ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) OldFkComputeSpecID

func (m *ComputeSpecPriceMutation) OldFkComputeSpecID(ctx context.Context) (v int32, err error)

OldFkComputeSpecID returns the old "fk_compute_spec_id" field's value of the ComputeSpecPrice entity. If the ComputeSpecPrice 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 (*ComputeSpecPriceMutation) OldPrice

func (m *ComputeSpecPriceMutation) OldPrice(ctx context.Context) (v float32, err error)

OldPrice returns the old "price" field's value of the ComputeSpecPrice entity. If the ComputeSpecPrice 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 (*ComputeSpecPriceMutation) Op

func (m *ComputeSpecPriceMutation) Op() Op

Op returns the operation name.

func (*ComputeSpecPriceMutation) Price

func (m *ComputeSpecPriceMutation) Price() (r float32, exists bool)

Price returns the value of the "price" field in the mutation.

func (*ComputeSpecPriceMutation) RemovedEdges

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

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

func (*ComputeSpecPriceMutation) RemovedIDs

func (m *ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) ResetDay

func (m *ComputeSpecPriceMutation) ResetDay()

ResetDay resets all changes to the "day" field.

func (*ComputeSpecPriceMutation) ResetEdge

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

func (m *ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) ResetFkComputeSpecID

func (m *ComputeSpecPriceMutation) ResetFkComputeSpecID()

ResetFkComputeSpecID resets all changes to the "fk_compute_spec_id" field.

func (*ComputeSpecPriceMutation) ResetPrice

func (m *ComputeSpecPriceMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*ComputeSpecPriceMutation) SetDay

func (m *ComputeSpecPriceMutation) SetDay(i int32)

SetDay sets the "day" field.

func (*ComputeSpecPriceMutation) SetField

func (m *ComputeSpecPriceMutation) 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 (*ComputeSpecPriceMutation) SetFkComputeSpecID

func (m *ComputeSpecPriceMutation) SetFkComputeSpecID(i int32)

SetFkComputeSpecID sets the "fk_compute_spec_id" field.

func (*ComputeSpecPriceMutation) SetID

func (m *ComputeSpecPriceMutation) SetID(id int32)

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

func (*ComputeSpecPriceMutation) SetOp

func (m *ComputeSpecPriceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ComputeSpecPriceMutation) SetPrice

func (m *ComputeSpecPriceMutation) SetPrice(f float32)

SetPrice sets the "price" field.

func (ComputeSpecPriceMutation) Tx

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

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

func (*ComputeSpecPriceMutation) Type

func (m *ComputeSpecPriceMutation) Type() string

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

func (*ComputeSpecPriceMutation) Where

Where appends a list predicates to the ComputeSpecPriceMutation builder.

func (*ComputeSpecPriceMutation) WhereP

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

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

type ComputeSpecPriceQuery

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

ComputeSpecPriceQuery is the builder for querying ComputeSpecPrice entities.

func (*ComputeSpecPriceQuery) Aggregate

Aggregate returns a ComputeSpecPriceSelect configured with the given aggregations.

func (*ComputeSpecPriceQuery) All

All executes the query and returns a list of ComputeSpecPrices.

func (*ComputeSpecPriceQuery) AllX

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

func (*ComputeSpecPriceQuery) Clone

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

func (*ComputeSpecPriceQuery) Count

func (_q *ComputeSpecPriceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComputeSpecPriceQuery) CountX

func (_q *ComputeSpecPriceQuery) CountX(ctx context.Context) int

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

func (*ComputeSpecPriceQuery) Exist

func (_q *ComputeSpecPriceQuery) Exist(ctx context.Context) (bool, error)

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

func (*ComputeSpecPriceQuery) ExistX

func (_q *ComputeSpecPriceQuery) ExistX(ctx context.Context) bool

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

func (*ComputeSpecPriceQuery) First

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

func (*ComputeSpecPriceQuery) FirstID

func (_q *ComputeSpecPriceQuery) FirstID(ctx context.Context) (id int32, err error)

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

func (*ComputeSpecPriceQuery) FirstIDX

func (_q *ComputeSpecPriceQuery) FirstIDX(ctx context.Context) int32

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

func (*ComputeSpecPriceQuery) FirstX

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

func (*ComputeSpecPriceQuery) GroupBy

func (_q *ComputeSpecPriceQuery) GroupBy(field string, fields ...string) *ComputeSpecPriceGroupBy

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 {
	FkComputeSpecID int32 `json:"fk_compute_spec_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ComputeSpecPrice.Query().
	GroupBy(computespecprice.FieldFkComputeSpecID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ComputeSpecPriceQuery) IDs

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

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

func (*ComputeSpecPriceQuery) IDsX

func (_q *ComputeSpecPriceQuery) IDsX(ctx context.Context) []int32

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

func (*ComputeSpecPriceQuery) Limit

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

func (*ComputeSpecPriceQuery) Offset

func (_q *ComputeSpecPriceQuery) Offset(offset int) *ComputeSpecPriceQuery

Offset to start from.

func (*ComputeSpecPriceQuery) Only

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

func (*ComputeSpecPriceQuery) OnlyID

func (_q *ComputeSpecPriceQuery) OnlyID(ctx context.Context) (id int32, err error)

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

func (*ComputeSpecPriceQuery) OnlyIDX

func (_q *ComputeSpecPriceQuery) OnlyIDX(ctx context.Context) int32

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

func (*ComputeSpecPriceQuery) OnlyX

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

func (*ComputeSpecPriceQuery) Order

Order specifies how the records should be ordered.

func (*ComputeSpecPriceQuery) Select

func (_q *ComputeSpecPriceQuery) Select(fields ...string) *ComputeSpecPriceSelect

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 {
	FkComputeSpecID int32 `json:"fk_compute_spec_id,omitempty"`
}

client.ComputeSpecPrice.Query().
	Select(computespecprice.FieldFkComputeSpecID).
	Scan(ctx, &v)

func (*ComputeSpecPriceQuery) Unique

func (_q *ComputeSpecPriceQuery) Unique(unique bool) *ComputeSpecPriceQuery

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

Where adds a new predicate for the ComputeSpecPriceQuery builder.

type ComputeSpecPriceSelect

type ComputeSpecPriceSelect struct {
	*ComputeSpecPriceQuery
	// contains filtered or unexported fields
}

ComputeSpecPriceSelect is the builder for selecting fields of ComputeSpecPrice entities.

func (*ComputeSpecPriceSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ComputeSpecPriceSelect) Bool

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

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

func (*ComputeSpecPriceSelect) BoolX

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

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

func (*ComputeSpecPriceSelect) Bools

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

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

func (*ComputeSpecPriceSelect) BoolsX

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

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

func (*ComputeSpecPriceSelect) Float64

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

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

func (*ComputeSpecPriceSelect) Float64X

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

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

func (*ComputeSpecPriceSelect) Float64s

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

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

func (*ComputeSpecPriceSelect) Float64sX

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

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

func (*ComputeSpecPriceSelect) Int

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

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

func (*ComputeSpecPriceSelect) IntX

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

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

func (*ComputeSpecPriceSelect) Ints

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

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

func (*ComputeSpecPriceSelect) IntsX

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

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

func (*ComputeSpecPriceSelect) Scan

func (_s *ComputeSpecPriceSelect) Scan(ctx context.Context, v any) error

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

func (*ComputeSpecPriceSelect) ScanX

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

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

func (*ComputeSpecPriceSelect) String

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

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

func (*ComputeSpecPriceSelect) StringX

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

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

func (*ComputeSpecPriceSelect) Strings

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

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

func (*ComputeSpecPriceSelect) StringsX

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

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

type ComputeSpecPriceUpdate

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

ComputeSpecPriceUpdate is the builder for updating ComputeSpecPrice entities.

func (*ComputeSpecPriceUpdate) AddDay

AddDay adds value to the "day" field.

func (*ComputeSpecPriceUpdate) AddFkComputeSpecID

func (_u *ComputeSpecPriceUpdate) AddFkComputeSpecID(v int32) *ComputeSpecPriceUpdate

AddFkComputeSpecID adds value to the "fk_compute_spec_id" field.

func (*ComputeSpecPriceUpdate) AddPrice

AddPrice adds value to the "price" field.

func (*ComputeSpecPriceUpdate) Exec

Exec executes the query.

func (*ComputeSpecPriceUpdate) ExecX

func (_u *ComputeSpecPriceUpdate) ExecX(ctx context.Context)

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

func (*ComputeSpecPriceUpdate) Mutation

Mutation returns the ComputeSpecPriceMutation object of the builder.

func (*ComputeSpecPriceUpdate) Save

func (_u *ComputeSpecPriceUpdate) Save(ctx context.Context) (int, error)

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

func (*ComputeSpecPriceUpdate) SaveX

func (_u *ComputeSpecPriceUpdate) SaveX(ctx context.Context) int

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

func (*ComputeSpecPriceUpdate) SetDay

SetDay sets the "day" field.

func (*ComputeSpecPriceUpdate) SetFkComputeSpecID

func (_u *ComputeSpecPriceUpdate) SetFkComputeSpecID(v int32) *ComputeSpecPriceUpdate

SetFkComputeSpecID sets the "fk_compute_spec_id" field.

func (*ComputeSpecPriceUpdate) SetNillableDay

func (_u *ComputeSpecPriceUpdate) SetNillableDay(v *int32) *ComputeSpecPriceUpdate

SetNillableDay sets the "day" field if the given value is not nil.

func (*ComputeSpecPriceUpdate) SetNillableFkComputeSpecID

func (_u *ComputeSpecPriceUpdate) SetNillableFkComputeSpecID(v *int32) *ComputeSpecPriceUpdate

SetNillableFkComputeSpecID sets the "fk_compute_spec_id" field if the given value is not nil.

func (*ComputeSpecPriceUpdate) SetNillablePrice

func (_u *ComputeSpecPriceUpdate) SetNillablePrice(v *float32) *ComputeSpecPriceUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*ComputeSpecPriceUpdate) SetPrice

SetPrice sets the "price" field.

func (*ComputeSpecPriceUpdate) Where

Where appends a list predicates to the ComputeSpecPriceUpdate builder.

type ComputeSpecPriceUpdateOne

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

ComputeSpecPriceUpdateOne is the builder for updating a single ComputeSpecPrice entity.

func (*ComputeSpecPriceUpdateOne) AddDay

AddDay adds value to the "day" field.

func (*ComputeSpecPriceUpdateOne) AddFkComputeSpecID

func (_u *ComputeSpecPriceUpdateOne) AddFkComputeSpecID(v int32) *ComputeSpecPriceUpdateOne

AddFkComputeSpecID adds value to the "fk_compute_spec_id" field.

func (*ComputeSpecPriceUpdateOne) AddPrice

AddPrice adds value to the "price" field.

func (*ComputeSpecPriceUpdateOne) Exec

Exec executes the query on the entity.

func (*ComputeSpecPriceUpdateOne) ExecX

func (_u *ComputeSpecPriceUpdateOne) ExecX(ctx context.Context)

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

func (*ComputeSpecPriceUpdateOne) Mutation

Mutation returns the ComputeSpecPriceMutation object of the builder.

func (*ComputeSpecPriceUpdateOne) Save

Save executes the query and returns the updated ComputeSpecPrice entity.

func (*ComputeSpecPriceUpdateOne) SaveX

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

func (*ComputeSpecPriceUpdateOne) Select

func (_u *ComputeSpecPriceUpdateOne) Select(field string, fields ...string) *ComputeSpecPriceUpdateOne

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

func (*ComputeSpecPriceUpdateOne) SetDay

SetDay sets the "day" field.

func (*ComputeSpecPriceUpdateOne) SetFkComputeSpecID

func (_u *ComputeSpecPriceUpdateOne) SetFkComputeSpecID(v int32) *ComputeSpecPriceUpdateOne

SetFkComputeSpecID sets the "fk_compute_spec_id" field.

func (*ComputeSpecPriceUpdateOne) SetNillableDay

SetNillableDay sets the "day" field if the given value is not nil.

func (*ComputeSpecPriceUpdateOne) SetNillableFkComputeSpecID

func (_u *ComputeSpecPriceUpdateOne) SetNillableFkComputeSpecID(v *int32) *ComputeSpecPriceUpdateOne

SetNillableFkComputeSpecID sets the "fk_compute_spec_id" field if the given value is not nil.

func (*ComputeSpecPriceUpdateOne) SetNillablePrice

SetNillablePrice sets the "price" field if the given value is not nil.

func (*ComputeSpecPriceUpdateOne) SetPrice

SetPrice sets the "price" field.

func (*ComputeSpecPriceUpdateOne) Where

Where appends a list predicates to the ComputeSpecPriceUpdate builder.

type ComputeSpecPrices

type ComputeSpecPrices []*ComputeSpecPrice

ComputeSpecPrices is a parsable slice of ComputeSpecPrice.

type ComputeSpecQuery

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

ComputeSpecQuery is the builder for querying ComputeSpec entities.

func (*ComputeSpecQuery) Aggregate

func (_q *ComputeSpecQuery) Aggregate(fns ...AggregateFunc) *ComputeSpecSelect

Aggregate returns a ComputeSpecSelect configured with the given aggregations.

func (*ComputeSpecQuery) All

func (_q *ComputeSpecQuery) All(ctx context.Context) ([]*ComputeSpec, error)

All executes the query and returns a list of ComputeSpecs.

func (*ComputeSpecQuery) AllX

func (_q *ComputeSpecQuery) AllX(ctx context.Context) []*ComputeSpec

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

func (*ComputeSpecQuery) Clone

func (_q *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 (_q *ComputeSpecQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComputeSpecQuery) CountX

func (_q *ComputeSpecQuery) CountX(ctx context.Context) int

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

func (*ComputeSpecQuery) Exist

func (_q *ComputeSpecQuery) Exist(ctx context.Context) (bool, error)

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

func (*ComputeSpecQuery) ExistX

func (_q *ComputeSpecQuery) ExistX(ctx context.Context) bool

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

func (*ComputeSpecQuery) First

func (_q *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 (_q *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 (_q *ComputeSpecQuery) FirstIDX(ctx context.Context) int32

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

func (*ComputeSpecQuery) FirstX

func (_q *ComputeSpecQuery) FirstX(ctx context.Context) *ComputeSpec

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

func (*ComputeSpecQuery) GroupBy

func (_q *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 int `json:"core,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ComputeSpec.Query().
	GroupBy(computespec.FieldCore).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ComputeSpecQuery) IDs

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

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

func (*ComputeSpecQuery) IDsX

func (_q *ComputeSpecQuery) IDsX(ctx context.Context) []int32

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

func (*ComputeSpecQuery) Limit

func (_q *ComputeSpecQuery) Limit(limit int) *ComputeSpecQuery

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

func (*ComputeSpecQuery) Offset

func (_q *ComputeSpecQuery) Offset(offset int) *ComputeSpecQuery

Offset to start from.

func (*ComputeSpecQuery) Only

func (_q *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 (_q *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 (_q *ComputeSpecQuery) OnlyIDX(ctx context.Context) int32

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

func (*ComputeSpecQuery) OnlyX

func (_q *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 (_q *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 int `json:"core,omitempty"`
}

client.ComputeSpec.Query().
	Select(computespec.FieldCore).
	Scan(ctx, &v)

func (*ComputeSpecQuery) Unique

func (_q *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 (_s *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 (_s *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) AddCore

func (_u *ComputeSpecUpdate) AddCore(v int) *ComputeSpecUpdate

AddCore adds value to the "core" field.

func (*ComputeSpecUpdate) AddMemory

func (_u *ComputeSpecUpdate) AddMemory(v int) *ComputeSpecUpdate

AddMemory adds value to the "memory" field.

func (*ComputeSpecUpdate) Exec

func (_u *ComputeSpecUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComputeSpecUpdate) ExecX

func (_u *ComputeSpecUpdate) ExecX(ctx context.Context)

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

func (*ComputeSpecUpdate) Mutation

func (_u *ComputeSpecUpdate) Mutation() *ComputeSpecMutation

Mutation returns the ComputeSpecMutation object of the builder.

func (*ComputeSpecUpdate) Save

func (_u *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 (_u *ComputeSpecUpdate) SaveX(ctx context.Context) int

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

func (*ComputeSpecUpdate) SetCore

func (_u *ComputeSpecUpdate) SetCore(v int) *ComputeSpecUpdate

SetCore sets the "core" field.

func (*ComputeSpecUpdate) SetMemory

func (_u *ComputeSpecUpdate) SetMemory(v int) *ComputeSpecUpdate

SetMemory sets the "memory" field.

func (*ComputeSpecUpdate) SetNillableCore

func (_u *ComputeSpecUpdate) SetNillableCore(v *int) *ComputeSpecUpdate

SetNillableCore sets the "core" field if the given value is not nil.

func (*ComputeSpecUpdate) SetNillableMemory

func (_u *ComputeSpecUpdate) SetNillableMemory(v *int) *ComputeSpecUpdate

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

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

AddCore adds value to the "core" field.

func (*ComputeSpecUpdateOne) AddMemory

func (_u *ComputeSpecUpdateOne) AddMemory(v int) *ComputeSpecUpdateOne

AddMemory adds value to the "memory" field.

func (*ComputeSpecUpdateOne) Exec

func (_u *ComputeSpecUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ComputeSpecUpdateOne) ExecX

func (_u *ComputeSpecUpdateOne) ExecX(ctx context.Context)

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

func (*ComputeSpecUpdateOne) Mutation

func (_u *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

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

func (*ComputeSpecUpdateOne) Select

func (_u *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 (_u *ComputeSpecUpdateOne) SetMemory(v int) *ComputeSpecUpdateOne

SetMemory sets the "memory" field.

func (*ComputeSpecUpdateOne) SetNillableCore

func (_u *ComputeSpecUpdateOne) SetNillableCore(v *int) *ComputeSpecUpdateOne

SetNillableCore sets the "core" field if the given value is not nil.

func (*ComputeSpecUpdateOne) SetNillableMemory

func (_u *ComputeSpecUpdateOne) SetNillableMemory(v *int) *ComputeSpecUpdateOne

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

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 Cycle

type Cycle struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// Cycle holds the value of the "cycle" field.
	Cycle float64 `json:"cycle,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"`
	// contains filtered or unexported fields
}

Cycle is the model entity for the Cycle schema.

func (*Cycle) String

func (_m *Cycle) String() string

String implements the fmt.Stringer.

func (*Cycle) Unwrap

func (_m *Cycle) Unwrap() *Cycle

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

func (_m *Cycle) Update() *CycleUpdateOne

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

func (*Cycle) Value

func (_m *Cycle) Value(name string) (ent.Value, error)

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

type CycleClient

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

CycleClient is a client for the Cycle schema.

func NewCycleClient

func NewCycleClient(c config) *CycleClient

NewCycleClient returns a client for the Cycle from the given config.

func (*CycleClient) Create

func (c *CycleClient) Create() *CycleCreate

Create returns a builder for creating a Cycle entity.

func (*CycleClient) CreateBulk

func (c *CycleClient) CreateBulk(builders ...*CycleCreate) *CycleCreateBulk

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

func (*CycleClient) Delete

func (c *CycleClient) Delete() *CycleDelete

Delete returns a delete builder for Cycle.

func (*CycleClient) DeleteOne

func (c *CycleClient) DeleteOne(_m *Cycle) *CycleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CycleClient) DeleteOneID

func (c *CycleClient) DeleteOneID(id uuid.UUID) *CycleDeleteOne

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

func (*CycleClient) Get

func (c *CycleClient) Get(ctx context.Context, id uuid.UUID) (*Cycle, error)

Get returns a Cycle entity by its id.

func (*CycleClient) GetX

func (c *CycleClient) GetX(ctx context.Context, id uuid.UUID) *Cycle

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

func (*CycleClient) Hooks

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

Hooks returns the client hooks.

func (*CycleClient) Intercept

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

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

func (*CycleClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CycleClient) MapCreateBulk

func (c *CycleClient) MapCreateBulk(slice any, setFunc func(*CycleCreate, int)) *CycleCreateBulk

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

func (*CycleClient) Query

func (c *CycleClient) Query() *CycleQuery

Query returns a query builder for Cycle.

func (*CycleClient) Update

func (c *CycleClient) Update() *CycleUpdate

Update returns an update builder for Cycle.

func (*CycleClient) UpdateOne

func (c *CycleClient) UpdateOne(_m *Cycle) *CycleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CycleClient) UpdateOneID

func (c *CycleClient) UpdateOneID(id uuid.UUID) *CycleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CycleClient) Use

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

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

type CycleCreate

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

CycleCreate is the builder for creating a Cycle entity.

func (*CycleCreate) Exec

func (_c *CycleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleCreate) ExecX

func (_c *CycleCreate) ExecX(ctx context.Context)

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

func (*CycleCreate) Mutation

func (_c *CycleCreate) Mutation() *CycleMutation

Mutation returns the CycleMutation object of the builder.

func (*CycleCreate) Save

func (_c *CycleCreate) Save(ctx context.Context) (*Cycle, error)

Save creates the Cycle in the database.

func (*CycleCreate) SaveX

func (_c *CycleCreate) SaveX(ctx context.Context) *Cycle

SaveX calls Save and panics if Save returns an error.

func (*CycleCreate) SetCreateTime

func (_c *CycleCreate) SetCreateTime(v time.Time) *CycleCreate

SetCreateTime sets the "create_time" field.

func (*CycleCreate) SetCycle

func (_c *CycleCreate) SetCycle(v float64) *CycleCreate

SetCycle sets the "cycle" field.

func (*CycleCreate) SetFkUserID

func (_c *CycleCreate) SetFkUserID(v uuid.UUID) *CycleCreate

SetFkUserID sets the "fk_user_id" field.

func (*CycleCreate) SetID

func (_c *CycleCreate) SetID(v uuid.UUID) *CycleCreate

SetID sets the "id" field.

func (*CycleCreate) SetNillableID

func (_c *CycleCreate) SetNillableID(v *uuid.UUID) *CycleCreate

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

func (*CycleCreate) SetUpdateTime

func (_c *CycleCreate) SetUpdateTime(v time.Time) *CycleCreate

SetUpdateTime sets the "update_time" field.

type CycleCreateBulk

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

CycleCreateBulk is the builder for creating many Cycle entities in bulk.

func (*CycleCreateBulk) Exec

func (_c *CycleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleCreateBulk) ExecX

func (_c *CycleCreateBulk) ExecX(ctx context.Context)

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

func (*CycleCreateBulk) Save

func (_c *CycleCreateBulk) Save(ctx context.Context) ([]*Cycle, error)

Save creates the Cycle entities in the database.

func (*CycleCreateBulk) SaveX

func (_c *CycleCreateBulk) SaveX(ctx context.Context) []*Cycle

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

type CycleDelete

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

CycleDelete is the builder for deleting a Cycle entity.

func (*CycleDelete) Exec

func (_d *CycleDelete) Exec(ctx context.Context) (int, error)

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

func (*CycleDelete) ExecX

func (_d *CycleDelete) ExecX(ctx context.Context) int

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

func (*CycleDelete) Where

func (_d *CycleDelete) Where(ps ...predicate.Cycle) *CycleDelete

Where appends a list predicates to the CycleDelete builder.

type CycleDeleteOne

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

CycleDeleteOne is the builder for deleting a single Cycle entity.

func (*CycleDeleteOne) Exec

func (_d *CycleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CycleDeleteOne) ExecX

func (_d *CycleDeleteOne) ExecX(ctx context.Context)

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

func (*CycleDeleteOne) Where

func (_d *CycleDeleteOne) Where(ps ...predicate.Cycle) *CycleDeleteOne

Where appends a list predicates to the CycleDelete builder.

type CycleGroupBy

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

CycleGroupBy is the group-by builder for Cycle entities.

func (*CycleGroupBy) Aggregate

func (_g *CycleGroupBy) Aggregate(fns ...AggregateFunc) *CycleGroupBy

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

func (*CycleGroupBy) Bool

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

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

func (*CycleGroupBy) BoolX

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

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

func (*CycleGroupBy) Bools

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

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

func (*CycleGroupBy) BoolsX

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

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

func (*CycleGroupBy) Float64

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

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

func (*CycleGroupBy) Float64X

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

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

func (*CycleGroupBy) Float64s

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

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

func (*CycleGroupBy) Float64sX

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

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

func (*CycleGroupBy) Int

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

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

func (*CycleGroupBy) IntX

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

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

func (*CycleGroupBy) Ints

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

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

func (*CycleGroupBy) IntsX

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

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

func (*CycleGroupBy) Scan

func (_g *CycleGroupBy) Scan(ctx context.Context, v any) error

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

func (*CycleGroupBy) ScanX

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

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

func (*CycleGroupBy) String

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

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

func (*CycleGroupBy) StringX

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

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

func (*CycleGroupBy) Strings

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

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

func (*CycleGroupBy) StringsX

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

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

type CycleMutation

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

CycleMutation represents an operation that mutates the Cycle nodes in the graph.

func (*CycleMutation) AddCycle

func (m *CycleMutation) AddCycle(f float64)

AddCycle adds f to the "cycle" field.

func (*CycleMutation) AddField

func (m *CycleMutation) 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 (*CycleMutation) AddedCycle

func (m *CycleMutation) AddedCycle() (r float64, exists bool)

AddedCycle returns the value that was added to the "cycle" field in this mutation.

func (*CycleMutation) AddedEdges

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

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

func (*CycleMutation) AddedField

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

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

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

func (*CycleMutation) AddedIDs

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

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

func (*CycleMutation) ClearEdge

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

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

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

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

func (*CycleMutation) ClearedFields

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

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

func (CycleMutation) Client

func (m CycleMutation) 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 (*CycleMutation) CreateTime

func (m *CycleMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*CycleMutation) Cycle

func (m *CycleMutation) Cycle() (r float64, exists bool)

Cycle returns the value of the "cycle" field in the mutation.

func (*CycleMutation) EdgeCleared

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

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

func (*CycleMutation) Field

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

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

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

func (*CycleMutation) Fields

func (m *CycleMutation) 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 (*CycleMutation) FkUserID

func (m *CycleMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*CycleMutation) ID

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

func (m *CycleMutation) 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 (*CycleMutation) OldCreateTime

func (m *CycleMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Cycle entity. If the Cycle 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 (*CycleMutation) OldCycle

func (m *CycleMutation) OldCycle(ctx context.Context) (v float64, err error)

OldCycle returns the old "cycle" field's value of the Cycle entity. If the Cycle 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 (*CycleMutation) OldField

func (m *CycleMutation) 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 (*CycleMutation) OldFkUserID

func (m *CycleMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the Cycle entity. If the Cycle 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 (*CycleMutation) OldUpdateTime

func (m *CycleMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Cycle entity. If the Cycle 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 (*CycleMutation) Op

func (m *CycleMutation) Op() Op

Op returns the operation name.

func (*CycleMutation) RemovedEdges

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

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

func (*CycleMutation) RemovedIDs

func (m *CycleMutation) 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 (*CycleMutation) ResetCreateTime

func (m *CycleMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*CycleMutation) ResetCycle

func (m *CycleMutation) ResetCycle()

ResetCycle resets all changes to the "cycle" field.

func (*CycleMutation) ResetEdge

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

func (m *CycleMutation) 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 (*CycleMutation) ResetFkUserID

func (m *CycleMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*CycleMutation) ResetUpdateTime

func (m *CycleMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*CycleMutation) SetCreateTime

func (m *CycleMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*CycleMutation) SetCycle

func (m *CycleMutation) SetCycle(f float64)

SetCycle sets the "cycle" field.

func (*CycleMutation) SetField

func (m *CycleMutation) 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 (*CycleMutation) SetFkUserID

func (m *CycleMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*CycleMutation) SetID

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

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

func (*CycleMutation) SetOp

func (m *CycleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CycleMutation) SetUpdateTime

func (m *CycleMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (CycleMutation) Tx

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

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

func (*CycleMutation) Type

func (m *CycleMutation) Type() string

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

func (*CycleMutation) UpdateTime

func (m *CycleMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*CycleMutation) Where

func (m *CycleMutation) Where(ps ...predicate.Cycle)

Where appends a list predicates to the CycleMutation builder.

func (*CycleMutation) WhereP

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

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

type CycleOrder

type CycleOrder struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// 订单编号
	OrderNo string `json:"order_no,omitempty"`
	// 产品名字
	ProductName string `json:"product_name,omitempty"`
	// 产品描述
	ProductDesc string `json:"product_desc,omitempty"`
	// symbol
	Symbol string `json:"symbol,omitempty"`
	// Cycle holds the value of the "cycle" field.
	Cycle float64 `json:"cycle,omitempty"`
	// 资源id,可为空
	ResourceID *string `json:"resource_id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

CycleOrder is the model entity for the CycleOrder schema.

func (*CycleOrder) String

func (_m *CycleOrder) String() string

String implements the fmt.Stringer.

func (*CycleOrder) Unwrap

func (_m *CycleOrder) Unwrap() *CycleOrder

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

func (_m *CycleOrder) Update() *CycleOrderUpdateOne

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

func (*CycleOrder) Value

func (_m *CycleOrder) Value(name string) (ent.Value, error)

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

type CycleOrderClient

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

CycleOrderClient is a client for the CycleOrder schema.

func NewCycleOrderClient

func NewCycleOrderClient(c config) *CycleOrderClient

NewCycleOrderClient returns a client for the CycleOrder from the given config.

func (*CycleOrderClient) Create

func (c *CycleOrderClient) Create() *CycleOrderCreate

Create returns a builder for creating a CycleOrder entity.

func (*CycleOrderClient) CreateBulk

func (c *CycleOrderClient) CreateBulk(builders ...*CycleOrderCreate) *CycleOrderCreateBulk

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

func (*CycleOrderClient) Delete

func (c *CycleOrderClient) Delete() *CycleOrderDelete

Delete returns a delete builder for CycleOrder.

func (*CycleOrderClient) DeleteOne

func (c *CycleOrderClient) DeleteOne(_m *CycleOrder) *CycleOrderDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CycleOrderClient) DeleteOneID

func (c *CycleOrderClient) DeleteOneID(id uuid.UUID) *CycleOrderDeleteOne

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

func (*CycleOrderClient) Get

Get returns a CycleOrder entity by its id.

func (*CycleOrderClient) GetX

func (c *CycleOrderClient) GetX(ctx context.Context, id uuid.UUID) *CycleOrder

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

func (*CycleOrderClient) Hooks

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

Hooks returns the client hooks.

func (*CycleOrderClient) Intercept

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

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

func (*CycleOrderClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CycleOrderClient) MapCreateBulk

func (c *CycleOrderClient) MapCreateBulk(slice any, setFunc func(*CycleOrderCreate, int)) *CycleOrderCreateBulk

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

func (*CycleOrderClient) Query

func (c *CycleOrderClient) Query() *CycleOrderQuery

Query returns a query builder for CycleOrder.

func (*CycleOrderClient) Update

func (c *CycleOrderClient) Update() *CycleOrderUpdate

Update returns an update builder for CycleOrder.

func (*CycleOrderClient) UpdateOne

func (c *CycleOrderClient) UpdateOne(_m *CycleOrder) *CycleOrderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CycleOrderClient) UpdateOneID

func (c *CycleOrderClient) UpdateOneID(id uuid.UUID) *CycleOrderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CycleOrderClient) Use

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

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

type CycleOrderCreate

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

CycleOrderCreate is the builder for creating a CycleOrder entity.

func (*CycleOrderCreate) Exec

func (_c *CycleOrderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleOrderCreate) ExecX

func (_c *CycleOrderCreate) ExecX(ctx context.Context)

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

func (*CycleOrderCreate) Mutation

func (_c *CycleOrderCreate) Mutation() *CycleOrderMutation

Mutation returns the CycleOrderMutation object of the builder.

func (*CycleOrderCreate) Save

func (_c *CycleOrderCreate) Save(ctx context.Context) (*CycleOrder, error)

Save creates the CycleOrder in the database.

func (*CycleOrderCreate) SaveX

func (_c *CycleOrderCreate) SaveX(ctx context.Context) *CycleOrder

SaveX calls Save and panics if Save returns an error.

func (*CycleOrderCreate) SetCreateTime

func (_c *CycleOrderCreate) SetCreateTime(v time.Time) *CycleOrderCreate

SetCreateTime sets the "create_time" field.

func (*CycleOrderCreate) SetCycle

func (_c *CycleOrderCreate) SetCycle(v float64) *CycleOrderCreate

SetCycle sets the "cycle" field.

func (*CycleOrderCreate) SetFkUserID

func (_c *CycleOrderCreate) SetFkUserID(v uuid.UUID) *CycleOrderCreate

SetFkUserID sets the "fk_user_id" field.

func (*CycleOrderCreate) SetID

SetID sets the "id" field.

func (*CycleOrderCreate) SetNillableID

func (_c *CycleOrderCreate) SetNillableID(v *uuid.UUID) *CycleOrderCreate

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

func (*CycleOrderCreate) SetNillableResourceID

func (_c *CycleOrderCreate) SetNillableResourceID(v *string) *CycleOrderCreate

SetNillableResourceID sets the "resource_id" field if the given value is not nil.

func (*CycleOrderCreate) SetOrderNo

func (_c *CycleOrderCreate) SetOrderNo(v string) *CycleOrderCreate

SetOrderNo sets the "order_no" field.

func (*CycleOrderCreate) SetProductDesc

func (_c *CycleOrderCreate) SetProductDesc(v string) *CycleOrderCreate

SetProductDesc sets the "product_desc" field.

func (*CycleOrderCreate) SetProductName

func (_c *CycleOrderCreate) SetProductName(v string) *CycleOrderCreate

SetProductName sets the "product_name" field.

func (*CycleOrderCreate) SetResourceID

func (_c *CycleOrderCreate) SetResourceID(v string) *CycleOrderCreate

SetResourceID sets the "resource_id" field.

func (*CycleOrderCreate) SetSymbol

func (_c *CycleOrderCreate) SetSymbol(v string) *CycleOrderCreate

SetSymbol sets the "symbol" field.

type CycleOrderCreateBulk

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

CycleOrderCreateBulk is the builder for creating many CycleOrder entities in bulk.

func (*CycleOrderCreateBulk) Exec

func (_c *CycleOrderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleOrderCreateBulk) ExecX

func (_c *CycleOrderCreateBulk) ExecX(ctx context.Context)

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

func (*CycleOrderCreateBulk) Save

func (_c *CycleOrderCreateBulk) Save(ctx context.Context) ([]*CycleOrder, error)

Save creates the CycleOrder entities in the database.

func (*CycleOrderCreateBulk) SaveX

func (_c *CycleOrderCreateBulk) SaveX(ctx context.Context) []*CycleOrder

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

type CycleOrderDelete

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

CycleOrderDelete is the builder for deleting a CycleOrder entity.

func (*CycleOrderDelete) Exec

func (_d *CycleOrderDelete) Exec(ctx context.Context) (int, error)

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

func (*CycleOrderDelete) ExecX

func (_d *CycleOrderDelete) ExecX(ctx context.Context) int

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

func (*CycleOrderDelete) Where

Where appends a list predicates to the CycleOrderDelete builder.

type CycleOrderDeleteOne

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

CycleOrderDeleteOne is the builder for deleting a single CycleOrder entity.

func (*CycleOrderDeleteOne) Exec

func (_d *CycleOrderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CycleOrderDeleteOne) ExecX

func (_d *CycleOrderDeleteOne) ExecX(ctx context.Context)

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

func (*CycleOrderDeleteOne) Where

Where appends a list predicates to the CycleOrderDelete builder.

type CycleOrderGroupBy

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

CycleOrderGroupBy is the group-by builder for CycleOrder entities.

func (*CycleOrderGroupBy) Aggregate

func (_g *CycleOrderGroupBy) Aggregate(fns ...AggregateFunc) *CycleOrderGroupBy

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

func (*CycleOrderGroupBy) Bool

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

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

func (*CycleOrderGroupBy) BoolX

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

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

func (*CycleOrderGroupBy) Bools

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

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

func (*CycleOrderGroupBy) BoolsX

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

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

func (*CycleOrderGroupBy) Float64

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

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

func (*CycleOrderGroupBy) Float64X

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

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

func (*CycleOrderGroupBy) Float64s

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

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

func (*CycleOrderGroupBy) Float64sX

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

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

func (*CycleOrderGroupBy) Int

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

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

func (*CycleOrderGroupBy) IntX

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

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

func (*CycleOrderGroupBy) Ints

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

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

func (*CycleOrderGroupBy) IntsX

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

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

func (*CycleOrderGroupBy) Scan

func (_g *CycleOrderGroupBy) Scan(ctx context.Context, v any) error

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

func (*CycleOrderGroupBy) ScanX

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

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

func (*CycleOrderGroupBy) String

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

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

func (*CycleOrderGroupBy) StringX

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

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

func (*CycleOrderGroupBy) Strings

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

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

func (*CycleOrderGroupBy) StringsX

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

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

type CycleOrderMutation

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

CycleOrderMutation represents an operation that mutates the CycleOrder nodes in the graph.

func (*CycleOrderMutation) AddCycle

func (m *CycleOrderMutation) AddCycle(f float64)

AddCycle adds f to the "cycle" field.

func (*CycleOrderMutation) AddField

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) AddedCycle

func (m *CycleOrderMutation) AddedCycle() (r float64, exists bool)

AddedCycle returns the value that was added to the "cycle" field in this mutation.

func (*CycleOrderMutation) AddedEdges

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

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

func (*CycleOrderMutation) AddedField

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

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

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

func (*CycleOrderMutation) AddedIDs

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

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

func (*CycleOrderMutation) ClearEdge

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

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) ClearResourceID

func (m *CycleOrderMutation) ClearResourceID()

ClearResourceID clears the value of the "resource_id" field.

func (*CycleOrderMutation) ClearedEdges

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

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

func (*CycleOrderMutation) ClearedFields

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

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

func (CycleOrderMutation) Client

func (m CycleOrderMutation) 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 (*CycleOrderMutation) CreateTime

func (m *CycleOrderMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*CycleOrderMutation) Cycle

func (m *CycleOrderMutation) Cycle() (r float64, exists bool)

Cycle returns the value of the "cycle" field in the mutation.

func (*CycleOrderMutation) EdgeCleared

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

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

func (*CycleOrderMutation) Field

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

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

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

func (*CycleOrderMutation) Fields

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) FkUserID

func (m *CycleOrderMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*CycleOrderMutation) ID

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

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) OldCreateTime

func (m *CycleOrderMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) OldCycle

func (m *CycleOrderMutation) OldCycle(ctx context.Context) (v float64, err error)

OldCycle returns the old "cycle" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) OldField

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) OldFkUserID

func (m *CycleOrderMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) OldOrderNo

func (m *CycleOrderMutation) OldOrderNo(ctx context.Context) (v string, err error)

OldOrderNo returns the old "order_no" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) OldProductDesc

func (m *CycleOrderMutation) OldProductDesc(ctx context.Context) (v string, err error)

OldProductDesc returns the old "product_desc" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) OldProductName

func (m *CycleOrderMutation) OldProductName(ctx context.Context) (v string, err error)

OldProductName returns the old "product_name" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) OldResourceID

func (m *CycleOrderMutation) OldResourceID(ctx context.Context) (v *string, err error)

OldResourceID returns the old "resource_id" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) OldSymbol

func (m *CycleOrderMutation) OldSymbol(ctx context.Context) (v string, err error)

OldSymbol returns the old "symbol" field's value of the CycleOrder entity. If the CycleOrder 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 (*CycleOrderMutation) Op

func (m *CycleOrderMutation) Op() Op

Op returns the operation name.

func (*CycleOrderMutation) OrderNo

func (m *CycleOrderMutation) OrderNo() (r string, exists bool)

OrderNo returns the value of the "order_no" field in the mutation.

func (*CycleOrderMutation) ProductDesc

func (m *CycleOrderMutation) ProductDesc() (r string, exists bool)

ProductDesc returns the value of the "product_desc" field in the mutation.

func (*CycleOrderMutation) ProductName

func (m *CycleOrderMutation) ProductName() (r string, exists bool)

ProductName returns the value of the "product_name" field in the mutation.

func (*CycleOrderMutation) RemovedEdges

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

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

func (*CycleOrderMutation) RemovedIDs

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) ResetCreateTime

func (m *CycleOrderMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*CycleOrderMutation) ResetCycle

func (m *CycleOrderMutation) ResetCycle()

ResetCycle resets all changes to the "cycle" field.

func (*CycleOrderMutation) ResetEdge

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

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) ResetFkUserID

func (m *CycleOrderMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*CycleOrderMutation) ResetOrderNo

func (m *CycleOrderMutation) ResetOrderNo()

ResetOrderNo resets all changes to the "order_no" field.

func (*CycleOrderMutation) ResetProductDesc

func (m *CycleOrderMutation) ResetProductDesc()

ResetProductDesc resets all changes to the "product_desc" field.

func (*CycleOrderMutation) ResetProductName

func (m *CycleOrderMutation) ResetProductName()

ResetProductName resets all changes to the "product_name" field.

func (*CycleOrderMutation) ResetResourceID

func (m *CycleOrderMutation) ResetResourceID()

ResetResourceID resets all changes to the "resource_id" field.

func (*CycleOrderMutation) ResetSymbol

func (m *CycleOrderMutation) ResetSymbol()

ResetSymbol resets all changes to the "symbol" field.

func (*CycleOrderMutation) ResourceID

func (m *CycleOrderMutation) ResourceID() (r string, exists bool)

ResourceID returns the value of the "resource_id" field in the mutation.

func (*CycleOrderMutation) ResourceIDCleared

func (m *CycleOrderMutation) ResourceIDCleared() bool

ResourceIDCleared returns if the "resource_id" field was cleared in this mutation.

func (*CycleOrderMutation) SetCreateTime

func (m *CycleOrderMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*CycleOrderMutation) SetCycle

func (m *CycleOrderMutation) SetCycle(f float64)

SetCycle sets the "cycle" field.

func (*CycleOrderMutation) SetField

func (m *CycleOrderMutation) 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 (*CycleOrderMutation) SetFkUserID

func (m *CycleOrderMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*CycleOrderMutation) SetID

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

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

func (*CycleOrderMutation) SetOp

func (m *CycleOrderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CycleOrderMutation) SetOrderNo

func (m *CycleOrderMutation) SetOrderNo(s string)

SetOrderNo sets the "order_no" field.

func (*CycleOrderMutation) SetProductDesc

func (m *CycleOrderMutation) SetProductDesc(s string)

SetProductDesc sets the "product_desc" field.

func (*CycleOrderMutation) SetProductName

func (m *CycleOrderMutation) SetProductName(s string)

SetProductName sets the "product_name" field.

func (*CycleOrderMutation) SetResourceID

func (m *CycleOrderMutation) SetResourceID(s string)

SetResourceID sets the "resource_id" field.

func (*CycleOrderMutation) SetSymbol

func (m *CycleOrderMutation) SetSymbol(s string)

SetSymbol sets the "symbol" field.

func (*CycleOrderMutation) Symbol

func (m *CycleOrderMutation) Symbol() (r string, exists bool)

Symbol returns the value of the "symbol" field in the mutation.

func (CycleOrderMutation) Tx

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

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

func (*CycleOrderMutation) Type

func (m *CycleOrderMutation) Type() string

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

func (*CycleOrderMutation) Where

func (m *CycleOrderMutation) Where(ps ...predicate.CycleOrder)

Where appends a list predicates to the CycleOrderMutation builder.

func (*CycleOrderMutation) WhereP

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

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

type CycleOrderQuery

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

CycleOrderQuery is the builder for querying CycleOrder entities.

func (*CycleOrderQuery) Aggregate

func (_q *CycleOrderQuery) Aggregate(fns ...AggregateFunc) *CycleOrderSelect

Aggregate returns a CycleOrderSelect configured with the given aggregations.

func (*CycleOrderQuery) All

func (_q *CycleOrderQuery) All(ctx context.Context) ([]*CycleOrder, error)

All executes the query and returns a list of CycleOrders.

func (*CycleOrderQuery) AllX

func (_q *CycleOrderQuery) AllX(ctx context.Context) []*CycleOrder

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

func (*CycleOrderQuery) Clone

func (_q *CycleOrderQuery) Clone() *CycleOrderQuery

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

func (*CycleOrderQuery) Count

func (_q *CycleOrderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CycleOrderQuery) CountX

func (_q *CycleOrderQuery) CountX(ctx context.Context) int

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

func (*CycleOrderQuery) Exist

func (_q *CycleOrderQuery) Exist(ctx context.Context) (bool, error)

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

func (*CycleOrderQuery) ExistX

func (_q *CycleOrderQuery) ExistX(ctx context.Context) bool

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

func (*CycleOrderQuery) First

func (_q *CycleOrderQuery) First(ctx context.Context) (*CycleOrder, error)

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

func (*CycleOrderQuery) FirstID

func (_q *CycleOrderQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CycleOrderQuery) FirstIDX

func (_q *CycleOrderQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CycleOrderQuery) FirstX

func (_q *CycleOrderQuery) FirstX(ctx context.Context) *CycleOrder

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

func (*CycleOrderQuery) GroupBy

func (_q *CycleOrderQuery) GroupBy(field string, fields ...string) *CycleOrderGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CycleOrder.Query().
	GroupBy(cycleorder.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CycleOrderQuery) IDs

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

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

func (*CycleOrderQuery) IDsX

func (_q *CycleOrderQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CycleOrderQuery) Limit

func (_q *CycleOrderQuery) Limit(limit int) *CycleOrderQuery

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

func (*CycleOrderQuery) Offset

func (_q *CycleOrderQuery) Offset(offset int) *CycleOrderQuery

Offset to start from.

func (*CycleOrderQuery) Only

func (_q *CycleOrderQuery) Only(ctx context.Context) (*CycleOrder, error)

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

func (*CycleOrderQuery) OnlyID

func (_q *CycleOrderQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CycleOrderQuery) OnlyIDX

func (_q *CycleOrderQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CycleOrderQuery) OnlyX

func (_q *CycleOrderQuery) OnlyX(ctx context.Context) *CycleOrder

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

func (*CycleOrderQuery) Order

Order specifies how the records should be ordered.

func (*CycleOrderQuery) Select

func (_q *CycleOrderQuery) Select(fields ...string) *CycleOrderSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.CycleOrder.Query().
	Select(cycleorder.FieldFkUserID).
	Scan(ctx, &v)

func (*CycleOrderQuery) Unique

func (_q *CycleOrderQuery) Unique(unique bool) *CycleOrderQuery

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

Where adds a new predicate for the CycleOrderQuery builder.

type CycleOrderSelect

type CycleOrderSelect struct {
	*CycleOrderQuery
	// contains filtered or unexported fields
}

CycleOrderSelect is the builder for selecting fields of CycleOrder entities.

func (*CycleOrderSelect) Aggregate

func (_s *CycleOrderSelect) Aggregate(fns ...AggregateFunc) *CycleOrderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CycleOrderSelect) Bool

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

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

func (*CycleOrderSelect) BoolX

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

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

func (*CycleOrderSelect) Bools

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

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

func (*CycleOrderSelect) BoolsX

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

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

func (*CycleOrderSelect) Float64

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

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

func (*CycleOrderSelect) Float64X

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

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

func (*CycleOrderSelect) Float64s

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

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

func (*CycleOrderSelect) Float64sX

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

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

func (*CycleOrderSelect) Int

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

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

func (*CycleOrderSelect) IntX

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

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

func (*CycleOrderSelect) Ints

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

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

func (*CycleOrderSelect) IntsX

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

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

func (*CycleOrderSelect) Scan

func (_s *CycleOrderSelect) Scan(ctx context.Context, v any) error

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

func (*CycleOrderSelect) ScanX

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

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

func (*CycleOrderSelect) String

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

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

func (*CycleOrderSelect) StringX

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

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

func (*CycleOrderSelect) Strings

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

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

func (*CycleOrderSelect) StringsX

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

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

type CycleOrderUpdate

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

CycleOrderUpdate is the builder for updating CycleOrder entities.

func (*CycleOrderUpdate) AddCycle

func (_u *CycleOrderUpdate) AddCycle(v float64) *CycleOrderUpdate

AddCycle adds value to the "cycle" field.

func (*CycleOrderUpdate) ClearResourceID

func (_u *CycleOrderUpdate) ClearResourceID() *CycleOrderUpdate

ClearResourceID clears the value of the "resource_id" field.

func (*CycleOrderUpdate) Exec

func (_u *CycleOrderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleOrderUpdate) ExecX

func (_u *CycleOrderUpdate) ExecX(ctx context.Context)

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

func (*CycleOrderUpdate) Mutation

func (_u *CycleOrderUpdate) Mutation() *CycleOrderMutation

Mutation returns the CycleOrderMutation object of the builder.

func (*CycleOrderUpdate) Save

func (_u *CycleOrderUpdate) Save(ctx context.Context) (int, error)

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

func (*CycleOrderUpdate) SaveX

func (_u *CycleOrderUpdate) SaveX(ctx context.Context) int

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

func (*CycleOrderUpdate) SetCreateTime

func (_u *CycleOrderUpdate) SetCreateTime(v time.Time) *CycleOrderUpdate

SetCreateTime sets the "create_time" field.

func (*CycleOrderUpdate) SetCycle

func (_u *CycleOrderUpdate) SetCycle(v float64) *CycleOrderUpdate

SetCycle sets the "cycle" field.

func (*CycleOrderUpdate) SetFkUserID

func (_u *CycleOrderUpdate) SetFkUserID(v uuid.UUID) *CycleOrderUpdate

SetFkUserID sets the "fk_user_id" field.

func (*CycleOrderUpdate) SetNillableCreateTime

func (_u *CycleOrderUpdate) SetNillableCreateTime(v *time.Time) *CycleOrderUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleOrderUpdate) SetNillableCycle

func (_u *CycleOrderUpdate) SetNillableCycle(v *float64) *CycleOrderUpdate

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleOrderUpdate) SetNillableFkUserID

func (_u *CycleOrderUpdate) SetNillableFkUserID(v *uuid.UUID) *CycleOrderUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleOrderUpdate) SetNillableOrderNo

func (_u *CycleOrderUpdate) SetNillableOrderNo(v *string) *CycleOrderUpdate

SetNillableOrderNo sets the "order_no" field if the given value is not nil.

func (*CycleOrderUpdate) SetNillableProductDesc

func (_u *CycleOrderUpdate) SetNillableProductDesc(v *string) *CycleOrderUpdate

SetNillableProductDesc sets the "product_desc" field if the given value is not nil.

func (*CycleOrderUpdate) SetNillableProductName

func (_u *CycleOrderUpdate) SetNillableProductName(v *string) *CycleOrderUpdate

SetNillableProductName sets the "product_name" field if the given value is not nil.

func (*CycleOrderUpdate) SetNillableResourceID

func (_u *CycleOrderUpdate) SetNillableResourceID(v *string) *CycleOrderUpdate

SetNillableResourceID sets the "resource_id" field if the given value is not nil.

func (*CycleOrderUpdate) SetNillableSymbol

func (_u *CycleOrderUpdate) SetNillableSymbol(v *string) *CycleOrderUpdate

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*CycleOrderUpdate) SetOrderNo

func (_u *CycleOrderUpdate) SetOrderNo(v string) *CycleOrderUpdate

SetOrderNo sets the "order_no" field.

func (*CycleOrderUpdate) SetProductDesc

func (_u *CycleOrderUpdate) SetProductDesc(v string) *CycleOrderUpdate

SetProductDesc sets the "product_desc" field.

func (*CycleOrderUpdate) SetProductName

func (_u *CycleOrderUpdate) SetProductName(v string) *CycleOrderUpdate

SetProductName sets the "product_name" field.

func (*CycleOrderUpdate) SetResourceID

func (_u *CycleOrderUpdate) SetResourceID(v string) *CycleOrderUpdate

SetResourceID sets the "resource_id" field.

func (*CycleOrderUpdate) SetSymbol

func (_u *CycleOrderUpdate) SetSymbol(v string) *CycleOrderUpdate

SetSymbol sets the "symbol" field.

func (*CycleOrderUpdate) Where

Where appends a list predicates to the CycleOrderUpdate builder.

type CycleOrderUpdateOne

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

CycleOrderUpdateOne is the builder for updating a single CycleOrder entity.

func (*CycleOrderUpdateOne) AddCycle

AddCycle adds value to the "cycle" field.

func (*CycleOrderUpdateOne) ClearResourceID

func (_u *CycleOrderUpdateOne) ClearResourceID() *CycleOrderUpdateOne

ClearResourceID clears the value of the "resource_id" field.

func (*CycleOrderUpdateOne) Exec

func (_u *CycleOrderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CycleOrderUpdateOne) ExecX

func (_u *CycleOrderUpdateOne) ExecX(ctx context.Context)

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

func (*CycleOrderUpdateOne) Mutation

func (_u *CycleOrderUpdateOne) Mutation() *CycleOrderMutation

Mutation returns the CycleOrderMutation object of the builder.

func (*CycleOrderUpdateOne) Save

Save executes the query and returns the updated CycleOrder entity.

func (*CycleOrderUpdateOne) SaveX

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

func (*CycleOrderUpdateOne) Select

func (_u *CycleOrderUpdateOne) Select(field string, fields ...string) *CycleOrderUpdateOne

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

func (*CycleOrderUpdateOne) SetCreateTime

func (_u *CycleOrderUpdateOne) SetCreateTime(v time.Time) *CycleOrderUpdateOne

SetCreateTime sets the "create_time" field.

func (*CycleOrderUpdateOne) SetCycle

SetCycle sets the "cycle" field.

func (*CycleOrderUpdateOne) SetFkUserID

func (_u *CycleOrderUpdateOne) SetFkUserID(v uuid.UUID) *CycleOrderUpdateOne

SetFkUserID sets the "fk_user_id" field.

func (*CycleOrderUpdateOne) SetNillableCreateTime

func (_u *CycleOrderUpdateOne) SetNillableCreateTime(v *time.Time) *CycleOrderUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetNillableCycle

func (_u *CycleOrderUpdateOne) SetNillableCycle(v *float64) *CycleOrderUpdateOne

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetNillableFkUserID

func (_u *CycleOrderUpdateOne) SetNillableFkUserID(v *uuid.UUID) *CycleOrderUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetNillableOrderNo

func (_u *CycleOrderUpdateOne) SetNillableOrderNo(v *string) *CycleOrderUpdateOne

SetNillableOrderNo sets the "order_no" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetNillableProductDesc

func (_u *CycleOrderUpdateOne) SetNillableProductDesc(v *string) *CycleOrderUpdateOne

SetNillableProductDesc sets the "product_desc" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetNillableProductName

func (_u *CycleOrderUpdateOne) SetNillableProductName(v *string) *CycleOrderUpdateOne

SetNillableProductName sets the "product_name" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetNillableResourceID

func (_u *CycleOrderUpdateOne) SetNillableResourceID(v *string) *CycleOrderUpdateOne

SetNillableResourceID sets the "resource_id" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetNillableSymbol

func (_u *CycleOrderUpdateOne) SetNillableSymbol(v *string) *CycleOrderUpdateOne

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*CycleOrderUpdateOne) SetOrderNo

func (_u *CycleOrderUpdateOne) SetOrderNo(v string) *CycleOrderUpdateOne

SetOrderNo sets the "order_no" field.

func (*CycleOrderUpdateOne) SetProductDesc

func (_u *CycleOrderUpdateOne) SetProductDesc(v string) *CycleOrderUpdateOne

SetProductDesc sets the "product_desc" field.

func (*CycleOrderUpdateOne) SetProductName

func (_u *CycleOrderUpdateOne) SetProductName(v string) *CycleOrderUpdateOne

SetProductName sets the "product_name" field.

func (*CycleOrderUpdateOne) SetResourceID

func (_u *CycleOrderUpdateOne) SetResourceID(v string) *CycleOrderUpdateOne

SetResourceID sets the "resource_id" field.

func (*CycleOrderUpdateOne) SetSymbol

SetSymbol sets the "symbol" field.

func (*CycleOrderUpdateOne) Where

Where appends a list predicates to the CycleOrderUpdate builder.

type CycleOrders

type CycleOrders []*CycleOrder

CycleOrders is a parsable slice of CycleOrder.

type CycleQuery

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

CycleQuery is the builder for querying Cycle entities.

func (*CycleQuery) Aggregate

func (_q *CycleQuery) Aggregate(fns ...AggregateFunc) *CycleSelect

Aggregate returns a CycleSelect configured with the given aggregations.

func (*CycleQuery) All

func (_q *CycleQuery) All(ctx context.Context) ([]*Cycle, error)

All executes the query and returns a list of Cycles.

func (*CycleQuery) AllX

func (_q *CycleQuery) AllX(ctx context.Context) []*Cycle

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

func (*CycleQuery) Clone

func (_q *CycleQuery) Clone() *CycleQuery

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

func (*CycleQuery) Count

func (_q *CycleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CycleQuery) CountX

func (_q *CycleQuery) CountX(ctx context.Context) int

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

func (*CycleQuery) Exist

func (_q *CycleQuery) Exist(ctx context.Context) (bool, error)

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

func (*CycleQuery) ExistX

func (_q *CycleQuery) ExistX(ctx context.Context) bool

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

func (*CycleQuery) First

func (_q *CycleQuery) First(ctx context.Context) (*Cycle, error)

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

func (*CycleQuery) FirstID

func (_q *CycleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CycleQuery) FirstIDX

func (_q *CycleQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CycleQuery) FirstX

func (_q *CycleQuery) FirstX(ctx context.Context) *Cycle

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

func (*CycleQuery) GroupBy

func (_q *CycleQuery) GroupBy(field string, fields ...string) *CycleGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Cycle.Query().
	GroupBy(cycle.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CycleQuery) IDs

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

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

func (*CycleQuery) IDsX

func (_q *CycleQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CycleQuery) Limit

func (_q *CycleQuery) Limit(limit int) *CycleQuery

Limit the number of records to be returned by this query.

func (*CycleQuery) Offset

func (_q *CycleQuery) Offset(offset int) *CycleQuery

Offset to start from.

func (*CycleQuery) Only

func (_q *CycleQuery) Only(ctx context.Context) (*Cycle, error)

Only returns a single Cycle entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Cycle entity is found. Returns a *NotFoundError when no Cycle entities are found.

func (*CycleQuery) OnlyID

func (_q *CycleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Cycle ID in the query. Returns a *NotSingularError when more than one Cycle ID is found. Returns a *NotFoundError when no entities are found.

func (*CycleQuery) OnlyIDX

func (_q *CycleQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CycleQuery) OnlyX

func (_q *CycleQuery) OnlyX(ctx context.Context) *Cycle

OnlyX is like Only, but panics if an error occurs.

func (*CycleQuery) Order

func (_q *CycleQuery) Order(o ...cycle.OrderOption) *CycleQuery

Order specifies how the records should be ordered.

func (*CycleQuery) Select

func (_q *CycleQuery) Select(fields ...string) *CycleSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.Cycle.Query().
	Select(cycle.FieldFkUserID).
	Scan(ctx, &v)

func (*CycleQuery) Unique

func (_q *CycleQuery) Unique(unique bool) *CycleQuery

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 (*CycleQuery) Where

func (_q *CycleQuery) Where(ps ...predicate.Cycle) *CycleQuery

Where adds a new predicate for the CycleQuery builder.

type CycleRecharge

type CycleRecharge struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// 商家订单号
	OutTradeNo string `json:"out_trade_no,omitempty"`
	// 支付宝订单号
	AlipayTradeNo string `json:"alipay_trade_no,omitempty"`
	// 充值渠道
	RechargeChannel int `json:"recharge_channel,omitempty"`
	// 兑换码
	RedeemCode string `json:"redeem_code,omitempty"`
	// 状态
	State string `json:"state,omitempty"`
	// 支付的钱
	PayAmount float64 `json:"pay_amount,omitempty"`
	// 收到的钱
	TotalAmount float64 `json:"total_amount,omitempty"`
	// 购买的周期
	BuyCycle float64 `json:"buy_cycle,omitempty"`
	// 创建时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// 更新时间
	UpdateTime time.Time `json:"update_time,omitempty"`
	// contains filtered or unexported fields
}

CycleRecharge is the model entity for the CycleRecharge schema.

func (*CycleRecharge) String

func (_m *CycleRecharge) String() string

String implements the fmt.Stringer.

func (*CycleRecharge) Unwrap

func (_m *CycleRecharge) Unwrap() *CycleRecharge

Unwrap unwraps the CycleRecharge 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 (*CycleRecharge) Update

func (_m *CycleRecharge) Update() *CycleRechargeUpdateOne

Update returns a builder for updating this CycleRecharge. Note that you need to call CycleRecharge.Unwrap() before calling this method if this CycleRecharge was returned from a transaction, and the transaction was committed or rolled back.

func (*CycleRecharge) Value

func (_m *CycleRecharge) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the CycleRecharge. This includes values selected through modifiers, order, etc.

type CycleRechargeClient

type CycleRechargeClient struct {
	// contains filtered or unexported fields
}

CycleRechargeClient is a client for the CycleRecharge schema.

func NewCycleRechargeClient

func NewCycleRechargeClient(c config) *CycleRechargeClient

NewCycleRechargeClient returns a client for the CycleRecharge from the given config.

func (*CycleRechargeClient) Create

Create returns a builder for creating a CycleRecharge entity.

func (*CycleRechargeClient) CreateBulk

CreateBulk returns a builder for creating a bulk of CycleRecharge entities.

func (*CycleRechargeClient) Delete

Delete returns a delete builder for CycleRecharge.

func (*CycleRechargeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CycleRechargeClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CycleRechargeClient) Get

Get returns a CycleRecharge entity by its id.

func (*CycleRechargeClient) GetX

GetX is like Get, but panics if an error occurs.

func (*CycleRechargeClient) Hooks

func (c *CycleRechargeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CycleRechargeClient) Intercept

func (c *CycleRechargeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cyclerecharge.Intercept(f(g(h())))`.

func (*CycleRechargeClient) Interceptors

func (c *CycleRechargeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CycleRechargeClient) MapCreateBulk

func (c *CycleRechargeClient) MapCreateBulk(slice any, setFunc func(*CycleRechargeCreate, int)) *CycleRechargeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CycleRechargeClient) Query

Query returns a query builder for CycleRecharge.

func (*CycleRechargeClient) Update

Update returns an update builder for CycleRecharge.

func (*CycleRechargeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CycleRechargeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*CycleRechargeClient) Use

func (c *CycleRechargeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cyclerecharge.Hooks(f(g(h())))`.

type CycleRechargeCreate

type CycleRechargeCreate struct {
	// contains filtered or unexported fields
}

CycleRechargeCreate is the builder for creating a CycleRecharge entity.

func (*CycleRechargeCreate) Exec

func (_c *CycleRechargeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleRechargeCreate) ExecX

func (_c *CycleRechargeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRechargeCreate) Mutation

Mutation returns the CycleRechargeMutation object of the builder.

func (*CycleRechargeCreate) Save

Save creates the CycleRecharge in the database.

func (*CycleRechargeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CycleRechargeCreate) SetAlipayTradeNo

func (_c *CycleRechargeCreate) SetAlipayTradeNo(v string) *CycleRechargeCreate

SetAlipayTradeNo sets the "alipay_trade_no" field.

func (*CycleRechargeCreate) SetBuyCycle

func (_c *CycleRechargeCreate) SetBuyCycle(v float64) *CycleRechargeCreate

SetBuyCycle sets the "buy_cycle" field.

func (*CycleRechargeCreate) SetCreateTime

func (_c *CycleRechargeCreate) SetCreateTime(v time.Time) *CycleRechargeCreate

SetCreateTime sets the "create_time" field.

func (*CycleRechargeCreate) SetFkUserID

func (_c *CycleRechargeCreate) SetFkUserID(v uuid.UUID) *CycleRechargeCreate

SetFkUserID sets the "fk_user_id" field.

func (*CycleRechargeCreate) SetID

SetID sets the "id" field.

func (*CycleRechargeCreate) SetNillableID

func (_c *CycleRechargeCreate) SetNillableID(v *uuid.UUID) *CycleRechargeCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CycleRechargeCreate) SetOutTradeNo

func (_c *CycleRechargeCreate) SetOutTradeNo(v string) *CycleRechargeCreate

SetOutTradeNo sets the "out_trade_no" field.

func (*CycleRechargeCreate) SetPayAmount

func (_c *CycleRechargeCreate) SetPayAmount(v float64) *CycleRechargeCreate

SetPayAmount sets the "pay_amount" field.

func (*CycleRechargeCreate) SetRechargeChannel

func (_c *CycleRechargeCreate) SetRechargeChannel(v int) *CycleRechargeCreate

SetRechargeChannel sets the "recharge_channel" field.

func (*CycleRechargeCreate) SetRedeemCode

func (_c *CycleRechargeCreate) SetRedeemCode(v string) *CycleRechargeCreate

SetRedeemCode sets the "redeem_code" field.

func (*CycleRechargeCreate) SetState

SetState sets the "state" field.

func (*CycleRechargeCreate) SetTotalAmount

func (_c *CycleRechargeCreate) SetTotalAmount(v float64) *CycleRechargeCreate

SetTotalAmount sets the "total_amount" field.

func (*CycleRechargeCreate) SetUpdateTime

func (_c *CycleRechargeCreate) SetUpdateTime(v time.Time) *CycleRechargeCreate

SetUpdateTime sets the "update_time" field.

type CycleRechargeCreateBulk

type CycleRechargeCreateBulk struct {
	// contains filtered or unexported fields
}

CycleRechargeCreateBulk is the builder for creating many CycleRecharge entities in bulk.

func (*CycleRechargeCreateBulk) Exec

Exec executes the query.

func (*CycleRechargeCreateBulk) ExecX

func (_c *CycleRechargeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRechargeCreateBulk) Save

Save creates the CycleRecharge entities in the database.

func (*CycleRechargeCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type CycleRechargeDelete

type CycleRechargeDelete struct {
	// contains filtered or unexported fields
}

CycleRechargeDelete is the builder for deleting a CycleRecharge entity.

func (*CycleRechargeDelete) Exec

func (_d *CycleRechargeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CycleRechargeDelete) ExecX

func (_d *CycleRechargeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CycleRechargeDelete) Where

Where appends a list predicates to the CycleRechargeDelete builder.

type CycleRechargeDeleteOne

type CycleRechargeDeleteOne struct {
	// contains filtered or unexported fields
}

CycleRechargeDeleteOne is the builder for deleting a single CycleRecharge entity.

func (*CycleRechargeDeleteOne) Exec

Exec executes the deletion query.

func (*CycleRechargeDeleteOne) ExecX

func (_d *CycleRechargeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRechargeDeleteOne) Where

Where appends a list predicates to the CycleRechargeDelete builder.

type CycleRechargeGroupBy

type CycleRechargeGroupBy struct {
	// contains filtered or unexported fields
}

CycleRechargeGroupBy is the group-by builder for CycleRecharge entities.

func (*CycleRechargeGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*CycleRechargeGroupBy) Bool

func (s *CycleRechargeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) BoolX

func (s *CycleRechargeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleRechargeGroupBy) Bools

func (s *CycleRechargeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) BoolsX

func (s *CycleRechargeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleRechargeGroupBy) Float64

func (s *CycleRechargeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) Float64X

func (s *CycleRechargeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleRechargeGroupBy) Float64s

func (s *CycleRechargeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) Float64sX

func (s *CycleRechargeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleRechargeGroupBy) Int

func (s *CycleRechargeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) IntX

func (s *CycleRechargeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleRechargeGroupBy) Ints

func (s *CycleRechargeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) IntsX

func (s *CycleRechargeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleRechargeGroupBy) Scan

func (_g *CycleRechargeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleRechargeGroupBy) ScanX

func (s *CycleRechargeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleRechargeGroupBy) String

func (s *CycleRechargeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) StringX

func (s *CycleRechargeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleRechargeGroupBy) Strings

func (s *CycleRechargeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleRechargeGroupBy) StringsX

func (s *CycleRechargeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleRechargeMutation

type CycleRechargeMutation struct {
	// contains filtered or unexported fields
}

CycleRechargeMutation represents an operation that mutates the CycleRecharge nodes in the graph.

func (*CycleRechargeMutation) AddBuyCycle

func (m *CycleRechargeMutation) AddBuyCycle(f float64)

AddBuyCycle adds f to the "buy_cycle" field.

func (*CycleRechargeMutation) AddField

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) AddPayAmount

func (m *CycleRechargeMutation) AddPayAmount(f float64)

AddPayAmount adds f to the "pay_amount" field.

func (*CycleRechargeMutation) AddRechargeChannel

func (m *CycleRechargeMutation) AddRechargeChannel(i int)

AddRechargeChannel adds i to the "recharge_channel" field.

func (*CycleRechargeMutation) AddTotalAmount

func (m *CycleRechargeMutation) AddTotalAmount(f float64)

AddTotalAmount adds f to the "total_amount" field.

func (*CycleRechargeMutation) AddedBuyCycle

func (m *CycleRechargeMutation) AddedBuyCycle() (r float64, exists bool)

AddedBuyCycle returns the value that was added to the "buy_cycle" field in this mutation.

func (*CycleRechargeMutation) AddedEdges

func (m *CycleRechargeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CycleRechargeMutation) AddedField

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) AddedFields

func (m *CycleRechargeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CycleRechargeMutation) AddedIDs

func (m *CycleRechargeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CycleRechargeMutation) AddedPayAmount

func (m *CycleRechargeMutation) AddedPayAmount() (r float64, exists bool)

AddedPayAmount returns the value that was added to the "pay_amount" field in this mutation.

func (*CycleRechargeMutation) AddedRechargeChannel

func (m *CycleRechargeMutation) AddedRechargeChannel() (r int, exists bool)

AddedRechargeChannel returns the value that was added to the "recharge_channel" field in this mutation.

func (*CycleRechargeMutation) AddedTotalAmount

func (m *CycleRechargeMutation) AddedTotalAmount() (r float64, exists bool)

AddedTotalAmount returns the value that was added to the "total_amount" field in this mutation.

func (*CycleRechargeMutation) AlipayTradeNo

func (m *CycleRechargeMutation) AlipayTradeNo() (r string, exists bool)

AlipayTradeNo returns the value of the "alipay_trade_no" field in the mutation.

func (*CycleRechargeMutation) BuyCycle

func (m *CycleRechargeMutation) BuyCycle() (r float64, exists bool)

BuyCycle returns the value of the "buy_cycle" field in the mutation.

func (*CycleRechargeMutation) ClearEdge

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) ClearField

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) ClearedEdges

func (m *CycleRechargeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CycleRechargeMutation) ClearedFields

func (m *CycleRechargeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CycleRechargeMutation) Client

func (m CycleRechargeMutation) 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 (*CycleRechargeMutation) CreateTime

func (m *CycleRechargeMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*CycleRechargeMutation) EdgeCleared

func (m *CycleRechargeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CycleRechargeMutation) Field

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) FieldCleared

func (m *CycleRechargeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CycleRechargeMutation) Fields

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) FkUserID

func (m *CycleRechargeMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*CycleRechargeMutation) ID

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) 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 (*CycleRechargeMutation) OldAlipayTradeNo

func (m *CycleRechargeMutation) OldAlipayTradeNo(ctx context.Context) (v string, err error)

OldAlipayTradeNo returns the old "alipay_trade_no" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldBuyCycle

func (m *CycleRechargeMutation) OldBuyCycle(ctx context.Context) (v float64, err error)

OldBuyCycle returns the old "buy_cycle" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldCreateTime

func (m *CycleRechargeMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldField

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) OldFkUserID

func (m *CycleRechargeMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldOutTradeNo

func (m *CycleRechargeMutation) OldOutTradeNo(ctx context.Context) (v string, err error)

OldOutTradeNo returns the old "out_trade_no" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldPayAmount

func (m *CycleRechargeMutation) OldPayAmount(ctx context.Context) (v float64, err error)

OldPayAmount returns the old "pay_amount" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldRechargeChannel

func (m *CycleRechargeMutation) OldRechargeChannel(ctx context.Context) (v int, err error)

OldRechargeChannel returns the old "recharge_channel" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldRedeemCode

func (m *CycleRechargeMutation) OldRedeemCode(ctx context.Context) (v string, err error)

OldRedeemCode returns the old "redeem_code" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldState

func (m *CycleRechargeMutation) OldState(ctx context.Context) (v string, err error)

OldState returns the old "state" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldTotalAmount

func (m *CycleRechargeMutation) OldTotalAmount(ctx context.Context) (v float64, err error)

OldTotalAmount returns the old "total_amount" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) OldUpdateTime

func (m *CycleRechargeMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the CycleRecharge entity. If the CycleRecharge 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 (*CycleRechargeMutation) Op

func (m *CycleRechargeMutation) Op() Op

Op returns the operation name.

func (*CycleRechargeMutation) OutTradeNo

func (m *CycleRechargeMutation) OutTradeNo() (r string, exists bool)

OutTradeNo returns the value of the "out_trade_no" field in the mutation.

func (*CycleRechargeMutation) PayAmount

func (m *CycleRechargeMutation) PayAmount() (r float64, exists bool)

PayAmount returns the value of the "pay_amount" field in the mutation.

func (*CycleRechargeMutation) RechargeChannel

func (m *CycleRechargeMutation) RechargeChannel() (r int, exists bool)

RechargeChannel returns the value of the "recharge_channel" field in the mutation.

func (*CycleRechargeMutation) RedeemCode

func (m *CycleRechargeMutation) RedeemCode() (r string, exists bool)

RedeemCode returns the value of the "redeem_code" field in the mutation.

func (*CycleRechargeMutation) RemovedEdges

func (m *CycleRechargeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CycleRechargeMutation) RemovedIDs

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) ResetAlipayTradeNo

func (m *CycleRechargeMutation) ResetAlipayTradeNo()

ResetAlipayTradeNo resets all changes to the "alipay_trade_no" field.

func (*CycleRechargeMutation) ResetBuyCycle

func (m *CycleRechargeMutation) ResetBuyCycle()

ResetBuyCycle resets all changes to the "buy_cycle" field.

func (*CycleRechargeMutation) ResetCreateTime

func (m *CycleRechargeMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*CycleRechargeMutation) ResetEdge

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) ResetField

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) ResetFkUserID

func (m *CycleRechargeMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*CycleRechargeMutation) ResetOutTradeNo

func (m *CycleRechargeMutation) ResetOutTradeNo()

ResetOutTradeNo resets all changes to the "out_trade_no" field.

func (*CycleRechargeMutation) ResetPayAmount

func (m *CycleRechargeMutation) ResetPayAmount()

ResetPayAmount resets all changes to the "pay_amount" field.

func (*CycleRechargeMutation) ResetRechargeChannel

func (m *CycleRechargeMutation) ResetRechargeChannel()

ResetRechargeChannel resets all changes to the "recharge_channel" field.

func (*CycleRechargeMutation) ResetRedeemCode

func (m *CycleRechargeMutation) ResetRedeemCode()

ResetRedeemCode resets all changes to the "redeem_code" field.

func (*CycleRechargeMutation) ResetState

func (m *CycleRechargeMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*CycleRechargeMutation) ResetTotalAmount

func (m *CycleRechargeMutation) ResetTotalAmount()

ResetTotalAmount resets all changes to the "total_amount" field.

func (*CycleRechargeMutation) ResetUpdateTime

func (m *CycleRechargeMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*CycleRechargeMutation) SetAlipayTradeNo

func (m *CycleRechargeMutation) SetAlipayTradeNo(s string)

SetAlipayTradeNo sets the "alipay_trade_no" field.

func (*CycleRechargeMutation) SetBuyCycle

func (m *CycleRechargeMutation) SetBuyCycle(f float64)

SetBuyCycle sets the "buy_cycle" field.

func (*CycleRechargeMutation) SetCreateTime

func (m *CycleRechargeMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*CycleRechargeMutation) SetField

func (m *CycleRechargeMutation) 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 (*CycleRechargeMutation) SetFkUserID

func (m *CycleRechargeMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*CycleRechargeMutation) SetID

func (m *CycleRechargeMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of CycleRecharge entities.

func (*CycleRechargeMutation) SetOp

func (m *CycleRechargeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CycleRechargeMutation) SetOutTradeNo

func (m *CycleRechargeMutation) SetOutTradeNo(s string)

SetOutTradeNo sets the "out_trade_no" field.

func (*CycleRechargeMutation) SetPayAmount

func (m *CycleRechargeMutation) SetPayAmount(f float64)

SetPayAmount sets the "pay_amount" field.

func (*CycleRechargeMutation) SetRechargeChannel

func (m *CycleRechargeMutation) SetRechargeChannel(i int)

SetRechargeChannel sets the "recharge_channel" field.

func (*CycleRechargeMutation) SetRedeemCode

func (m *CycleRechargeMutation) SetRedeemCode(s string)

SetRedeemCode sets the "redeem_code" field.

func (*CycleRechargeMutation) SetState

func (m *CycleRechargeMutation) SetState(s string)

SetState sets the "state" field.

func (*CycleRechargeMutation) SetTotalAmount

func (m *CycleRechargeMutation) SetTotalAmount(f float64)

SetTotalAmount sets the "total_amount" field.

func (*CycleRechargeMutation) SetUpdateTime

func (m *CycleRechargeMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*CycleRechargeMutation) State

func (m *CycleRechargeMutation) State() (r string, exists bool)

State returns the value of the "state" field in the mutation.

func (*CycleRechargeMutation) TotalAmount

func (m *CycleRechargeMutation) TotalAmount() (r float64, exists bool)

TotalAmount returns the value of the "total_amount" field in the mutation.

func (CycleRechargeMutation) Tx

func (m CycleRechargeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CycleRechargeMutation) Type

func (m *CycleRechargeMutation) Type() string

Type returns the node type of this mutation (CycleRecharge).

func (*CycleRechargeMutation) UpdateTime

func (m *CycleRechargeMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*CycleRechargeMutation) Where

Where appends a list predicates to the CycleRechargeMutation builder.

func (*CycleRechargeMutation) WhereP

func (m *CycleRechargeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CycleRechargeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CycleRechargeQuery

type CycleRechargeQuery struct {
	// contains filtered or unexported fields
}

CycleRechargeQuery is the builder for querying CycleRecharge entities.

func (*CycleRechargeQuery) Aggregate

func (_q *CycleRechargeQuery) Aggregate(fns ...AggregateFunc) *CycleRechargeSelect

Aggregate returns a CycleRechargeSelect configured with the given aggregations.

func (*CycleRechargeQuery) All

All executes the query and returns a list of CycleRecharges.

func (*CycleRechargeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*CycleRechargeQuery) Clone

Clone returns a duplicate of the CycleRechargeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CycleRechargeQuery) Count

func (_q *CycleRechargeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CycleRechargeQuery) CountX

func (_q *CycleRechargeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CycleRechargeQuery) Exist

func (_q *CycleRechargeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CycleRechargeQuery) ExistX

func (_q *CycleRechargeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CycleRechargeQuery) First

First returns the first CycleRecharge entity from the query. Returns a *NotFoundError when no CycleRecharge was found.

func (*CycleRechargeQuery) FirstID

func (_q *CycleRechargeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first CycleRecharge ID from the query. Returns a *NotFoundError when no CycleRecharge ID was found.

func (*CycleRechargeQuery) FirstIDX

func (_q *CycleRechargeQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*CycleRechargeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*CycleRechargeQuery) GroupBy

func (_q *CycleRechargeQuery) GroupBy(field string, fields ...string) *CycleRechargeGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CycleRecharge.Query().
	GroupBy(cyclerecharge.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CycleRechargeQuery) IDs

func (_q *CycleRechargeQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of CycleRecharge IDs.

func (*CycleRechargeQuery) IDsX

func (_q *CycleRechargeQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*CycleRechargeQuery) Limit

func (_q *CycleRechargeQuery) Limit(limit int) *CycleRechargeQuery

Limit the number of records to be returned by this query.

func (*CycleRechargeQuery) Offset

func (_q *CycleRechargeQuery) Offset(offset int) *CycleRechargeQuery

Offset to start from.

func (*CycleRechargeQuery) Only

Only returns a single CycleRecharge entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CycleRecharge entity is found. Returns a *NotFoundError when no CycleRecharge entities are found.

func (*CycleRechargeQuery) OnlyID

func (_q *CycleRechargeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only CycleRecharge ID in the query. Returns a *NotSingularError when more than one CycleRecharge ID is found. Returns a *NotFoundError when no entities are found.

func (*CycleRechargeQuery) OnlyIDX

func (_q *CycleRechargeQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CycleRechargeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*CycleRechargeQuery) Order

Order specifies how the records should be ordered.

func (*CycleRechargeQuery) Select

func (_q *CycleRechargeQuery) Select(fields ...string) *CycleRechargeSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.CycleRecharge.Query().
	Select(cyclerecharge.FieldFkUserID).
	Scan(ctx, &v)

func (*CycleRechargeQuery) Unique

func (_q *CycleRechargeQuery) Unique(unique bool) *CycleRechargeQuery

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 (*CycleRechargeQuery) Where

Where adds a new predicate for the CycleRechargeQuery builder.

type CycleRechargeSelect

type CycleRechargeSelect struct {
	*CycleRechargeQuery
	// contains filtered or unexported fields
}

CycleRechargeSelect is the builder for selecting fields of CycleRecharge entities.

func (*CycleRechargeSelect) Aggregate

func (_s *CycleRechargeSelect) Aggregate(fns ...AggregateFunc) *CycleRechargeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CycleRechargeSelect) Bool

func (s *CycleRechargeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) BoolX

func (s *CycleRechargeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleRechargeSelect) Bools

func (s *CycleRechargeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) BoolsX

func (s *CycleRechargeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleRechargeSelect) Float64

func (s *CycleRechargeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) Float64X

func (s *CycleRechargeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleRechargeSelect) Float64s

func (s *CycleRechargeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) Float64sX

func (s *CycleRechargeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleRechargeSelect) Int

func (s *CycleRechargeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) IntX

func (s *CycleRechargeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleRechargeSelect) Ints

func (s *CycleRechargeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) IntsX

func (s *CycleRechargeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleRechargeSelect) Scan

func (_s *CycleRechargeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleRechargeSelect) ScanX

func (s *CycleRechargeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleRechargeSelect) String

func (s *CycleRechargeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) StringX

func (s *CycleRechargeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleRechargeSelect) Strings

func (s *CycleRechargeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleRechargeSelect) StringsX

func (s *CycleRechargeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleRechargeUpdate

type CycleRechargeUpdate struct {
	// contains filtered or unexported fields
}

CycleRechargeUpdate is the builder for updating CycleRecharge entities.

func (*CycleRechargeUpdate) AddBuyCycle

func (_u *CycleRechargeUpdate) AddBuyCycle(v float64) *CycleRechargeUpdate

AddBuyCycle adds value to the "buy_cycle" field.

func (*CycleRechargeUpdate) AddPayAmount

func (_u *CycleRechargeUpdate) AddPayAmount(v float64) *CycleRechargeUpdate

AddPayAmount adds value to the "pay_amount" field.

func (*CycleRechargeUpdate) AddRechargeChannel

func (_u *CycleRechargeUpdate) AddRechargeChannel(v int) *CycleRechargeUpdate

AddRechargeChannel adds value to the "recharge_channel" field.

func (*CycleRechargeUpdate) AddTotalAmount

func (_u *CycleRechargeUpdate) AddTotalAmount(v float64) *CycleRechargeUpdate

AddTotalAmount adds value to the "total_amount" field.

func (*CycleRechargeUpdate) Exec

func (_u *CycleRechargeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleRechargeUpdate) ExecX

func (_u *CycleRechargeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRechargeUpdate) Mutation

Mutation returns the CycleRechargeMutation object of the builder.

func (*CycleRechargeUpdate) Save

func (_u *CycleRechargeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CycleRechargeUpdate) SaveX

func (_u *CycleRechargeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CycleRechargeUpdate) SetAlipayTradeNo

func (_u *CycleRechargeUpdate) SetAlipayTradeNo(v string) *CycleRechargeUpdate

SetAlipayTradeNo sets the "alipay_trade_no" field.

func (*CycleRechargeUpdate) SetBuyCycle

func (_u *CycleRechargeUpdate) SetBuyCycle(v float64) *CycleRechargeUpdate

SetBuyCycle sets the "buy_cycle" field.

func (*CycleRechargeUpdate) SetCreateTime

func (_u *CycleRechargeUpdate) SetCreateTime(v time.Time) *CycleRechargeUpdate

SetCreateTime sets the "create_time" field.

func (*CycleRechargeUpdate) SetFkUserID

func (_u *CycleRechargeUpdate) SetFkUserID(v uuid.UUID) *CycleRechargeUpdate

SetFkUserID sets the "fk_user_id" field.

func (*CycleRechargeUpdate) SetNillableAlipayTradeNo

func (_u *CycleRechargeUpdate) SetNillableAlipayTradeNo(v *string) *CycleRechargeUpdate

SetNillableAlipayTradeNo sets the "alipay_trade_no" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableBuyCycle

func (_u *CycleRechargeUpdate) SetNillableBuyCycle(v *float64) *CycleRechargeUpdate

SetNillableBuyCycle sets the "buy_cycle" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableCreateTime

func (_u *CycleRechargeUpdate) SetNillableCreateTime(v *time.Time) *CycleRechargeUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableFkUserID

func (_u *CycleRechargeUpdate) SetNillableFkUserID(v *uuid.UUID) *CycleRechargeUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableOutTradeNo

func (_u *CycleRechargeUpdate) SetNillableOutTradeNo(v *string) *CycleRechargeUpdate

SetNillableOutTradeNo sets the "out_trade_no" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillablePayAmount

func (_u *CycleRechargeUpdate) SetNillablePayAmount(v *float64) *CycleRechargeUpdate

SetNillablePayAmount sets the "pay_amount" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableRechargeChannel

func (_u *CycleRechargeUpdate) SetNillableRechargeChannel(v *int) *CycleRechargeUpdate

SetNillableRechargeChannel sets the "recharge_channel" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableRedeemCode

func (_u *CycleRechargeUpdate) SetNillableRedeemCode(v *string) *CycleRechargeUpdate

SetNillableRedeemCode sets the "redeem_code" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableState

func (_u *CycleRechargeUpdate) SetNillableState(v *string) *CycleRechargeUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableTotalAmount

func (_u *CycleRechargeUpdate) SetNillableTotalAmount(v *float64) *CycleRechargeUpdate

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*CycleRechargeUpdate) SetNillableUpdateTime

func (_u *CycleRechargeUpdate) SetNillableUpdateTime(v *time.Time) *CycleRechargeUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CycleRechargeUpdate) SetOutTradeNo

func (_u *CycleRechargeUpdate) SetOutTradeNo(v string) *CycleRechargeUpdate

SetOutTradeNo sets the "out_trade_no" field.

func (*CycleRechargeUpdate) SetPayAmount

func (_u *CycleRechargeUpdate) SetPayAmount(v float64) *CycleRechargeUpdate

SetPayAmount sets the "pay_amount" field.

func (*CycleRechargeUpdate) SetRechargeChannel

func (_u *CycleRechargeUpdate) SetRechargeChannel(v int) *CycleRechargeUpdate

SetRechargeChannel sets the "recharge_channel" field.

func (*CycleRechargeUpdate) SetRedeemCode

func (_u *CycleRechargeUpdate) SetRedeemCode(v string) *CycleRechargeUpdate

SetRedeemCode sets the "redeem_code" field.

func (*CycleRechargeUpdate) SetState

SetState sets the "state" field.

func (*CycleRechargeUpdate) SetTotalAmount

func (_u *CycleRechargeUpdate) SetTotalAmount(v float64) *CycleRechargeUpdate

SetTotalAmount sets the "total_amount" field.

func (*CycleRechargeUpdate) SetUpdateTime

func (_u *CycleRechargeUpdate) SetUpdateTime(v time.Time) *CycleRechargeUpdate

SetUpdateTime sets the "update_time" field.

func (*CycleRechargeUpdate) Where

Where appends a list predicates to the CycleRechargeUpdate builder.

type CycleRechargeUpdateOne

type CycleRechargeUpdateOne struct {
	// contains filtered or unexported fields
}

CycleRechargeUpdateOne is the builder for updating a single CycleRecharge entity.

func (*CycleRechargeUpdateOne) AddBuyCycle

AddBuyCycle adds value to the "buy_cycle" field.

func (*CycleRechargeUpdateOne) AddPayAmount

AddPayAmount adds value to the "pay_amount" field.

func (*CycleRechargeUpdateOne) AddRechargeChannel

func (_u *CycleRechargeUpdateOne) AddRechargeChannel(v int) *CycleRechargeUpdateOne

AddRechargeChannel adds value to the "recharge_channel" field.

func (*CycleRechargeUpdateOne) AddTotalAmount

func (_u *CycleRechargeUpdateOne) AddTotalAmount(v float64) *CycleRechargeUpdateOne

AddTotalAmount adds value to the "total_amount" field.

func (*CycleRechargeUpdateOne) Exec

Exec executes the query on the entity.

func (*CycleRechargeUpdateOne) ExecX

func (_u *CycleRechargeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRechargeUpdateOne) Mutation

Mutation returns the CycleRechargeMutation object of the builder.

func (*CycleRechargeUpdateOne) Save

Save executes the query and returns the updated CycleRecharge entity.

func (*CycleRechargeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*CycleRechargeUpdateOne) Select

func (_u *CycleRechargeUpdateOne) Select(field string, fields ...string) *CycleRechargeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CycleRechargeUpdateOne) SetAlipayTradeNo

func (_u *CycleRechargeUpdateOne) SetAlipayTradeNo(v string) *CycleRechargeUpdateOne

SetAlipayTradeNo sets the "alipay_trade_no" field.

func (*CycleRechargeUpdateOne) SetBuyCycle

SetBuyCycle sets the "buy_cycle" field.

func (*CycleRechargeUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*CycleRechargeUpdateOne) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleRechargeUpdateOne) SetNillableAlipayTradeNo

func (_u *CycleRechargeUpdateOne) SetNillableAlipayTradeNo(v *string) *CycleRechargeUpdateOne

SetNillableAlipayTradeNo sets the "alipay_trade_no" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableBuyCycle

func (_u *CycleRechargeUpdateOne) SetNillableBuyCycle(v *float64) *CycleRechargeUpdateOne

SetNillableBuyCycle sets the "buy_cycle" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableCreateTime

func (_u *CycleRechargeUpdateOne) SetNillableCreateTime(v *time.Time) *CycleRechargeUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableFkUserID

func (_u *CycleRechargeUpdateOne) SetNillableFkUserID(v *uuid.UUID) *CycleRechargeUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableOutTradeNo

func (_u *CycleRechargeUpdateOne) SetNillableOutTradeNo(v *string) *CycleRechargeUpdateOne

SetNillableOutTradeNo sets the "out_trade_no" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillablePayAmount

func (_u *CycleRechargeUpdateOne) SetNillablePayAmount(v *float64) *CycleRechargeUpdateOne

SetNillablePayAmount sets the "pay_amount" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableRechargeChannel

func (_u *CycleRechargeUpdateOne) SetNillableRechargeChannel(v *int) *CycleRechargeUpdateOne

SetNillableRechargeChannel sets the "recharge_channel" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableRedeemCode

func (_u *CycleRechargeUpdateOne) SetNillableRedeemCode(v *string) *CycleRechargeUpdateOne

SetNillableRedeemCode sets the "redeem_code" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableState

func (_u *CycleRechargeUpdateOne) SetNillableState(v *string) *CycleRechargeUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableTotalAmount

func (_u *CycleRechargeUpdateOne) SetNillableTotalAmount(v *float64) *CycleRechargeUpdateOne

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetNillableUpdateTime

func (_u *CycleRechargeUpdateOne) SetNillableUpdateTime(v *time.Time) *CycleRechargeUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CycleRechargeUpdateOne) SetOutTradeNo

SetOutTradeNo sets the "out_trade_no" field.

func (*CycleRechargeUpdateOne) SetPayAmount

SetPayAmount sets the "pay_amount" field.

func (*CycleRechargeUpdateOne) SetRechargeChannel

func (_u *CycleRechargeUpdateOne) SetRechargeChannel(v int) *CycleRechargeUpdateOne

SetRechargeChannel sets the "recharge_channel" field.

func (*CycleRechargeUpdateOne) SetRedeemCode

SetRedeemCode sets the "redeem_code" field.

func (*CycleRechargeUpdateOne) SetState

SetState sets the "state" field.

func (*CycleRechargeUpdateOne) SetTotalAmount

func (_u *CycleRechargeUpdateOne) SetTotalAmount(v float64) *CycleRechargeUpdateOne

SetTotalAmount sets the "total_amount" field.

func (*CycleRechargeUpdateOne) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*CycleRechargeUpdateOne) Where

Where appends a list predicates to the CycleRechargeUpdate builder.

type CycleRecharges

type CycleRecharges []*CycleRecharge

CycleRecharges is a parsable slice of CycleRecharge.

type CycleRedeemCode

type CycleRedeemCode struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// 兑换码
	RedeemCode string `json:"redeem_code,omitempty"`
	// 兑换码对应的周期
	Cycle float64 `json:"cycle,omitempty"`
	// 状态
	State bool `json:"state,omitempty"`
	// 创建时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// 使用
	UseTime time.Time `json:"use_time,omitempty"`
	// contains filtered or unexported fields
}

CycleRedeemCode is the model entity for the CycleRedeemCode schema.

func (*CycleRedeemCode) String

func (_m *CycleRedeemCode) String() string

String implements the fmt.Stringer.

func (*CycleRedeemCode) Unwrap

func (_m *CycleRedeemCode) Unwrap() *CycleRedeemCode

Unwrap unwraps the CycleRedeemCode 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 (*CycleRedeemCode) Update

Update returns a builder for updating this CycleRedeemCode. Note that you need to call CycleRedeemCode.Unwrap() before calling this method if this CycleRedeemCode was returned from a transaction, and the transaction was committed or rolled back.

func (*CycleRedeemCode) Value

func (_m *CycleRedeemCode) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the CycleRedeemCode. This includes values selected through modifiers, order, etc.

type CycleRedeemCodeClient

type CycleRedeemCodeClient struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeClient is a client for the CycleRedeemCode schema.

func NewCycleRedeemCodeClient

func NewCycleRedeemCodeClient(c config) *CycleRedeemCodeClient

NewCycleRedeemCodeClient returns a client for the CycleRedeemCode from the given config.

func (*CycleRedeemCodeClient) Create

Create returns a builder for creating a CycleRedeemCode entity.

func (*CycleRedeemCodeClient) CreateBulk

CreateBulk returns a builder for creating a bulk of CycleRedeemCode entities.

func (*CycleRedeemCodeClient) Delete

Delete returns a delete builder for CycleRedeemCode.

func (*CycleRedeemCodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CycleRedeemCodeClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CycleRedeemCodeClient) Get

Get returns a CycleRedeemCode entity by its id.

func (*CycleRedeemCodeClient) GetX

GetX is like Get, but panics if an error occurs.

func (*CycleRedeemCodeClient) Hooks

func (c *CycleRedeemCodeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CycleRedeemCodeClient) Intercept

func (c *CycleRedeemCodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cycleredeemcode.Intercept(f(g(h())))`.

func (*CycleRedeemCodeClient) Interceptors

func (c *CycleRedeemCodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CycleRedeemCodeClient) MapCreateBulk

func (c *CycleRedeemCodeClient) MapCreateBulk(slice any, setFunc func(*CycleRedeemCodeCreate, int)) *CycleRedeemCodeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CycleRedeemCodeClient) Query

Query returns a query builder for CycleRedeemCode.

func (*CycleRedeemCodeClient) Update

Update returns an update builder for CycleRedeemCode.

func (*CycleRedeemCodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CycleRedeemCodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*CycleRedeemCodeClient) Use

func (c *CycleRedeemCodeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cycleredeemcode.Hooks(f(g(h())))`.

type CycleRedeemCodeCreate

type CycleRedeemCodeCreate struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeCreate is the builder for creating a CycleRedeemCode entity.

func (*CycleRedeemCodeCreate) Exec

Exec executes the query.

func (*CycleRedeemCodeCreate) ExecX

func (_c *CycleRedeemCodeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRedeemCodeCreate) Mutation

Mutation returns the CycleRedeemCodeMutation object of the builder.

func (*CycleRedeemCodeCreate) Save

Save creates the CycleRedeemCode in the database.

func (*CycleRedeemCodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CycleRedeemCodeCreate) SetCreateTime

func (_c *CycleRedeemCodeCreate) SetCreateTime(v time.Time) *CycleRedeemCodeCreate

SetCreateTime sets the "create_time" field.

func (*CycleRedeemCodeCreate) SetCycle

SetCycle sets the "cycle" field.

func (*CycleRedeemCodeCreate) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleRedeemCodeCreate) SetID

SetID sets the "id" field.

func (*CycleRedeemCodeCreate) SetNillableFkUserID

func (_c *CycleRedeemCodeCreate) SetNillableFkUserID(v *uuid.UUID) *CycleRedeemCodeCreate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleRedeemCodeCreate) SetNillableID

func (_c *CycleRedeemCodeCreate) SetNillableID(v *uuid.UUID) *CycleRedeemCodeCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CycleRedeemCodeCreate) SetNillableUseTime

func (_c *CycleRedeemCodeCreate) SetNillableUseTime(v *time.Time) *CycleRedeemCodeCreate

SetNillableUseTime sets the "use_time" field if the given value is not nil.

func (*CycleRedeemCodeCreate) SetRedeemCode

func (_c *CycleRedeemCodeCreate) SetRedeemCode(v string) *CycleRedeemCodeCreate

SetRedeemCode sets the "redeem_code" field.

func (*CycleRedeemCodeCreate) SetState

SetState sets the "state" field.

func (*CycleRedeemCodeCreate) SetUseTime

SetUseTime sets the "use_time" field.

type CycleRedeemCodeCreateBulk

type CycleRedeemCodeCreateBulk struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeCreateBulk is the builder for creating many CycleRedeemCode entities in bulk.

func (*CycleRedeemCodeCreateBulk) Exec

Exec executes the query.

func (*CycleRedeemCodeCreateBulk) ExecX

func (_c *CycleRedeemCodeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRedeemCodeCreateBulk) Save

Save creates the CycleRedeemCode entities in the database.

func (*CycleRedeemCodeCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type CycleRedeemCodeDelete

type CycleRedeemCodeDelete struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeDelete is the builder for deleting a CycleRedeemCode entity.

func (*CycleRedeemCodeDelete) Exec

func (_d *CycleRedeemCodeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CycleRedeemCodeDelete) ExecX

func (_d *CycleRedeemCodeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CycleRedeemCodeDelete) Where

Where appends a list predicates to the CycleRedeemCodeDelete builder.

type CycleRedeemCodeDeleteOne

type CycleRedeemCodeDeleteOne struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeDeleteOne is the builder for deleting a single CycleRedeemCode entity.

func (*CycleRedeemCodeDeleteOne) Exec

Exec executes the deletion query.

func (*CycleRedeemCodeDeleteOne) ExecX

func (_d *CycleRedeemCodeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRedeemCodeDeleteOne) Where

Where appends a list predicates to the CycleRedeemCodeDelete builder.

type CycleRedeemCodeGroupBy

type CycleRedeemCodeGroupBy struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeGroupBy is the group-by builder for CycleRedeemCode entities.

func (*CycleRedeemCodeGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*CycleRedeemCodeGroupBy) Bool

func (s *CycleRedeemCodeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) BoolX

func (s *CycleRedeemCodeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) Bools

func (s *CycleRedeemCodeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) BoolsX

func (s *CycleRedeemCodeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) Float64

func (s *CycleRedeemCodeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) Float64X

func (s *CycleRedeemCodeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) Float64s

func (s *CycleRedeemCodeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) Float64sX

func (s *CycleRedeemCodeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) Int

func (s *CycleRedeemCodeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) IntX

func (s *CycleRedeemCodeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) Ints

func (s *CycleRedeemCodeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) IntsX

func (s *CycleRedeemCodeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) Scan

func (_g *CycleRedeemCodeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleRedeemCodeGroupBy) ScanX

func (s *CycleRedeemCodeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) String

func (s *CycleRedeemCodeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) StringX

func (s *CycleRedeemCodeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleRedeemCodeGroupBy) Strings

func (s *CycleRedeemCodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeGroupBy) StringsX

func (s *CycleRedeemCodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleRedeemCodeMutation

type CycleRedeemCodeMutation struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeMutation represents an operation that mutates the CycleRedeemCode nodes in the graph.

func (*CycleRedeemCodeMutation) AddCycle

func (m *CycleRedeemCodeMutation) AddCycle(f float64)

AddCycle adds f to the "cycle" field.

func (*CycleRedeemCodeMutation) AddField

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) AddedCycle

func (m *CycleRedeemCodeMutation) AddedCycle() (r float64, exists bool)

AddedCycle returns the value that was added to the "cycle" field in this mutation.

func (*CycleRedeemCodeMutation) AddedEdges

func (m *CycleRedeemCodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CycleRedeemCodeMutation) AddedField

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) AddedFields

func (m *CycleRedeemCodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CycleRedeemCodeMutation) AddedIDs

func (m *CycleRedeemCodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CycleRedeemCodeMutation) ClearEdge

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) ClearField

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) ClearFkUserID

func (m *CycleRedeemCodeMutation) ClearFkUserID()

ClearFkUserID clears the value of the "fk_user_id" field.

func (*CycleRedeemCodeMutation) ClearUseTime

func (m *CycleRedeemCodeMutation) ClearUseTime()

ClearUseTime clears the value of the "use_time" field.

func (*CycleRedeemCodeMutation) ClearedEdges

func (m *CycleRedeemCodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CycleRedeemCodeMutation) ClearedFields

func (m *CycleRedeemCodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CycleRedeemCodeMutation) Client

func (m CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) CreateTime

func (m *CycleRedeemCodeMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*CycleRedeemCodeMutation) Cycle

func (m *CycleRedeemCodeMutation) Cycle() (r float64, exists bool)

Cycle returns the value of the "cycle" field in the mutation.

func (*CycleRedeemCodeMutation) EdgeCleared

func (m *CycleRedeemCodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CycleRedeemCodeMutation) Field

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) FieldCleared

func (m *CycleRedeemCodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CycleRedeemCodeMutation) Fields

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) FkUserID

func (m *CycleRedeemCodeMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*CycleRedeemCodeMutation) FkUserIDCleared

func (m *CycleRedeemCodeMutation) FkUserIDCleared() bool

FkUserIDCleared returns if the "fk_user_id" field was cleared in this mutation.

func (*CycleRedeemCodeMutation) ID

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) OldCreateTime

func (m *CycleRedeemCodeMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the CycleRedeemCode entity. If the CycleRedeemCode 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 (*CycleRedeemCodeMutation) OldCycle

func (m *CycleRedeemCodeMutation) OldCycle(ctx context.Context) (v float64, err error)

OldCycle returns the old "cycle" field's value of the CycleRedeemCode entity. If the CycleRedeemCode 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 (*CycleRedeemCodeMutation) OldField

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) OldFkUserID

func (m *CycleRedeemCodeMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the CycleRedeemCode entity. If the CycleRedeemCode 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 (*CycleRedeemCodeMutation) OldRedeemCode

func (m *CycleRedeemCodeMutation) OldRedeemCode(ctx context.Context) (v string, err error)

OldRedeemCode returns the old "redeem_code" field's value of the CycleRedeemCode entity. If the CycleRedeemCode 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 (*CycleRedeemCodeMutation) OldState

func (m *CycleRedeemCodeMutation) OldState(ctx context.Context) (v bool, err error)

OldState returns the old "state" field's value of the CycleRedeemCode entity. If the CycleRedeemCode 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 (*CycleRedeemCodeMutation) OldUseTime

func (m *CycleRedeemCodeMutation) OldUseTime(ctx context.Context) (v time.Time, err error)

OldUseTime returns the old "use_time" field's value of the CycleRedeemCode entity. If the CycleRedeemCode 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 (*CycleRedeemCodeMutation) Op

func (m *CycleRedeemCodeMutation) Op() Op

Op returns the operation name.

func (*CycleRedeemCodeMutation) RedeemCode

func (m *CycleRedeemCodeMutation) RedeemCode() (r string, exists bool)

RedeemCode returns the value of the "redeem_code" field in the mutation.

func (*CycleRedeemCodeMutation) RemovedEdges

func (m *CycleRedeemCodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CycleRedeemCodeMutation) RemovedIDs

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) ResetCreateTime

func (m *CycleRedeemCodeMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*CycleRedeemCodeMutation) ResetCycle

func (m *CycleRedeemCodeMutation) ResetCycle()

ResetCycle resets all changes to the "cycle" field.

func (*CycleRedeemCodeMutation) ResetEdge

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) ResetField

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) ResetFkUserID

func (m *CycleRedeemCodeMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*CycleRedeemCodeMutation) ResetRedeemCode

func (m *CycleRedeemCodeMutation) ResetRedeemCode()

ResetRedeemCode resets all changes to the "redeem_code" field.

func (*CycleRedeemCodeMutation) ResetState

func (m *CycleRedeemCodeMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*CycleRedeemCodeMutation) ResetUseTime

func (m *CycleRedeemCodeMutation) ResetUseTime()

ResetUseTime resets all changes to the "use_time" field.

func (*CycleRedeemCodeMutation) SetCreateTime

func (m *CycleRedeemCodeMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*CycleRedeemCodeMutation) SetCycle

func (m *CycleRedeemCodeMutation) SetCycle(f float64)

SetCycle sets the "cycle" field.

func (*CycleRedeemCodeMutation) SetField

func (m *CycleRedeemCodeMutation) 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 (*CycleRedeemCodeMutation) SetFkUserID

func (m *CycleRedeemCodeMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*CycleRedeemCodeMutation) SetID

func (m *CycleRedeemCodeMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of CycleRedeemCode entities.

func (*CycleRedeemCodeMutation) SetOp

func (m *CycleRedeemCodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CycleRedeemCodeMutation) SetRedeemCode

func (m *CycleRedeemCodeMutation) SetRedeemCode(s string)

SetRedeemCode sets the "redeem_code" field.

func (*CycleRedeemCodeMutation) SetState

func (m *CycleRedeemCodeMutation) SetState(b bool)

SetState sets the "state" field.

func (*CycleRedeemCodeMutation) SetUseTime

func (m *CycleRedeemCodeMutation) SetUseTime(t time.Time)

SetUseTime sets the "use_time" field.

func (*CycleRedeemCodeMutation) State

func (m *CycleRedeemCodeMutation) State() (r bool, exists bool)

State returns the value of the "state" field in the mutation.

func (CycleRedeemCodeMutation) Tx

func (m CycleRedeemCodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CycleRedeemCodeMutation) Type

func (m *CycleRedeemCodeMutation) Type() string

Type returns the node type of this mutation (CycleRedeemCode).

func (*CycleRedeemCodeMutation) UseTime

func (m *CycleRedeemCodeMutation) UseTime() (r time.Time, exists bool)

UseTime returns the value of the "use_time" field in the mutation.

func (*CycleRedeemCodeMutation) UseTimeCleared

func (m *CycleRedeemCodeMutation) UseTimeCleared() bool

UseTimeCleared returns if the "use_time" field was cleared in this mutation.

func (*CycleRedeemCodeMutation) Where

Where appends a list predicates to the CycleRedeemCodeMutation builder.

func (*CycleRedeemCodeMutation) WhereP

func (m *CycleRedeemCodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CycleRedeemCodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CycleRedeemCodeQuery

type CycleRedeemCodeQuery struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeQuery is the builder for querying CycleRedeemCode entities.

func (*CycleRedeemCodeQuery) Aggregate

Aggregate returns a CycleRedeemCodeSelect configured with the given aggregations.

func (*CycleRedeemCodeQuery) All

All executes the query and returns a list of CycleRedeemCodes.

func (*CycleRedeemCodeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*CycleRedeemCodeQuery) Clone

Clone returns a duplicate of the CycleRedeemCodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CycleRedeemCodeQuery) Count

func (_q *CycleRedeemCodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CycleRedeemCodeQuery) CountX

func (_q *CycleRedeemCodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CycleRedeemCodeQuery) Exist

func (_q *CycleRedeemCodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CycleRedeemCodeQuery) ExistX

func (_q *CycleRedeemCodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CycleRedeemCodeQuery) First

First returns the first CycleRedeemCode entity from the query. Returns a *NotFoundError when no CycleRedeemCode was found.

func (*CycleRedeemCodeQuery) FirstID

func (_q *CycleRedeemCodeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first CycleRedeemCode ID from the query. Returns a *NotFoundError when no CycleRedeemCode ID was found.

func (*CycleRedeemCodeQuery) FirstIDX

func (_q *CycleRedeemCodeQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*CycleRedeemCodeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*CycleRedeemCodeQuery) GroupBy

func (_q *CycleRedeemCodeQuery) GroupBy(field string, fields ...string) *CycleRedeemCodeGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CycleRedeemCode.Query().
	GroupBy(cycleredeemcode.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CycleRedeemCodeQuery) IDs

func (_q *CycleRedeemCodeQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of CycleRedeemCode IDs.

func (*CycleRedeemCodeQuery) IDsX

func (_q *CycleRedeemCodeQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*CycleRedeemCodeQuery) Limit

func (_q *CycleRedeemCodeQuery) Limit(limit int) *CycleRedeemCodeQuery

Limit the number of records to be returned by this query.

func (*CycleRedeemCodeQuery) Offset

func (_q *CycleRedeemCodeQuery) Offset(offset int) *CycleRedeemCodeQuery

Offset to start from.

func (*CycleRedeemCodeQuery) Only

Only returns a single CycleRedeemCode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CycleRedeemCode entity is found. Returns a *NotFoundError when no CycleRedeemCode entities are found.

func (*CycleRedeemCodeQuery) OnlyID

func (_q *CycleRedeemCodeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only CycleRedeemCode ID in the query. Returns a *NotSingularError when more than one CycleRedeemCode ID is found. Returns a *NotFoundError when no entities are found.

func (*CycleRedeemCodeQuery) OnlyIDX

func (_q *CycleRedeemCodeQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CycleRedeemCodeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*CycleRedeemCodeQuery) Order

Order specifies how the records should be ordered.

func (*CycleRedeemCodeQuery) Select

func (_q *CycleRedeemCodeQuery) Select(fields ...string) *CycleRedeemCodeSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.CycleRedeemCode.Query().
	Select(cycleredeemcode.FieldFkUserID).
	Scan(ctx, &v)

func (*CycleRedeemCodeQuery) Unique

func (_q *CycleRedeemCodeQuery) Unique(unique bool) *CycleRedeemCodeQuery

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 (*CycleRedeemCodeQuery) Where

Where adds a new predicate for the CycleRedeemCodeQuery builder.

type CycleRedeemCodeSelect

type CycleRedeemCodeSelect struct {
	*CycleRedeemCodeQuery
	// contains filtered or unexported fields
}

CycleRedeemCodeSelect is the builder for selecting fields of CycleRedeemCode entities.

func (*CycleRedeemCodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*CycleRedeemCodeSelect) Bool

func (s *CycleRedeemCodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) BoolX

func (s *CycleRedeemCodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleRedeemCodeSelect) Bools

func (s *CycleRedeemCodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) BoolsX

func (s *CycleRedeemCodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleRedeemCodeSelect) Float64

func (s *CycleRedeemCodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) Float64X

func (s *CycleRedeemCodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleRedeemCodeSelect) Float64s

func (s *CycleRedeemCodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) Float64sX

func (s *CycleRedeemCodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleRedeemCodeSelect) Int

func (s *CycleRedeemCodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) IntX

func (s *CycleRedeemCodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleRedeemCodeSelect) Ints

func (s *CycleRedeemCodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) IntsX

func (s *CycleRedeemCodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleRedeemCodeSelect) Scan

func (_s *CycleRedeemCodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleRedeemCodeSelect) ScanX

func (s *CycleRedeemCodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleRedeemCodeSelect) String

func (s *CycleRedeemCodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) StringX

func (s *CycleRedeemCodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleRedeemCodeSelect) Strings

func (s *CycleRedeemCodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleRedeemCodeSelect) StringsX

func (s *CycleRedeemCodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleRedeemCodeUpdate

type CycleRedeemCodeUpdate struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeUpdate is the builder for updating CycleRedeemCode entities.

func (*CycleRedeemCodeUpdate) AddCycle

AddCycle adds value to the "cycle" field.

func (*CycleRedeemCodeUpdate) ClearFkUserID

func (_u *CycleRedeemCodeUpdate) ClearFkUserID() *CycleRedeemCodeUpdate

ClearFkUserID clears the value of the "fk_user_id" field.

func (*CycleRedeemCodeUpdate) ClearUseTime

func (_u *CycleRedeemCodeUpdate) ClearUseTime() *CycleRedeemCodeUpdate

ClearUseTime clears the value of the "use_time" field.

func (*CycleRedeemCodeUpdate) Exec

Exec executes the query.

func (*CycleRedeemCodeUpdate) ExecX

func (_u *CycleRedeemCodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRedeemCodeUpdate) Mutation

Mutation returns the CycleRedeemCodeMutation object of the builder.

func (*CycleRedeemCodeUpdate) Save

func (_u *CycleRedeemCodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CycleRedeemCodeUpdate) SaveX

func (_u *CycleRedeemCodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CycleRedeemCodeUpdate) SetCreateTime

func (_u *CycleRedeemCodeUpdate) SetCreateTime(v time.Time) *CycleRedeemCodeUpdate

SetCreateTime sets the "create_time" field.

func (*CycleRedeemCodeUpdate) SetCycle

SetCycle sets the "cycle" field.

func (*CycleRedeemCodeUpdate) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleRedeemCodeUpdate) SetNillableCreateTime

func (_u *CycleRedeemCodeUpdate) SetNillableCreateTime(v *time.Time) *CycleRedeemCodeUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleRedeemCodeUpdate) SetNillableCycle

func (_u *CycleRedeemCodeUpdate) SetNillableCycle(v *float64) *CycleRedeemCodeUpdate

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleRedeemCodeUpdate) SetNillableFkUserID

func (_u *CycleRedeemCodeUpdate) SetNillableFkUserID(v *uuid.UUID) *CycleRedeemCodeUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleRedeemCodeUpdate) SetNillableRedeemCode

func (_u *CycleRedeemCodeUpdate) SetNillableRedeemCode(v *string) *CycleRedeemCodeUpdate

SetNillableRedeemCode sets the "redeem_code" field if the given value is not nil.

func (*CycleRedeemCodeUpdate) SetNillableState

func (_u *CycleRedeemCodeUpdate) SetNillableState(v *bool) *CycleRedeemCodeUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*CycleRedeemCodeUpdate) SetNillableUseTime

func (_u *CycleRedeemCodeUpdate) SetNillableUseTime(v *time.Time) *CycleRedeemCodeUpdate

SetNillableUseTime sets the "use_time" field if the given value is not nil.

func (*CycleRedeemCodeUpdate) SetRedeemCode

func (_u *CycleRedeemCodeUpdate) SetRedeemCode(v string) *CycleRedeemCodeUpdate

SetRedeemCode sets the "redeem_code" field.

func (*CycleRedeemCodeUpdate) SetState

SetState sets the "state" field.

func (*CycleRedeemCodeUpdate) SetUseTime

SetUseTime sets the "use_time" field.

func (*CycleRedeemCodeUpdate) Where

Where appends a list predicates to the CycleRedeemCodeUpdate builder.

type CycleRedeemCodeUpdateOne

type CycleRedeemCodeUpdateOne struct {
	// contains filtered or unexported fields
}

CycleRedeemCodeUpdateOne is the builder for updating a single CycleRedeemCode entity.

func (*CycleRedeemCodeUpdateOne) AddCycle

AddCycle adds value to the "cycle" field.

func (*CycleRedeemCodeUpdateOne) ClearFkUserID

ClearFkUserID clears the value of the "fk_user_id" field.

func (*CycleRedeemCodeUpdateOne) ClearUseTime

ClearUseTime clears the value of the "use_time" field.

func (*CycleRedeemCodeUpdateOne) Exec

Exec executes the query on the entity.

func (*CycleRedeemCodeUpdateOne) ExecX

func (_u *CycleRedeemCodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRedeemCodeUpdateOne) Mutation

Mutation returns the CycleRedeemCodeMutation object of the builder.

func (*CycleRedeemCodeUpdateOne) Save

Save executes the query and returns the updated CycleRedeemCode entity.

func (*CycleRedeemCodeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*CycleRedeemCodeUpdateOne) Select

func (_u *CycleRedeemCodeUpdateOne) Select(field string, fields ...string) *CycleRedeemCodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CycleRedeemCodeUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*CycleRedeemCodeUpdateOne) SetCycle

SetCycle sets the "cycle" field.

func (*CycleRedeemCodeUpdateOne) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleRedeemCodeUpdateOne) SetNillableCreateTime

func (_u *CycleRedeemCodeUpdateOne) SetNillableCreateTime(v *time.Time) *CycleRedeemCodeUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleRedeemCodeUpdateOne) SetNillableCycle

func (_u *CycleRedeemCodeUpdateOne) SetNillableCycle(v *float64) *CycleRedeemCodeUpdateOne

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleRedeemCodeUpdateOne) SetNillableFkUserID

func (_u *CycleRedeemCodeUpdateOne) SetNillableFkUserID(v *uuid.UUID) *CycleRedeemCodeUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleRedeemCodeUpdateOne) SetNillableRedeemCode

func (_u *CycleRedeemCodeUpdateOne) SetNillableRedeemCode(v *string) *CycleRedeemCodeUpdateOne

SetNillableRedeemCode sets the "redeem_code" field if the given value is not nil.

func (*CycleRedeemCodeUpdateOne) SetNillableState

func (_u *CycleRedeemCodeUpdateOne) SetNillableState(v *bool) *CycleRedeemCodeUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*CycleRedeemCodeUpdateOne) SetNillableUseTime

func (_u *CycleRedeemCodeUpdateOne) SetNillableUseTime(v *time.Time) *CycleRedeemCodeUpdateOne

SetNillableUseTime sets the "use_time" field if the given value is not nil.

func (*CycleRedeemCodeUpdateOne) SetRedeemCode

SetRedeemCode sets the "redeem_code" field.

func (*CycleRedeemCodeUpdateOne) SetState

SetState sets the "state" field.

func (*CycleRedeemCodeUpdateOne) SetUseTime

SetUseTime sets the "use_time" field.

func (*CycleRedeemCodeUpdateOne) Where

Where appends a list predicates to the CycleRedeemCodeUpdate builder.

type CycleRedeemCodes

type CycleRedeemCodes []*CycleRedeemCode

CycleRedeemCodes is a parsable slice of CycleRedeemCode.

type CycleRenewal

type CycleRenewal struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// 资源ID
	ResourceID uuid.UUID `json:"resource_id,omitempty"`
	// 资源类型
	ResourceType int `json:"resource_type,omitempty"`
	// 产品名字
	ProductName string `json:"product_name,omitempty"`
	// 产品描述
	ProductDesc string `json:"product_desc,omitempty"`
	// 状态
	State int8 `json:"state,omitempty"`
	// 延长时间
	ExtendDay int8 `json:"extend_day,omitempty"`
	// 额外的价格
	ExtendPrice float64 `json:"extend_price,omitempty"`
	// 到期时间
	DueTime *time.Time `json:"due_time,omitempty"`
	// 续费时间
	RenewalTime *time.Time `json:"renewal_time,omitempty"`
	// 自动续费
	AutoRenewal bool `json:"auto_renewal,omitempty"`
	// contains filtered or unexported fields
}

CycleRenewal is the model entity for the CycleRenewal schema.

func (*CycleRenewal) String

func (_m *CycleRenewal) String() string

String implements the fmt.Stringer.

func (*CycleRenewal) Unwrap

func (_m *CycleRenewal) Unwrap() *CycleRenewal

Unwrap unwraps the CycleRenewal 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 (*CycleRenewal) Update

func (_m *CycleRenewal) Update() *CycleRenewalUpdateOne

Update returns a builder for updating this CycleRenewal. Note that you need to call CycleRenewal.Unwrap() before calling this method if this CycleRenewal was returned from a transaction, and the transaction was committed or rolled back.

func (*CycleRenewal) Value

func (_m *CycleRenewal) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the CycleRenewal. This includes values selected through modifiers, order, etc.

type CycleRenewalClient

type CycleRenewalClient struct {
	// contains filtered or unexported fields
}

CycleRenewalClient is a client for the CycleRenewal schema.

func NewCycleRenewalClient

func NewCycleRenewalClient(c config) *CycleRenewalClient

NewCycleRenewalClient returns a client for the CycleRenewal from the given config.

func (*CycleRenewalClient) Create

Create returns a builder for creating a CycleRenewal entity.

func (*CycleRenewalClient) CreateBulk

func (c *CycleRenewalClient) CreateBulk(builders ...*CycleRenewalCreate) *CycleRenewalCreateBulk

CreateBulk returns a builder for creating a bulk of CycleRenewal entities.

func (*CycleRenewalClient) Delete

Delete returns a delete builder for CycleRenewal.

func (*CycleRenewalClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CycleRenewalClient) DeleteOneID

func (c *CycleRenewalClient) DeleteOneID(id uuid.UUID) *CycleRenewalDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CycleRenewalClient) Get

Get returns a CycleRenewal entity by its id.

func (*CycleRenewalClient) GetX

GetX is like Get, but panics if an error occurs.

func (*CycleRenewalClient) Hooks

func (c *CycleRenewalClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CycleRenewalClient) Intercept

func (c *CycleRenewalClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cyclerenewal.Intercept(f(g(h())))`.

func (*CycleRenewalClient) Interceptors

func (c *CycleRenewalClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CycleRenewalClient) MapCreateBulk

func (c *CycleRenewalClient) MapCreateBulk(slice any, setFunc func(*CycleRenewalCreate, int)) *CycleRenewalCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CycleRenewalClient) Query

Query returns a query builder for CycleRenewal.

func (*CycleRenewalClient) Update

Update returns an update builder for CycleRenewal.

func (*CycleRenewalClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CycleRenewalClient) UpdateOneID

func (c *CycleRenewalClient) UpdateOneID(id uuid.UUID) *CycleRenewalUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CycleRenewalClient) Use

func (c *CycleRenewalClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cyclerenewal.Hooks(f(g(h())))`.

type CycleRenewalCreate

type CycleRenewalCreate struct {
	// contains filtered or unexported fields
}

CycleRenewalCreate is the builder for creating a CycleRenewal entity.

func (*CycleRenewalCreate) Exec

func (_c *CycleRenewalCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleRenewalCreate) ExecX

func (_c *CycleRenewalCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRenewalCreate) Mutation

func (_c *CycleRenewalCreate) Mutation() *CycleRenewalMutation

Mutation returns the CycleRenewalMutation object of the builder.

func (*CycleRenewalCreate) Save

Save creates the CycleRenewal in the database.

func (*CycleRenewalCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CycleRenewalCreate) SetAutoRenewal

func (_c *CycleRenewalCreate) SetAutoRenewal(v bool) *CycleRenewalCreate

SetAutoRenewal sets the "auto_renewal" field.

func (*CycleRenewalCreate) SetDueTime

func (_c *CycleRenewalCreate) SetDueTime(v time.Time) *CycleRenewalCreate

SetDueTime sets the "due_time" field.

func (*CycleRenewalCreate) SetExtendDay

func (_c *CycleRenewalCreate) SetExtendDay(v int8) *CycleRenewalCreate

SetExtendDay sets the "extend_day" field.

func (*CycleRenewalCreate) SetExtendPrice

func (_c *CycleRenewalCreate) SetExtendPrice(v float64) *CycleRenewalCreate

SetExtendPrice sets the "extend_price" field.

func (*CycleRenewalCreate) SetFkUserID

func (_c *CycleRenewalCreate) SetFkUserID(v uuid.UUID) *CycleRenewalCreate

SetFkUserID sets the "fk_user_id" field.

func (*CycleRenewalCreate) SetID

SetID sets the "id" field.

func (*CycleRenewalCreate) SetNillableDueTime

func (_c *CycleRenewalCreate) SetNillableDueTime(v *time.Time) *CycleRenewalCreate

SetNillableDueTime sets the "due_time" field if the given value is not nil.

func (*CycleRenewalCreate) SetNillableID

func (_c *CycleRenewalCreate) SetNillableID(v *uuid.UUID) *CycleRenewalCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CycleRenewalCreate) SetNillableRenewalTime

func (_c *CycleRenewalCreate) SetNillableRenewalTime(v *time.Time) *CycleRenewalCreate

SetNillableRenewalTime sets the "renewal_time" field if the given value is not nil.

func (*CycleRenewalCreate) SetProductDesc

func (_c *CycleRenewalCreate) SetProductDesc(v string) *CycleRenewalCreate

SetProductDesc sets the "product_desc" field.

func (*CycleRenewalCreate) SetProductName

func (_c *CycleRenewalCreate) SetProductName(v string) *CycleRenewalCreate

SetProductName sets the "product_name" field.

func (*CycleRenewalCreate) SetRenewalTime

func (_c *CycleRenewalCreate) SetRenewalTime(v time.Time) *CycleRenewalCreate

SetRenewalTime sets the "renewal_time" field.

func (*CycleRenewalCreate) SetResourceID

func (_c *CycleRenewalCreate) SetResourceID(v uuid.UUID) *CycleRenewalCreate

SetResourceID sets the "resource_id" field.

func (*CycleRenewalCreate) SetResourceType

func (_c *CycleRenewalCreate) SetResourceType(v int) *CycleRenewalCreate

SetResourceType sets the "resource_type" field.

func (*CycleRenewalCreate) SetState

func (_c *CycleRenewalCreate) SetState(v int8) *CycleRenewalCreate

SetState sets the "state" field.

type CycleRenewalCreateBulk

type CycleRenewalCreateBulk struct {
	// contains filtered or unexported fields
}

CycleRenewalCreateBulk is the builder for creating many CycleRenewal entities in bulk.

func (*CycleRenewalCreateBulk) Exec

Exec executes the query.

func (*CycleRenewalCreateBulk) ExecX

func (_c *CycleRenewalCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRenewalCreateBulk) Save

Save creates the CycleRenewal entities in the database.

func (*CycleRenewalCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type CycleRenewalDelete

type CycleRenewalDelete struct {
	// contains filtered or unexported fields
}

CycleRenewalDelete is the builder for deleting a CycleRenewal entity.

func (*CycleRenewalDelete) Exec

func (_d *CycleRenewalDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CycleRenewalDelete) ExecX

func (_d *CycleRenewalDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CycleRenewalDelete) Where

Where appends a list predicates to the CycleRenewalDelete builder.

type CycleRenewalDeleteOne

type CycleRenewalDeleteOne struct {
	// contains filtered or unexported fields
}

CycleRenewalDeleteOne is the builder for deleting a single CycleRenewal entity.

func (*CycleRenewalDeleteOne) Exec

Exec executes the deletion query.

func (*CycleRenewalDeleteOne) ExecX

func (_d *CycleRenewalDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRenewalDeleteOne) Where

Where appends a list predicates to the CycleRenewalDelete builder.

type CycleRenewalGroupBy

type CycleRenewalGroupBy struct {
	// contains filtered or unexported fields
}

CycleRenewalGroupBy is the group-by builder for CycleRenewal entities.

func (*CycleRenewalGroupBy) Aggregate

func (_g *CycleRenewalGroupBy) Aggregate(fns ...AggregateFunc) *CycleRenewalGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*CycleRenewalGroupBy) Bool

func (s *CycleRenewalGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) BoolX

func (s *CycleRenewalGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleRenewalGroupBy) Bools

func (s *CycleRenewalGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) BoolsX

func (s *CycleRenewalGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleRenewalGroupBy) Float64

func (s *CycleRenewalGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) Float64X

func (s *CycleRenewalGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleRenewalGroupBy) Float64s

func (s *CycleRenewalGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) Float64sX

func (s *CycleRenewalGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleRenewalGroupBy) Int

func (s *CycleRenewalGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) IntX

func (s *CycleRenewalGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleRenewalGroupBy) Ints

func (s *CycleRenewalGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) IntsX

func (s *CycleRenewalGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleRenewalGroupBy) Scan

func (_g *CycleRenewalGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleRenewalGroupBy) ScanX

func (s *CycleRenewalGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleRenewalGroupBy) String

func (s *CycleRenewalGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) StringX

func (s *CycleRenewalGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleRenewalGroupBy) Strings

func (s *CycleRenewalGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleRenewalGroupBy) StringsX

func (s *CycleRenewalGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleRenewalMutation

type CycleRenewalMutation struct {
	// contains filtered or unexported fields
}

CycleRenewalMutation represents an operation that mutates the CycleRenewal nodes in the graph.

func (*CycleRenewalMutation) AddExtendDay

func (m *CycleRenewalMutation) AddExtendDay(i int8)

AddExtendDay adds i to the "extend_day" field.

func (*CycleRenewalMutation) AddExtendPrice

func (m *CycleRenewalMutation) AddExtendPrice(f float64)

AddExtendPrice adds f to the "extend_price" field.

func (*CycleRenewalMutation) AddField

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) AddResourceType

func (m *CycleRenewalMutation) AddResourceType(i int)

AddResourceType adds i to the "resource_type" field.

func (*CycleRenewalMutation) AddState

func (m *CycleRenewalMutation) AddState(i int8)

AddState adds i to the "state" field.

func (*CycleRenewalMutation) AddedEdges

func (m *CycleRenewalMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CycleRenewalMutation) AddedExtendDay

func (m *CycleRenewalMutation) AddedExtendDay() (r int8, exists bool)

AddedExtendDay returns the value that was added to the "extend_day" field in this mutation.

func (*CycleRenewalMutation) AddedExtendPrice

func (m *CycleRenewalMutation) AddedExtendPrice() (r float64, exists bool)

AddedExtendPrice returns the value that was added to the "extend_price" field in this mutation.

func (*CycleRenewalMutation) AddedField

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) AddedFields

func (m *CycleRenewalMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CycleRenewalMutation) AddedIDs

func (m *CycleRenewalMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CycleRenewalMutation) AddedResourceType

func (m *CycleRenewalMutation) AddedResourceType() (r int, exists bool)

AddedResourceType returns the value that was added to the "resource_type" field in this mutation.

func (*CycleRenewalMutation) AddedState

func (m *CycleRenewalMutation) AddedState() (r int8, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*CycleRenewalMutation) AutoRenewal

func (m *CycleRenewalMutation) AutoRenewal() (r bool, exists bool)

AutoRenewal returns the value of the "auto_renewal" field in the mutation.

func (*CycleRenewalMutation) ClearDueTime

func (m *CycleRenewalMutation) ClearDueTime()

ClearDueTime clears the value of the "due_time" field.

func (*CycleRenewalMutation) ClearEdge

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) ClearField

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) ClearRenewalTime

func (m *CycleRenewalMutation) ClearRenewalTime()

ClearRenewalTime clears the value of the "renewal_time" field.

func (*CycleRenewalMutation) ClearedEdges

func (m *CycleRenewalMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CycleRenewalMutation) ClearedFields

func (m *CycleRenewalMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CycleRenewalMutation) Client

func (m CycleRenewalMutation) 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 (*CycleRenewalMutation) DueTime

func (m *CycleRenewalMutation) DueTime() (r time.Time, exists bool)

DueTime returns the value of the "due_time" field in the mutation.

func (*CycleRenewalMutation) DueTimeCleared

func (m *CycleRenewalMutation) DueTimeCleared() bool

DueTimeCleared returns if the "due_time" field was cleared in this mutation.

func (*CycleRenewalMutation) EdgeCleared

func (m *CycleRenewalMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CycleRenewalMutation) ExtendDay

func (m *CycleRenewalMutation) ExtendDay() (r int8, exists bool)

ExtendDay returns the value of the "extend_day" field in the mutation.

func (*CycleRenewalMutation) ExtendPrice

func (m *CycleRenewalMutation) ExtendPrice() (r float64, exists bool)

ExtendPrice returns the value of the "extend_price" field in the mutation.

func (*CycleRenewalMutation) Field

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) FieldCleared

func (m *CycleRenewalMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CycleRenewalMutation) Fields

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) FkUserID

func (m *CycleRenewalMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*CycleRenewalMutation) ID

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) 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 (*CycleRenewalMutation) OldAutoRenewal

func (m *CycleRenewalMutation) OldAutoRenewal(ctx context.Context) (v bool, err error)

OldAutoRenewal returns the old "auto_renewal" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldDueTime

func (m *CycleRenewalMutation) OldDueTime(ctx context.Context) (v *time.Time, err error)

OldDueTime returns the old "due_time" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldExtendDay

func (m *CycleRenewalMutation) OldExtendDay(ctx context.Context) (v int8, err error)

OldExtendDay returns the old "extend_day" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldExtendPrice

func (m *CycleRenewalMutation) OldExtendPrice(ctx context.Context) (v float64, err error)

OldExtendPrice returns the old "extend_price" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldField

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) OldFkUserID

func (m *CycleRenewalMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldProductDesc

func (m *CycleRenewalMutation) OldProductDesc(ctx context.Context) (v string, err error)

OldProductDesc returns the old "product_desc" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldProductName

func (m *CycleRenewalMutation) OldProductName(ctx context.Context) (v string, err error)

OldProductName returns the old "product_name" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldRenewalTime

func (m *CycleRenewalMutation) OldRenewalTime(ctx context.Context) (v *time.Time, err error)

OldRenewalTime returns the old "renewal_time" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldResourceID

func (m *CycleRenewalMutation) OldResourceID(ctx context.Context) (v uuid.UUID, err error)

OldResourceID returns the old "resource_id" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldResourceType

func (m *CycleRenewalMutation) OldResourceType(ctx context.Context) (v int, err error)

OldResourceType returns the old "resource_type" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) OldState

func (m *CycleRenewalMutation) OldState(ctx context.Context) (v int8, err error)

OldState returns the old "state" field's value of the CycleRenewal entity. If the CycleRenewal 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 (*CycleRenewalMutation) Op

func (m *CycleRenewalMutation) Op() Op

Op returns the operation name.

func (*CycleRenewalMutation) ProductDesc

func (m *CycleRenewalMutation) ProductDesc() (r string, exists bool)

ProductDesc returns the value of the "product_desc" field in the mutation.

func (*CycleRenewalMutation) ProductName

func (m *CycleRenewalMutation) ProductName() (r string, exists bool)

ProductName returns the value of the "product_name" field in the mutation.

func (*CycleRenewalMutation) RemovedEdges

func (m *CycleRenewalMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CycleRenewalMutation) RemovedIDs

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) RenewalTime

func (m *CycleRenewalMutation) RenewalTime() (r time.Time, exists bool)

RenewalTime returns the value of the "renewal_time" field in the mutation.

func (*CycleRenewalMutation) RenewalTimeCleared

func (m *CycleRenewalMutation) RenewalTimeCleared() bool

RenewalTimeCleared returns if the "renewal_time" field was cleared in this mutation.

func (*CycleRenewalMutation) ResetAutoRenewal

func (m *CycleRenewalMutation) ResetAutoRenewal()

ResetAutoRenewal resets all changes to the "auto_renewal" field.

func (*CycleRenewalMutation) ResetDueTime

func (m *CycleRenewalMutation) ResetDueTime()

ResetDueTime resets all changes to the "due_time" field.

func (*CycleRenewalMutation) ResetEdge

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) ResetExtendDay

func (m *CycleRenewalMutation) ResetExtendDay()

ResetExtendDay resets all changes to the "extend_day" field.

func (*CycleRenewalMutation) ResetExtendPrice

func (m *CycleRenewalMutation) ResetExtendPrice()

ResetExtendPrice resets all changes to the "extend_price" field.

func (*CycleRenewalMutation) ResetField

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) ResetFkUserID

func (m *CycleRenewalMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*CycleRenewalMutation) ResetProductDesc

func (m *CycleRenewalMutation) ResetProductDesc()

ResetProductDesc resets all changes to the "product_desc" field.

func (*CycleRenewalMutation) ResetProductName

func (m *CycleRenewalMutation) ResetProductName()

ResetProductName resets all changes to the "product_name" field.

func (*CycleRenewalMutation) ResetRenewalTime

func (m *CycleRenewalMutation) ResetRenewalTime()

ResetRenewalTime resets all changes to the "renewal_time" field.

func (*CycleRenewalMutation) ResetResourceID

func (m *CycleRenewalMutation) ResetResourceID()

ResetResourceID resets all changes to the "resource_id" field.

func (*CycleRenewalMutation) ResetResourceType

func (m *CycleRenewalMutation) ResetResourceType()

ResetResourceType resets all changes to the "resource_type" field.

func (*CycleRenewalMutation) ResetState

func (m *CycleRenewalMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*CycleRenewalMutation) ResourceID

func (m *CycleRenewalMutation) ResourceID() (r uuid.UUID, exists bool)

ResourceID returns the value of the "resource_id" field in the mutation.

func (*CycleRenewalMutation) ResourceType

func (m *CycleRenewalMutation) ResourceType() (r int, exists bool)

ResourceType returns the value of the "resource_type" field in the mutation.

func (*CycleRenewalMutation) SetAutoRenewal

func (m *CycleRenewalMutation) SetAutoRenewal(b bool)

SetAutoRenewal sets the "auto_renewal" field.

func (*CycleRenewalMutation) SetDueTime

func (m *CycleRenewalMutation) SetDueTime(t time.Time)

SetDueTime sets the "due_time" field.

func (*CycleRenewalMutation) SetExtendDay

func (m *CycleRenewalMutation) SetExtendDay(i int8)

SetExtendDay sets the "extend_day" field.

func (*CycleRenewalMutation) SetExtendPrice

func (m *CycleRenewalMutation) SetExtendPrice(f float64)

SetExtendPrice sets the "extend_price" field.

func (*CycleRenewalMutation) SetField

func (m *CycleRenewalMutation) 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 (*CycleRenewalMutation) SetFkUserID

func (m *CycleRenewalMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*CycleRenewalMutation) SetID

func (m *CycleRenewalMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of CycleRenewal entities.

func (*CycleRenewalMutation) SetOp

func (m *CycleRenewalMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CycleRenewalMutation) SetProductDesc

func (m *CycleRenewalMutation) SetProductDesc(s string)

SetProductDesc sets the "product_desc" field.

func (*CycleRenewalMutation) SetProductName

func (m *CycleRenewalMutation) SetProductName(s string)

SetProductName sets the "product_name" field.

func (*CycleRenewalMutation) SetRenewalTime

func (m *CycleRenewalMutation) SetRenewalTime(t time.Time)

SetRenewalTime sets the "renewal_time" field.

func (*CycleRenewalMutation) SetResourceID

func (m *CycleRenewalMutation) SetResourceID(u uuid.UUID)

SetResourceID sets the "resource_id" field.

func (*CycleRenewalMutation) SetResourceType

func (m *CycleRenewalMutation) SetResourceType(i int)

SetResourceType sets the "resource_type" field.

func (*CycleRenewalMutation) SetState

func (m *CycleRenewalMutation) SetState(i int8)

SetState sets the "state" field.

func (*CycleRenewalMutation) State

func (m *CycleRenewalMutation) State() (r int8, exists bool)

State returns the value of the "state" field in the mutation.

func (CycleRenewalMutation) Tx

func (m CycleRenewalMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CycleRenewalMutation) Type

func (m *CycleRenewalMutation) Type() string

Type returns the node type of this mutation (CycleRenewal).

func (*CycleRenewalMutation) Where

Where appends a list predicates to the CycleRenewalMutation builder.

func (*CycleRenewalMutation) WhereP

func (m *CycleRenewalMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CycleRenewalMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CycleRenewalQuery

type CycleRenewalQuery struct {
	// contains filtered or unexported fields
}

CycleRenewalQuery is the builder for querying CycleRenewal entities.

func (*CycleRenewalQuery) Aggregate

func (_q *CycleRenewalQuery) Aggregate(fns ...AggregateFunc) *CycleRenewalSelect

Aggregate returns a CycleRenewalSelect configured with the given aggregations.

func (*CycleRenewalQuery) All

func (_q *CycleRenewalQuery) All(ctx context.Context) ([]*CycleRenewal, error)

All executes the query and returns a list of CycleRenewals.

func (*CycleRenewalQuery) AllX

func (_q *CycleRenewalQuery) AllX(ctx context.Context) []*CycleRenewal

AllX is like All, but panics if an error occurs.

func (*CycleRenewalQuery) Clone

func (_q *CycleRenewalQuery) Clone() *CycleRenewalQuery

Clone returns a duplicate of the CycleRenewalQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CycleRenewalQuery) Count

func (_q *CycleRenewalQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CycleRenewalQuery) CountX

func (_q *CycleRenewalQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CycleRenewalQuery) Exist

func (_q *CycleRenewalQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CycleRenewalQuery) ExistX

func (_q *CycleRenewalQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CycleRenewalQuery) First

func (_q *CycleRenewalQuery) First(ctx context.Context) (*CycleRenewal, error)

First returns the first CycleRenewal entity from the query. Returns a *NotFoundError when no CycleRenewal was found.

func (*CycleRenewalQuery) FirstID

func (_q *CycleRenewalQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first CycleRenewal ID from the query. Returns a *NotFoundError when no CycleRenewal ID was found.

func (*CycleRenewalQuery) FirstIDX

func (_q *CycleRenewalQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*CycleRenewalQuery) FirstX

func (_q *CycleRenewalQuery) FirstX(ctx context.Context) *CycleRenewal

FirstX is like First, but panics if an error occurs.

func (*CycleRenewalQuery) GroupBy

func (_q *CycleRenewalQuery) GroupBy(field string, fields ...string) *CycleRenewalGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CycleRenewal.Query().
	GroupBy(cyclerenewal.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CycleRenewalQuery) IDs

func (_q *CycleRenewalQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of CycleRenewal IDs.

func (*CycleRenewalQuery) IDsX

func (_q *CycleRenewalQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*CycleRenewalQuery) Limit

func (_q *CycleRenewalQuery) Limit(limit int) *CycleRenewalQuery

Limit the number of records to be returned by this query.

func (*CycleRenewalQuery) Offset

func (_q *CycleRenewalQuery) Offset(offset int) *CycleRenewalQuery

Offset to start from.

func (*CycleRenewalQuery) Only

Only returns a single CycleRenewal entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CycleRenewal entity is found. Returns a *NotFoundError when no CycleRenewal entities are found.

func (*CycleRenewalQuery) OnlyID

func (_q *CycleRenewalQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only CycleRenewal ID in the query. Returns a *NotSingularError when more than one CycleRenewal ID is found. Returns a *NotFoundError when no entities are found.

func (*CycleRenewalQuery) OnlyIDX

func (_q *CycleRenewalQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CycleRenewalQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*CycleRenewalQuery) Order

Order specifies how the records should be ordered.

func (*CycleRenewalQuery) Select

func (_q *CycleRenewalQuery) Select(fields ...string) *CycleRenewalSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.CycleRenewal.Query().
	Select(cyclerenewal.FieldFkUserID).
	Scan(ctx, &v)

func (*CycleRenewalQuery) Unique

func (_q *CycleRenewalQuery) Unique(unique bool) *CycleRenewalQuery

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 (*CycleRenewalQuery) Where

Where adds a new predicate for the CycleRenewalQuery builder.

type CycleRenewalSelect

type CycleRenewalSelect struct {
	*CycleRenewalQuery
	// contains filtered or unexported fields
}

CycleRenewalSelect is the builder for selecting fields of CycleRenewal entities.

func (*CycleRenewalSelect) Aggregate

func (_s *CycleRenewalSelect) Aggregate(fns ...AggregateFunc) *CycleRenewalSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CycleRenewalSelect) Bool

func (s *CycleRenewalSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) BoolX

func (s *CycleRenewalSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleRenewalSelect) Bools

func (s *CycleRenewalSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) BoolsX

func (s *CycleRenewalSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleRenewalSelect) Float64

func (s *CycleRenewalSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) Float64X

func (s *CycleRenewalSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleRenewalSelect) Float64s

func (s *CycleRenewalSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) Float64sX

func (s *CycleRenewalSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleRenewalSelect) Int

func (s *CycleRenewalSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) IntX

func (s *CycleRenewalSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleRenewalSelect) Ints

func (s *CycleRenewalSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) IntsX

func (s *CycleRenewalSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleRenewalSelect) Scan

func (_s *CycleRenewalSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleRenewalSelect) ScanX

func (s *CycleRenewalSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleRenewalSelect) String

func (s *CycleRenewalSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) StringX

func (s *CycleRenewalSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleRenewalSelect) Strings

func (s *CycleRenewalSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleRenewalSelect) StringsX

func (s *CycleRenewalSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleRenewalUpdate

type CycleRenewalUpdate struct {
	// contains filtered or unexported fields
}

CycleRenewalUpdate is the builder for updating CycleRenewal entities.

func (*CycleRenewalUpdate) AddExtendDay

func (_u *CycleRenewalUpdate) AddExtendDay(v int8) *CycleRenewalUpdate

AddExtendDay adds value to the "extend_day" field.

func (*CycleRenewalUpdate) AddExtendPrice

func (_u *CycleRenewalUpdate) AddExtendPrice(v float64) *CycleRenewalUpdate

AddExtendPrice adds value to the "extend_price" field.

func (*CycleRenewalUpdate) AddResourceType

func (_u *CycleRenewalUpdate) AddResourceType(v int) *CycleRenewalUpdate

AddResourceType adds value to the "resource_type" field.

func (*CycleRenewalUpdate) AddState

func (_u *CycleRenewalUpdate) AddState(v int8) *CycleRenewalUpdate

AddState adds value to the "state" field.

func (*CycleRenewalUpdate) ClearDueTime

func (_u *CycleRenewalUpdate) ClearDueTime() *CycleRenewalUpdate

ClearDueTime clears the value of the "due_time" field.

func (*CycleRenewalUpdate) ClearRenewalTime

func (_u *CycleRenewalUpdate) ClearRenewalTime() *CycleRenewalUpdate

ClearRenewalTime clears the value of the "renewal_time" field.

func (*CycleRenewalUpdate) Exec

func (_u *CycleRenewalUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleRenewalUpdate) ExecX

func (_u *CycleRenewalUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRenewalUpdate) Mutation

func (_u *CycleRenewalUpdate) Mutation() *CycleRenewalMutation

Mutation returns the CycleRenewalMutation object of the builder.

func (*CycleRenewalUpdate) Save

func (_u *CycleRenewalUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CycleRenewalUpdate) SaveX

func (_u *CycleRenewalUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CycleRenewalUpdate) SetAutoRenewal

func (_u *CycleRenewalUpdate) SetAutoRenewal(v bool) *CycleRenewalUpdate

SetAutoRenewal sets the "auto_renewal" field.

func (*CycleRenewalUpdate) SetDueTime

func (_u *CycleRenewalUpdate) SetDueTime(v time.Time) *CycleRenewalUpdate

SetDueTime sets the "due_time" field.

func (*CycleRenewalUpdate) SetExtendDay

func (_u *CycleRenewalUpdate) SetExtendDay(v int8) *CycleRenewalUpdate

SetExtendDay sets the "extend_day" field.

func (*CycleRenewalUpdate) SetExtendPrice

func (_u *CycleRenewalUpdate) SetExtendPrice(v float64) *CycleRenewalUpdate

SetExtendPrice sets the "extend_price" field.

func (*CycleRenewalUpdate) SetFkUserID

func (_u *CycleRenewalUpdate) SetFkUserID(v uuid.UUID) *CycleRenewalUpdate

SetFkUserID sets the "fk_user_id" field.

func (*CycleRenewalUpdate) SetNillableAutoRenewal

func (_u *CycleRenewalUpdate) SetNillableAutoRenewal(v *bool) *CycleRenewalUpdate

SetNillableAutoRenewal sets the "auto_renewal" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableDueTime

func (_u *CycleRenewalUpdate) SetNillableDueTime(v *time.Time) *CycleRenewalUpdate

SetNillableDueTime sets the "due_time" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableExtendDay

func (_u *CycleRenewalUpdate) SetNillableExtendDay(v *int8) *CycleRenewalUpdate

SetNillableExtendDay sets the "extend_day" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableExtendPrice

func (_u *CycleRenewalUpdate) SetNillableExtendPrice(v *float64) *CycleRenewalUpdate

SetNillableExtendPrice sets the "extend_price" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableFkUserID

func (_u *CycleRenewalUpdate) SetNillableFkUserID(v *uuid.UUID) *CycleRenewalUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableProductDesc

func (_u *CycleRenewalUpdate) SetNillableProductDesc(v *string) *CycleRenewalUpdate

SetNillableProductDesc sets the "product_desc" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableProductName

func (_u *CycleRenewalUpdate) SetNillableProductName(v *string) *CycleRenewalUpdate

SetNillableProductName sets the "product_name" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableRenewalTime

func (_u *CycleRenewalUpdate) SetNillableRenewalTime(v *time.Time) *CycleRenewalUpdate

SetNillableRenewalTime sets the "renewal_time" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableResourceID

func (_u *CycleRenewalUpdate) SetNillableResourceID(v *uuid.UUID) *CycleRenewalUpdate

SetNillableResourceID sets the "resource_id" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableResourceType

func (_u *CycleRenewalUpdate) SetNillableResourceType(v *int) *CycleRenewalUpdate

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*CycleRenewalUpdate) SetNillableState

func (_u *CycleRenewalUpdate) SetNillableState(v *int8) *CycleRenewalUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*CycleRenewalUpdate) SetProductDesc

func (_u *CycleRenewalUpdate) SetProductDesc(v string) *CycleRenewalUpdate

SetProductDesc sets the "product_desc" field.

func (*CycleRenewalUpdate) SetProductName

func (_u *CycleRenewalUpdate) SetProductName(v string) *CycleRenewalUpdate

SetProductName sets the "product_name" field.

func (*CycleRenewalUpdate) SetRenewalTime

func (_u *CycleRenewalUpdate) SetRenewalTime(v time.Time) *CycleRenewalUpdate

SetRenewalTime sets the "renewal_time" field.

func (*CycleRenewalUpdate) SetResourceID

func (_u *CycleRenewalUpdate) SetResourceID(v uuid.UUID) *CycleRenewalUpdate

SetResourceID sets the "resource_id" field.

func (*CycleRenewalUpdate) SetResourceType

func (_u *CycleRenewalUpdate) SetResourceType(v int) *CycleRenewalUpdate

SetResourceType sets the "resource_type" field.

func (*CycleRenewalUpdate) SetState

func (_u *CycleRenewalUpdate) SetState(v int8) *CycleRenewalUpdate

SetState sets the "state" field.

func (*CycleRenewalUpdate) Where

Where appends a list predicates to the CycleRenewalUpdate builder.

type CycleRenewalUpdateOne

type CycleRenewalUpdateOne struct {
	// contains filtered or unexported fields
}

CycleRenewalUpdateOne is the builder for updating a single CycleRenewal entity.

func (*CycleRenewalUpdateOne) AddExtendDay

func (_u *CycleRenewalUpdateOne) AddExtendDay(v int8) *CycleRenewalUpdateOne

AddExtendDay adds value to the "extend_day" field.

func (*CycleRenewalUpdateOne) AddExtendPrice

func (_u *CycleRenewalUpdateOne) AddExtendPrice(v float64) *CycleRenewalUpdateOne

AddExtendPrice adds value to the "extend_price" field.

func (*CycleRenewalUpdateOne) AddResourceType

func (_u *CycleRenewalUpdateOne) AddResourceType(v int) *CycleRenewalUpdateOne

AddResourceType adds value to the "resource_type" field.

func (*CycleRenewalUpdateOne) AddState

AddState adds value to the "state" field.

func (*CycleRenewalUpdateOne) ClearDueTime

func (_u *CycleRenewalUpdateOne) ClearDueTime() *CycleRenewalUpdateOne

ClearDueTime clears the value of the "due_time" field.

func (*CycleRenewalUpdateOne) ClearRenewalTime

func (_u *CycleRenewalUpdateOne) ClearRenewalTime() *CycleRenewalUpdateOne

ClearRenewalTime clears the value of the "renewal_time" field.

func (*CycleRenewalUpdateOne) Exec

Exec executes the query on the entity.

func (*CycleRenewalUpdateOne) ExecX

func (_u *CycleRenewalUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleRenewalUpdateOne) Mutation

Mutation returns the CycleRenewalMutation object of the builder.

func (*CycleRenewalUpdateOne) Save

Save executes the query and returns the updated CycleRenewal entity.

func (*CycleRenewalUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*CycleRenewalUpdateOne) Select

func (_u *CycleRenewalUpdateOne) Select(field string, fields ...string) *CycleRenewalUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CycleRenewalUpdateOne) SetAutoRenewal

func (_u *CycleRenewalUpdateOne) SetAutoRenewal(v bool) *CycleRenewalUpdateOne

SetAutoRenewal sets the "auto_renewal" field.

func (*CycleRenewalUpdateOne) SetDueTime

SetDueTime sets the "due_time" field.

func (*CycleRenewalUpdateOne) SetExtendDay

func (_u *CycleRenewalUpdateOne) SetExtendDay(v int8) *CycleRenewalUpdateOne

SetExtendDay sets the "extend_day" field.

func (*CycleRenewalUpdateOne) SetExtendPrice

func (_u *CycleRenewalUpdateOne) SetExtendPrice(v float64) *CycleRenewalUpdateOne

SetExtendPrice sets the "extend_price" field.

func (*CycleRenewalUpdateOne) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleRenewalUpdateOne) SetNillableAutoRenewal

func (_u *CycleRenewalUpdateOne) SetNillableAutoRenewal(v *bool) *CycleRenewalUpdateOne

SetNillableAutoRenewal sets the "auto_renewal" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableDueTime

func (_u *CycleRenewalUpdateOne) SetNillableDueTime(v *time.Time) *CycleRenewalUpdateOne

SetNillableDueTime sets the "due_time" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableExtendDay

func (_u *CycleRenewalUpdateOne) SetNillableExtendDay(v *int8) *CycleRenewalUpdateOne

SetNillableExtendDay sets the "extend_day" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableExtendPrice

func (_u *CycleRenewalUpdateOne) SetNillableExtendPrice(v *float64) *CycleRenewalUpdateOne

SetNillableExtendPrice sets the "extend_price" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableFkUserID

func (_u *CycleRenewalUpdateOne) SetNillableFkUserID(v *uuid.UUID) *CycleRenewalUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableProductDesc

func (_u *CycleRenewalUpdateOne) SetNillableProductDesc(v *string) *CycleRenewalUpdateOne

SetNillableProductDesc sets the "product_desc" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableProductName

func (_u *CycleRenewalUpdateOne) SetNillableProductName(v *string) *CycleRenewalUpdateOne

SetNillableProductName sets the "product_name" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableRenewalTime

func (_u *CycleRenewalUpdateOne) SetNillableRenewalTime(v *time.Time) *CycleRenewalUpdateOne

SetNillableRenewalTime sets the "renewal_time" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableResourceID

func (_u *CycleRenewalUpdateOne) SetNillableResourceID(v *uuid.UUID) *CycleRenewalUpdateOne

SetNillableResourceID sets the "resource_id" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableResourceType

func (_u *CycleRenewalUpdateOne) SetNillableResourceType(v *int) *CycleRenewalUpdateOne

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetNillableState

func (_u *CycleRenewalUpdateOne) SetNillableState(v *int8) *CycleRenewalUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*CycleRenewalUpdateOne) SetProductDesc

func (_u *CycleRenewalUpdateOne) SetProductDesc(v string) *CycleRenewalUpdateOne

SetProductDesc sets the "product_desc" field.

func (*CycleRenewalUpdateOne) SetProductName

func (_u *CycleRenewalUpdateOne) SetProductName(v string) *CycleRenewalUpdateOne

SetProductName sets the "product_name" field.

func (*CycleRenewalUpdateOne) SetRenewalTime

func (_u *CycleRenewalUpdateOne) SetRenewalTime(v time.Time) *CycleRenewalUpdateOne

SetRenewalTime sets the "renewal_time" field.

func (*CycleRenewalUpdateOne) SetResourceID

func (_u *CycleRenewalUpdateOne) SetResourceID(v uuid.UUID) *CycleRenewalUpdateOne

SetResourceID sets the "resource_id" field.

func (*CycleRenewalUpdateOne) SetResourceType

func (_u *CycleRenewalUpdateOne) SetResourceType(v int) *CycleRenewalUpdateOne

SetResourceType sets the "resource_type" field.

func (*CycleRenewalUpdateOne) SetState

SetState sets the "state" field.

func (*CycleRenewalUpdateOne) Where

Where appends a list predicates to the CycleRenewalUpdate builder.

type CycleRenewals

type CycleRenewals []*CycleRenewal

CycleRenewals is a parsable slice of CycleRenewal.

type CycleSelect

type CycleSelect struct {
	*CycleQuery
	// contains filtered or unexported fields
}

CycleSelect is the builder for selecting fields of Cycle entities.

func (*CycleSelect) Aggregate

func (_s *CycleSelect) Aggregate(fns ...AggregateFunc) *CycleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CycleSelect) Bool

func (s *CycleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleSelect) BoolX

func (s *CycleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleSelect) Bools

func (s *CycleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleSelect) BoolsX

func (s *CycleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleSelect) Float64

func (s *CycleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleSelect) Float64X

func (s *CycleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleSelect) Float64s

func (s *CycleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleSelect) Float64sX

func (s *CycleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleSelect) Int

func (s *CycleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleSelect) IntX

func (s *CycleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleSelect) Ints

func (s *CycleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleSelect) IntsX

func (s *CycleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleSelect) Scan

func (_s *CycleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleSelect) ScanX

func (s *CycleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleSelect) String

func (s *CycleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleSelect) StringX

func (s *CycleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleSelect) Strings

func (s *CycleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleSelect) StringsX

func (s *CycleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleTransaction

type CycleTransaction struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// cycleId
	FkCycleID uuid.UUID `json:"fk_cycle_id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// fk_cycle_order_id
	FkCycleOrderID uuid.UUID `json:"fk_cycle_order_id,omitempty"`
	// fk_cycle_recharge_id
	FkCycleRechargeID uuid.UUID `json:"fk_cycle_recharge_id,omitempty"`
	// 操作
	Operation string `json:"operation,omitempty"`
	// symbol
	Symbol string `json:"symbol,omitempty"`
	// Cycle holds the value of the "cycle" field.
	Cycle float64 `json:"cycle,omitempty"`
	// 余额
	Balance float64 `json:"balance,omitempty"`
	// 操作时间
	OperationTime time.Time `json:"operation_time,omitempty"`
	// contains filtered or unexported fields
}

CycleTransaction is the model entity for the CycleTransaction schema.

func (*CycleTransaction) String

func (_m *CycleTransaction) String() string

String implements the fmt.Stringer.

func (*CycleTransaction) Unwrap

func (_m *CycleTransaction) Unwrap() *CycleTransaction

Unwrap unwraps the CycleTransaction 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 (*CycleTransaction) Update

Update returns a builder for updating this CycleTransaction. Note that you need to call CycleTransaction.Unwrap() before calling this method if this CycleTransaction was returned from a transaction, and the transaction was committed or rolled back.

func (*CycleTransaction) Value

func (_m *CycleTransaction) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the CycleTransaction. This includes values selected through modifiers, order, etc.

type CycleTransactionClient

type CycleTransactionClient struct {
	// contains filtered or unexported fields
}

CycleTransactionClient is a client for the CycleTransaction schema.

func NewCycleTransactionClient

func NewCycleTransactionClient(c config) *CycleTransactionClient

NewCycleTransactionClient returns a client for the CycleTransaction from the given config.

func (*CycleTransactionClient) Create

Create returns a builder for creating a CycleTransaction entity.

func (*CycleTransactionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of CycleTransaction entities.

func (*CycleTransactionClient) Delete

Delete returns a delete builder for CycleTransaction.

func (*CycleTransactionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CycleTransactionClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CycleTransactionClient) Get

Get returns a CycleTransaction entity by its id.

func (*CycleTransactionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*CycleTransactionClient) Hooks

func (c *CycleTransactionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CycleTransactionClient) Intercept

func (c *CycleTransactionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cycletransaction.Intercept(f(g(h())))`.

func (*CycleTransactionClient) Interceptors

func (c *CycleTransactionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CycleTransactionClient) MapCreateBulk

func (c *CycleTransactionClient) MapCreateBulk(slice any, setFunc func(*CycleTransactionCreate, int)) *CycleTransactionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CycleTransactionClient) Query

Query returns a query builder for CycleTransaction.

func (*CycleTransactionClient) Update

Update returns an update builder for CycleTransaction.

func (*CycleTransactionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CycleTransactionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*CycleTransactionClient) Use

func (c *CycleTransactionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cycletransaction.Hooks(f(g(h())))`.

type CycleTransactionCreate

type CycleTransactionCreate struct {
	// contains filtered or unexported fields
}

CycleTransactionCreate is the builder for creating a CycleTransaction entity.

func (*CycleTransactionCreate) Exec

Exec executes the query.

func (*CycleTransactionCreate) ExecX

func (_c *CycleTransactionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleTransactionCreate) Mutation

Mutation returns the CycleTransactionMutation object of the builder.

func (*CycleTransactionCreate) Save

Save creates the CycleTransaction in the database.

func (*CycleTransactionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CycleTransactionCreate) SetBalance

SetBalance sets the "balance" field.

func (*CycleTransactionCreate) SetCycle

SetCycle sets the "cycle" field.

func (*CycleTransactionCreate) SetFkCycleID

SetFkCycleID sets the "fk_cycle_id" field.

func (*CycleTransactionCreate) SetFkCycleOrderID

func (_c *CycleTransactionCreate) SetFkCycleOrderID(v uuid.UUID) *CycleTransactionCreate

SetFkCycleOrderID sets the "fk_cycle_order_id" field.

func (*CycleTransactionCreate) SetFkCycleRechargeID

func (_c *CycleTransactionCreate) SetFkCycleRechargeID(v uuid.UUID) *CycleTransactionCreate

SetFkCycleRechargeID sets the "fk_cycle_recharge_id" field.

func (*CycleTransactionCreate) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleTransactionCreate) SetID

SetID sets the "id" field.

func (*CycleTransactionCreate) SetNillableID

func (_c *CycleTransactionCreate) SetNillableID(v *uuid.UUID) *CycleTransactionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CycleTransactionCreate) SetOperation

SetOperation sets the "operation" field.

func (*CycleTransactionCreate) SetOperationTime

func (_c *CycleTransactionCreate) SetOperationTime(v time.Time) *CycleTransactionCreate

SetOperationTime sets the "operation_time" field.

func (*CycleTransactionCreate) SetSymbol

SetSymbol sets the "symbol" field.

type CycleTransactionCreateBulk

type CycleTransactionCreateBulk struct {
	// contains filtered or unexported fields
}

CycleTransactionCreateBulk is the builder for creating many CycleTransaction entities in bulk.

func (*CycleTransactionCreateBulk) Exec

Exec executes the query.

func (*CycleTransactionCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*CycleTransactionCreateBulk) Save

Save creates the CycleTransaction entities in the database.

func (*CycleTransactionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type CycleTransactionDelete

type CycleTransactionDelete struct {
	// contains filtered or unexported fields
}

CycleTransactionDelete is the builder for deleting a CycleTransaction entity.

func (*CycleTransactionDelete) Exec

func (_d *CycleTransactionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CycleTransactionDelete) ExecX

func (_d *CycleTransactionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CycleTransactionDelete) Where

Where appends a list predicates to the CycleTransactionDelete builder.

type CycleTransactionDeleteOne

type CycleTransactionDeleteOne struct {
	// contains filtered or unexported fields
}

CycleTransactionDeleteOne is the builder for deleting a single CycleTransaction entity.

func (*CycleTransactionDeleteOne) Exec

Exec executes the deletion query.

func (*CycleTransactionDeleteOne) ExecX

func (_d *CycleTransactionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleTransactionDeleteOne) Where

Where appends a list predicates to the CycleTransactionDelete builder.

type CycleTransactionGroupBy

type CycleTransactionGroupBy struct {
	// contains filtered or unexported fields
}

CycleTransactionGroupBy is the group-by builder for CycleTransaction entities.

func (*CycleTransactionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*CycleTransactionGroupBy) Bool

func (s *CycleTransactionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) BoolX

func (s *CycleTransactionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleTransactionGroupBy) Bools

func (s *CycleTransactionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) BoolsX

func (s *CycleTransactionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleTransactionGroupBy) Float64

func (s *CycleTransactionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) Float64X

func (s *CycleTransactionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleTransactionGroupBy) Float64s

func (s *CycleTransactionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) Float64sX

func (s *CycleTransactionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleTransactionGroupBy) Int

func (s *CycleTransactionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) IntX

func (s *CycleTransactionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleTransactionGroupBy) Ints

func (s *CycleTransactionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) IntsX

func (s *CycleTransactionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleTransactionGroupBy) Scan

func (_g *CycleTransactionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleTransactionGroupBy) ScanX

func (s *CycleTransactionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleTransactionGroupBy) String

func (s *CycleTransactionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) StringX

func (s *CycleTransactionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleTransactionGroupBy) Strings

func (s *CycleTransactionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleTransactionGroupBy) StringsX

func (s *CycleTransactionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleTransactionMutation

type CycleTransactionMutation struct {
	// contains filtered or unexported fields
}

CycleTransactionMutation represents an operation that mutates the CycleTransaction nodes in the graph.

func (*CycleTransactionMutation) AddBalance

func (m *CycleTransactionMutation) AddBalance(f float64)

AddBalance adds f to the "balance" field.

func (*CycleTransactionMutation) AddCycle

func (m *CycleTransactionMutation) AddCycle(f float64)

AddCycle adds f to the "cycle" field.

func (*CycleTransactionMutation) AddField

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) AddedBalance

func (m *CycleTransactionMutation) AddedBalance() (r float64, exists bool)

AddedBalance returns the value that was added to the "balance" field in this mutation.

func (*CycleTransactionMutation) AddedCycle

func (m *CycleTransactionMutation) AddedCycle() (r float64, exists bool)

AddedCycle returns the value that was added to the "cycle" field in this mutation.

func (*CycleTransactionMutation) AddedEdges

func (m *CycleTransactionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CycleTransactionMutation) AddedField

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) AddedFields

func (m *CycleTransactionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CycleTransactionMutation) AddedIDs

func (m *CycleTransactionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CycleTransactionMutation) Balance

func (m *CycleTransactionMutation) Balance() (r float64, exists bool)

Balance returns the value of the "balance" field in the mutation.

func (*CycleTransactionMutation) ClearEdge

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) ClearField

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) ClearedEdges

func (m *CycleTransactionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CycleTransactionMutation) ClearedFields

func (m *CycleTransactionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CycleTransactionMutation) Client

func (m CycleTransactionMutation) 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 (*CycleTransactionMutation) Cycle

func (m *CycleTransactionMutation) Cycle() (r float64, exists bool)

Cycle returns the value of the "cycle" field in the mutation.

func (*CycleTransactionMutation) EdgeCleared

func (m *CycleTransactionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CycleTransactionMutation) Field

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) FieldCleared

func (m *CycleTransactionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CycleTransactionMutation) Fields

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) FkCycleID

func (m *CycleTransactionMutation) FkCycleID() (r uuid.UUID, exists bool)

FkCycleID returns the value of the "fk_cycle_id" field in the mutation.

func (*CycleTransactionMutation) FkCycleOrderID

func (m *CycleTransactionMutation) FkCycleOrderID() (r uuid.UUID, exists bool)

FkCycleOrderID returns the value of the "fk_cycle_order_id" field in the mutation.

func (*CycleTransactionMutation) FkCycleRechargeID

func (m *CycleTransactionMutation) FkCycleRechargeID() (r uuid.UUID, exists bool)

FkCycleRechargeID returns the value of the "fk_cycle_recharge_id" field in the mutation.

func (*CycleTransactionMutation) FkUserID

func (m *CycleTransactionMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*CycleTransactionMutation) ID

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) 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 (*CycleTransactionMutation) OldBalance

func (m *CycleTransactionMutation) OldBalance(ctx context.Context) (v float64, err error)

OldBalance returns the old "balance" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldCycle

func (m *CycleTransactionMutation) OldCycle(ctx context.Context) (v float64, err error)

OldCycle returns the old "cycle" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldField

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) OldFkCycleID

func (m *CycleTransactionMutation) OldFkCycleID(ctx context.Context) (v uuid.UUID, err error)

OldFkCycleID returns the old "fk_cycle_id" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldFkCycleOrderID

func (m *CycleTransactionMutation) OldFkCycleOrderID(ctx context.Context) (v uuid.UUID, err error)

OldFkCycleOrderID returns the old "fk_cycle_order_id" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldFkCycleRechargeID

func (m *CycleTransactionMutation) OldFkCycleRechargeID(ctx context.Context) (v uuid.UUID, err error)

OldFkCycleRechargeID returns the old "fk_cycle_recharge_id" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldFkUserID

func (m *CycleTransactionMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldOperation

func (m *CycleTransactionMutation) OldOperation(ctx context.Context) (v string, err error)

OldOperation returns the old "operation" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldOperationTime

func (m *CycleTransactionMutation) OldOperationTime(ctx context.Context) (v time.Time, err error)

OldOperationTime returns the old "operation_time" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) OldSymbol

func (m *CycleTransactionMutation) OldSymbol(ctx context.Context) (v string, err error)

OldSymbol returns the old "symbol" field's value of the CycleTransaction entity. If the CycleTransaction 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 (*CycleTransactionMutation) Op

func (m *CycleTransactionMutation) Op() Op

Op returns the operation name.

func (*CycleTransactionMutation) Operation

func (m *CycleTransactionMutation) Operation() (r string, exists bool)

Operation returns the value of the "operation" field in the mutation.

func (*CycleTransactionMutation) OperationTime

func (m *CycleTransactionMutation) OperationTime() (r time.Time, exists bool)

OperationTime returns the value of the "operation_time" field in the mutation.

func (*CycleTransactionMutation) RemovedEdges

func (m *CycleTransactionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CycleTransactionMutation) RemovedIDs

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) ResetBalance

func (m *CycleTransactionMutation) ResetBalance()

ResetBalance resets all changes to the "balance" field.

func (*CycleTransactionMutation) ResetCycle

func (m *CycleTransactionMutation) ResetCycle()

ResetCycle resets all changes to the "cycle" field.

func (*CycleTransactionMutation) ResetEdge

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) ResetField

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) ResetFkCycleID

func (m *CycleTransactionMutation) ResetFkCycleID()

ResetFkCycleID resets all changes to the "fk_cycle_id" field.

func (*CycleTransactionMutation) ResetFkCycleOrderID

func (m *CycleTransactionMutation) ResetFkCycleOrderID()

ResetFkCycleOrderID resets all changes to the "fk_cycle_order_id" field.

func (*CycleTransactionMutation) ResetFkCycleRechargeID

func (m *CycleTransactionMutation) ResetFkCycleRechargeID()

ResetFkCycleRechargeID resets all changes to the "fk_cycle_recharge_id" field.

func (*CycleTransactionMutation) ResetFkUserID

func (m *CycleTransactionMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*CycleTransactionMutation) ResetOperation

func (m *CycleTransactionMutation) ResetOperation()

ResetOperation resets all changes to the "operation" field.

func (*CycleTransactionMutation) ResetOperationTime

func (m *CycleTransactionMutation) ResetOperationTime()

ResetOperationTime resets all changes to the "operation_time" field.

func (*CycleTransactionMutation) ResetSymbol

func (m *CycleTransactionMutation) ResetSymbol()

ResetSymbol resets all changes to the "symbol" field.

func (*CycleTransactionMutation) SetBalance

func (m *CycleTransactionMutation) SetBalance(f float64)

SetBalance sets the "balance" field.

func (*CycleTransactionMutation) SetCycle

func (m *CycleTransactionMutation) SetCycle(f float64)

SetCycle sets the "cycle" field.

func (*CycleTransactionMutation) SetField

func (m *CycleTransactionMutation) 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 (*CycleTransactionMutation) SetFkCycleID

func (m *CycleTransactionMutation) SetFkCycleID(u uuid.UUID)

SetFkCycleID sets the "fk_cycle_id" field.

func (*CycleTransactionMutation) SetFkCycleOrderID

func (m *CycleTransactionMutation) SetFkCycleOrderID(u uuid.UUID)

SetFkCycleOrderID sets the "fk_cycle_order_id" field.

func (*CycleTransactionMutation) SetFkCycleRechargeID

func (m *CycleTransactionMutation) SetFkCycleRechargeID(u uuid.UUID)

SetFkCycleRechargeID sets the "fk_cycle_recharge_id" field.

func (*CycleTransactionMutation) SetFkUserID

func (m *CycleTransactionMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*CycleTransactionMutation) SetID

func (m *CycleTransactionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of CycleTransaction entities.

func (*CycleTransactionMutation) SetOp

func (m *CycleTransactionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CycleTransactionMutation) SetOperation

func (m *CycleTransactionMutation) SetOperation(s string)

SetOperation sets the "operation" field.

func (*CycleTransactionMutation) SetOperationTime

func (m *CycleTransactionMutation) SetOperationTime(t time.Time)

SetOperationTime sets the "operation_time" field.

func (*CycleTransactionMutation) SetSymbol

func (m *CycleTransactionMutation) SetSymbol(s string)

SetSymbol sets the "symbol" field.

func (*CycleTransactionMutation) Symbol

func (m *CycleTransactionMutation) Symbol() (r string, exists bool)

Symbol returns the value of the "symbol" field in the mutation.

func (CycleTransactionMutation) Tx

func (m CycleTransactionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CycleTransactionMutation) Type

func (m *CycleTransactionMutation) Type() string

Type returns the node type of this mutation (CycleTransaction).

func (*CycleTransactionMutation) Where

Where appends a list predicates to the CycleTransactionMutation builder.

func (*CycleTransactionMutation) WhereP

func (m *CycleTransactionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CycleTransactionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CycleTransactionQuery

type CycleTransactionQuery struct {
	// contains filtered or unexported fields
}

CycleTransactionQuery is the builder for querying CycleTransaction entities.

func (*CycleTransactionQuery) Aggregate

Aggregate returns a CycleTransactionSelect configured with the given aggregations.

func (*CycleTransactionQuery) All

All executes the query and returns a list of CycleTransactions.

func (*CycleTransactionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*CycleTransactionQuery) Clone

Clone returns a duplicate of the CycleTransactionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CycleTransactionQuery) Count

func (_q *CycleTransactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CycleTransactionQuery) CountX

func (_q *CycleTransactionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CycleTransactionQuery) Exist

func (_q *CycleTransactionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CycleTransactionQuery) ExistX

func (_q *CycleTransactionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CycleTransactionQuery) First

First returns the first CycleTransaction entity from the query. Returns a *NotFoundError when no CycleTransaction was found.

func (*CycleTransactionQuery) FirstID

func (_q *CycleTransactionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first CycleTransaction ID from the query. Returns a *NotFoundError when no CycleTransaction ID was found.

func (*CycleTransactionQuery) FirstIDX

func (_q *CycleTransactionQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*CycleTransactionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*CycleTransactionQuery) GroupBy

func (_q *CycleTransactionQuery) GroupBy(field string, fields ...string) *CycleTransactionGroupBy

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 {
	FkCycleID uuid.UUID `json:"fk_cycle_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CycleTransaction.Query().
	GroupBy(cycletransaction.FieldFkCycleID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CycleTransactionQuery) IDs

func (_q *CycleTransactionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of CycleTransaction IDs.

func (*CycleTransactionQuery) IDsX

func (_q *CycleTransactionQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*CycleTransactionQuery) Limit

Limit the number of records to be returned by this query.

func (*CycleTransactionQuery) Offset

func (_q *CycleTransactionQuery) Offset(offset int) *CycleTransactionQuery

Offset to start from.

func (*CycleTransactionQuery) Only

Only returns a single CycleTransaction entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CycleTransaction entity is found. Returns a *NotFoundError when no CycleTransaction entities are found.

func (*CycleTransactionQuery) OnlyID

func (_q *CycleTransactionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only CycleTransaction ID in the query. Returns a *NotSingularError when more than one CycleTransaction ID is found. Returns a *NotFoundError when no entities are found.

func (*CycleTransactionQuery) OnlyIDX

func (_q *CycleTransactionQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CycleTransactionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*CycleTransactionQuery) Order

Order specifies how the records should be ordered.

func (*CycleTransactionQuery) Select

func (_q *CycleTransactionQuery) Select(fields ...string) *CycleTransactionSelect

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 {
	FkCycleID uuid.UUID `json:"fk_cycle_id,omitempty"`
}

client.CycleTransaction.Query().
	Select(cycletransaction.FieldFkCycleID).
	Scan(ctx, &v)

func (*CycleTransactionQuery) Unique

func (_q *CycleTransactionQuery) Unique(unique bool) *CycleTransactionQuery

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 (*CycleTransactionQuery) Where

Where adds a new predicate for the CycleTransactionQuery builder.

type CycleTransactionSelect

type CycleTransactionSelect struct {
	*CycleTransactionQuery
	// contains filtered or unexported fields
}

CycleTransactionSelect is the builder for selecting fields of CycleTransaction entities.

func (*CycleTransactionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*CycleTransactionSelect) Bool

func (s *CycleTransactionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) BoolX

func (s *CycleTransactionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CycleTransactionSelect) Bools

func (s *CycleTransactionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) BoolsX

func (s *CycleTransactionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CycleTransactionSelect) Float64

func (s *CycleTransactionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) Float64X

func (s *CycleTransactionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CycleTransactionSelect) Float64s

func (s *CycleTransactionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) Float64sX

func (s *CycleTransactionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CycleTransactionSelect) Int

func (s *CycleTransactionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) IntX

func (s *CycleTransactionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CycleTransactionSelect) Ints

func (s *CycleTransactionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) IntsX

func (s *CycleTransactionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CycleTransactionSelect) Scan

func (_s *CycleTransactionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CycleTransactionSelect) ScanX

func (s *CycleTransactionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CycleTransactionSelect) String

func (s *CycleTransactionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) StringX

func (s *CycleTransactionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CycleTransactionSelect) Strings

func (s *CycleTransactionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CycleTransactionSelect) StringsX

func (s *CycleTransactionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CycleTransactionUpdate

type CycleTransactionUpdate struct {
	// contains filtered or unexported fields
}

CycleTransactionUpdate is the builder for updating CycleTransaction entities.

func (*CycleTransactionUpdate) AddBalance

AddBalance adds value to the "balance" field.

func (*CycleTransactionUpdate) AddCycle

AddCycle adds value to the "cycle" field.

func (*CycleTransactionUpdate) Exec

Exec executes the query.

func (*CycleTransactionUpdate) ExecX

func (_u *CycleTransactionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleTransactionUpdate) Mutation

Mutation returns the CycleTransactionMutation object of the builder.

func (*CycleTransactionUpdate) Save

func (_u *CycleTransactionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CycleTransactionUpdate) SaveX

func (_u *CycleTransactionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CycleTransactionUpdate) SetBalance

SetBalance sets the "balance" field.

func (*CycleTransactionUpdate) SetCycle

SetCycle sets the "cycle" field.

func (*CycleTransactionUpdate) SetFkCycleID

SetFkCycleID sets the "fk_cycle_id" field.

func (*CycleTransactionUpdate) SetFkCycleOrderID

func (_u *CycleTransactionUpdate) SetFkCycleOrderID(v uuid.UUID) *CycleTransactionUpdate

SetFkCycleOrderID sets the "fk_cycle_order_id" field.

func (*CycleTransactionUpdate) SetFkCycleRechargeID

func (_u *CycleTransactionUpdate) SetFkCycleRechargeID(v uuid.UUID) *CycleTransactionUpdate

SetFkCycleRechargeID sets the "fk_cycle_recharge_id" field.

func (*CycleTransactionUpdate) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleTransactionUpdate) SetNillableBalance

func (_u *CycleTransactionUpdate) SetNillableBalance(v *float64) *CycleTransactionUpdate

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableCycle

func (_u *CycleTransactionUpdate) SetNillableCycle(v *float64) *CycleTransactionUpdate

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableFkCycleID

func (_u *CycleTransactionUpdate) SetNillableFkCycleID(v *uuid.UUID) *CycleTransactionUpdate

SetNillableFkCycleID sets the "fk_cycle_id" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableFkCycleOrderID

func (_u *CycleTransactionUpdate) SetNillableFkCycleOrderID(v *uuid.UUID) *CycleTransactionUpdate

SetNillableFkCycleOrderID sets the "fk_cycle_order_id" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableFkCycleRechargeID

func (_u *CycleTransactionUpdate) SetNillableFkCycleRechargeID(v *uuid.UUID) *CycleTransactionUpdate

SetNillableFkCycleRechargeID sets the "fk_cycle_recharge_id" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableFkUserID

func (_u *CycleTransactionUpdate) SetNillableFkUserID(v *uuid.UUID) *CycleTransactionUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableOperation

func (_u *CycleTransactionUpdate) SetNillableOperation(v *string) *CycleTransactionUpdate

SetNillableOperation sets the "operation" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableOperationTime

func (_u *CycleTransactionUpdate) SetNillableOperationTime(v *time.Time) *CycleTransactionUpdate

SetNillableOperationTime sets the "operation_time" field if the given value is not nil.

func (*CycleTransactionUpdate) SetNillableSymbol

func (_u *CycleTransactionUpdate) SetNillableSymbol(v *string) *CycleTransactionUpdate

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*CycleTransactionUpdate) SetOperation

SetOperation sets the "operation" field.

func (*CycleTransactionUpdate) SetOperationTime

func (_u *CycleTransactionUpdate) SetOperationTime(v time.Time) *CycleTransactionUpdate

SetOperationTime sets the "operation_time" field.

func (*CycleTransactionUpdate) SetSymbol

SetSymbol sets the "symbol" field.

func (*CycleTransactionUpdate) Where

Where appends a list predicates to the CycleTransactionUpdate builder.

type CycleTransactionUpdateOne

type CycleTransactionUpdateOne struct {
	// contains filtered or unexported fields
}

CycleTransactionUpdateOne is the builder for updating a single CycleTransaction entity.

func (*CycleTransactionUpdateOne) AddBalance

AddBalance adds value to the "balance" field.

func (*CycleTransactionUpdateOne) AddCycle

AddCycle adds value to the "cycle" field.

func (*CycleTransactionUpdateOne) Exec

Exec executes the query on the entity.

func (*CycleTransactionUpdateOne) ExecX

func (_u *CycleTransactionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleTransactionUpdateOne) Mutation

Mutation returns the CycleTransactionMutation object of the builder.

func (*CycleTransactionUpdateOne) Save

Save executes the query and returns the updated CycleTransaction entity.

func (*CycleTransactionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*CycleTransactionUpdateOne) Select

func (_u *CycleTransactionUpdateOne) Select(field string, fields ...string) *CycleTransactionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CycleTransactionUpdateOne) SetBalance

SetBalance sets the "balance" field.

func (*CycleTransactionUpdateOne) SetCycle

SetCycle sets the "cycle" field.

func (*CycleTransactionUpdateOne) SetFkCycleID

SetFkCycleID sets the "fk_cycle_id" field.

func (*CycleTransactionUpdateOne) SetFkCycleOrderID

SetFkCycleOrderID sets the "fk_cycle_order_id" field.

func (*CycleTransactionUpdateOne) SetFkCycleRechargeID

func (_u *CycleTransactionUpdateOne) SetFkCycleRechargeID(v uuid.UUID) *CycleTransactionUpdateOne

SetFkCycleRechargeID sets the "fk_cycle_recharge_id" field.

func (*CycleTransactionUpdateOne) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*CycleTransactionUpdateOne) SetNillableBalance

func (_u *CycleTransactionUpdateOne) SetNillableBalance(v *float64) *CycleTransactionUpdateOne

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableCycle

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableFkCycleID

func (_u *CycleTransactionUpdateOne) SetNillableFkCycleID(v *uuid.UUID) *CycleTransactionUpdateOne

SetNillableFkCycleID sets the "fk_cycle_id" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableFkCycleOrderID

func (_u *CycleTransactionUpdateOne) SetNillableFkCycleOrderID(v *uuid.UUID) *CycleTransactionUpdateOne

SetNillableFkCycleOrderID sets the "fk_cycle_order_id" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableFkCycleRechargeID

func (_u *CycleTransactionUpdateOne) SetNillableFkCycleRechargeID(v *uuid.UUID) *CycleTransactionUpdateOne

SetNillableFkCycleRechargeID sets the "fk_cycle_recharge_id" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableFkUserID

func (_u *CycleTransactionUpdateOne) SetNillableFkUserID(v *uuid.UUID) *CycleTransactionUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableOperation

func (_u *CycleTransactionUpdateOne) SetNillableOperation(v *string) *CycleTransactionUpdateOne

SetNillableOperation sets the "operation" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableOperationTime

func (_u *CycleTransactionUpdateOne) SetNillableOperationTime(v *time.Time) *CycleTransactionUpdateOne

SetNillableOperationTime sets the "operation_time" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetNillableSymbol

func (_u *CycleTransactionUpdateOne) SetNillableSymbol(v *string) *CycleTransactionUpdateOne

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*CycleTransactionUpdateOne) SetOperation

SetOperation sets the "operation" field.

func (*CycleTransactionUpdateOne) SetOperationTime

SetOperationTime sets the "operation_time" field.

func (*CycleTransactionUpdateOne) SetSymbol

SetSymbol sets the "symbol" field.

func (*CycleTransactionUpdateOne) Where

Where appends a list predicates to the CycleTransactionUpdate builder.

type CycleTransactions

type CycleTransactions []*CycleTransaction

CycleTransactions is a parsable slice of CycleTransaction.

type CycleUpdate

type CycleUpdate struct {
	// contains filtered or unexported fields
}

CycleUpdate is the builder for updating Cycle entities.

func (*CycleUpdate) AddCycle

func (_u *CycleUpdate) AddCycle(v float64) *CycleUpdate

AddCycle adds value to the "cycle" field.

func (*CycleUpdate) Exec

func (_u *CycleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CycleUpdate) ExecX

func (_u *CycleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleUpdate) Mutation

func (_u *CycleUpdate) Mutation() *CycleMutation

Mutation returns the CycleMutation object of the builder.

func (*CycleUpdate) Save

func (_u *CycleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CycleUpdate) SaveX

func (_u *CycleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CycleUpdate) SetCreateTime

func (_u *CycleUpdate) SetCreateTime(v time.Time) *CycleUpdate

SetCreateTime sets the "create_time" field.

func (*CycleUpdate) SetCycle

func (_u *CycleUpdate) SetCycle(v float64) *CycleUpdate

SetCycle sets the "cycle" field.

func (*CycleUpdate) SetFkUserID

func (_u *CycleUpdate) SetFkUserID(v uuid.UUID) *CycleUpdate

SetFkUserID sets the "fk_user_id" field.

func (*CycleUpdate) SetNillableCreateTime

func (_u *CycleUpdate) SetNillableCreateTime(v *time.Time) *CycleUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleUpdate) SetNillableCycle

func (_u *CycleUpdate) SetNillableCycle(v *float64) *CycleUpdate

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleUpdate) SetNillableFkUserID

func (_u *CycleUpdate) SetNillableFkUserID(v *uuid.UUID) *CycleUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleUpdate) SetNillableUpdateTime

func (_u *CycleUpdate) SetNillableUpdateTime(v *time.Time) *CycleUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CycleUpdate) SetUpdateTime

func (_u *CycleUpdate) SetUpdateTime(v time.Time) *CycleUpdate

SetUpdateTime sets the "update_time" field.

func (*CycleUpdate) Where

func (_u *CycleUpdate) Where(ps ...predicate.Cycle) *CycleUpdate

Where appends a list predicates to the CycleUpdate builder.

type CycleUpdateOne

type CycleUpdateOne struct {
	// contains filtered or unexported fields
}

CycleUpdateOne is the builder for updating a single Cycle entity.

func (*CycleUpdateOne) AddCycle

func (_u *CycleUpdateOne) AddCycle(v float64) *CycleUpdateOne

AddCycle adds value to the "cycle" field.

func (*CycleUpdateOne) Exec

func (_u *CycleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CycleUpdateOne) ExecX

func (_u *CycleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CycleUpdateOne) Mutation

func (_u *CycleUpdateOne) Mutation() *CycleMutation

Mutation returns the CycleMutation object of the builder.

func (*CycleUpdateOne) Save

func (_u *CycleUpdateOne) Save(ctx context.Context) (*Cycle, error)

Save executes the query and returns the updated Cycle entity.

func (*CycleUpdateOne) SaveX

func (_u *CycleUpdateOne) SaveX(ctx context.Context) *Cycle

SaveX is like Save, but panics if an error occurs.

func (*CycleUpdateOne) Select

func (_u *CycleUpdateOne) Select(field string, fields ...string) *CycleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CycleUpdateOne) SetCreateTime

func (_u *CycleUpdateOne) SetCreateTime(v time.Time) *CycleUpdateOne

SetCreateTime sets the "create_time" field.

func (*CycleUpdateOne) SetCycle

func (_u *CycleUpdateOne) SetCycle(v float64) *CycleUpdateOne

SetCycle sets the "cycle" field.

func (*CycleUpdateOne) SetFkUserID

func (_u *CycleUpdateOne) SetFkUserID(v uuid.UUID) *CycleUpdateOne

SetFkUserID sets the "fk_user_id" field.

func (*CycleUpdateOne) SetNillableCreateTime

func (_u *CycleUpdateOne) SetNillableCreateTime(v *time.Time) *CycleUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CycleUpdateOne) SetNillableCycle

func (_u *CycleUpdateOne) SetNillableCycle(v *float64) *CycleUpdateOne

SetNillableCycle sets the "cycle" field if the given value is not nil.

func (*CycleUpdateOne) SetNillableFkUserID

func (_u *CycleUpdateOne) SetNillableFkUserID(v *uuid.UUID) *CycleUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*CycleUpdateOne) SetNillableUpdateTime

func (_u *CycleUpdateOne) SetNillableUpdateTime(v *time.Time) *CycleUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CycleUpdateOne) SetUpdateTime

func (_u *CycleUpdateOne) SetUpdateTime(v time.Time) *CycleUpdateOne

SetUpdateTime sets the "update_time" field.

func (*CycleUpdateOne) Where

func (_u *CycleUpdateOne) Where(ps ...predicate.Cycle) *CycleUpdateOne

Where appends a list predicates to the CycleUpdate builder.

type Cycles

type Cycles []*Cycle

Cycles is a parsable slice of Cycle.

type DomainBinding

type DomainBinding struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户ID
	UserID uuid.UUID `json:"user_id,omitempty"`
	// 实例ID
	FkComputeInstanceID uuid.UUID `json:"fk_compute_instance_id,omitempty"`
	// 网络映射id
	FkNetworkMappingID uuid.UUID `json:"fk_network_mapping_id,omitempty"`
	// 映射名
	Name string `json:"name,omitempty"`
	// 域名
	Domain string `json:"domain,omitempty"`
	// 映射到gateway的端口
	GatewayPort int32 `json:"gateway_port,omitempty"`
	// 创建时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

DomainBinding is the model entity for the DomainBinding schema.

func (*DomainBinding) String

func (_m *DomainBinding) String() string

String implements the fmt.Stringer.

func (*DomainBinding) Unwrap

func (_m *DomainBinding) Unwrap() *DomainBinding

Unwrap unwraps the DomainBinding 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 (*DomainBinding) Update

func (_m *DomainBinding) Update() *DomainBindingUpdateOne

Update returns a builder for updating this DomainBinding. Note that you need to call DomainBinding.Unwrap() before calling this method if this DomainBinding was returned from a transaction, and the transaction was committed or rolled back.

func (*DomainBinding) Value

func (_m *DomainBinding) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the DomainBinding. This includes values selected through modifiers, order, etc.

type DomainBindingClient

type DomainBindingClient struct {
	// contains filtered or unexported fields
}

DomainBindingClient is a client for the DomainBinding schema.

func NewDomainBindingClient

func NewDomainBindingClient(c config) *DomainBindingClient

NewDomainBindingClient returns a client for the DomainBinding from the given config.

func (*DomainBindingClient) Create

Create returns a builder for creating a DomainBinding entity.

func (*DomainBindingClient) CreateBulk

CreateBulk returns a builder for creating a bulk of DomainBinding entities.

func (*DomainBindingClient) Delete

Delete returns a delete builder for DomainBinding.

func (*DomainBindingClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DomainBindingClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DomainBindingClient) Get

Get returns a DomainBinding entity by its id.

func (*DomainBindingClient) GetX

GetX is like Get, but panics if an error occurs.

func (*DomainBindingClient) Hooks

func (c *DomainBindingClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DomainBindingClient) Intercept

func (c *DomainBindingClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `domainbinding.Intercept(f(g(h())))`.

func (*DomainBindingClient) Interceptors

func (c *DomainBindingClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DomainBindingClient) MapCreateBulk

func (c *DomainBindingClient) MapCreateBulk(slice any, setFunc func(*DomainBindingCreate, int)) *DomainBindingCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DomainBindingClient) Query

Query returns a query builder for DomainBinding.

func (*DomainBindingClient) Update

Update returns an update builder for DomainBinding.

func (*DomainBindingClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DomainBindingClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DomainBindingClient) Use

func (c *DomainBindingClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `domainbinding.Hooks(f(g(h())))`.

type DomainBindingCreate

type DomainBindingCreate struct {
	// contains filtered or unexported fields
}

DomainBindingCreate is the builder for creating a DomainBinding entity.

func (*DomainBindingCreate) Exec

func (_c *DomainBindingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DomainBindingCreate) ExecX

func (_c *DomainBindingCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DomainBindingCreate) Mutation

Mutation returns the DomainBindingMutation object of the builder.

func (*DomainBindingCreate) Save

Save creates the DomainBinding in the database.

func (*DomainBindingCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DomainBindingCreate) SetCreateTime

func (_c *DomainBindingCreate) SetCreateTime(v time.Time) *DomainBindingCreate

SetCreateTime sets the "create_time" field.

func (*DomainBindingCreate) SetDomain

SetDomain sets the "domain" field.

func (*DomainBindingCreate) SetFkComputeInstanceID

func (_c *DomainBindingCreate) SetFkComputeInstanceID(v uuid.UUID) *DomainBindingCreate

SetFkComputeInstanceID sets the "fk_compute_instance_id" field.

func (*DomainBindingCreate) SetFkNetworkMappingID

func (_c *DomainBindingCreate) SetFkNetworkMappingID(v uuid.UUID) *DomainBindingCreate

SetFkNetworkMappingID sets the "fk_network_mapping_id" field.

func (*DomainBindingCreate) SetGatewayPort

func (_c *DomainBindingCreate) SetGatewayPort(v int32) *DomainBindingCreate

SetGatewayPort sets the "gateway_port" field.

func (*DomainBindingCreate) SetID

SetID sets the "id" field.

func (*DomainBindingCreate) SetName

SetName sets the "name" field.

func (*DomainBindingCreate) SetNillableID

func (_c *DomainBindingCreate) SetNillableID(v *uuid.UUID) *DomainBindingCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*DomainBindingCreate) SetUserID

SetUserID sets the "user_id" field.

type DomainBindingCreateBulk

type DomainBindingCreateBulk struct {
	// contains filtered or unexported fields
}

DomainBindingCreateBulk is the builder for creating many DomainBinding entities in bulk.

func (*DomainBindingCreateBulk) Exec

Exec executes the query.

func (*DomainBindingCreateBulk) ExecX

func (_c *DomainBindingCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DomainBindingCreateBulk) Save

Save creates the DomainBinding entities in the database.

func (*DomainBindingCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type DomainBindingDelete

type DomainBindingDelete struct {
	// contains filtered or unexported fields
}

DomainBindingDelete is the builder for deleting a DomainBinding entity.

func (*DomainBindingDelete) Exec

func (_d *DomainBindingDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DomainBindingDelete) ExecX

func (_d *DomainBindingDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DomainBindingDelete) Where

Where appends a list predicates to the DomainBindingDelete builder.

type DomainBindingDeleteOne

type DomainBindingDeleteOne struct {
	// contains filtered or unexported fields
}

DomainBindingDeleteOne is the builder for deleting a single DomainBinding entity.

func (*DomainBindingDeleteOne) Exec

Exec executes the deletion query.

func (*DomainBindingDeleteOne) ExecX

func (_d *DomainBindingDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DomainBindingDeleteOne) Where

Where appends a list predicates to the DomainBindingDelete builder.

type DomainBindingGroupBy

type DomainBindingGroupBy struct {
	// contains filtered or unexported fields
}

DomainBindingGroupBy is the group-by builder for DomainBinding entities.

func (*DomainBindingGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*DomainBindingGroupBy) Bool

func (s *DomainBindingGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) BoolX

func (s *DomainBindingGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DomainBindingGroupBy) Bools

func (s *DomainBindingGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) BoolsX

func (s *DomainBindingGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DomainBindingGroupBy) Float64

func (s *DomainBindingGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) Float64X

func (s *DomainBindingGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DomainBindingGroupBy) Float64s

func (s *DomainBindingGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) Float64sX

func (s *DomainBindingGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DomainBindingGroupBy) Int

func (s *DomainBindingGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) IntX

func (s *DomainBindingGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DomainBindingGroupBy) Ints

func (s *DomainBindingGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) IntsX

func (s *DomainBindingGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DomainBindingGroupBy) Scan

func (_g *DomainBindingGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DomainBindingGroupBy) ScanX

func (s *DomainBindingGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DomainBindingGroupBy) String

func (s *DomainBindingGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) StringX

func (s *DomainBindingGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DomainBindingGroupBy) Strings

func (s *DomainBindingGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DomainBindingGroupBy) StringsX

func (s *DomainBindingGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DomainBindingMutation

type DomainBindingMutation struct {
	// contains filtered or unexported fields
}

DomainBindingMutation represents an operation that mutates the DomainBinding nodes in the graph.

func (*DomainBindingMutation) AddField

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) AddGatewayPort

func (m *DomainBindingMutation) AddGatewayPort(i int32)

AddGatewayPort adds i to the "gateway_port" field.

func (*DomainBindingMutation) AddedEdges

func (m *DomainBindingMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DomainBindingMutation) AddedField

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) AddedFields

func (m *DomainBindingMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DomainBindingMutation) AddedGatewayPort

func (m *DomainBindingMutation) AddedGatewayPort() (r int32, exists bool)

AddedGatewayPort returns the value that was added to the "gateway_port" field in this mutation.

func (*DomainBindingMutation) AddedIDs

func (m *DomainBindingMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DomainBindingMutation) ClearEdge

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) ClearField

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) ClearedEdges

func (m *DomainBindingMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DomainBindingMutation) ClearedFields

func (m *DomainBindingMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DomainBindingMutation) Client

func (m DomainBindingMutation) 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 (*DomainBindingMutation) CreateTime

func (m *DomainBindingMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DomainBindingMutation) Domain

func (m *DomainBindingMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*DomainBindingMutation) EdgeCleared

func (m *DomainBindingMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DomainBindingMutation) Field

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) FieldCleared

func (m *DomainBindingMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DomainBindingMutation) Fields

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) FkComputeInstanceID

func (m *DomainBindingMutation) FkComputeInstanceID() (r uuid.UUID, exists bool)

FkComputeInstanceID returns the value of the "fk_compute_instance_id" field in the mutation.

func (*DomainBindingMutation) FkNetworkMappingID

func (m *DomainBindingMutation) FkNetworkMappingID() (r uuid.UUID, exists bool)

FkNetworkMappingID returns the value of the "fk_network_mapping_id" field in the mutation.

func (*DomainBindingMutation) GatewayPort

func (m *DomainBindingMutation) GatewayPort() (r int32, exists bool)

GatewayPort returns the value of the "gateway_port" field in the mutation.

func (*DomainBindingMutation) ID

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) 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 (*DomainBindingMutation) Name

func (m *DomainBindingMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*DomainBindingMutation) OldCreateTime

func (m *DomainBindingMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DomainBinding entity. If the DomainBinding 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 (*DomainBindingMutation) OldDomain

func (m *DomainBindingMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the DomainBinding entity. If the DomainBinding 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 (*DomainBindingMutation) OldField

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) OldFkComputeInstanceID

func (m *DomainBindingMutation) OldFkComputeInstanceID(ctx context.Context) (v uuid.UUID, err error)

OldFkComputeInstanceID returns the old "fk_compute_instance_id" field's value of the DomainBinding entity. If the DomainBinding 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 (*DomainBindingMutation) OldFkNetworkMappingID

func (m *DomainBindingMutation) OldFkNetworkMappingID(ctx context.Context) (v uuid.UUID, err error)

OldFkNetworkMappingID returns the old "fk_network_mapping_id" field's value of the DomainBinding entity. If the DomainBinding 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 (*DomainBindingMutation) OldGatewayPort

func (m *DomainBindingMutation) OldGatewayPort(ctx context.Context) (v int32, err error)

OldGatewayPort returns the old "gateway_port" field's value of the DomainBinding entity. If the DomainBinding 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 (*DomainBindingMutation) OldName

func (m *DomainBindingMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the DomainBinding entity. If the DomainBinding 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 (*DomainBindingMutation) OldUserID

func (m *DomainBindingMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the DomainBinding entity. If the DomainBinding 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 (*DomainBindingMutation) Op

func (m *DomainBindingMutation) Op() Op

Op returns the operation name.

func (*DomainBindingMutation) RemovedEdges

func (m *DomainBindingMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DomainBindingMutation) RemovedIDs

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) ResetCreateTime

func (m *DomainBindingMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DomainBindingMutation) ResetDomain

func (m *DomainBindingMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*DomainBindingMutation) ResetEdge

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) ResetField

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) ResetFkComputeInstanceID

func (m *DomainBindingMutation) ResetFkComputeInstanceID()

ResetFkComputeInstanceID resets all changes to the "fk_compute_instance_id" field.

func (*DomainBindingMutation) ResetFkNetworkMappingID

func (m *DomainBindingMutation) ResetFkNetworkMappingID()

ResetFkNetworkMappingID resets all changes to the "fk_network_mapping_id" field.

func (*DomainBindingMutation) ResetGatewayPort

func (m *DomainBindingMutation) ResetGatewayPort()

ResetGatewayPort resets all changes to the "gateway_port" field.

func (*DomainBindingMutation) ResetName

func (m *DomainBindingMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DomainBindingMutation) ResetUserID

func (m *DomainBindingMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*DomainBindingMutation) SetCreateTime

func (m *DomainBindingMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DomainBindingMutation) SetDomain

func (m *DomainBindingMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*DomainBindingMutation) SetField

func (m *DomainBindingMutation) 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 (*DomainBindingMutation) SetFkComputeInstanceID

func (m *DomainBindingMutation) SetFkComputeInstanceID(u uuid.UUID)

SetFkComputeInstanceID sets the "fk_compute_instance_id" field.

func (*DomainBindingMutation) SetFkNetworkMappingID

func (m *DomainBindingMutation) SetFkNetworkMappingID(u uuid.UUID)

SetFkNetworkMappingID sets the "fk_network_mapping_id" field.

func (*DomainBindingMutation) SetGatewayPort

func (m *DomainBindingMutation) SetGatewayPort(i int32)

SetGatewayPort sets the "gateway_port" field.

func (*DomainBindingMutation) SetID

func (m *DomainBindingMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DomainBinding entities.

func (*DomainBindingMutation) SetName

func (m *DomainBindingMutation) SetName(s string)

SetName sets the "name" field.

func (*DomainBindingMutation) SetOp

func (m *DomainBindingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DomainBindingMutation) SetUserID

func (m *DomainBindingMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (DomainBindingMutation) Tx

func (m DomainBindingMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DomainBindingMutation) Type

func (m *DomainBindingMutation) Type() string

Type returns the node type of this mutation (DomainBinding).

func (*DomainBindingMutation) UserID

func (m *DomainBindingMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*DomainBindingMutation) Where

Where appends a list predicates to the DomainBindingMutation builder.

func (*DomainBindingMutation) WhereP

func (m *DomainBindingMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DomainBindingMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DomainBindingQuery

type DomainBindingQuery struct {
	// contains filtered or unexported fields
}

DomainBindingQuery is the builder for querying DomainBinding entities.

func (*DomainBindingQuery) Aggregate

func (_q *DomainBindingQuery) Aggregate(fns ...AggregateFunc) *DomainBindingSelect

Aggregate returns a DomainBindingSelect configured with the given aggregations.

func (*DomainBindingQuery) All

All executes the query and returns a list of DomainBindings.

func (*DomainBindingQuery) AllX

AllX is like All, but panics if an error occurs.

func (*DomainBindingQuery) Clone

Clone returns a duplicate of the DomainBindingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DomainBindingQuery) Count

func (_q *DomainBindingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DomainBindingQuery) CountX

func (_q *DomainBindingQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DomainBindingQuery) Exist

func (_q *DomainBindingQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DomainBindingQuery) ExistX

func (_q *DomainBindingQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DomainBindingQuery) First

First returns the first DomainBinding entity from the query. Returns a *NotFoundError when no DomainBinding was found.

func (*DomainBindingQuery) FirstID

func (_q *DomainBindingQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first DomainBinding ID from the query. Returns a *NotFoundError when no DomainBinding ID was found.

func (*DomainBindingQuery) FirstIDX

func (_q *DomainBindingQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*DomainBindingQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*DomainBindingQuery) GroupBy

func (_q *DomainBindingQuery) GroupBy(field string, fields ...string) *DomainBindingGroupBy

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 uuid.UUID `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DomainBinding.Query().
	GroupBy(domainbinding.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DomainBindingQuery) IDs

func (_q *DomainBindingQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of DomainBinding IDs.

func (*DomainBindingQuery) IDsX

func (_q *DomainBindingQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*DomainBindingQuery) Limit

func (_q *DomainBindingQuery) Limit(limit int) *DomainBindingQuery

Limit the number of records to be returned by this query.

func (*DomainBindingQuery) Offset

func (_q *DomainBindingQuery) Offset(offset int) *DomainBindingQuery

Offset to start from.

func (*DomainBindingQuery) Only

Only returns a single DomainBinding entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DomainBinding entity is found. Returns a *NotFoundError when no DomainBinding entities are found.

func (*DomainBindingQuery) OnlyID

func (_q *DomainBindingQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only DomainBinding ID in the query. Returns a *NotSingularError when more than one DomainBinding ID is found. Returns a *NotFoundError when no entities are found.

func (*DomainBindingQuery) OnlyIDX

func (_q *DomainBindingQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DomainBindingQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*DomainBindingQuery) Order

Order specifies how the records should be ordered.

func (*DomainBindingQuery) Select

func (_q *DomainBindingQuery) Select(fields ...string) *DomainBindingSelect

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 uuid.UUID `json:"user_id,omitempty"`
}

client.DomainBinding.Query().
	Select(domainbinding.FieldUserID).
	Scan(ctx, &v)

func (*DomainBindingQuery) Unique

func (_q *DomainBindingQuery) Unique(unique bool) *DomainBindingQuery

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 (*DomainBindingQuery) Where

Where adds a new predicate for the DomainBindingQuery builder.

type DomainBindingSelect

type DomainBindingSelect struct {
	*DomainBindingQuery
	// contains filtered or unexported fields
}

DomainBindingSelect is the builder for selecting fields of DomainBinding entities.

func (*DomainBindingSelect) Aggregate

func (_s *DomainBindingSelect) Aggregate(fns ...AggregateFunc) *DomainBindingSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DomainBindingSelect) Bool

func (s *DomainBindingSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) BoolX

func (s *DomainBindingSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DomainBindingSelect) Bools

func (s *DomainBindingSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) BoolsX

func (s *DomainBindingSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DomainBindingSelect) Float64

func (s *DomainBindingSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) Float64X

func (s *DomainBindingSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DomainBindingSelect) Float64s

func (s *DomainBindingSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) Float64sX

func (s *DomainBindingSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DomainBindingSelect) Int

func (s *DomainBindingSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) IntX

func (s *DomainBindingSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DomainBindingSelect) Ints

func (s *DomainBindingSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) IntsX

func (s *DomainBindingSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DomainBindingSelect) Scan

func (_s *DomainBindingSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DomainBindingSelect) ScanX

func (s *DomainBindingSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DomainBindingSelect) String

func (s *DomainBindingSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) StringX

func (s *DomainBindingSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DomainBindingSelect) Strings

func (s *DomainBindingSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DomainBindingSelect) StringsX

func (s *DomainBindingSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DomainBindingUpdate

type DomainBindingUpdate struct {
	// contains filtered or unexported fields
}

DomainBindingUpdate is the builder for updating DomainBinding entities.

func (*DomainBindingUpdate) AddGatewayPort

func (_u *DomainBindingUpdate) AddGatewayPort(v int32) *DomainBindingUpdate

AddGatewayPort adds value to the "gateway_port" field.

func (*DomainBindingUpdate) Exec

func (_u *DomainBindingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DomainBindingUpdate) ExecX

func (_u *DomainBindingUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DomainBindingUpdate) Mutation

Mutation returns the DomainBindingMutation object of the builder.

func (*DomainBindingUpdate) Save

func (_u *DomainBindingUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DomainBindingUpdate) SaveX

func (_u *DomainBindingUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DomainBindingUpdate) SetCreateTime

func (_u *DomainBindingUpdate) SetCreateTime(v time.Time) *DomainBindingUpdate

SetCreateTime sets the "create_time" field.

func (*DomainBindingUpdate) SetDomain

SetDomain sets the "domain" field.

func (*DomainBindingUpdate) SetFkComputeInstanceID

func (_u *DomainBindingUpdate) SetFkComputeInstanceID(v uuid.UUID) *DomainBindingUpdate

SetFkComputeInstanceID sets the "fk_compute_instance_id" field.

func (*DomainBindingUpdate) SetFkNetworkMappingID

func (_u *DomainBindingUpdate) SetFkNetworkMappingID(v uuid.UUID) *DomainBindingUpdate

SetFkNetworkMappingID sets the "fk_network_mapping_id" field.

func (*DomainBindingUpdate) SetGatewayPort

func (_u *DomainBindingUpdate) SetGatewayPort(v int32) *DomainBindingUpdate

SetGatewayPort sets the "gateway_port" field.

func (*DomainBindingUpdate) SetName

SetName sets the "name" field.

func (*DomainBindingUpdate) SetNillableCreateTime

func (_u *DomainBindingUpdate) SetNillableCreateTime(v *time.Time) *DomainBindingUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*DomainBindingUpdate) SetNillableDomain

func (_u *DomainBindingUpdate) SetNillableDomain(v *string) *DomainBindingUpdate

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*DomainBindingUpdate) SetNillableFkComputeInstanceID

func (_u *DomainBindingUpdate) SetNillableFkComputeInstanceID(v *uuid.UUID) *DomainBindingUpdate

SetNillableFkComputeInstanceID sets the "fk_compute_instance_id" field if the given value is not nil.

func (*DomainBindingUpdate) SetNillableFkNetworkMappingID

func (_u *DomainBindingUpdate) SetNillableFkNetworkMappingID(v *uuid.UUID) *DomainBindingUpdate

SetNillableFkNetworkMappingID sets the "fk_network_mapping_id" field if the given value is not nil.

func (*DomainBindingUpdate) SetNillableGatewayPort

func (_u *DomainBindingUpdate) SetNillableGatewayPort(v *int32) *DomainBindingUpdate

SetNillableGatewayPort sets the "gateway_port" field if the given value is not nil.

func (*DomainBindingUpdate) SetNillableName

func (_u *DomainBindingUpdate) SetNillableName(v *string) *DomainBindingUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*DomainBindingUpdate) SetNillableUserID

func (_u *DomainBindingUpdate) SetNillableUserID(v *uuid.UUID) *DomainBindingUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*DomainBindingUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*DomainBindingUpdate) Where

Where appends a list predicates to the DomainBindingUpdate builder.

type DomainBindingUpdateOne

type DomainBindingUpdateOne struct {
	// contains filtered or unexported fields
}

DomainBindingUpdateOne is the builder for updating a single DomainBinding entity.

func (*DomainBindingUpdateOne) AddGatewayPort

func (_u *DomainBindingUpdateOne) AddGatewayPort(v int32) *DomainBindingUpdateOne

AddGatewayPort adds value to the "gateway_port" field.

func (*DomainBindingUpdateOne) Exec

Exec executes the query on the entity.

func (*DomainBindingUpdateOne) ExecX

func (_u *DomainBindingUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DomainBindingUpdateOne) Mutation

Mutation returns the DomainBindingMutation object of the builder.

func (*DomainBindingUpdateOne) Save

Save executes the query and returns the updated DomainBinding entity.

func (*DomainBindingUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*DomainBindingUpdateOne) Select

func (_u *DomainBindingUpdateOne) Select(field string, fields ...string) *DomainBindingUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DomainBindingUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*DomainBindingUpdateOne) SetDomain

SetDomain sets the "domain" field.

func (*DomainBindingUpdateOne) SetFkComputeInstanceID

func (_u *DomainBindingUpdateOne) SetFkComputeInstanceID(v uuid.UUID) *DomainBindingUpdateOne

SetFkComputeInstanceID sets the "fk_compute_instance_id" field.

func (*DomainBindingUpdateOne) SetFkNetworkMappingID

func (_u *DomainBindingUpdateOne) SetFkNetworkMappingID(v uuid.UUID) *DomainBindingUpdateOne

SetFkNetworkMappingID sets the "fk_network_mapping_id" field.

func (*DomainBindingUpdateOne) SetGatewayPort

func (_u *DomainBindingUpdateOne) SetGatewayPort(v int32) *DomainBindingUpdateOne

SetGatewayPort sets the "gateway_port" field.

func (*DomainBindingUpdateOne) SetName

SetName sets the "name" field.

func (*DomainBindingUpdateOne) SetNillableCreateTime

func (_u *DomainBindingUpdateOne) SetNillableCreateTime(v *time.Time) *DomainBindingUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*DomainBindingUpdateOne) SetNillableDomain

func (_u *DomainBindingUpdateOne) SetNillableDomain(v *string) *DomainBindingUpdateOne

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*DomainBindingUpdateOne) SetNillableFkComputeInstanceID

func (_u *DomainBindingUpdateOne) SetNillableFkComputeInstanceID(v *uuid.UUID) *DomainBindingUpdateOne

SetNillableFkComputeInstanceID sets the "fk_compute_instance_id" field if the given value is not nil.

func (*DomainBindingUpdateOne) SetNillableFkNetworkMappingID

func (_u *DomainBindingUpdateOne) SetNillableFkNetworkMappingID(v *uuid.UUID) *DomainBindingUpdateOne

SetNillableFkNetworkMappingID sets the "fk_network_mapping_id" field if the given value is not nil.

func (*DomainBindingUpdateOne) SetNillableGatewayPort

func (_u *DomainBindingUpdateOne) SetNillableGatewayPort(v *int32) *DomainBindingUpdateOne

SetNillableGatewayPort sets the "gateway_port" field if the given value is not nil.

func (*DomainBindingUpdateOne) SetNillableName

func (_u *DomainBindingUpdateOne) SetNillableName(v *string) *DomainBindingUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*DomainBindingUpdateOne) SetNillableUserID

func (_u *DomainBindingUpdateOne) SetNillableUserID(v *uuid.UUID) *DomainBindingUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*DomainBindingUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*DomainBindingUpdateOne) Where

Where appends a list predicates to the DomainBindingUpdate builder.

type DomainBindings

type DomainBindings []*DomainBinding

DomainBindings is a parsable slice of DomainBinding.

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 (_m *Employee) String() string

String implements the fmt.Stringer.

func (*Employee) Unwrap

func (_m *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 (_m *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 (_m *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(_m *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) MapCreateBulk

func (c *EmployeeClient) MapCreateBulk(slice any, setFunc func(*EmployeeCreate, int)) *EmployeeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*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(_m *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 (_c *EmployeeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmployeeCreate) ExecX

func (_c *EmployeeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EmployeeCreate) Mutation

func (_c *EmployeeCreate) Mutation() *EmployeeMutation

Mutation returns the EmployeeMutation object of the builder.

func (*EmployeeCreate) Save

func (_c *EmployeeCreate) Save(ctx context.Context) (*Employee, error)

Save creates the Employee in the database.

func (*EmployeeCreate) SaveX

func (_c *EmployeeCreate) SaveX(ctx context.Context) *Employee

SaveX calls Save and panics if Save returns an error.

func (*EmployeeCreate) SetAge

func (_c *EmployeeCreate) SetAge(v int32) *EmployeeCreate

SetAge sets the "age" field.

func (*EmployeeCreate) SetName

func (_c *EmployeeCreate) SetName(v string) *EmployeeCreate

SetName sets the "name" field.

func (*EmployeeCreate) SetNillableAge

func (_c *EmployeeCreate) SetNillableAge(v *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 (_c *EmployeeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EmployeeCreateBulk) ExecX

func (_c *EmployeeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EmployeeCreateBulk) Save

func (_c *EmployeeCreateBulk) Save(ctx context.Context) ([]*Employee, error)

Save creates the Employee entities in the database.

func (*EmployeeCreateBulk) SaveX

func (_c *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 (_d *EmployeeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EmployeeDelete) ExecX

func (_d *EmployeeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EmployeeDelete) Where

func (_d *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 (_d *EmployeeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EmployeeDeleteOne) ExecX

func (_d *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 (_g *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 (_g *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 (_q *EmployeeQuery) Aggregate(fns ...AggregateFunc) *EmployeeSelect

Aggregate returns a EmployeeSelect configured with the given aggregations.

func (*EmployeeQuery) All

func (_q *EmployeeQuery) All(ctx context.Context) ([]*Employee, error)

All executes the query and returns a list of Employees.

func (*EmployeeQuery) AllX

func (_q *EmployeeQuery) AllX(ctx context.Context) []*Employee

AllX is like All, but panics if an error occurs.

func (*EmployeeQuery) Clone

func (_q *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 (_q *EmployeeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EmployeeQuery) CountX

func (_q *EmployeeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EmployeeQuery) Exist

func (_q *EmployeeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EmployeeQuery) ExistX

func (_q *EmployeeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EmployeeQuery) First

func (_q *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 (_q *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 (_q *EmployeeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EmployeeQuery) FirstX

func (_q *EmployeeQuery) FirstX(ctx context.Context) *Employee

FirstX is like First, but panics if an error occurs.

func (*EmployeeQuery) GroupBy

func (_q *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 (_q *EmployeeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Employee IDs.

func (*EmployeeQuery) IDsX

func (_q *EmployeeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EmployeeQuery) Limit

func (_q *EmployeeQuery) Limit(limit int) *EmployeeQuery

Limit the number of records to be returned by this query.

func (*EmployeeQuery) Offset

func (_q *EmployeeQuery) Offset(offset int) *EmployeeQuery

Offset to start from.

func (*EmployeeQuery) Only

func (_q *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 (_q *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 (_q *EmployeeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EmployeeQuery) OnlyX

func (_q *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 (_q *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 (_q *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 (_q *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 (_s *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 (_s *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 (_u *EmployeeUpdate) AddAge(v int32) *EmployeeUpdate

AddAge adds value to the "age" field.

func (*EmployeeUpdate) ClearAge

func (_u *EmployeeUpdate) ClearAge() *EmployeeUpdate

ClearAge clears the value of the "age" field.

func (*EmployeeUpdate) Exec

func (_u *EmployeeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmployeeUpdate) ExecX

func (_u *EmployeeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EmployeeUpdate) Mutation

func (_u *EmployeeUpdate) Mutation() *EmployeeMutation

Mutation returns the EmployeeMutation object of the builder.

func (*EmployeeUpdate) Save

func (_u *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 (_u *EmployeeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EmployeeUpdate) SetAge

func (_u *EmployeeUpdate) SetAge(v int32) *EmployeeUpdate

SetAge sets the "age" field.

func (*EmployeeUpdate) SetName

func (_u *EmployeeUpdate) SetName(v string) *EmployeeUpdate

SetName sets the "name" field.

func (*EmployeeUpdate) SetNillableAge

func (_u *EmployeeUpdate) SetNillableAge(v *int32) *EmployeeUpdate

SetNillableAge sets the "age" field if the given value is not nil.

func (*EmployeeUpdate) SetNillableName

func (_u *EmployeeUpdate) SetNillableName(v *string) *EmployeeUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*EmployeeUpdate) Where

func (_u *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 (_u *EmployeeUpdateOne) AddAge(v int32) *EmployeeUpdateOne

AddAge adds value to the "age" field.

func (*EmployeeUpdateOne) ClearAge

func (_u *EmployeeUpdateOne) ClearAge() *EmployeeUpdateOne

ClearAge clears the value of the "age" field.

func (*EmployeeUpdateOne) Exec

func (_u *EmployeeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EmployeeUpdateOne) ExecX

func (_u *EmployeeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EmployeeUpdateOne) Mutation

func (_u *EmployeeUpdateOne) Mutation() *EmployeeMutation

Mutation returns the EmployeeMutation object of the builder.

func (*EmployeeUpdateOne) Save

func (_u *EmployeeUpdateOne) Save(ctx context.Context) (*Employee, error)

Save executes the query and returns the updated Employee entity.

func (*EmployeeUpdateOne) SaveX

func (_u *EmployeeUpdateOne) SaveX(ctx context.Context) *Employee

SaveX is like Save, but panics if an error occurs.

func (*EmployeeUpdateOne) Select

func (_u *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 (_u *EmployeeUpdateOne) SetAge(v int32) *EmployeeUpdateOne

SetAge sets the "age" field.

func (*EmployeeUpdateOne) SetName

func (_u *EmployeeUpdateOne) SetName(v string) *EmployeeUpdateOne

SetName sets the "name" field.

func (*EmployeeUpdateOne) SetNillableAge

func (_u *EmployeeUpdateOne) SetNillableAge(v *int32) *EmployeeUpdateOne

SetNillableAge sets the "age" field if the given value is not nil.

func (*EmployeeUpdateOne) SetNillableName

func (_u *EmployeeUpdateOne) SetNillableName(v *string) *EmployeeUpdateOne

SetNillableName sets the "name" 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 Gateway

type Gateway struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// 网关ip
	IP string `json:"ip,omitempty"`
	// 端口号
	Port int32 `json:"port,omitempty"`
	// 内网ip
	InternalIP string `json:"internal_ip,omitempty"`
	// frp 认证Token
	AuthToken string `json:"auth_token,omitempty"`
	// contains filtered or unexported fields
}

Gateway is the model entity for the Gateway schema.

func (*Gateway) String

func (_m *Gateway) String() string

String implements the fmt.Stringer.

func (*Gateway) Unwrap

func (_m *Gateway) Unwrap() *Gateway

Unwrap unwraps the Gateway 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 (*Gateway) Update

func (_m *Gateway) Update() *GatewayUpdateOne

Update returns a builder for updating this Gateway. Note that you need to call Gateway.Unwrap() before calling this method if this Gateway was returned from a transaction, and the transaction was committed or rolled back.

func (*Gateway) Value

func (_m *Gateway) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Gateway. This includes values selected through modifiers, order, etc.

type GatewayClient

type GatewayClient struct {
	// contains filtered or unexported fields
}

GatewayClient is a client for the Gateway schema.

func NewGatewayClient

func NewGatewayClient(c config) *GatewayClient

NewGatewayClient returns a client for the Gateway from the given config.

func (*GatewayClient) Create

func (c *GatewayClient) Create() *GatewayCreate

Create returns a builder for creating a Gateway entity.

func (*GatewayClient) CreateBulk

func (c *GatewayClient) CreateBulk(builders ...*GatewayCreate) *GatewayCreateBulk

CreateBulk returns a builder for creating a bulk of Gateway entities.

func (*GatewayClient) Delete

func (c *GatewayClient) Delete() *GatewayDelete

Delete returns a delete builder for Gateway.

func (*GatewayClient) DeleteOne

func (c *GatewayClient) DeleteOne(_m *Gateway) *GatewayDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GatewayClient) DeleteOneID

func (c *GatewayClient) DeleteOneID(id uuid.UUID) *GatewayDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GatewayClient) Get

func (c *GatewayClient) Get(ctx context.Context, id uuid.UUID) (*Gateway, error)

Get returns a Gateway entity by its id.

func (*GatewayClient) GetX

func (c *GatewayClient) GetX(ctx context.Context, id uuid.UUID) *Gateway

GetX is like Get, but panics if an error occurs.

func (*GatewayClient) Hooks

func (c *GatewayClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GatewayClient) Intercept

func (c *GatewayClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `gateway.Intercept(f(g(h())))`.

func (*GatewayClient) Interceptors

func (c *GatewayClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GatewayClient) MapCreateBulk

func (c *GatewayClient) MapCreateBulk(slice any, setFunc func(*GatewayCreate, int)) *GatewayCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*GatewayClient) Query

func (c *GatewayClient) Query() *GatewayQuery

Query returns a query builder for Gateway.

func (*GatewayClient) Update

func (c *GatewayClient) Update() *GatewayUpdate

Update returns an update builder for Gateway.

func (*GatewayClient) UpdateOne

func (c *GatewayClient) UpdateOne(_m *Gateway) *GatewayUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GatewayClient) UpdateOneID

func (c *GatewayClient) UpdateOneID(id uuid.UUID) *GatewayUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GatewayClient) Use

func (c *GatewayClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `gateway.Hooks(f(g(h())))`.

type GatewayCreate

type GatewayCreate struct {
	// contains filtered or unexported fields
}

GatewayCreate is the builder for creating a Gateway entity.

func (*GatewayCreate) Exec

func (_c *GatewayCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GatewayCreate) ExecX

func (_c *GatewayCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayCreate) Mutation

func (_c *GatewayCreate) Mutation() *GatewayMutation

Mutation returns the GatewayMutation object of the builder.

func (*GatewayCreate) Save

func (_c *GatewayCreate) Save(ctx context.Context) (*Gateway, error)

Save creates the Gateway in the database.

func (*GatewayCreate) SaveX

func (_c *GatewayCreate) SaveX(ctx context.Context) *Gateway

SaveX calls Save and panics if Save returns an error.

func (*GatewayCreate) SetAuthToken added in v0.0.12

func (_c *GatewayCreate) SetAuthToken(v string) *GatewayCreate

SetAuthToken sets the "auth_token" field.

func (*GatewayCreate) SetID

func (_c *GatewayCreate) SetID(v uuid.UUID) *GatewayCreate

SetID sets the "id" field.

func (*GatewayCreate) SetIP

func (_c *GatewayCreate) SetIP(v string) *GatewayCreate

SetIP sets the "ip" field.

func (*GatewayCreate) SetInternalIP

func (_c *GatewayCreate) SetInternalIP(v string) *GatewayCreate

SetInternalIP sets the "internal_ip" field.

func (*GatewayCreate) SetName

func (_c *GatewayCreate) SetName(v string) *GatewayCreate

SetName sets the "name" field.

func (*GatewayCreate) SetNillableID

func (_c *GatewayCreate) SetNillableID(v *uuid.UUID) *GatewayCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*GatewayCreate) SetPort

func (_c *GatewayCreate) SetPort(v int32) *GatewayCreate

SetPort sets the "port" field.

type GatewayCreateBulk

type GatewayCreateBulk struct {
	// contains filtered or unexported fields
}

GatewayCreateBulk is the builder for creating many Gateway entities in bulk.

func (*GatewayCreateBulk) Exec

func (_c *GatewayCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GatewayCreateBulk) ExecX

func (_c *GatewayCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayCreateBulk) Save

func (_c *GatewayCreateBulk) Save(ctx context.Context) ([]*Gateway, error)

Save creates the Gateway entities in the database.

func (*GatewayCreateBulk) SaveX

func (_c *GatewayCreateBulk) SaveX(ctx context.Context) []*Gateway

SaveX is like Save, but panics if an error occurs.

type GatewayDelete

type GatewayDelete struct {
	// contains filtered or unexported fields
}

GatewayDelete is the builder for deleting a Gateway entity.

func (*GatewayDelete) Exec

func (_d *GatewayDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GatewayDelete) ExecX

func (_d *GatewayDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GatewayDelete) Where

func (_d *GatewayDelete) Where(ps ...predicate.Gateway) *GatewayDelete

Where appends a list predicates to the GatewayDelete builder.

type GatewayDeleteOne

type GatewayDeleteOne struct {
	// contains filtered or unexported fields
}

GatewayDeleteOne is the builder for deleting a single Gateway entity.

func (*GatewayDeleteOne) Exec

func (_d *GatewayDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GatewayDeleteOne) ExecX

func (_d *GatewayDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayDeleteOne) Where

Where appends a list predicates to the GatewayDelete builder.

type GatewayGroupBy

type GatewayGroupBy struct {
	// contains filtered or unexported fields
}

GatewayGroupBy is the group-by builder for Gateway entities.

func (*GatewayGroupBy) Aggregate

func (_g *GatewayGroupBy) Aggregate(fns ...AggregateFunc) *GatewayGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GatewayGroupBy) Bool

func (s *GatewayGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) BoolX

func (s *GatewayGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GatewayGroupBy) Bools

func (s *GatewayGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) BoolsX

func (s *GatewayGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GatewayGroupBy) Float64

func (s *GatewayGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) Float64X

func (s *GatewayGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GatewayGroupBy) Float64s

func (s *GatewayGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) Float64sX

func (s *GatewayGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GatewayGroupBy) Int

func (s *GatewayGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) IntX

func (s *GatewayGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GatewayGroupBy) Ints

func (s *GatewayGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) IntsX

func (s *GatewayGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GatewayGroupBy) Scan

func (_g *GatewayGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GatewayGroupBy) ScanX

func (s *GatewayGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GatewayGroupBy) String

func (s *GatewayGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) StringX

func (s *GatewayGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GatewayGroupBy) Strings

func (s *GatewayGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GatewayGroupBy) StringsX

func (s *GatewayGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GatewayMutation

type GatewayMutation struct {
	// contains filtered or unexported fields
}

GatewayMutation represents an operation that mutates the Gateway nodes in the graph.

func (*GatewayMutation) AddField

func (m *GatewayMutation) 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 (*GatewayMutation) AddPort

func (m *GatewayMutation) AddPort(i int32)

AddPort adds i to the "port" field.

func (*GatewayMutation) AddedEdges

func (m *GatewayMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GatewayMutation) AddedField

func (m *GatewayMutation) 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 (*GatewayMutation) AddedFields

func (m *GatewayMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GatewayMutation) AddedIDs

func (m *GatewayMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GatewayMutation) AddedPort

func (m *GatewayMutation) AddedPort() (r int32, exists bool)

AddedPort returns the value that was added to the "port" field in this mutation.

func (*GatewayMutation) AuthToken added in v0.0.12

func (m *GatewayMutation) AuthToken() (r string, exists bool)

AuthToken returns the value of the "auth_token" field in the mutation.

func (*GatewayMutation) ClearEdge

func (m *GatewayMutation) 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 (*GatewayMutation) ClearField

func (m *GatewayMutation) 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 (*GatewayMutation) ClearedEdges

func (m *GatewayMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GatewayMutation) ClearedFields

func (m *GatewayMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GatewayMutation) Client

func (m GatewayMutation) 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 (*GatewayMutation) EdgeCleared

func (m *GatewayMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GatewayMutation) Field

func (m *GatewayMutation) 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 (*GatewayMutation) FieldCleared

func (m *GatewayMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GatewayMutation) Fields

func (m *GatewayMutation) 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 (*GatewayMutation) ID

func (m *GatewayMutation) 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 (*GatewayMutation) IDs

func (m *GatewayMutation) 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 (*GatewayMutation) IP

func (m *GatewayMutation) IP() (r string, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*GatewayMutation) InternalIP

func (m *GatewayMutation) InternalIP() (r string, exists bool)

InternalIP returns the value of the "internal_ip" field in the mutation.

func (*GatewayMutation) Name

func (m *GatewayMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GatewayMutation) OldAuthToken added in v0.0.12

func (m *GatewayMutation) OldAuthToken(ctx context.Context) (v string, err error)

OldAuthToken returns the old "auth_token" field's value of the Gateway entity. If the Gateway 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 (*GatewayMutation) OldField

func (m *GatewayMutation) 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 (*GatewayMutation) OldIP

func (m *GatewayMutation) OldIP(ctx context.Context) (v string, err error)

OldIP returns the old "ip" field's value of the Gateway entity. If the Gateway 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 (*GatewayMutation) OldInternalIP

func (m *GatewayMutation) OldInternalIP(ctx context.Context) (v string, err error)

OldInternalIP returns the old "internal_ip" field's value of the Gateway entity. If the Gateway 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 (*GatewayMutation) OldName

func (m *GatewayMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Gateway entity. If the Gateway 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 (*GatewayMutation) OldPort

func (m *GatewayMutation) OldPort(ctx context.Context) (v int32, err error)

OldPort returns the old "port" field's value of the Gateway entity. If the Gateway 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 (*GatewayMutation) Op

func (m *GatewayMutation) Op() Op

Op returns the operation name.

func (*GatewayMutation) Port

func (m *GatewayMutation) Port() (r int32, exists bool)

Port returns the value of the "port" field in the mutation.

func (*GatewayMutation) RemovedEdges

func (m *GatewayMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GatewayMutation) RemovedIDs

func (m *GatewayMutation) 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 (*GatewayMutation) ResetAuthToken added in v0.0.12

func (m *GatewayMutation) ResetAuthToken()

ResetAuthToken resets all changes to the "auth_token" field.

func (*GatewayMutation) ResetEdge

func (m *GatewayMutation) 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 (*GatewayMutation) ResetField

func (m *GatewayMutation) 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 (*GatewayMutation) ResetIP

func (m *GatewayMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*GatewayMutation) ResetInternalIP

func (m *GatewayMutation) ResetInternalIP()

ResetInternalIP resets all changes to the "internal_ip" field.

func (*GatewayMutation) ResetName

func (m *GatewayMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GatewayMutation) ResetPort

func (m *GatewayMutation) ResetPort()

ResetPort resets all changes to the "port" field.

func (*GatewayMutation) SetAuthToken added in v0.0.12

func (m *GatewayMutation) SetAuthToken(s string)

SetAuthToken sets the "auth_token" field.

func (*GatewayMutation) SetField

func (m *GatewayMutation) 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 (*GatewayMutation) SetID

func (m *GatewayMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Gateway entities.

func (*GatewayMutation) SetIP

func (m *GatewayMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*GatewayMutation) SetInternalIP

func (m *GatewayMutation) SetInternalIP(s string)

SetInternalIP sets the "internal_ip" field.

func (*GatewayMutation) SetName

func (m *GatewayMutation) SetName(s string)

SetName sets the "name" field.

func (*GatewayMutation) SetOp

func (m *GatewayMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GatewayMutation) SetPort

func (m *GatewayMutation) SetPort(i int32)

SetPort sets the "port" field.

func (GatewayMutation) Tx

func (m GatewayMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GatewayMutation) Type

func (m *GatewayMutation) Type() string

Type returns the node type of this mutation (Gateway).

func (*GatewayMutation) Where

func (m *GatewayMutation) Where(ps ...predicate.Gateway)

Where appends a list predicates to the GatewayMutation builder.

func (*GatewayMutation) WhereP

func (m *GatewayMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GatewayMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GatewayPort

type GatewayPort struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// gateway id
	FkGatewayID uuid.UUID `json:"fk_gateway_id,omitempty"`
	// 端口号
	Port int32 `json:"port,omitempty"`
	// 是否使用
	IsUse bool `json:"is_use,omitempty"`
	// 是否public 端口
	IsPublic bool `json:"is_public,omitempty"`
	// contains filtered or unexported fields
}

GatewayPort is the model entity for the GatewayPort schema.

func (*GatewayPort) String

func (_m *GatewayPort) String() string

String implements the fmt.Stringer.

func (*GatewayPort) Unwrap

func (_m *GatewayPort) Unwrap() *GatewayPort

Unwrap unwraps the GatewayPort 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 (*GatewayPort) Update

func (_m *GatewayPort) Update() *GatewayPortUpdateOne

Update returns a builder for updating this GatewayPort. Note that you need to call GatewayPort.Unwrap() before calling this method if this GatewayPort was returned from a transaction, and the transaction was committed or rolled back.

func (*GatewayPort) Value

func (_m *GatewayPort) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the GatewayPort. This includes values selected through modifiers, order, etc.

type GatewayPortClient

type GatewayPortClient struct {
	// contains filtered or unexported fields
}

GatewayPortClient is a client for the GatewayPort schema.

func NewGatewayPortClient

func NewGatewayPortClient(c config) *GatewayPortClient

NewGatewayPortClient returns a client for the GatewayPort from the given config.

func (*GatewayPortClient) Create

func (c *GatewayPortClient) Create() *GatewayPortCreate

Create returns a builder for creating a GatewayPort entity.

func (*GatewayPortClient) CreateBulk

func (c *GatewayPortClient) CreateBulk(builders ...*GatewayPortCreate) *GatewayPortCreateBulk

CreateBulk returns a builder for creating a bulk of GatewayPort entities.

func (*GatewayPortClient) Delete

func (c *GatewayPortClient) Delete() *GatewayPortDelete

Delete returns a delete builder for GatewayPort.

func (*GatewayPortClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GatewayPortClient) DeleteOneID

func (c *GatewayPortClient) DeleteOneID(id uuid.UUID) *GatewayPortDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GatewayPortClient) Get

Get returns a GatewayPort entity by its id.

func (*GatewayPortClient) GetX

GetX is like Get, but panics if an error occurs.

func (*GatewayPortClient) Hooks

func (c *GatewayPortClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GatewayPortClient) Intercept

func (c *GatewayPortClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `gatewayport.Intercept(f(g(h())))`.

func (*GatewayPortClient) Interceptors

func (c *GatewayPortClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GatewayPortClient) MapCreateBulk

func (c *GatewayPortClient) MapCreateBulk(slice any, setFunc func(*GatewayPortCreate, int)) *GatewayPortCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*GatewayPortClient) Query

func (c *GatewayPortClient) Query() *GatewayPortQuery

Query returns a query builder for GatewayPort.

func (*GatewayPortClient) Update

func (c *GatewayPortClient) Update() *GatewayPortUpdate

Update returns an update builder for GatewayPort.

func (*GatewayPortClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GatewayPortClient) UpdateOneID

func (c *GatewayPortClient) UpdateOneID(id uuid.UUID) *GatewayPortUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GatewayPortClient) Use

func (c *GatewayPortClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `gatewayport.Hooks(f(g(h())))`.

type GatewayPortCreate

type GatewayPortCreate struct {
	// contains filtered or unexported fields
}

GatewayPortCreate is the builder for creating a GatewayPort entity.

func (*GatewayPortCreate) Exec

func (_c *GatewayPortCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GatewayPortCreate) ExecX

func (_c *GatewayPortCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayPortCreate) Mutation

func (_c *GatewayPortCreate) Mutation() *GatewayPortMutation

Mutation returns the GatewayPortMutation object of the builder.

func (*GatewayPortCreate) Save

Save creates the GatewayPort in the database.

func (*GatewayPortCreate) SaveX

func (_c *GatewayPortCreate) SaveX(ctx context.Context) *GatewayPort

SaveX calls Save and panics if Save returns an error.

func (*GatewayPortCreate) SetFkGatewayID

func (_c *GatewayPortCreate) SetFkGatewayID(v uuid.UUID) *GatewayPortCreate

SetFkGatewayID sets the "fk_gateway_id" field.

func (*GatewayPortCreate) SetID

SetID sets the "id" field.

func (*GatewayPortCreate) SetIsPublic

func (_c *GatewayPortCreate) SetIsPublic(v bool) *GatewayPortCreate

SetIsPublic sets the "is_public" field.

func (*GatewayPortCreate) SetIsUse

func (_c *GatewayPortCreate) SetIsUse(v bool) *GatewayPortCreate

SetIsUse sets the "is_use" field.

func (*GatewayPortCreate) SetNillableID

func (_c *GatewayPortCreate) SetNillableID(v *uuid.UUID) *GatewayPortCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*GatewayPortCreate) SetNillableIsPublic

func (_c *GatewayPortCreate) SetNillableIsPublic(v *bool) *GatewayPortCreate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*GatewayPortCreate) SetNillableIsUse

func (_c *GatewayPortCreate) SetNillableIsUse(v *bool) *GatewayPortCreate

SetNillableIsUse sets the "is_use" field if the given value is not nil.

func (*GatewayPortCreate) SetPort

func (_c *GatewayPortCreate) SetPort(v int32) *GatewayPortCreate

SetPort sets the "port" field.

type GatewayPortCreateBulk

type GatewayPortCreateBulk struct {
	// contains filtered or unexported fields
}

GatewayPortCreateBulk is the builder for creating many GatewayPort entities in bulk.

func (*GatewayPortCreateBulk) Exec

Exec executes the query.

func (*GatewayPortCreateBulk) ExecX

func (_c *GatewayPortCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayPortCreateBulk) Save

Save creates the GatewayPort entities in the database.

func (*GatewayPortCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type GatewayPortDelete

type GatewayPortDelete struct {
	// contains filtered or unexported fields
}

GatewayPortDelete is the builder for deleting a GatewayPort entity.

func (*GatewayPortDelete) Exec

func (_d *GatewayPortDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GatewayPortDelete) ExecX

func (_d *GatewayPortDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GatewayPortDelete) Where

Where appends a list predicates to the GatewayPortDelete builder.

type GatewayPortDeleteOne

type GatewayPortDeleteOne struct {
	// contains filtered or unexported fields
}

GatewayPortDeleteOne is the builder for deleting a single GatewayPort entity.

func (*GatewayPortDeleteOne) Exec

func (_d *GatewayPortDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GatewayPortDeleteOne) ExecX

func (_d *GatewayPortDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayPortDeleteOne) Where

Where appends a list predicates to the GatewayPortDelete builder.

type GatewayPortGroupBy

type GatewayPortGroupBy struct {
	// contains filtered or unexported fields
}

GatewayPortGroupBy is the group-by builder for GatewayPort entities.

func (*GatewayPortGroupBy) Aggregate

func (_g *GatewayPortGroupBy) Aggregate(fns ...AggregateFunc) *GatewayPortGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GatewayPortGroupBy) Bool

func (s *GatewayPortGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) BoolX

func (s *GatewayPortGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GatewayPortGroupBy) Bools

func (s *GatewayPortGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) BoolsX

func (s *GatewayPortGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GatewayPortGroupBy) Float64

func (s *GatewayPortGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) Float64X

func (s *GatewayPortGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GatewayPortGroupBy) Float64s

func (s *GatewayPortGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) Float64sX

func (s *GatewayPortGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GatewayPortGroupBy) Int

func (s *GatewayPortGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) IntX

func (s *GatewayPortGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GatewayPortGroupBy) Ints

func (s *GatewayPortGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) IntsX

func (s *GatewayPortGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GatewayPortGroupBy) Scan

func (_g *GatewayPortGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GatewayPortGroupBy) ScanX

func (s *GatewayPortGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GatewayPortGroupBy) String

func (s *GatewayPortGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) StringX

func (s *GatewayPortGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GatewayPortGroupBy) Strings

func (s *GatewayPortGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GatewayPortGroupBy) StringsX

func (s *GatewayPortGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GatewayPortMutation

type GatewayPortMutation struct {
	// contains filtered or unexported fields
}

GatewayPortMutation represents an operation that mutates the GatewayPort nodes in the graph.

func (*GatewayPortMutation) AddField

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) AddPort

func (m *GatewayPortMutation) AddPort(i int32)

AddPort adds i to the "port" field.

func (*GatewayPortMutation) AddedEdges

func (m *GatewayPortMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GatewayPortMutation) AddedField

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) AddedFields

func (m *GatewayPortMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GatewayPortMutation) AddedIDs

func (m *GatewayPortMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GatewayPortMutation) AddedPort

func (m *GatewayPortMutation) AddedPort() (r int32, exists bool)

AddedPort returns the value that was added to the "port" field in this mutation.

func (*GatewayPortMutation) ClearEdge

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) ClearField

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) ClearedEdges

func (m *GatewayPortMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GatewayPortMutation) ClearedFields

func (m *GatewayPortMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GatewayPortMutation) Client

func (m GatewayPortMutation) 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 (*GatewayPortMutation) EdgeCleared

func (m *GatewayPortMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GatewayPortMutation) Field

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) FieldCleared

func (m *GatewayPortMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GatewayPortMutation) Fields

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) FkGatewayID

func (m *GatewayPortMutation) FkGatewayID() (r uuid.UUID, exists bool)

FkGatewayID returns the value of the "fk_gateway_id" field in the mutation.

func (*GatewayPortMutation) ID

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) IDs

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) IsPublic

func (m *GatewayPortMutation) IsPublic() (r bool, exists bool)

IsPublic returns the value of the "is_public" field in the mutation.

func (*GatewayPortMutation) IsUse

func (m *GatewayPortMutation) IsUse() (r bool, exists bool)

IsUse returns the value of the "is_use" field in the mutation.

func (*GatewayPortMutation) OldField

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) OldFkGatewayID

func (m *GatewayPortMutation) OldFkGatewayID(ctx context.Context) (v uuid.UUID, err error)

OldFkGatewayID returns the old "fk_gateway_id" field's value of the GatewayPort entity. If the GatewayPort 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 (*GatewayPortMutation) OldIsPublic

func (m *GatewayPortMutation) OldIsPublic(ctx context.Context) (v bool, err error)

OldIsPublic returns the old "is_public" field's value of the GatewayPort entity. If the GatewayPort 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 (*GatewayPortMutation) OldIsUse

func (m *GatewayPortMutation) OldIsUse(ctx context.Context) (v bool, err error)

OldIsUse returns the old "is_use" field's value of the GatewayPort entity. If the GatewayPort 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 (*GatewayPortMutation) OldPort

func (m *GatewayPortMutation) OldPort(ctx context.Context) (v int32, err error)

OldPort returns the old "port" field's value of the GatewayPort entity. If the GatewayPort 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 (*GatewayPortMutation) Op

func (m *GatewayPortMutation) Op() Op

Op returns the operation name.

func (*GatewayPortMutation) Port

func (m *GatewayPortMutation) Port() (r int32, exists bool)

Port returns the value of the "port" field in the mutation.

func (*GatewayPortMutation) RemovedEdges

func (m *GatewayPortMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GatewayPortMutation) RemovedIDs

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) ResetEdge

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) ResetField

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) ResetFkGatewayID

func (m *GatewayPortMutation) ResetFkGatewayID()

ResetFkGatewayID resets all changes to the "fk_gateway_id" field.

func (*GatewayPortMutation) ResetIsPublic

func (m *GatewayPortMutation) ResetIsPublic()

ResetIsPublic resets all changes to the "is_public" field.

func (*GatewayPortMutation) ResetIsUse

func (m *GatewayPortMutation) ResetIsUse()

ResetIsUse resets all changes to the "is_use" field.

func (*GatewayPortMutation) ResetPort

func (m *GatewayPortMutation) ResetPort()

ResetPort resets all changes to the "port" field.

func (*GatewayPortMutation) SetField

func (m *GatewayPortMutation) 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 (*GatewayPortMutation) SetFkGatewayID

func (m *GatewayPortMutation) SetFkGatewayID(u uuid.UUID)

SetFkGatewayID sets the "fk_gateway_id" field.

func (*GatewayPortMutation) SetID

func (m *GatewayPortMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of GatewayPort entities.

func (*GatewayPortMutation) SetIsPublic

func (m *GatewayPortMutation) SetIsPublic(b bool)

SetIsPublic sets the "is_public" field.

func (*GatewayPortMutation) SetIsUse

func (m *GatewayPortMutation) SetIsUse(b bool)

SetIsUse sets the "is_use" field.

func (*GatewayPortMutation) SetOp

func (m *GatewayPortMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GatewayPortMutation) SetPort

func (m *GatewayPortMutation) SetPort(i int32)

SetPort sets the "port" field.

func (GatewayPortMutation) Tx

func (m GatewayPortMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GatewayPortMutation) Type

func (m *GatewayPortMutation) Type() string

Type returns the node type of this mutation (GatewayPort).

func (*GatewayPortMutation) Where

func (m *GatewayPortMutation) Where(ps ...predicate.GatewayPort)

Where appends a list predicates to the GatewayPortMutation builder.

func (*GatewayPortMutation) WhereP

func (m *GatewayPortMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GatewayPortMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GatewayPortQuery

type GatewayPortQuery struct {
	// contains filtered or unexported fields
}

GatewayPortQuery is the builder for querying GatewayPort entities.

func (*GatewayPortQuery) Aggregate

func (_q *GatewayPortQuery) Aggregate(fns ...AggregateFunc) *GatewayPortSelect

Aggregate returns a GatewayPortSelect configured with the given aggregations.

func (*GatewayPortQuery) All

func (_q *GatewayPortQuery) All(ctx context.Context) ([]*GatewayPort, error)

All executes the query and returns a list of GatewayPorts.

func (*GatewayPortQuery) AllX

func (_q *GatewayPortQuery) AllX(ctx context.Context) []*GatewayPort

AllX is like All, but panics if an error occurs.

func (*GatewayPortQuery) Clone

func (_q *GatewayPortQuery) Clone() *GatewayPortQuery

Clone returns a duplicate of the GatewayPortQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GatewayPortQuery) Count

func (_q *GatewayPortQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GatewayPortQuery) CountX

func (_q *GatewayPortQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GatewayPortQuery) Exist

func (_q *GatewayPortQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GatewayPortQuery) ExistX

func (_q *GatewayPortQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GatewayPortQuery) First

func (_q *GatewayPortQuery) First(ctx context.Context) (*GatewayPort, error)

First returns the first GatewayPort entity from the query. Returns a *NotFoundError when no GatewayPort was found.

func (*GatewayPortQuery) FirstID

func (_q *GatewayPortQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first GatewayPort ID from the query. Returns a *NotFoundError when no GatewayPort ID was found.

func (*GatewayPortQuery) FirstIDX

func (_q *GatewayPortQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*GatewayPortQuery) FirstX

func (_q *GatewayPortQuery) FirstX(ctx context.Context) *GatewayPort

FirstX is like First, but panics if an error occurs.

func (*GatewayPortQuery) GroupBy

func (_q *GatewayPortQuery) GroupBy(field string, fields ...string) *GatewayPortGroupBy

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 {
	FkGatewayID uuid.UUID `json:"fk_gateway_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GatewayPort.Query().
	GroupBy(gatewayport.FieldFkGatewayID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GatewayPortQuery) IDs

func (_q *GatewayPortQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of GatewayPort IDs.

func (*GatewayPortQuery) IDsX

func (_q *GatewayPortQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*GatewayPortQuery) Limit

func (_q *GatewayPortQuery) Limit(limit int) *GatewayPortQuery

Limit the number of records to be returned by this query.

func (*GatewayPortQuery) Offset

func (_q *GatewayPortQuery) Offset(offset int) *GatewayPortQuery

Offset to start from.

func (*GatewayPortQuery) Only

func (_q *GatewayPortQuery) Only(ctx context.Context) (*GatewayPort, error)

Only returns a single GatewayPort entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GatewayPort entity is found. Returns a *NotFoundError when no GatewayPort entities are found.

func (*GatewayPortQuery) OnlyID

func (_q *GatewayPortQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only GatewayPort ID in the query. Returns a *NotSingularError when more than one GatewayPort ID is found. Returns a *NotFoundError when no entities are found.

func (*GatewayPortQuery) OnlyIDX

func (_q *GatewayPortQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GatewayPortQuery) OnlyX

func (_q *GatewayPortQuery) OnlyX(ctx context.Context) *GatewayPort

OnlyX is like Only, but panics if an error occurs.

func (*GatewayPortQuery) Order

Order specifies how the records should be ordered.

func (*GatewayPortQuery) Select

func (_q *GatewayPortQuery) Select(fields ...string) *GatewayPortSelect

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 {
	FkGatewayID uuid.UUID `json:"fk_gateway_id,omitempty"`
}

client.GatewayPort.Query().
	Select(gatewayport.FieldFkGatewayID).
	Scan(ctx, &v)

func (*GatewayPortQuery) Unique

func (_q *GatewayPortQuery) Unique(unique bool) *GatewayPortQuery

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 (*GatewayPortQuery) Where

Where adds a new predicate for the GatewayPortQuery builder.

type GatewayPortSelect

type GatewayPortSelect struct {
	*GatewayPortQuery
	// contains filtered or unexported fields
}

GatewayPortSelect is the builder for selecting fields of GatewayPort entities.

func (*GatewayPortSelect) Aggregate

func (_s *GatewayPortSelect) Aggregate(fns ...AggregateFunc) *GatewayPortSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GatewayPortSelect) Bool

func (s *GatewayPortSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) BoolX

func (s *GatewayPortSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GatewayPortSelect) Bools

func (s *GatewayPortSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) BoolsX

func (s *GatewayPortSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GatewayPortSelect) Float64

func (s *GatewayPortSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) Float64X

func (s *GatewayPortSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GatewayPortSelect) Float64s

func (s *GatewayPortSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) Float64sX

func (s *GatewayPortSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GatewayPortSelect) Int

func (s *GatewayPortSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) IntX

func (s *GatewayPortSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GatewayPortSelect) Ints

func (s *GatewayPortSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) IntsX

func (s *GatewayPortSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GatewayPortSelect) Scan

func (_s *GatewayPortSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GatewayPortSelect) ScanX

func (s *GatewayPortSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GatewayPortSelect) String

func (s *GatewayPortSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) StringX

func (s *GatewayPortSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GatewayPortSelect) Strings

func (s *GatewayPortSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GatewayPortSelect) StringsX

func (s *GatewayPortSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GatewayPortUpdate

type GatewayPortUpdate struct {
	// contains filtered or unexported fields
}

GatewayPortUpdate is the builder for updating GatewayPort entities.

func (*GatewayPortUpdate) AddPort

func (_u *GatewayPortUpdate) AddPort(v int32) *GatewayPortUpdate

AddPort adds value to the "port" field.

func (*GatewayPortUpdate) Exec

func (_u *GatewayPortUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GatewayPortUpdate) ExecX

func (_u *GatewayPortUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayPortUpdate) Mutation

func (_u *GatewayPortUpdate) Mutation() *GatewayPortMutation

Mutation returns the GatewayPortMutation object of the builder.

func (*GatewayPortUpdate) Save

func (_u *GatewayPortUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GatewayPortUpdate) SaveX

func (_u *GatewayPortUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GatewayPortUpdate) SetFkGatewayID

func (_u *GatewayPortUpdate) SetFkGatewayID(v uuid.UUID) *GatewayPortUpdate

SetFkGatewayID sets the "fk_gateway_id" field.

func (*GatewayPortUpdate) SetIsPublic

func (_u *GatewayPortUpdate) SetIsPublic(v bool) *GatewayPortUpdate

SetIsPublic sets the "is_public" field.

func (*GatewayPortUpdate) SetIsUse

func (_u *GatewayPortUpdate) SetIsUse(v bool) *GatewayPortUpdate

SetIsUse sets the "is_use" field.

func (*GatewayPortUpdate) SetNillableFkGatewayID

func (_u *GatewayPortUpdate) SetNillableFkGatewayID(v *uuid.UUID) *GatewayPortUpdate

SetNillableFkGatewayID sets the "fk_gateway_id" field if the given value is not nil.

func (*GatewayPortUpdate) SetNillableIsPublic

func (_u *GatewayPortUpdate) SetNillableIsPublic(v *bool) *GatewayPortUpdate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*GatewayPortUpdate) SetNillableIsUse

func (_u *GatewayPortUpdate) SetNillableIsUse(v *bool) *GatewayPortUpdate

SetNillableIsUse sets the "is_use" field if the given value is not nil.

func (*GatewayPortUpdate) SetNillablePort

func (_u *GatewayPortUpdate) SetNillablePort(v *int32) *GatewayPortUpdate

SetNillablePort sets the "port" field if the given value is not nil.

func (*GatewayPortUpdate) SetPort

func (_u *GatewayPortUpdate) SetPort(v int32) *GatewayPortUpdate

SetPort sets the "port" field.

func (*GatewayPortUpdate) Where

Where appends a list predicates to the GatewayPortUpdate builder.

type GatewayPortUpdateOne

type GatewayPortUpdateOne struct {
	// contains filtered or unexported fields
}

GatewayPortUpdateOne is the builder for updating a single GatewayPort entity.

func (*GatewayPortUpdateOne) AddPort

AddPort adds value to the "port" field.

func (*GatewayPortUpdateOne) Exec

func (_u *GatewayPortUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GatewayPortUpdateOne) ExecX

func (_u *GatewayPortUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayPortUpdateOne) Mutation

func (_u *GatewayPortUpdateOne) Mutation() *GatewayPortMutation

Mutation returns the GatewayPortMutation object of the builder.

func (*GatewayPortUpdateOne) Save

Save executes the query and returns the updated GatewayPort entity.

func (*GatewayPortUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GatewayPortUpdateOne) Select

func (_u *GatewayPortUpdateOne) Select(field string, fields ...string) *GatewayPortUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GatewayPortUpdateOne) SetFkGatewayID

func (_u *GatewayPortUpdateOne) SetFkGatewayID(v uuid.UUID) *GatewayPortUpdateOne

SetFkGatewayID sets the "fk_gateway_id" field.

func (*GatewayPortUpdateOne) SetIsPublic

func (_u *GatewayPortUpdateOne) SetIsPublic(v bool) *GatewayPortUpdateOne

SetIsPublic sets the "is_public" field.

func (*GatewayPortUpdateOne) SetIsUse

SetIsUse sets the "is_use" field.

func (*GatewayPortUpdateOne) SetNillableFkGatewayID

func (_u *GatewayPortUpdateOne) SetNillableFkGatewayID(v *uuid.UUID) *GatewayPortUpdateOne

SetNillableFkGatewayID sets the "fk_gateway_id" field if the given value is not nil.

func (*GatewayPortUpdateOne) SetNillableIsPublic

func (_u *GatewayPortUpdateOne) SetNillableIsPublic(v *bool) *GatewayPortUpdateOne

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*GatewayPortUpdateOne) SetNillableIsUse

func (_u *GatewayPortUpdateOne) SetNillableIsUse(v *bool) *GatewayPortUpdateOne

SetNillableIsUse sets the "is_use" field if the given value is not nil.

func (*GatewayPortUpdateOne) SetNillablePort

func (_u *GatewayPortUpdateOne) SetNillablePort(v *int32) *GatewayPortUpdateOne

SetNillablePort sets the "port" field if the given value is not nil.

func (*GatewayPortUpdateOne) SetPort

SetPort sets the "port" field.

func (*GatewayPortUpdateOne) Where

Where appends a list predicates to the GatewayPortUpdate builder.

type GatewayPorts

type GatewayPorts []*GatewayPort

GatewayPorts is a parsable slice of GatewayPort.

type GatewayQuery

type GatewayQuery struct {
	// contains filtered or unexported fields
}

GatewayQuery is the builder for querying Gateway entities.

func (*GatewayQuery) Aggregate

func (_q *GatewayQuery) Aggregate(fns ...AggregateFunc) *GatewaySelect

Aggregate returns a GatewaySelect configured with the given aggregations.

func (*GatewayQuery) All

func (_q *GatewayQuery) All(ctx context.Context) ([]*Gateway, error)

All executes the query and returns a list of Gateways.

func (*GatewayQuery) AllX

func (_q *GatewayQuery) AllX(ctx context.Context) []*Gateway

AllX is like All, but panics if an error occurs.

func (*GatewayQuery) Clone

func (_q *GatewayQuery) Clone() *GatewayQuery

Clone returns a duplicate of the GatewayQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GatewayQuery) Count

func (_q *GatewayQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GatewayQuery) CountX

func (_q *GatewayQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GatewayQuery) Exist

func (_q *GatewayQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GatewayQuery) ExistX

func (_q *GatewayQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GatewayQuery) First

func (_q *GatewayQuery) First(ctx context.Context) (*Gateway, error)

First returns the first Gateway entity from the query. Returns a *NotFoundError when no Gateway was found.

func (*GatewayQuery) FirstID

func (_q *GatewayQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Gateway ID from the query. Returns a *NotFoundError when no Gateway ID was found.

func (*GatewayQuery) FirstIDX

func (_q *GatewayQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*GatewayQuery) FirstX

func (_q *GatewayQuery) FirstX(ctx context.Context) *Gateway

FirstX is like First, but panics if an error occurs.

func (*GatewayQuery) GroupBy

func (_q *GatewayQuery) GroupBy(field string, fields ...string) *GatewayGroupBy

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.Gateway.Query().
	GroupBy(gateway.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GatewayQuery) IDs

func (_q *GatewayQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Gateway IDs.

func (*GatewayQuery) IDsX

func (_q *GatewayQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*GatewayQuery) Limit

func (_q *GatewayQuery) Limit(limit int) *GatewayQuery

Limit the number of records to be returned by this query.

func (*GatewayQuery) Offset

func (_q *GatewayQuery) Offset(offset int) *GatewayQuery

Offset to start from.

func (*GatewayQuery) Only

func (_q *GatewayQuery) Only(ctx context.Context) (*Gateway, error)

Only returns a single Gateway entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Gateway entity is found. Returns a *NotFoundError when no Gateway entities are found.

func (*GatewayQuery) OnlyID

func (_q *GatewayQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Gateway ID in the query. Returns a *NotSingularError when more than one Gateway ID is found. Returns a *NotFoundError when no entities are found.

func (*GatewayQuery) OnlyIDX

func (_q *GatewayQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GatewayQuery) OnlyX

func (_q *GatewayQuery) OnlyX(ctx context.Context) *Gateway

OnlyX is like Only, but panics if an error occurs.

func (*GatewayQuery) Order

func (_q *GatewayQuery) Order(o ...gateway.OrderOption) *GatewayQuery

Order specifies how the records should be ordered.

func (*GatewayQuery) Select

func (_q *GatewayQuery) Select(fields ...string) *GatewaySelect

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.Gateway.Query().
	Select(gateway.FieldName).
	Scan(ctx, &v)

func (*GatewayQuery) Unique

func (_q *GatewayQuery) Unique(unique bool) *GatewayQuery

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 (*GatewayQuery) Where

func (_q *GatewayQuery) Where(ps ...predicate.Gateway) *GatewayQuery

Where adds a new predicate for the GatewayQuery builder.

type GatewaySelect

type GatewaySelect struct {
	*GatewayQuery
	// contains filtered or unexported fields
}

GatewaySelect is the builder for selecting fields of Gateway entities.

func (*GatewaySelect) Aggregate

func (_s *GatewaySelect) Aggregate(fns ...AggregateFunc) *GatewaySelect

Aggregate adds the given aggregation functions to the selector query.

func (*GatewaySelect) Bool

func (s *GatewaySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) BoolX

func (s *GatewaySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GatewaySelect) Bools

func (s *GatewaySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) BoolsX

func (s *GatewaySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GatewaySelect) Float64

func (s *GatewaySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) Float64X

func (s *GatewaySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GatewaySelect) Float64s

func (s *GatewaySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) Float64sX

func (s *GatewaySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GatewaySelect) Int

func (s *GatewaySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) IntX

func (s *GatewaySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GatewaySelect) Ints

func (s *GatewaySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) IntsX

func (s *GatewaySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GatewaySelect) Scan

func (_s *GatewaySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GatewaySelect) ScanX

func (s *GatewaySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GatewaySelect) String

func (s *GatewaySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) StringX

func (s *GatewaySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GatewaySelect) Strings

func (s *GatewaySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GatewaySelect) StringsX

func (s *GatewaySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GatewayUpdate

type GatewayUpdate struct {
	// contains filtered or unexported fields
}

GatewayUpdate is the builder for updating Gateway entities.

func (*GatewayUpdate) AddPort

func (_u *GatewayUpdate) AddPort(v int32) *GatewayUpdate

AddPort adds value to the "port" field.

func (*GatewayUpdate) Exec

func (_u *GatewayUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GatewayUpdate) ExecX

func (_u *GatewayUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayUpdate) Mutation

func (_u *GatewayUpdate) Mutation() *GatewayMutation

Mutation returns the GatewayMutation object of the builder.

func (*GatewayUpdate) Save

func (_u *GatewayUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GatewayUpdate) SaveX

func (_u *GatewayUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GatewayUpdate) SetAuthToken added in v0.0.12

func (_u *GatewayUpdate) SetAuthToken(v string) *GatewayUpdate

SetAuthToken sets the "auth_token" field.

func (*GatewayUpdate) SetIP

func (_u *GatewayUpdate) SetIP(v string) *GatewayUpdate

SetIP sets the "ip" field.

func (*GatewayUpdate) SetInternalIP

func (_u *GatewayUpdate) SetInternalIP(v string) *GatewayUpdate

SetInternalIP sets the "internal_ip" field.

func (*GatewayUpdate) SetName

func (_u *GatewayUpdate) SetName(v string) *GatewayUpdate

SetName sets the "name" field.

func (*GatewayUpdate) SetNillableAuthToken added in v0.0.12

func (_u *GatewayUpdate) SetNillableAuthToken(v *string) *GatewayUpdate

SetNillableAuthToken sets the "auth_token" field if the given value is not nil.

func (*GatewayUpdate) SetNillableIP

func (_u *GatewayUpdate) SetNillableIP(v *string) *GatewayUpdate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*GatewayUpdate) SetNillableInternalIP

func (_u *GatewayUpdate) SetNillableInternalIP(v *string) *GatewayUpdate

SetNillableInternalIP sets the "internal_ip" field if the given value is not nil.

func (*GatewayUpdate) SetNillableName

func (_u *GatewayUpdate) SetNillableName(v *string) *GatewayUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*GatewayUpdate) SetNillablePort

func (_u *GatewayUpdate) SetNillablePort(v *int32) *GatewayUpdate

SetNillablePort sets the "port" field if the given value is not nil.

func (*GatewayUpdate) SetPort

func (_u *GatewayUpdate) SetPort(v int32) *GatewayUpdate

SetPort sets the "port" field.

func (*GatewayUpdate) Where

func (_u *GatewayUpdate) Where(ps ...predicate.Gateway) *GatewayUpdate

Where appends a list predicates to the GatewayUpdate builder.

type GatewayUpdateOne

type GatewayUpdateOne struct {
	// contains filtered or unexported fields
}

GatewayUpdateOne is the builder for updating a single Gateway entity.

func (*GatewayUpdateOne) AddPort

func (_u *GatewayUpdateOne) AddPort(v int32) *GatewayUpdateOne

AddPort adds value to the "port" field.

func (*GatewayUpdateOne) Exec

func (_u *GatewayUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GatewayUpdateOne) ExecX

func (_u *GatewayUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GatewayUpdateOne) Mutation

func (_u *GatewayUpdateOne) Mutation() *GatewayMutation

Mutation returns the GatewayMutation object of the builder.

func (*GatewayUpdateOne) Save

func (_u *GatewayUpdateOne) Save(ctx context.Context) (*Gateway, error)

Save executes the query and returns the updated Gateway entity.

func (*GatewayUpdateOne) SaveX

func (_u *GatewayUpdateOne) SaveX(ctx context.Context) *Gateway

SaveX is like Save, but panics if an error occurs.

func (*GatewayUpdateOne) Select

func (_u *GatewayUpdateOne) Select(field string, fields ...string) *GatewayUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GatewayUpdateOne) SetAuthToken added in v0.0.12

func (_u *GatewayUpdateOne) SetAuthToken(v string) *GatewayUpdateOne

SetAuthToken sets the "auth_token" field.

func (*GatewayUpdateOne) SetIP

SetIP sets the "ip" field.

func (*GatewayUpdateOne) SetInternalIP

func (_u *GatewayUpdateOne) SetInternalIP(v string) *GatewayUpdateOne

SetInternalIP sets the "internal_ip" field.

func (*GatewayUpdateOne) SetName

func (_u *GatewayUpdateOne) SetName(v string) *GatewayUpdateOne

SetName sets the "name" field.

func (*GatewayUpdateOne) SetNillableAuthToken added in v0.0.12

func (_u *GatewayUpdateOne) SetNillableAuthToken(v *string) *GatewayUpdateOne

SetNillableAuthToken sets the "auth_token" field if the given value is not nil.

func (*GatewayUpdateOne) SetNillableIP

func (_u *GatewayUpdateOne) SetNillableIP(v *string) *GatewayUpdateOne

SetNillableIP sets the "ip" field if the given value is not nil.

func (*GatewayUpdateOne) SetNillableInternalIP

func (_u *GatewayUpdateOne) SetNillableInternalIP(v *string) *GatewayUpdateOne

SetNillableInternalIP sets the "internal_ip" field if the given value is not nil.

func (*GatewayUpdateOne) SetNillableName

func (_u *GatewayUpdateOne) SetNillableName(v *string) *GatewayUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*GatewayUpdateOne) SetNillablePort

func (_u *GatewayUpdateOne) SetNillablePort(v *int32) *GatewayUpdateOne

SetNillablePort sets the "port" field if the given value is not nil.

func (*GatewayUpdateOne) SetPort

func (_u *GatewayUpdateOne) SetPort(v int32) *GatewayUpdateOne

SetPort sets the "port" field.

func (*GatewayUpdateOne) Where

Where appends a list predicates to the GatewayUpdate builder.

type Gateways

type Gateways []*Gateway

Gateways is a parsable slice of Gateway.

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 NetworkMapping

type NetworkMapping struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Protocol holds the value of the "protocol" field.
	Protocol string `json:"protocol,omitempty"`
	// gateway id
	FkGatewayID uuid.UUID `json:"fk_gateway_id,omitempty"`
	// 映射到网关的端口号
	GatewayPort int32 `json:"gateway_port,omitempty"`
	// 网关ip
	GatewayIP string `json:"gateway_ip,omitempty"`
	// 需要映射的虚拟机端口号
	ComputerPort int32 `json:"computer_port,omitempty"`
	//  0 待开始 1 进行中 2 已完成, 3 失败
	Status int `json:"status,omitempty"`
	// 虚拟机实例ID
	FkComputerID uuid.UUID `json:"fk_computer_id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// 删除状态
	DeleteState bool `json:"delete_state,omitempty"`
	// 创建时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

NetworkMapping is the model entity for the NetworkMapping schema.

func (*NetworkMapping) String

func (_m *NetworkMapping) String() string

String implements the fmt.Stringer.

func (*NetworkMapping) Unwrap

func (_m *NetworkMapping) Unwrap() *NetworkMapping

Unwrap unwraps the NetworkMapping 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 (*NetworkMapping) Update

Update returns a builder for updating this NetworkMapping. Note that you need to call NetworkMapping.Unwrap() before calling this method if this NetworkMapping was returned from a transaction, and the transaction was committed or rolled back.

func (*NetworkMapping) Value

func (_m *NetworkMapping) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the NetworkMapping. This includes values selected through modifiers, order, etc.

type NetworkMappingClient

type NetworkMappingClient struct {
	// contains filtered or unexported fields
}

NetworkMappingClient is a client for the NetworkMapping schema.

func NewNetworkMappingClient

func NewNetworkMappingClient(c config) *NetworkMappingClient

NewNetworkMappingClient returns a client for the NetworkMapping from the given config.

func (*NetworkMappingClient) Create

Create returns a builder for creating a NetworkMapping entity.

func (*NetworkMappingClient) CreateBulk

CreateBulk returns a builder for creating a bulk of NetworkMapping entities.

func (*NetworkMappingClient) Delete

Delete returns a delete builder for NetworkMapping.

func (*NetworkMappingClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NetworkMappingClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NetworkMappingClient) Get

Get returns a NetworkMapping entity by its id.

func (*NetworkMappingClient) GetX

GetX is like Get, but panics if an error occurs.

func (*NetworkMappingClient) Hooks

func (c *NetworkMappingClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NetworkMappingClient) Intercept

func (c *NetworkMappingClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `networkmapping.Intercept(f(g(h())))`.

func (*NetworkMappingClient) Interceptors

func (c *NetworkMappingClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NetworkMappingClient) MapCreateBulk

func (c *NetworkMappingClient) MapCreateBulk(slice any, setFunc func(*NetworkMappingCreate, int)) *NetworkMappingCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*NetworkMappingClient) Query

Query returns a query builder for NetworkMapping.

func (*NetworkMappingClient) Update

Update returns an update builder for NetworkMapping.

func (*NetworkMappingClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NetworkMappingClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NetworkMappingClient) Use

func (c *NetworkMappingClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `networkmapping.Hooks(f(g(h())))`.

type NetworkMappingCreate

type NetworkMappingCreate struct {
	// contains filtered or unexported fields
}

NetworkMappingCreate is the builder for creating a NetworkMapping entity.

func (*NetworkMappingCreate) Exec

func (_c *NetworkMappingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NetworkMappingCreate) ExecX

func (_c *NetworkMappingCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetworkMappingCreate) Mutation

Mutation returns the NetworkMappingMutation object of the builder.

func (*NetworkMappingCreate) Save

Save creates the NetworkMapping in the database.

func (*NetworkMappingCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NetworkMappingCreate) SetComputerPort

func (_c *NetworkMappingCreate) SetComputerPort(v int32) *NetworkMappingCreate

SetComputerPort sets the "computer_port" field.

func (*NetworkMappingCreate) SetCreateTime

func (_c *NetworkMappingCreate) SetCreateTime(v time.Time) *NetworkMappingCreate

SetCreateTime sets the "create_time" field.

func (*NetworkMappingCreate) SetDeleteState

func (_c *NetworkMappingCreate) SetDeleteState(v bool) *NetworkMappingCreate

SetDeleteState sets the "delete_state" field.

func (*NetworkMappingCreate) SetFkComputerID

func (_c *NetworkMappingCreate) SetFkComputerID(v uuid.UUID) *NetworkMappingCreate

SetFkComputerID sets the "fk_computer_id" field.

func (*NetworkMappingCreate) SetFkGatewayID

func (_c *NetworkMappingCreate) SetFkGatewayID(v uuid.UUID) *NetworkMappingCreate

SetFkGatewayID sets the "fk_gateway_id" field.

func (*NetworkMappingCreate) SetFkUserID

func (_c *NetworkMappingCreate) SetFkUserID(v uuid.UUID) *NetworkMappingCreate

SetFkUserID sets the "fk_user_id" field.

func (*NetworkMappingCreate) SetGatewayIP

func (_c *NetworkMappingCreate) SetGatewayIP(v string) *NetworkMappingCreate

SetGatewayIP sets the "gateway_ip" field.

func (*NetworkMappingCreate) SetGatewayPort

func (_c *NetworkMappingCreate) SetGatewayPort(v int32) *NetworkMappingCreate

SetGatewayPort sets the "gateway_port" field.

func (*NetworkMappingCreate) SetID

SetID sets the "id" field.

func (*NetworkMappingCreate) SetName

SetName sets the "name" field.

func (*NetworkMappingCreate) SetNillableCreateTime

func (_c *NetworkMappingCreate) SetNillableCreateTime(v *time.Time) *NetworkMappingCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*NetworkMappingCreate) SetNillableDeleteState

func (_c *NetworkMappingCreate) SetNillableDeleteState(v *bool) *NetworkMappingCreate

SetNillableDeleteState sets the "delete_state" field if the given value is not nil.

func (*NetworkMappingCreate) SetNillableID

func (_c *NetworkMappingCreate) SetNillableID(v *uuid.UUID) *NetworkMappingCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*NetworkMappingCreate) SetNillableProtocol

func (_c *NetworkMappingCreate) SetNillableProtocol(v *string) *NetworkMappingCreate

SetNillableProtocol sets the "protocol" field if the given value is not nil.

func (*NetworkMappingCreate) SetNillableStatus

func (_c *NetworkMappingCreate) SetNillableStatus(v *int) *NetworkMappingCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*NetworkMappingCreate) SetProtocol

func (_c *NetworkMappingCreate) SetProtocol(v string) *NetworkMappingCreate

SetProtocol sets the "protocol" field.

func (*NetworkMappingCreate) SetStatus

func (_c *NetworkMappingCreate) SetStatus(v int) *NetworkMappingCreate

SetStatus sets the "status" field.

type NetworkMappingCreateBulk

type NetworkMappingCreateBulk struct {
	// contains filtered or unexported fields
}

NetworkMappingCreateBulk is the builder for creating many NetworkMapping entities in bulk.

func (*NetworkMappingCreateBulk) Exec

Exec executes the query.

func (*NetworkMappingCreateBulk) ExecX

func (_c *NetworkMappingCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetworkMappingCreateBulk) Save

Save creates the NetworkMapping entities in the database.

func (*NetworkMappingCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type NetworkMappingDelete

type NetworkMappingDelete struct {
	// contains filtered or unexported fields
}

NetworkMappingDelete is the builder for deleting a NetworkMapping entity.

func (*NetworkMappingDelete) Exec

func (_d *NetworkMappingDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NetworkMappingDelete) ExecX

func (_d *NetworkMappingDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NetworkMappingDelete) Where

Where appends a list predicates to the NetworkMappingDelete builder.

type NetworkMappingDeleteOne

type NetworkMappingDeleteOne struct {
	// contains filtered or unexported fields
}

NetworkMappingDeleteOne is the builder for deleting a single NetworkMapping entity.

func (*NetworkMappingDeleteOne) Exec

Exec executes the deletion query.

func (*NetworkMappingDeleteOne) ExecX

func (_d *NetworkMappingDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetworkMappingDeleteOne) Where

Where appends a list predicates to the NetworkMappingDelete builder.

type NetworkMappingGroupBy

type NetworkMappingGroupBy struct {
	// contains filtered or unexported fields
}

NetworkMappingGroupBy is the group-by builder for NetworkMapping entities.

func (*NetworkMappingGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*NetworkMappingGroupBy) Bool

func (s *NetworkMappingGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) BoolX

func (s *NetworkMappingGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetworkMappingGroupBy) Bools

func (s *NetworkMappingGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) BoolsX

func (s *NetworkMappingGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetworkMappingGroupBy) Float64

func (s *NetworkMappingGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) Float64X

func (s *NetworkMappingGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetworkMappingGroupBy) Float64s

func (s *NetworkMappingGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) Float64sX

func (s *NetworkMappingGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetworkMappingGroupBy) Int

func (s *NetworkMappingGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) IntX

func (s *NetworkMappingGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetworkMappingGroupBy) Ints

func (s *NetworkMappingGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) IntsX

func (s *NetworkMappingGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetworkMappingGroupBy) Scan

func (_g *NetworkMappingGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NetworkMappingGroupBy) ScanX

func (s *NetworkMappingGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NetworkMappingGroupBy) String

func (s *NetworkMappingGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) StringX

func (s *NetworkMappingGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetworkMappingGroupBy) Strings

func (s *NetworkMappingGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NetworkMappingGroupBy) StringsX

func (s *NetworkMappingGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetworkMappingMutation

type NetworkMappingMutation struct {
	// contains filtered or unexported fields
}

NetworkMappingMutation represents an operation that mutates the NetworkMapping nodes in the graph.

func (*NetworkMappingMutation) AddComputerPort

func (m *NetworkMappingMutation) AddComputerPort(i int32)

AddComputerPort adds i to the "computer_port" field.

func (*NetworkMappingMutation) AddField

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) AddGatewayPort

func (m *NetworkMappingMutation) AddGatewayPort(i int32)

AddGatewayPort adds i to the "gateway_port" field.

func (*NetworkMappingMutation) AddStatus

func (m *NetworkMappingMutation) AddStatus(i int)

AddStatus adds i to the "status" field.

func (*NetworkMappingMutation) AddedComputerPort

func (m *NetworkMappingMutation) AddedComputerPort() (r int32, exists bool)

AddedComputerPort returns the value that was added to the "computer_port" field in this mutation.

func (*NetworkMappingMutation) AddedEdges

func (m *NetworkMappingMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NetworkMappingMutation) AddedField

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) AddedFields

func (m *NetworkMappingMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NetworkMappingMutation) AddedGatewayPort

func (m *NetworkMappingMutation) AddedGatewayPort() (r int32, exists bool)

AddedGatewayPort returns the value that was added to the "gateway_port" field in this mutation.

func (*NetworkMappingMutation) AddedIDs

func (m *NetworkMappingMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NetworkMappingMutation) AddedStatus

func (m *NetworkMappingMutation) AddedStatus() (r int, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*NetworkMappingMutation) ClearEdge

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) ClearField

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) ClearedEdges

func (m *NetworkMappingMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NetworkMappingMutation) ClearedFields

func (m *NetworkMappingMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NetworkMappingMutation) Client

func (m NetworkMappingMutation) 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 (*NetworkMappingMutation) ComputerPort

func (m *NetworkMappingMutation) ComputerPort() (r int32, exists bool)

ComputerPort returns the value of the "computer_port" field in the mutation.

func (*NetworkMappingMutation) CreateTime

func (m *NetworkMappingMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*NetworkMappingMutation) DeleteState

func (m *NetworkMappingMutation) DeleteState() (r bool, exists bool)

DeleteState returns the value of the "delete_state" field in the mutation.

func (*NetworkMappingMutation) EdgeCleared

func (m *NetworkMappingMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NetworkMappingMutation) Field

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) FieldCleared

func (m *NetworkMappingMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NetworkMappingMutation) Fields

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) FkComputerID

func (m *NetworkMappingMutation) FkComputerID() (r uuid.UUID, exists bool)

FkComputerID returns the value of the "fk_computer_id" field in the mutation.

func (*NetworkMappingMutation) FkGatewayID

func (m *NetworkMappingMutation) FkGatewayID() (r uuid.UUID, exists bool)

FkGatewayID returns the value of the "fk_gateway_id" field in the mutation.

func (*NetworkMappingMutation) FkUserID

func (m *NetworkMappingMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*NetworkMappingMutation) GatewayIP

func (m *NetworkMappingMutation) GatewayIP() (r string, exists bool)

GatewayIP returns the value of the "gateway_ip" field in the mutation.

func (*NetworkMappingMutation) GatewayPort

func (m *NetworkMappingMutation) GatewayPort() (r int32, exists bool)

GatewayPort returns the value of the "gateway_port" field in the mutation.

func (*NetworkMappingMutation) ID

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) 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 (*NetworkMappingMutation) Name

func (m *NetworkMappingMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*NetworkMappingMutation) OldComputerPort

func (m *NetworkMappingMutation) OldComputerPort(ctx context.Context) (v int32, err error)

OldComputerPort returns the old "computer_port" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldCreateTime

func (m *NetworkMappingMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldDeleteState

func (m *NetworkMappingMutation) OldDeleteState(ctx context.Context) (v bool, err error)

OldDeleteState returns the old "delete_state" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldField

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) OldFkComputerID

func (m *NetworkMappingMutation) OldFkComputerID(ctx context.Context) (v uuid.UUID, err error)

OldFkComputerID returns the old "fk_computer_id" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldFkGatewayID

func (m *NetworkMappingMutation) OldFkGatewayID(ctx context.Context) (v uuid.UUID, err error)

OldFkGatewayID returns the old "fk_gateway_id" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldFkUserID

func (m *NetworkMappingMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldGatewayIP

func (m *NetworkMappingMutation) OldGatewayIP(ctx context.Context) (v string, err error)

OldGatewayIP returns the old "gateway_ip" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldGatewayPort

func (m *NetworkMappingMutation) OldGatewayPort(ctx context.Context) (v int32, err error)

OldGatewayPort returns the old "gateway_port" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldName

func (m *NetworkMappingMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldProtocol

func (m *NetworkMappingMutation) OldProtocol(ctx context.Context) (v string, err error)

OldProtocol returns the old "protocol" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) OldStatus

func (m *NetworkMappingMutation) OldStatus(ctx context.Context) (v int, err error)

OldStatus returns the old "status" field's value of the NetworkMapping entity. If the NetworkMapping 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 (*NetworkMappingMutation) Op

func (m *NetworkMappingMutation) Op() Op

Op returns the operation name.

func (*NetworkMappingMutation) Protocol

func (m *NetworkMappingMutation) Protocol() (r string, exists bool)

Protocol returns the value of the "protocol" field in the mutation.

func (*NetworkMappingMutation) RemovedEdges

func (m *NetworkMappingMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NetworkMappingMutation) RemovedIDs

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) ResetComputerPort

func (m *NetworkMappingMutation) ResetComputerPort()

ResetComputerPort resets all changes to the "computer_port" field.

func (*NetworkMappingMutation) ResetCreateTime

func (m *NetworkMappingMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*NetworkMappingMutation) ResetDeleteState

func (m *NetworkMappingMutation) ResetDeleteState()

ResetDeleteState resets all changes to the "delete_state" field.

func (*NetworkMappingMutation) ResetEdge

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) ResetField

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) ResetFkComputerID

func (m *NetworkMappingMutation) ResetFkComputerID()

ResetFkComputerID resets all changes to the "fk_computer_id" field.

func (*NetworkMappingMutation) ResetFkGatewayID

func (m *NetworkMappingMutation) ResetFkGatewayID()

ResetFkGatewayID resets all changes to the "fk_gateway_id" field.

func (*NetworkMappingMutation) ResetFkUserID

func (m *NetworkMappingMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*NetworkMappingMutation) ResetGatewayIP

func (m *NetworkMappingMutation) ResetGatewayIP()

ResetGatewayIP resets all changes to the "gateway_ip" field.

func (*NetworkMappingMutation) ResetGatewayPort

func (m *NetworkMappingMutation) ResetGatewayPort()

ResetGatewayPort resets all changes to the "gateway_port" field.

func (*NetworkMappingMutation) ResetName

func (m *NetworkMappingMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NetworkMappingMutation) ResetProtocol

func (m *NetworkMappingMutation) ResetProtocol()

ResetProtocol resets all changes to the "protocol" field.

func (*NetworkMappingMutation) ResetStatus

func (m *NetworkMappingMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*NetworkMappingMutation) SetComputerPort

func (m *NetworkMappingMutation) SetComputerPort(i int32)

SetComputerPort sets the "computer_port" field.

func (*NetworkMappingMutation) SetCreateTime

func (m *NetworkMappingMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*NetworkMappingMutation) SetDeleteState

func (m *NetworkMappingMutation) SetDeleteState(b bool)

SetDeleteState sets the "delete_state" field.

func (*NetworkMappingMutation) SetField

func (m *NetworkMappingMutation) 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 (*NetworkMappingMutation) SetFkComputerID

func (m *NetworkMappingMutation) SetFkComputerID(u uuid.UUID)

SetFkComputerID sets the "fk_computer_id" field.

func (*NetworkMappingMutation) SetFkGatewayID

func (m *NetworkMappingMutation) SetFkGatewayID(u uuid.UUID)

SetFkGatewayID sets the "fk_gateway_id" field.

func (*NetworkMappingMutation) SetFkUserID

func (m *NetworkMappingMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*NetworkMappingMutation) SetGatewayIP

func (m *NetworkMappingMutation) SetGatewayIP(s string)

SetGatewayIP sets the "gateway_ip" field.

func (*NetworkMappingMutation) SetGatewayPort

func (m *NetworkMappingMutation) SetGatewayPort(i int32)

SetGatewayPort sets the "gateway_port" field.

func (*NetworkMappingMutation) SetID

func (m *NetworkMappingMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of NetworkMapping entities.

func (*NetworkMappingMutation) SetName

func (m *NetworkMappingMutation) SetName(s string)

SetName sets the "name" field.

func (*NetworkMappingMutation) SetOp

func (m *NetworkMappingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NetworkMappingMutation) SetProtocol

func (m *NetworkMappingMutation) SetProtocol(s string)

SetProtocol sets the "protocol" field.

func (*NetworkMappingMutation) SetStatus

func (m *NetworkMappingMutation) SetStatus(i int)

SetStatus sets the "status" field.

func (*NetworkMappingMutation) Status

func (m *NetworkMappingMutation) Status() (r int, exists bool)

Status returns the value of the "status" field in the mutation.

func (NetworkMappingMutation) Tx

func (m NetworkMappingMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NetworkMappingMutation) Type

func (m *NetworkMappingMutation) Type() string

Type returns the node type of this mutation (NetworkMapping).

func (*NetworkMappingMutation) Where

Where appends a list predicates to the NetworkMappingMutation builder.

func (*NetworkMappingMutation) WhereP

func (m *NetworkMappingMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NetworkMappingMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NetworkMappingQuery

type NetworkMappingQuery struct {
	// contains filtered or unexported fields
}

NetworkMappingQuery is the builder for querying NetworkMapping entities.

func (*NetworkMappingQuery) Aggregate

Aggregate returns a NetworkMappingSelect configured with the given aggregations.

func (*NetworkMappingQuery) All

All executes the query and returns a list of NetworkMappings.

func (*NetworkMappingQuery) AllX

AllX is like All, but panics if an error occurs.

func (*NetworkMappingQuery) Clone

Clone returns a duplicate of the NetworkMappingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NetworkMappingQuery) Count

func (_q *NetworkMappingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NetworkMappingQuery) CountX

func (_q *NetworkMappingQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NetworkMappingQuery) Exist

func (_q *NetworkMappingQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NetworkMappingQuery) ExistX

func (_q *NetworkMappingQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NetworkMappingQuery) First

First returns the first NetworkMapping entity from the query. Returns a *NotFoundError when no NetworkMapping was found.

func (*NetworkMappingQuery) FirstID

func (_q *NetworkMappingQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first NetworkMapping ID from the query. Returns a *NotFoundError when no NetworkMapping ID was found.

func (*NetworkMappingQuery) FirstIDX

func (_q *NetworkMappingQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*NetworkMappingQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*NetworkMappingQuery) GroupBy

func (_q *NetworkMappingQuery) GroupBy(field string, fields ...string) *NetworkMappingGroupBy

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.NetworkMapping.Query().
	GroupBy(networkmapping.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NetworkMappingQuery) IDs

func (_q *NetworkMappingQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of NetworkMapping IDs.

func (*NetworkMappingQuery) IDsX

func (_q *NetworkMappingQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*NetworkMappingQuery) Limit

func (_q *NetworkMappingQuery) Limit(limit int) *NetworkMappingQuery

Limit the number of records to be returned by this query.

func (*NetworkMappingQuery) Offset

func (_q *NetworkMappingQuery) Offset(offset int) *NetworkMappingQuery

Offset to start from.

func (*NetworkMappingQuery) Only

Only returns a single NetworkMapping entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NetworkMapping entity is found. Returns a *NotFoundError when no NetworkMapping entities are found.

func (*NetworkMappingQuery) OnlyID

func (_q *NetworkMappingQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only NetworkMapping ID in the query. Returns a *NotSingularError when more than one NetworkMapping ID is found. Returns a *NotFoundError when no entities are found.

func (*NetworkMappingQuery) OnlyIDX

func (_q *NetworkMappingQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NetworkMappingQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NetworkMappingQuery) Order

Order specifies how the records should be ordered.

func (*NetworkMappingQuery) Select

func (_q *NetworkMappingQuery) Select(fields ...string) *NetworkMappingSelect

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.NetworkMapping.Query().
	Select(networkmapping.FieldName).
	Scan(ctx, &v)

func (*NetworkMappingQuery) Unique

func (_q *NetworkMappingQuery) Unique(unique bool) *NetworkMappingQuery

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 (*NetworkMappingQuery) Where

Where adds a new predicate for the NetworkMappingQuery builder.

type NetworkMappingSelect

type NetworkMappingSelect struct {
	*NetworkMappingQuery
	// contains filtered or unexported fields
}

NetworkMappingSelect is the builder for selecting fields of NetworkMapping entities.

func (*NetworkMappingSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*NetworkMappingSelect) Bool

func (s *NetworkMappingSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) BoolX

func (s *NetworkMappingSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetworkMappingSelect) Bools

func (s *NetworkMappingSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) BoolsX

func (s *NetworkMappingSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetworkMappingSelect) Float64

func (s *NetworkMappingSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) Float64X

func (s *NetworkMappingSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetworkMappingSelect) Float64s

func (s *NetworkMappingSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) Float64sX

func (s *NetworkMappingSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetworkMappingSelect) Int

func (s *NetworkMappingSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) IntX

func (s *NetworkMappingSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetworkMappingSelect) Ints

func (s *NetworkMappingSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) IntsX

func (s *NetworkMappingSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetworkMappingSelect) Scan

func (_s *NetworkMappingSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NetworkMappingSelect) ScanX

func (s *NetworkMappingSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NetworkMappingSelect) String

func (s *NetworkMappingSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) StringX

func (s *NetworkMappingSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetworkMappingSelect) Strings

func (s *NetworkMappingSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NetworkMappingSelect) StringsX

func (s *NetworkMappingSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetworkMappingUpdate

type NetworkMappingUpdate struct {
	// contains filtered or unexported fields
}

NetworkMappingUpdate is the builder for updating NetworkMapping entities.

func (*NetworkMappingUpdate) AddComputerPort

func (_u *NetworkMappingUpdate) AddComputerPort(v int32) *NetworkMappingUpdate

AddComputerPort adds value to the "computer_port" field.

func (*NetworkMappingUpdate) AddGatewayPort

func (_u *NetworkMappingUpdate) AddGatewayPort(v int32) *NetworkMappingUpdate

AddGatewayPort adds value to the "gateway_port" field.

func (*NetworkMappingUpdate) AddStatus

func (_u *NetworkMappingUpdate) AddStatus(v int) *NetworkMappingUpdate

AddStatus adds value to the "status" field.

func (*NetworkMappingUpdate) Exec

func (_u *NetworkMappingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NetworkMappingUpdate) ExecX

func (_u *NetworkMappingUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetworkMappingUpdate) Mutation

Mutation returns the NetworkMappingMutation object of the builder.

func (*NetworkMappingUpdate) Save

func (_u *NetworkMappingUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NetworkMappingUpdate) SaveX

func (_u *NetworkMappingUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NetworkMappingUpdate) SetComputerPort

func (_u *NetworkMappingUpdate) SetComputerPort(v int32) *NetworkMappingUpdate

SetComputerPort sets the "computer_port" field.

func (*NetworkMappingUpdate) SetCreateTime

func (_u *NetworkMappingUpdate) SetCreateTime(v time.Time) *NetworkMappingUpdate

SetCreateTime sets the "create_time" field.

func (*NetworkMappingUpdate) SetDeleteState

func (_u *NetworkMappingUpdate) SetDeleteState(v bool) *NetworkMappingUpdate

SetDeleteState sets the "delete_state" field.

func (*NetworkMappingUpdate) SetFkComputerID

func (_u *NetworkMappingUpdate) SetFkComputerID(v uuid.UUID) *NetworkMappingUpdate

SetFkComputerID sets the "fk_computer_id" field.

func (*NetworkMappingUpdate) SetFkGatewayID

func (_u *NetworkMappingUpdate) SetFkGatewayID(v uuid.UUID) *NetworkMappingUpdate

SetFkGatewayID sets the "fk_gateway_id" field.

func (*NetworkMappingUpdate) SetFkUserID

func (_u *NetworkMappingUpdate) SetFkUserID(v uuid.UUID) *NetworkMappingUpdate

SetFkUserID sets the "fk_user_id" field.

func (*NetworkMappingUpdate) SetGatewayIP

func (_u *NetworkMappingUpdate) SetGatewayIP(v string) *NetworkMappingUpdate

SetGatewayIP sets the "gateway_ip" field.

func (*NetworkMappingUpdate) SetGatewayPort

func (_u *NetworkMappingUpdate) SetGatewayPort(v int32) *NetworkMappingUpdate

SetGatewayPort sets the "gateway_port" field.

func (*NetworkMappingUpdate) SetName

SetName sets the "name" field.

func (*NetworkMappingUpdate) SetNillableComputerPort

func (_u *NetworkMappingUpdate) SetNillableComputerPort(v *int32) *NetworkMappingUpdate

SetNillableComputerPort sets the "computer_port" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableCreateTime

func (_u *NetworkMappingUpdate) SetNillableCreateTime(v *time.Time) *NetworkMappingUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableDeleteState

func (_u *NetworkMappingUpdate) SetNillableDeleteState(v *bool) *NetworkMappingUpdate

SetNillableDeleteState sets the "delete_state" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableFkComputerID

func (_u *NetworkMappingUpdate) SetNillableFkComputerID(v *uuid.UUID) *NetworkMappingUpdate

SetNillableFkComputerID sets the "fk_computer_id" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableFkGatewayID

func (_u *NetworkMappingUpdate) SetNillableFkGatewayID(v *uuid.UUID) *NetworkMappingUpdate

SetNillableFkGatewayID sets the "fk_gateway_id" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableFkUserID

func (_u *NetworkMappingUpdate) SetNillableFkUserID(v *uuid.UUID) *NetworkMappingUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableGatewayIP

func (_u *NetworkMappingUpdate) SetNillableGatewayIP(v *string) *NetworkMappingUpdate

SetNillableGatewayIP sets the "gateway_ip" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableGatewayPort

func (_u *NetworkMappingUpdate) SetNillableGatewayPort(v *int32) *NetworkMappingUpdate

SetNillableGatewayPort sets the "gateway_port" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableName

func (_u *NetworkMappingUpdate) SetNillableName(v *string) *NetworkMappingUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableProtocol

func (_u *NetworkMappingUpdate) SetNillableProtocol(v *string) *NetworkMappingUpdate

SetNillableProtocol sets the "protocol" field if the given value is not nil.

func (*NetworkMappingUpdate) SetNillableStatus

func (_u *NetworkMappingUpdate) SetNillableStatus(v *int) *NetworkMappingUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*NetworkMappingUpdate) SetProtocol

func (_u *NetworkMappingUpdate) SetProtocol(v string) *NetworkMappingUpdate

SetProtocol sets the "protocol" field.

func (*NetworkMappingUpdate) SetStatus

func (_u *NetworkMappingUpdate) SetStatus(v int) *NetworkMappingUpdate

SetStatus sets the "status" field.

func (*NetworkMappingUpdate) Where

Where appends a list predicates to the NetworkMappingUpdate builder.

type NetworkMappingUpdateOne

type NetworkMappingUpdateOne struct {
	// contains filtered or unexported fields
}

NetworkMappingUpdateOne is the builder for updating a single NetworkMapping entity.

func (*NetworkMappingUpdateOne) AddComputerPort

func (_u *NetworkMappingUpdateOne) AddComputerPort(v int32) *NetworkMappingUpdateOne

AddComputerPort adds value to the "computer_port" field.

func (*NetworkMappingUpdateOne) AddGatewayPort

func (_u *NetworkMappingUpdateOne) AddGatewayPort(v int32) *NetworkMappingUpdateOne

AddGatewayPort adds value to the "gateway_port" field.

func (*NetworkMappingUpdateOne) AddStatus

AddStatus adds value to the "status" field.

func (*NetworkMappingUpdateOne) Exec

Exec executes the query on the entity.

func (*NetworkMappingUpdateOne) ExecX

func (_u *NetworkMappingUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetworkMappingUpdateOne) Mutation

Mutation returns the NetworkMappingMutation object of the builder.

func (*NetworkMappingUpdateOne) Save

Save executes the query and returns the updated NetworkMapping entity.

func (*NetworkMappingUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NetworkMappingUpdateOne) Select

func (_u *NetworkMappingUpdateOne) Select(field string, fields ...string) *NetworkMappingUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NetworkMappingUpdateOne) SetComputerPort

func (_u *NetworkMappingUpdateOne) SetComputerPort(v int32) *NetworkMappingUpdateOne

SetComputerPort sets the "computer_port" field.

func (*NetworkMappingUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*NetworkMappingUpdateOne) SetDeleteState

func (_u *NetworkMappingUpdateOne) SetDeleteState(v bool) *NetworkMappingUpdateOne

SetDeleteState sets the "delete_state" field.

func (*NetworkMappingUpdateOne) SetFkComputerID

func (_u *NetworkMappingUpdateOne) SetFkComputerID(v uuid.UUID) *NetworkMappingUpdateOne

SetFkComputerID sets the "fk_computer_id" field.

func (*NetworkMappingUpdateOne) SetFkGatewayID

SetFkGatewayID sets the "fk_gateway_id" field.

func (*NetworkMappingUpdateOne) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*NetworkMappingUpdateOne) SetGatewayIP

SetGatewayIP sets the "gateway_ip" field.

func (*NetworkMappingUpdateOne) SetGatewayPort

func (_u *NetworkMappingUpdateOne) SetGatewayPort(v int32) *NetworkMappingUpdateOne

SetGatewayPort sets the "gateway_port" field.

func (*NetworkMappingUpdateOne) SetName

SetName sets the "name" field.

func (*NetworkMappingUpdateOne) SetNillableComputerPort

func (_u *NetworkMappingUpdateOne) SetNillableComputerPort(v *int32) *NetworkMappingUpdateOne

SetNillableComputerPort sets the "computer_port" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableCreateTime

func (_u *NetworkMappingUpdateOne) SetNillableCreateTime(v *time.Time) *NetworkMappingUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableDeleteState

func (_u *NetworkMappingUpdateOne) SetNillableDeleteState(v *bool) *NetworkMappingUpdateOne

SetNillableDeleteState sets the "delete_state" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableFkComputerID

func (_u *NetworkMappingUpdateOne) SetNillableFkComputerID(v *uuid.UUID) *NetworkMappingUpdateOne

SetNillableFkComputerID sets the "fk_computer_id" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableFkGatewayID

func (_u *NetworkMappingUpdateOne) SetNillableFkGatewayID(v *uuid.UUID) *NetworkMappingUpdateOne

SetNillableFkGatewayID sets the "fk_gateway_id" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableFkUserID

func (_u *NetworkMappingUpdateOne) SetNillableFkUserID(v *uuid.UUID) *NetworkMappingUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableGatewayIP

func (_u *NetworkMappingUpdateOne) SetNillableGatewayIP(v *string) *NetworkMappingUpdateOne

SetNillableGatewayIP sets the "gateway_ip" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableGatewayPort

func (_u *NetworkMappingUpdateOne) SetNillableGatewayPort(v *int32) *NetworkMappingUpdateOne

SetNillableGatewayPort sets the "gateway_port" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableName

func (_u *NetworkMappingUpdateOne) SetNillableName(v *string) *NetworkMappingUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableProtocol

func (_u *NetworkMappingUpdateOne) SetNillableProtocol(v *string) *NetworkMappingUpdateOne

SetNillableProtocol sets the "protocol" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetNillableStatus

func (_u *NetworkMappingUpdateOne) SetNillableStatus(v *int) *NetworkMappingUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*NetworkMappingUpdateOne) SetProtocol

SetProtocol sets the "protocol" field.

func (*NetworkMappingUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*NetworkMappingUpdateOne) Where

Where appends a list predicates to the NetworkMappingUpdate builder.

type NetworkMappings

type NetworkMappings []*NetworkMapping

NetworkMappings is a parsable slice of NetworkMapping.

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 S3Bucket

type S3Bucket struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// bucketName
	BucketName string `json:"bucket_name,omitempty"`
	// CreatedTime holds the value of the "createdTime" field.
	CreatedTime time.Time `json:"createdTime,omitempty"`
	// contains filtered or unexported fields
}

S3Bucket is the model entity for the S3Bucket schema.

func (*S3Bucket) String

func (_m *S3Bucket) String() string

String implements the fmt.Stringer.

func (*S3Bucket) Unwrap

func (_m *S3Bucket) Unwrap() *S3Bucket

Unwrap unwraps the S3Bucket 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 (*S3Bucket) Update

func (_m *S3Bucket) Update() *S3BucketUpdateOne

Update returns a builder for updating this S3Bucket. Note that you need to call S3Bucket.Unwrap() before calling this method if this S3Bucket was returned from a transaction, and the transaction was committed or rolled back.

func (*S3Bucket) Value

func (_m *S3Bucket) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the S3Bucket. This includes values selected through modifiers, order, etc.

type S3BucketClient

type S3BucketClient struct {
	// contains filtered or unexported fields
}

S3BucketClient is a client for the S3Bucket schema.

func NewS3BucketClient

func NewS3BucketClient(c config) *S3BucketClient

NewS3BucketClient returns a client for the S3Bucket from the given config.

func (*S3BucketClient) Create

func (c *S3BucketClient) Create() *S3BucketCreate

Create returns a builder for creating a S3Bucket entity.

func (*S3BucketClient) CreateBulk

func (c *S3BucketClient) CreateBulk(builders ...*S3BucketCreate) *S3BucketCreateBulk

CreateBulk returns a builder for creating a bulk of S3Bucket entities.

func (*S3BucketClient) Delete

func (c *S3BucketClient) Delete() *S3BucketDelete

Delete returns a delete builder for S3Bucket.

func (*S3BucketClient) DeleteOne

func (c *S3BucketClient) DeleteOne(_m *S3Bucket) *S3BucketDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*S3BucketClient) DeleteOneID

func (c *S3BucketClient) DeleteOneID(id uuid.UUID) *S3BucketDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*S3BucketClient) Get

func (c *S3BucketClient) Get(ctx context.Context, id uuid.UUID) (*S3Bucket, error)

Get returns a S3Bucket entity by its id.

func (*S3BucketClient) GetX

func (c *S3BucketClient) GetX(ctx context.Context, id uuid.UUID) *S3Bucket

GetX is like Get, but panics if an error occurs.

func (*S3BucketClient) Hooks

func (c *S3BucketClient) Hooks() []Hook

Hooks returns the client hooks.

func (*S3BucketClient) Intercept

func (c *S3BucketClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `s3bucket.Intercept(f(g(h())))`.

func (*S3BucketClient) Interceptors

func (c *S3BucketClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*S3BucketClient) MapCreateBulk

func (c *S3BucketClient) MapCreateBulk(slice any, setFunc func(*S3BucketCreate, int)) *S3BucketCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*S3BucketClient) Query

func (c *S3BucketClient) Query() *S3BucketQuery

Query returns a query builder for S3Bucket.

func (*S3BucketClient) Update

func (c *S3BucketClient) Update() *S3BucketUpdate

Update returns an update builder for S3Bucket.

func (*S3BucketClient) UpdateOne

func (c *S3BucketClient) UpdateOne(_m *S3Bucket) *S3BucketUpdateOne

UpdateOne returns an update builder for the given entity.

func (*S3BucketClient) UpdateOneID

func (c *S3BucketClient) UpdateOneID(id uuid.UUID) *S3BucketUpdateOne

UpdateOneID returns an update builder for the given id.

func (*S3BucketClient) Use

func (c *S3BucketClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `s3bucket.Hooks(f(g(h())))`.

type S3BucketCreate

type S3BucketCreate struct {
	// contains filtered or unexported fields
}

S3BucketCreate is the builder for creating a S3Bucket entity.

func (*S3BucketCreate) Exec

func (_c *S3BucketCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*S3BucketCreate) ExecX

func (_c *S3BucketCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3BucketCreate) Mutation

func (_c *S3BucketCreate) Mutation() *S3BucketMutation

Mutation returns the S3BucketMutation object of the builder.

func (*S3BucketCreate) Save

func (_c *S3BucketCreate) Save(ctx context.Context) (*S3Bucket, error)

Save creates the S3Bucket in the database.

func (*S3BucketCreate) SaveX

func (_c *S3BucketCreate) SaveX(ctx context.Context) *S3Bucket

SaveX calls Save and panics if Save returns an error.

func (*S3BucketCreate) SetBucketName

func (_c *S3BucketCreate) SetBucketName(v string) *S3BucketCreate

SetBucketName sets the "bucket_name" field.

func (*S3BucketCreate) SetCreatedTime

func (_c *S3BucketCreate) SetCreatedTime(v time.Time) *S3BucketCreate

SetCreatedTime sets the "createdTime" field.

func (*S3BucketCreate) SetFkUserID

func (_c *S3BucketCreate) SetFkUserID(v uuid.UUID) *S3BucketCreate

SetFkUserID sets the "fk_user_id" field.

func (*S3BucketCreate) SetID

func (_c *S3BucketCreate) SetID(v uuid.UUID) *S3BucketCreate

SetID sets the "id" field.

func (*S3BucketCreate) SetNillableID

func (_c *S3BucketCreate) SetNillableID(v *uuid.UUID) *S3BucketCreate

SetNillableID sets the "id" field if the given value is not nil.

type S3BucketCreateBulk

type S3BucketCreateBulk struct {
	// contains filtered or unexported fields
}

S3BucketCreateBulk is the builder for creating many S3Bucket entities in bulk.

func (*S3BucketCreateBulk) Exec

func (_c *S3BucketCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*S3BucketCreateBulk) ExecX

func (_c *S3BucketCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3BucketCreateBulk) Save

func (_c *S3BucketCreateBulk) Save(ctx context.Context) ([]*S3Bucket, error)

Save creates the S3Bucket entities in the database.

func (*S3BucketCreateBulk) SaveX

func (_c *S3BucketCreateBulk) SaveX(ctx context.Context) []*S3Bucket

SaveX is like Save, but panics if an error occurs.

type S3BucketDelete

type S3BucketDelete struct {
	// contains filtered or unexported fields
}

S3BucketDelete is the builder for deleting a S3Bucket entity.

func (*S3BucketDelete) Exec

func (_d *S3BucketDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*S3BucketDelete) ExecX

func (_d *S3BucketDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*S3BucketDelete) Where

func (_d *S3BucketDelete) Where(ps ...predicate.S3Bucket) *S3BucketDelete

Where appends a list predicates to the S3BucketDelete builder.

type S3BucketDeleteOne

type S3BucketDeleteOne struct {
	// contains filtered or unexported fields
}

S3BucketDeleteOne is the builder for deleting a single S3Bucket entity.

func (*S3BucketDeleteOne) Exec

func (_d *S3BucketDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*S3BucketDeleteOne) ExecX

func (_d *S3BucketDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3BucketDeleteOne) Where

Where appends a list predicates to the S3BucketDelete builder.

type S3BucketGroupBy

type S3BucketGroupBy struct {
	// contains filtered or unexported fields
}

S3BucketGroupBy is the group-by builder for S3Bucket entities.

func (*S3BucketGroupBy) Aggregate

func (_g *S3BucketGroupBy) Aggregate(fns ...AggregateFunc) *S3BucketGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*S3BucketGroupBy) Bool

func (s *S3BucketGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) BoolX

func (s *S3BucketGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*S3BucketGroupBy) Bools

func (s *S3BucketGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) BoolsX

func (s *S3BucketGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*S3BucketGroupBy) Float64

func (s *S3BucketGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) Float64X

func (s *S3BucketGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*S3BucketGroupBy) Float64s

func (s *S3BucketGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) Float64sX

func (s *S3BucketGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*S3BucketGroupBy) Int

func (s *S3BucketGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) IntX

func (s *S3BucketGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*S3BucketGroupBy) Ints

func (s *S3BucketGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) IntsX

func (s *S3BucketGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*S3BucketGroupBy) Scan

func (_g *S3BucketGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*S3BucketGroupBy) ScanX

func (s *S3BucketGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*S3BucketGroupBy) String

func (s *S3BucketGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) StringX

func (s *S3BucketGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*S3BucketGroupBy) Strings

func (s *S3BucketGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*S3BucketGroupBy) StringsX

func (s *S3BucketGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type S3BucketMutation

type S3BucketMutation struct {
	// contains filtered or unexported fields
}

S3BucketMutation represents an operation that mutates the S3Bucket nodes in the graph.

func (*S3BucketMutation) AddField

func (m *S3BucketMutation) 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 (*S3BucketMutation) AddedEdges

func (m *S3BucketMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*S3BucketMutation) AddedField

func (m *S3BucketMutation) 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 (*S3BucketMutation) AddedFields

func (m *S3BucketMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*S3BucketMutation) AddedIDs

func (m *S3BucketMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*S3BucketMutation) BucketName

func (m *S3BucketMutation) BucketName() (r string, exists bool)

BucketName returns the value of the "bucket_name" field in the mutation.

func (*S3BucketMutation) ClearEdge

func (m *S3BucketMutation) 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 (*S3BucketMutation) ClearField

func (m *S3BucketMutation) 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 (*S3BucketMutation) ClearedEdges

func (m *S3BucketMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*S3BucketMutation) ClearedFields

func (m *S3BucketMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (S3BucketMutation) Client

func (m S3BucketMutation) 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 (*S3BucketMutation) CreatedTime

func (m *S3BucketMutation) CreatedTime() (r time.Time, exists bool)

CreatedTime returns the value of the "createdTime" field in the mutation.

func (*S3BucketMutation) EdgeCleared

func (m *S3BucketMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*S3BucketMutation) Field

func (m *S3BucketMutation) 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 (*S3BucketMutation) FieldCleared

func (m *S3BucketMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*S3BucketMutation) Fields

func (m *S3BucketMutation) 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 (*S3BucketMutation) FkUserID

func (m *S3BucketMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*S3BucketMutation) ID

func (m *S3BucketMutation) 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 (*S3BucketMutation) IDs

func (m *S3BucketMutation) 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 (*S3BucketMutation) OldBucketName

func (m *S3BucketMutation) OldBucketName(ctx context.Context) (v string, err error)

OldBucketName returns the old "bucket_name" field's value of the S3Bucket entity. If the S3Bucket 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 (*S3BucketMutation) OldCreatedTime

func (m *S3BucketMutation) OldCreatedTime(ctx context.Context) (v time.Time, err error)

OldCreatedTime returns the old "createdTime" field's value of the S3Bucket entity. If the S3Bucket 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 (*S3BucketMutation) OldField

func (m *S3BucketMutation) 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 (*S3BucketMutation) OldFkUserID

func (m *S3BucketMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the S3Bucket entity. If the S3Bucket 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 (*S3BucketMutation) Op

func (m *S3BucketMutation) Op() Op

Op returns the operation name.

func (*S3BucketMutation) RemovedEdges

func (m *S3BucketMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*S3BucketMutation) RemovedIDs

func (m *S3BucketMutation) 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 (*S3BucketMutation) ResetBucketName

func (m *S3BucketMutation) ResetBucketName()

ResetBucketName resets all changes to the "bucket_name" field.

func (*S3BucketMutation) ResetCreatedTime

func (m *S3BucketMutation) ResetCreatedTime()

ResetCreatedTime resets all changes to the "createdTime" field.

func (*S3BucketMutation) ResetEdge

func (m *S3BucketMutation) 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 (*S3BucketMutation) ResetField

func (m *S3BucketMutation) 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 (*S3BucketMutation) ResetFkUserID

func (m *S3BucketMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*S3BucketMutation) SetBucketName

func (m *S3BucketMutation) SetBucketName(s string)

SetBucketName sets the "bucket_name" field.

func (*S3BucketMutation) SetCreatedTime

func (m *S3BucketMutation) SetCreatedTime(t time.Time)

SetCreatedTime sets the "createdTime" field.

func (*S3BucketMutation) SetField

func (m *S3BucketMutation) 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 (*S3BucketMutation) SetFkUserID

func (m *S3BucketMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*S3BucketMutation) SetID

func (m *S3BucketMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of S3Bucket entities.

func (*S3BucketMutation) SetOp

func (m *S3BucketMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (S3BucketMutation) Tx

func (m S3BucketMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*S3BucketMutation) Type

func (m *S3BucketMutation) Type() string

Type returns the node type of this mutation (S3Bucket).

func (*S3BucketMutation) Where

func (m *S3BucketMutation) Where(ps ...predicate.S3Bucket)

Where appends a list predicates to the S3BucketMutation builder.

func (*S3BucketMutation) WhereP

func (m *S3BucketMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the S3BucketMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type S3BucketQuery

type S3BucketQuery struct {
	// contains filtered or unexported fields
}

S3BucketQuery is the builder for querying S3Bucket entities.

func (*S3BucketQuery) Aggregate

func (_q *S3BucketQuery) Aggregate(fns ...AggregateFunc) *S3BucketSelect

Aggregate returns a S3BucketSelect configured with the given aggregations.

func (*S3BucketQuery) All

func (_q *S3BucketQuery) All(ctx context.Context) ([]*S3Bucket, error)

All executes the query and returns a list of S3Buckets.

func (*S3BucketQuery) AllX

func (_q *S3BucketQuery) AllX(ctx context.Context) []*S3Bucket

AllX is like All, but panics if an error occurs.

func (*S3BucketQuery) Clone

func (_q *S3BucketQuery) Clone() *S3BucketQuery

Clone returns a duplicate of the S3BucketQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*S3BucketQuery) Count

func (_q *S3BucketQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*S3BucketQuery) CountX

func (_q *S3BucketQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*S3BucketQuery) Exist

func (_q *S3BucketQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*S3BucketQuery) ExistX

func (_q *S3BucketQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*S3BucketQuery) First

func (_q *S3BucketQuery) First(ctx context.Context) (*S3Bucket, error)

First returns the first S3Bucket entity from the query. Returns a *NotFoundError when no S3Bucket was found.

func (*S3BucketQuery) FirstID

func (_q *S3BucketQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first S3Bucket ID from the query. Returns a *NotFoundError when no S3Bucket ID was found.

func (*S3BucketQuery) FirstIDX

func (_q *S3BucketQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*S3BucketQuery) FirstX

func (_q *S3BucketQuery) FirstX(ctx context.Context) *S3Bucket

FirstX is like First, but panics if an error occurs.

func (*S3BucketQuery) GroupBy

func (_q *S3BucketQuery) GroupBy(field string, fields ...string) *S3BucketGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.S3Bucket.Query().
	GroupBy(s3bucket.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*S3BucketQuery) IDs

func (_q *S3BucketQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of S3Bucket IDs.

func (*S3BucketQuery) IDsX

func (_q *S3BucketQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*S3BucketQuery) Limit

func (_q *S3BucketQuery) Limit(limit int) *S3BucketQuery

Limit the number of records to be returned by this query.

func (*S3BucketQuery) Offset

func (_q *S3BucketQuery) Offset(offset int) *S3BucketQuery

Offset to start from.

func (*S3BucketQuery) Only

func (_q *S3BucketQuery) Only(ctx context.Context) (*S3Bucket, error)

Only returns a single S3Bucket entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one S3Bucket entity is found. Returns a *NotFoundError when no S3Bucket entities are found.

func (*S3BucketQuery) OnlyID

func (_q *S3BucketQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only S3Bucket ID in the query. Returns a *NotSingularError when more than one S3Bucket ID is found. Returns a *NotFoundError when no entities are found.

func (*S3BucketQuery) OnlyIDX

func (_q *S3BucketQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*S3BucketQuery) OnlyX

func (_q *S3BucketQuery) OnlyX(ctx context.Context) *S3Bucket

OnlyX is like Only, but panics if an error occurs.

func (*S3BucketQuery) Order

Order specifies how the records should be ordered.

func (*S3BucketQuery) Select

func (_q *S3BucketQuery) Select(fields ...string) *S3BucketSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.S3Bucket.Query().
	Select(s3bucket.FieldFkUserID).
	Scan(ctx, &v)

func (*S3BucketQuery) Unique

func (_q *S3BucketQuery) Unique(unique bool) *S3BucketQuery

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 (*S3BucketQuery) Where

func (_q *S3BucketQuery) Where(ps ...predicate.S3Bucket) *S3BucketQuery

Where adds a new predicate for the S3BucketQuery builder.

type S3BucketSelect

type S3BucketSelect struct {
	*S3BucketQuery
	// contains filtered or unexported fields
}

S3BucketSelect is the builder for selecting fields of S3Bucket entities.

func (*S3BucketSelect) Aggregate

func (_s *S3BucketSelect) Aggregate(fns ...AggregateFunc) *S3BucketSelect

Aggregate adds the given aggregation functions to the selector query.

func (*S3BucketSelect) Bool

func (s *S3BucketSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) BoolX

func (s *S3BucketSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*S3BucketSelect) Bools

func (s *S3BucketSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) BoolsX

func (s *S3BucketSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*S3BucketSelect) Float64

func (s *S3BucketSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) Float64X

func (s *S3BucketSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*S3BucketSelect) Float64s

func (s *S3BucketSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) Float64sX

func (s *S3BucketSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*S3BucketSelect) Int

func (s *S3BucketSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) IntX

func (s *S3BucketSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*S3BucketSelect) Ints

func (s *S3BucketSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) IntsX

func (s *S3BucketSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*S3BucketSelect) Scan

func (_s *S3BucketSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*S3BucketSelect) ScanX

func (s *S3BucketSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*S3BucketSelect) String

func (s *S3BucketSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) StringX

func (s *S3BucketSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*S3BucketSelect) Strings

func (s *S3BucketSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*S3BucketSelect) StringsX

func (s *S3BucketSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type S3BucketUpdate

type S3BucketUpdate struct {
	// contains filtered or unexported fields
}

S3BucketUpdate is the builder for updating S3Bucket entities.

func (*S3BucketUpdate) Exec

func (_u *S3BucketUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*S3BucketUpdate) ExecX

func (_u *S3BucketUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3BucketUpdate) Mutation

func (_u *S3BucketUpdate) Mutation() *S3BucketMutation

Mutation returns the S3BucketMutation object of the builder.

func (*S3BucketUpdate) Save

func (_u *S3BucketUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*S3BucketUpdate) SaveX

func (_u *S3BucketUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*S3BucketUpdate) SetBucketName

func (_u *S3BucketUpdate) SetBucketName(v string) *S3BucketUpdate

SetBucketName sets the "bucket_name" field.

func (*S3BucketUpdate) SetCreatedTime

func (_u *S3BucketUpdate) SetCreatedTime(v time.Time) *S3BucketUpdate

SetCreatedTime sets the "createdTime" field.

func (*S3BucketUpdate) SetFkUserID

func (_u *S3BucketUpdate) SetFkUserID(v uuid.UUID) *S3BucketUpdate

SetFkUserID sets the "fk_user_id" field.

func (*S3BucketUpdate) SetNillableBucketName

func (_u *S3BucketUpdate) SetNillableBucketName(v *string) *S3BucketUpdate

SetNillableBucketName sets the "bucket_name" field if the given value is not nil.

func (*S3BucketUpdate) SetNillableCreatedTime

func (_u *S3BucketUpdate) SetNillableCreatedTime(v *time.Time) *S3BucketUpdate

SetNillableCreatedTime sets the "createdTime" field if the given value is not nil.

func (*S3BucketUpdate) SetNillableFkUserID

func (_u *S3BucketUpdate) SetNillableFkUserID(v *uuid.UUID) *S3BucketUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*S3BucketUpdate) Where

func (_u *S3BucketUpdate) Where(ps ...predicate.S3Bucket) *S3BucketUpdate

Where appends a list predicates to the S3BucketUpdate builder.

type S3BucketUpdateOne

type S3BucketUpdateOne struct {
	// contains filtered or unexported fields
}

S3BucketUpdateOne is the builder for updating a single S3Bucket entity.

func (*S3BucketUpdateOne) Exec

func (_u *S3BucketUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*S3BucketUpdateOne) ExecX

func (_u *S3BucketUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3BucketUpdateOne) Mutation

func (_u *S3BucketUpdateOne) Mutation() *S3BucketMutation

Mutation returns the S3BucketMutation object of the builder.

func (*S3BucketUpdateOne) Save

func (_u *S3BucketUpdateOne) Save(ctx context.Context) (*S3Bucket, error)

Save executes the query and returns the updated S3Bucket entity.

func (*S3BucketUpdateOne) SaveX

func (_u *S3BucketUpdateOne) SaveX(ctx context.Context) *S3Bucket

SaveX is like Save, but panics if an error occurs.

func (*S3BucketUpdateOne) Select

func (_u *S3BucketUpdateOne) Select(field string, fields ...string) *S3BucketUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*S3BucketUpdateOne) SetBucketName

func (_u *S3BucketUpdateOne) SetBucketName(v string) *S3BucketUpdateOne

SetBucketName sets the "bucket_name" field.

func (*S3BucketUpdateOne) SetCreatedTime

func (_u *S3BucketUpdateOne) SetCreatedTime(v time.Time) *S3BucketUpdateOne

SetCreatedTime sets the "createdTime" field.

func (*S3BucketUpdateOne) SetFkUserID

func (_u *S3BucketUpdateOne) SetFkUserID(v uuid.UUID) *S3BucketUpdateOne

SetFkUserID sets the "fk_user_id" field.

func (*S3BucketUpdateOne) SetNillableBucketName

func (_u *S3BucketUpdateOne) SetNillableBucketName(v *string) *S3BucketUpdateOne

SetNillableBucketName sets the "bucket_name" field if the given value is not nil.

func (*S3BucketUpdateOne) SetNillableCreatedTime

func (_u *S3BucketUpdateOne) SetNillableCreatedTime(v *time.Time) *S3BucketUpdateOne

SetNillableCreatedTime sets the "createdTime" field if the given value is not nil.

func (*S3BucketUpdateOne) SetNillableFkUserID

func (_u *S3BucketUpdateOne) SetNillableFkUserID(v *uuid.UUID) *S3BucketUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*S3BucketUpdateOne) Where

Where appends a list predicates to the S3BucketUpdate builder.

type S3Buckets

type S3Buckets []*S3Bucket

S3Buckets is a parsable slice of S3Bucket.

type S3User

type S3User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// 类型
	Type int8 `json:"type,omitempty"`
	// accessKey
	AccessKey string `json:"access_key,omitempty"`
	// secretKey
	SecretKey string `json:"secret_key,omitempty"`
	// 创建时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// 修改时间
	UpdateTime time.Time `json:"update_time,omitempty"`
	// contains filtered or unexported fields
}

S3User is the model entity for the S3User schema.

func (*S3User) String

func (_m *S3User) String() string

String implements the fmt.Stringer.

func (*S3User) Unwrap

func (_m *S3User) Unwrap() *S3User

Unwrap unwraps the S3User 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 (*S3User) Update

func (_m *S3User) Update() *S3UserUpdateOne

Update returns a builder for updating this S3User. Note that you need to call S3User.Unwrap() before calling this method if this S3User was returned from a transaction, and the transaction was committed or rolled back.

func (*S3User) Value

func (_m *S3User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the S3User. This includes values selected through modifiers, order, etc.

type S3UserClient

type S3UserClient struct {
	// contains filtered or unexported fields
}

S3UserClient is a client for the S3User schema.

func NewS3UserClient

func NewS3UserClient(c config) *S3UserClient

NewS3UserClient returns a client for the S3User from the given config.

func (*S3UserClient) Create

func (c *S3UserClient) Create() *S3UserCreate

Create returns a builder for creating a S3User entity.

func (*S3UserClient) CreateBulk

func (c *S3UserClient) CreateBulk(builders ...*S3UserCreate) *S3UserCreateBulk

CreateBulk returns a builder for creating a bulk of S3User entities.

func (*S3UserClient) Delete

func (c *S3UserClient) Delete() *S3UserDelete

Delete returns a delete builder for S3User.

func (*S3UserClient) DeleteOne

func (c *S3UserClient) DeleteOne(_m *S3User) *S3UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*S3UserClient) DeleteOneID

func (c *S3UserClient) DeleteOneID(id uuid.UUID) *S3UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*S3UserClient) Get

func (c *S3UserClient) Get(ctx context.Context, id uuid.UUID) (*S3User, error)

Get returns a S3User entity by its id.

func (*S3UserClient) GetX

func (c *S3UserClient) GetX(ctx context.Context, id uuid.UUID) *S3User

GetX is like Get, but panics if an error occurs.

func (*S3UserClient) Hooks

func (c *S3UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*S3UserClient) Intercept

func (c *S3UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `s3user.Intercept(f(g(h())))`.

func (*S3UserClient) Interceptors

func (c *S3UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*S3UserClient) MapCreateBulk

func (c *S3UserClient) MapCreateBulk(slice any, setFunc func(*S3UserCreate, int)) *S3UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*S3UserClient) Query

func (c *S3UserClient) Query() *S3UserQuery

Query returns a query builder for S3User.

func (*S3UserClient) Update

func (c *S3UserClient) Update() *S3UserUpdate

Update returns an update builder for S3User.

func (*S3UserClient) UpdateOne

func (c *S3UserClient) UpdateOne(_m *S3User) *S3UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*S3UserClient) UpdateOneID

func (c *S3UserClient) UpdateOneID(id uuid.UUID) *S3UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*S3UserClient) Use

func (c *S3UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `s3user.Hooks(f(g(h())))`.

type S3UserCreate

type S3UserCreate struct {
	// contains filtered or unexported fields
}

S3UserCreate is the builder for creating a S3User entity.

func (*S3UserCreate) Exec

func (_c *S3UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*S3UserCreate) ExecX

func (_c *S3UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3UserCreate) Mutation

func (_c *S3UserCreate) Mutation() *S3UserMutation

Mutation returns the S3UserMutation object of the builder.

func (*S3UserCreate) Save

func (_c *S3UserCreate) Save(ctx context.Context) (*S3User, error)

Save creates the S3User in the database.

func (*S3UserCreate) SaveX

func (_c *S3UserCreate) SaveX(ctx context.Context) *S3User

SaveX calls Save and panics if Save returns an error.

func (*S3UserCreate) SetAccessKey

func (_c *S3UserCreate) SetAccessKey(v string) *S3UserCreate

SetAccessKey sets the "access_key" field.

func (*S3UserCreate) SetCreateTime

func (_c *S3UserCreate) SetCreateTime(v time.Time) *S3UserCreate

SetCreateTime sets the "create_time" field.

func (*S3UserCreate) SetFkUserID

func (_c *S3UserCreate) SetFkUserID(v uuid.UUID) *S3UserCreate

SetFkUserID sets the "fk_user_id" field.

func (*S3UserCreate) SetID

func (_c *S3UserCreate) SetID(v uuid.UUID) *S3UserCreate

SetID sets the "id" field.

func (*S3UserCreate) SetNillableCreateTime

func (_c *S3UserCreate) SetNillableCreateTime(v *time.Time) *S3UserCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*S3UserCreate) SetNillableID

func (_c *S3UserCreate) SetNillableID(v *uuid.UUID) *S3UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*S3UserCreate) SetNillableUpdateTime

func (_c *S3UserCreate) SetNillableUpdateTime(v *time.Time) *S3UserCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*S3UserCreate) SetSecretKey

func (_c *S3UserCreate) SetSecretKey(v string) *S3UserCreate

SetSecretKey sets the "secret_key" field.

func (*S3UserCreate) SetType

func (_c *S3UserCreate) SetType(v int8) *S3UserCreate

SetType sets the "type" field.

func (*S3UserCreate) SetUpdateTime

func (_c *S3UserCreate) SetUpdateTime(v time.Time) *S3UserCreate

SetUpdateTime sets the "update_time" field.

type S3UserCreateBulk

type S3UserCreateBulk struct {
	// contains filtered or unexported fields
}

S3UserCreateBulk is the builder for creating many S3User entities in bulk.

func (*S3UserCreateBulk) Exec

func (_c *S3UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*S3UserCreateBulk) ExecX

func (_c *S3UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3UserCreateBulk) Save

func (_c *S3UserCreateBulk) Save(ctx context.Context) ([]*S3User, error)

Save creates the S3User entities in the database.

func (*S3UserCreateBulk) SaveX

func (_c *S3UserCreateBulk) SaveX(ctx context.Context) []*S3User

SaveX is like Save, but panics if an error occurs.

type S3UserDelete

type S3UserDelete struct {
	// contains filtered or unexported fields
}

S3UserDelete is the builder for deleting a S3User entity.

func (*S3UserDelete) Exec

func (_d *S3UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*S3UserDelete) ExecX

func (_d *S3UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*S3UserDelete) Where

func (_d *S3UserDelete) Where(ps ...predicate.S3User) *S3UserDelete

Where appends a list predicates to the S3UserDelete builder.

type S3UserDeleteOne

type S3UserDeleteOne struct {
	// contains filtered or unexported fields
}

S3UserDeleteOne is the builder for deleting a single S3User entity.

func (*S3UserDeleteOne) Exec

func (_d *S3UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*S3UserDeleteOne) ExecX

func (_d *S3UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3UserDeleteOne) Where

func (_d *S3UserDeleteOne) Where(ps ...predicate.S3User) *S3UserDeleteOne

Where appends a list predicates to the S3UserDelete builder.

type S3UserGroupBy

type S3UserGroupBy struct {
	// contains filtered or unexported fields
}

S3UserGroupBy is the group-by builder for S3User entities.

func (*S3UserGroupBy) Aggregate

func (_g *S3UserGroupBy) Aggregate(fns ...AggregateFunc) *S3UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*S3UserGroupBy) Bool

func (s *S3UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) BoolX

func (s *S3UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*S3UserGroupBy) Bools

func (s *S3UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) BoolsX

func (s *S3UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*S3UserGroupBy) Float64

func (s *S3UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) Float64X

func (s *S3UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*S3UserGroupBy) Float64s

func (s *S3UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) Float64sX

func (s *S3UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*S3UserGroupBy) Int

func (s *S3UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) IntX

func (s *S3UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*S3UserGroupBy) Ints

func (s *S3UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) IntsX

func (s *S3UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*S3UserGroupBy) Scan

func (_g *S3UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*S3UserGroupBy) ScanX

func (s *S3UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*S3UserGroupBy) String

func (s *S3UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) StringX

func (s *S3UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*S3UserGroupBy) Strings

func (s *S3UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*S3UserGroupBy) StringsX

func (s *S3UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type S3UserMutation

type S3UserMutation struct {
	// contains filtered or unexported fields
}

S3UserMutation represents an operation that mutates the S3User nodes in the graph.

func (*S3UserMutation) AccessKey

func (m *S3UserMutation) AccessKey() (r string, exists bool)

AccessKey returns the value of the "access_key" field in the mutation.

func (*S3UserMutation) AddField

func (m *S3UserMutation) 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 (*S3UserMutation) AddType

func (m *S3UserMutation) AddType(i int8)

AddType adds i to the "type" field.

func (*S3UserMutation) AddedEdges

func (m *S3UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*S3UserMutation) AddedField

func (m *S3UserMutation) 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 (*S3UserMutation) AddedFields

func (m *S3UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*S3UserMutation) AddedIDs

func (m *S3UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*S3UserMutation) AddedType

func (m *S3UserMutation) AddedType() (r int8, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*S3UserMutation) ClearEdge

func (m *S3UserMutation) 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 (*S3UserMutation) ClearField

func (m *S3UserMutation) 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 (*S3UserMutation) ClearedEdges

func (m *S3UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*S3UserMutation) ClearedFields

func (m *S3UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (S3UserMutation) Client

func (m S3UserMutation) 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 (*S3UserMutation) CreateTime

func (m *S3UserMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*S3UserMutation) EdgeCleared

func (m *S3UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*S3UserMutation) Field

func (m *S3UserMutation) 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 (*S3UserMutation) FieldCleared

func (m *S3UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*S3UserMutation) Fields

func (m *S3UserMutation) 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 (*S3UserMutation) FkUserID

func (m *S3UserMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*S3UserMutation) GetType

func (m *S3UserMutation) GetType() (r int8, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*S3UserMutation) ID

func (m *S3UserMutation) 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 (*S3UserMutation) IDs

func (m *S3UserMutation) 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 (*S3UserMutation) OldAccessKey

func (m *S3UserMutation) OldAccessKey(ctx context.Context) (v string, err error)

OldAccessKey returns the old "access_key" field's value of the S3User entity. If the S3User 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 (*S3UserMutation) OldCreateTime

func (m *S3UserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the S3User entity. If the S3User 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 (*S3UserMutation) OldField

func (m *S3UserMutation) 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 (*S3UserMutation) OldFkUserID

func (m *S3UserMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the S3User entity. If the S3User 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 (*S3UserMutation) OldSecretKey

func (m *S3UserMutation) OldSecretKey(ctx context.Context) (v string, err error)

OldSecretKey returns the old "secret_key" field's value of the S3User entity. If the S3User 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 (*S3UserMutation) OldType

func (m *S3UserMutation) OldType(ctx context.Context) (v int8, err error)

OldType returns the old "type" field's value of the S3User entity. If the S3User 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 (*S3UserMutation) OldUpdateTime

func (m *S3UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the S3User entity. If the S3User 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 (*S3UserMutation) Op

func (m *S3UserMutation) Op() Op

Op returns the operation name.

func (*S3UserMutation) RemovedEdges

func (m *S3UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*S3UserMutation) RemovedIDs

func (m *S3UserMutation) 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 (*S3UserMutation) ResetAccessKey

func (m *S3UserMutation) ResetAccessKey()

ResetAccessKey resets all changes to the "access_key" field.

func (*S3UserMutation) ResetCreateTime

func (m *S3UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*S3UserMutation) ResetEdge

func (m *S3UserMutation) 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 (*S3UserMutation) ResetField

func (m *S3UserMutation) 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 (*S3UserMutation) ResetFkUserID

func (m *S3UserMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*S3UserMutation) ResetSecretKey

func (m *S3UserMutation) ResetSecretKey()

ResetSecretKey resets all changes to the "secret_key" field.

func (*S3UserMutation) ResetType

func (m *S3UserMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*S3UserMutation) ResetUpdateTime

func (m *S3UserMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*S3UserMutation) SecretKey

func (m *S3UserMutation) SecretKey() (r string, exists bool)

SecretKey returns the value of the "secret_key" field in the mutation.

func (*S3UserMutation) SetAccessKey

func (m *S3UserMutation) SetAccessKey(s string)

SetAccessKey sets the "access_key" field.

func (*S3UserMutation) SetCreateTime

func (m *S3UserMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*S3UserMutation) SetField

func (m *S3UserMutation) 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 (*S3UserMutation) SetFkUserID

func (m *S3UserMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*S3UserMutation) SetID

func (m *S3UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of S3User entities.

func (*S3UserMutation) SetOp

func (m *S3UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*S3UserMutation) SetSecretKey

func (m *S3UserMutation) SetSecretKey(s string)

SetSecretKey sets the "secret_key" field.

func (*S3UserMutation) SetType

func (m *S3UserMutation) SetType(i int8)

SetType sets the "type" field.

func (*S3UserMutation) SetUpdateTime

func (m *S3UserMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (S3UserMutation) Tx

func (m S3UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*S3UserMutation) Type

func (m *S3UserMutation) Type() string

Type returns the node type of this mutation (S3User).

func (*S3UserMutation) UpdateTime

func (m *S3UserMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*S3UserMutation) Where

func (m *S3UserMutation) Where(ps ...predicate.S3User)

Where appends a list predicates to the S3UserMutation builder.

func (*S3UserMutation) WhereP

func (m *S3UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the S3UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type S3UserQuery

type S3UserQuery struct {
	// contains filtered or unexported fields
}

S3UserQuery is the builder for querying S3User entities.

func (*S3UserQuery) Aggregate

func (_q *S3UserQuery) Aggregate(fns ...AggregateFunc) *S3UserSelect

Aggregate returns a S3UserSelect configured with the given aggregations.

func (*S3UserQuery) All

func (_q *S3UserQuery) All(ctx context.Context) ([]*S3User, error)

All executes the query and returns a list of S3Users.

func (*S3UserQuery) AllX

func (_q *S3UserQuery) AllX(ctx context.Context) []*S3User

AllX is like All, but panics if an error occurs.

func (*S3UserQuery) Clone

func (_q *S3UserQuery) Clone() *S3UserQuery

Clone returns a duplicate of the S3UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*S3UserQuery) Count

func (_q *S3UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*S3UserQuery) CountX

func (_q *S3UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*S3UserQuery) Exist

func (_q *S3UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*S3UserQuery) ExistX

func (_q *S3UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*S3UserQuery) First

func (_q *S3UserQuery) First(ctx context.Context) (*S3User, error)

First returns the first S3User entity from the query. Returns a *NotFoundError when no S3User was found.

func (*S3UserQuery) FirstID

func (_q *S3UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first S3User ID from the query. Returns a *NotFoundError when no S3User ID was found.

func (*S3UserQuery) FirstIDX

func (_q *S3UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*S3UserQuery) FirstX

func (_q *S3UserQuery) FirstX(ctx context.Context) *S3User

FirstX is like First, but panics if an error occurs.

func (*S3UserQuery) GroupBy

func (_q *S3UserQuery) GroupBy(field string, fields ...string) *S3UserGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.S3User.Query().
	GroupBy(s3user.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*S3UserQuery) IDs

func (_q *S3UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of S3User IDs.

func (*S3UserQuery) IDsX

func (_q *S3UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*S3UserQuery) Limit

func (_q *S3UserQuery) Limit(limit int) *S3UserQuery

Limit the number of records to be returned by this query.

func (*S3UserQuery) Offset

func (_q *S3UserQuery) Offset(offset int) *S3UserQuery

Offset to start from.

func (*S3UserQuery) Only

func (_q *S3UserQuery) Only(ctx context.Context) (*S3User, error)

Only returns a single S3User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one S3User entity is found. Returns a *NotFoundError when no S3User entities are found.

func (*S3UserQuery) OnlyID

func (_q *S3UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only S3User ID in the query. Returns a *NotSingularError when more than one S3User ID is found. Returns a *NotFoundError when no entities are found.

func (*S3UserQuery) OnlyIDX

func (_q *S3UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*S3UserQuery) OnlyX

func (_q *S3UserQuery) OnlyX(ctx context.Context) *S3User

OnlyX is like Only, but panics if an error occurs.

func (*S3UserQuery) Order

func (_q *S3UserQuery) Order(o ...s3user.OrderOption) *S3UserQuery

Order specifies how the records should be ordered.

func (*S3UserQuery) Select

func (_q *S3UserQuery) Select(fields ...string) *S3UserSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.S3User.Query().
	Select(s3user.FieldFkUserID).
	Scan(ctx, &v)

func (*S3UserQuery) Unique

func (_q *S3UserQuery) Unique(unique bool) *S3UserQuery

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 (*S3UserQuery) Where

func (_q *S3UserQuery) Where(ps ...predicate.S3User) *S3UserQuery

Where adds a new predicate for the S3UserQuery builder.

type S3UserSelect

type S3UserSelect struct {
	*S3UserQuery
	// contains filtered or unexported fields
}

S3UserSelect is the builder for selecting fields of S3User entities.

func (*S3UserSelect) Aggregate

func (_s *S3UserSelect) Aggregate(fns ...AggregateFunc) *S3UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*S3UserSelect) Bool

func (s *S3UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) BoolX

func (s *S3UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*S3UserSelect) Bools

func (s *S3UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) BoolsX

func (s *S3UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*S3UserSelect) Float64

func (s *S3UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) Float64X

func (s *S3UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*S3UserSelect) Float64s

func (s *S3UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) Float64sX

func (s *S3UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*S3UserSelect) Int

func (s *S3UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) IntX

func (s *S3UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*S3UserSelect) Ints

func (s *S3UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) IntsX

func (s *S3UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*S3UserSelect) Scan

func (_s *S3UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*S3UserSelect) ScanX

func (s *S3UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*S3UserSelect) String

func (s *S3UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) StringX

func (s *S3UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*S3UserSelect) Strings

func (s *S3UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*S3UserSelect) StringsX

func (s *S3UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type S3UserUpdate

type S3UserUpdate struct {
	// contains filtered or unexported fields
}

S3UserUpdate is the builder for updating S3User entities.

func (*S3UserUpdate) AddType

func (_u *S3UserUpdate) AddType(v int8) *S3UserUpdate

AddType adds value to the "type" field.

func (*S3UserUpdate) Exec

func (_u *S3UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*S3UserUpdate) ExecX

func (_u *S3UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3UserUpdate) Mutation

func (_u *S3UserUpdate) Mutation() *S3UserMutation

Mutation returns the S3UserMutation object of the builder.

func (*S3UserUpdate) Save

func (_u *S3UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*S3UserUpdate) SaveX

func (_u *S3UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*S3UserUpdate) SetAccessKey

func (_u *S3UserUpdate) SetAccessKey(v string) *S3UserUpdate

SetAccessKey sets the "access_key" field.

func (*S3UserUpdate) SetCreateTime

func (_u *S3UserUpdate) SetCreateTime(v time.Time) *S3UserUpdate

SetCreateTime sets the "create_time" field.

func (*S3UserUpdate) SetFkUserID

func (_u *S3UserUpdate) SetFkUserID(v uuid.UUID) *S3UserUpdate

SetFkUserID sets the "fk_user_id" field.

func (*S3UserUpdate) SetNillableAccessKey

func (_u *S3UserUpdate) SetNillableAccessKey(v *string) *S3UserUpdate

SetNillableAccessKey sets the "access_key" field if the given value is not nil.

func (*S3UserUpdate) SetNillableCreateTime

func (_u *S3UserUpdate) SetNillableCreateTime(v *time.Time) *S3UserUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*S3UserUpdate) SetNillableFkUserID

func (_u *S3UserUpdate) SetNillableFkUserID(v *uuid.UUID) *S3UserUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*S3UserUpdate) SetNillableSecretKey

func (_u *S3UserUpdate) SetNillableSecretKey(v *string) *S3UserUpdate

SetNillableSecretKey sets the "secret_key" field if the given value is not nil.

func (*S3UserUpdate) SetNillableType

func (_u *S3UserUpdate) SetNillableType(v *int8) *S3UserUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*S3UserUpdate) SetNillableUpdateTime

func (_u *S3UserUpdate) SetNillableUpdateTime(v *time.Time) *S3UserUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*S3UserUpdate) SetSecretKey

func (_u *S3UserUpdate) SetSecretKey(v string) *S3UserUpdate

SetSecretKey sets the "secret_key" field.

func (*S3UserUpdate) SetType

func (_u *S3UserUpdate) SetType(v int8) *S3UserUpdate

SetType sets the "type" field.

func (*S3UserUpdate) SetUpdateTime

func (_u *S3UserUpdate) SetUpdateTime(v time.Time) *S3UserUpdate

SetUpdateTime sets the "update_time" field.

func (*S3UserUpdate) Where

func (_u *S3UserUpdate) Where(ps ...predicate.S3User) *S3UserUpdate

Where appends a list predicates to the S3UserUpdate builder.

type S3UserUpdateOne

type S3UserUpdateOne struct {
	// contains filtered or unexported fields
}

S3UserUpdateOne is the builder for updating a single S3User entity.

func (*S3UserUpdateOne) AddType

func (_u *S3UserUpdateOne) AddType(v int8) *S3UserUpdateOne

AddType adds value to the "type" field.

func (*S3UserUpdateOne) Exec

func (_u *S3UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*S3UserUpdateOne) ExecX

func (_u *S3UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*S3UserUpdateOne) Mutation

func (_u *S3UserUpdateOne) Mutation() *S3UserMutation

Mutation returns the S3UserMutation object of the builder.

func (*S3UserUpdateOne) Save

func (_u *S3UserUpdateOne) Save(ctx context.Context) (*S3User, error)

Save executes the query and returns the updated S3User entity.

func (*S3UserUpdateOne) SaveX

func (_u *S3UserUpdateOne) SaveX(ctx context.Context) *S3User

SaveX is like Save, but panics if an error occurs.

func (*S3UserUpdateOne) Select

func (_u *S3UserUpdateOne) Select(field string, fields ...string) *S3UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*S3UserUpdateOne) SetAccessKey

func (_u *S3UserUpdateOne) SetAccessKey(v string) *S3UserUpdateOne

SetAccessKey sets the "access_key" field.

func (*S3UserUpdateOne) SetCreateTime

func (_u *S3UserUpdateOne) SetCreateTime(v time.Time) *S3UserUpdateOne

SetCreateTime sets the "create_time" field.

func (*S3UserUpdateOne) SetFkUserID

func (_u *S3UserUpdateOne) SetFkUserID(v uuid.UUID) *S3UserUpdateOne

SetFkUserID sets the "fk_user_id" field.

func (*S3UserUpdateOne) SetNillableAccessKey

func (_u *S3UserUpdateOne) SetNillableAccessKey(v *string) *S3UserUpdateOne

SetNillableAccessKey sets the "access_key" field if the given value is not nil.

func (*S3UserUpdateOne) SetNillableCreateTime

func (_u *S3UserUpdateOne) SetNillableCreateTime(v *time.Time) *S3UserUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*S3UserUpdateOne) SetNillableFkUserID

func (_u *S3UserUpdateOne) SetNillableFkUserID(v *uuid.UUID) *S3UserUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*S3UserUpdateOne) SetNillableSecretKey

func (_u *S3UserUpdateOne) SetNillableSecretKey(v *string) *S3UserUpdateOne

SetNillableSecretKey sets the "secret_key" field if the given value is not nil.

func (*S3UserUpdateOne) SetNillableType

func (_u *S3UserUpdateOne) SetNillableType(v *int8) *S3UserUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*S3UserUpdateOne) SetNillableUpdateTime

func (_u *S3UserUpdateOne) SetNillableUpdateTime(v *time.Time) *S3UserUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*S3UserUpdateOne) SetSecretKey

func (_u *S3UserUpdateOne) SetSecretKey(v string) *S3UserUpdateOne

SetSecretKey sets the "secret_key" field.

func (*S3UserUpdateOne) SetType

func (_u *S3UserUpdateOne) SetType(v int8) *S3UserUpdateOne

SetType sets the "type" field.

func (*S3UserUpdateOne) SetUpdateTime

func (_u *S3UserUpdateOne) SetUpdateTime(v time.Time) *S3UserUpdateOne

SetUpdateTime sets the "update_time" field.

func (*S3UserUpdateOne) Where

func (_u *S3UserUpdateOne) Where(ps ...predicate.S3User) *S3UserUpdateOne

Where appends a list predicates to the S3UserUpdate builder.

type S3Users

type S3Users []*S3User

S3Users is a parsable slice of S3User.

type Script

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

func (_m *Script) QueryScriptExecutionRecords() *ScriptExecutionRecordQuery

QueryScriptExecutionRecords queries the "scriptExecutionRecords" edge of the Script entity.

func (*Script) String

func (_m *Script) String() string

String implements the fmt.Stringer.

func (*Script) Unwrap

func (_m *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

func (_m *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

func (_m *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

type ScriptClient struct {
	// contains filtered or unexported fields
}

ScriptClient is a client for the Script schema.

func NewScriptClient

func NewScriptClient(c config) *ScriptClient

NewScriptClient returns a client for the Script from the given config.

func (*ScriptClient) Create

func (c *ScriptClient) Create() *ScriptCreate

Create returns a builder for creating a Script entity.

func (*ScriptClient) CreateBulk

func (c *ScriptClient) CreateBulk(builders ...*ScriptCreate) *ScriptCreateBulk

CreateBulk returns a builder for creating a bulk of Script entities.

func (*ScriptClient) Delete

func (c *ScriptClient) Delete() *ScriptDelete

Delete returns a delete builder for Script.

func (*ScriptClient) DeleteOne

func (c *ScriptClient) DeleteOne(_m *Script) *ScriptDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ScriptClient) DeleteOneID

func (c *ScriptClient) DeleteOneID(id int32) *ScriptDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ScriptClient) Get

func (c *ScriptClient) Get(ctx context.Context, id int32) (*Script, error)

Get returns a Script entity by its id.

func (*ScriptClient) GetX

func (c *ScriptClient) GetX(ctx context.Context, id int32) *Script

GetX is like Get, but panics if an error occurs.

func (*ScriptClient) Hooks

func (c *ScriptClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScriptClient) Intercept

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

func (c *ScriptClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ScriptClient) MapCreateBulk

func (c *ScriptClient) MapCreateBulk(slice any, setFunc func(*ScriptCreate, int)) *ScriptCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ScriptClient) Query

func (c *ScriptClient) Query() *ScriptQuery

Query returns a query builder for Script.

func (*ScriptClient) QueryScriptExecutionRecords

func (c *ScriptClient) QueryScriptExecutionRecords(_m *Script) *ScriptExecutionRecordQuery

QueryScriptExecutionRecords queries the scriptExecutionRecords edge of a Script.

func (*ScriptClient) Update

func (c *ScriptClient) Update() *ScriptUpdate

Update returns an update builder for Script.

func (*ScriptClient) UpdateOne

func (c *ScriptClient) UpdateOne(_m *Script) *ScriptUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScriptClient) UpdateOneID

func (c *ScriptClient) UpdateOneID(id int32) *ScriptUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ScriptClient) Use

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

type ScriptCreate struct {
	// contains filtered or unexported fields
}

ScriptCreate is the builder for creating a Script entity.

func (*ScriptCreate) AddScriptExecutionRecordIDs

func (_c *ScriptCreate) AddScriptExecutionRecordIDs(ids ...int32) *ScriptCreate

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptCreate) AddScriptExecutionRecords

func (_c *ScriptCreate) AddScriptExecutionRecords(v ...*ScriptExecutionRecord) *ScriptCreate

AddScriptExecutionRecords adds the "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptCreate) Exec

func (_c *ScriptCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptCreate) ExecX

func (_c *ScriptCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptCreate) Mutation

func (_c *ScriptCreate) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptCreate) Save

func (_c *ScriptCreate) Save(ctx context.Context) (*Script, error)

Save creates the Script in the database.

func (*ScriptCreate) SaveX

func (_c *ScriptCreate) SaveX(ctx context.Context) *Script

SaveX calls Save and panics if Save returns an error.

func (*ScriptCreate) SetCreateTime

func (_c *ScriptCreate) SetCreateTime(v time.Time) *ScriptCreate

SetCreateTime sets the "create_time" field.

func (*ScriptCreate) SetFileAddress

func (_c *ScriptCreate) SetFileAddress(v string) *ScriptCreate

SetFileAddress sets the "file_address" field.

func (*ScriptCreate) SetID

func (_c *ScriptCreate) SetID(v int32) *ScriptCreate

SetID sets the "id" field.

func (*ScriptCreate) SetNillableCreateTime

func (_c *ScriptCreate) SetNillableCreateTime(v *time.Time) *ScriptCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptCreate) SetNillableUpdateTime

func (_c *ScriptCreate) SetNillableUpdateTime(v *time.Time) *ScriptCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptCreate) SetScriptContent

func (_c *ScriptCreate) SetScriptContent(v string) *ScriptCreate

SetScriptContent sets the "script_content" field.

func (*ScriptCreate) SetScriptName

func (_c *ScriptCreate) SetScriptName(v string) *ScriptCreate

SetScriptName sets the "script_name" field.

func (*ScriptCreate) SetTaskNumber

func (_c *ScriptCreate) SetTaskNumber(v int32) *ScriptCreate

SetTaskNumber sets the "task_number" field.

func (*ScriptCreate) SetUpdateTime

func (_c *ScriptCreate) SetUpdateTime(v time.Time) *ScriptCreate

SetUpdateTime sets the "update_time" field.

func (*ScriptCreate) SetUserID

func (_c *ScriptCreate) SetUserID(v string) *ScriptCreate

SetUserID sets the "user_id" field.

type ScriptCreateBulk

type ScriptCreateBulk struct {
	// contains filtered or unexported fields
}

ScriptCreateBulk is the builder for creating many Script entities in bulk.

func (*ScriptCreateBulk) Exec

func (_c *ScriptCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptCreateBulk) ExecX

func (_c *ScriptCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptCreateBulk) Save

func (_c *ScriptCreateBulk) Save(ctx context.Context) ([]*Script, error)

Save creates the Script entities in the database.

func (*ScriptCreateBulk) SaveX

func (_c *ScriptCreateBulk) SaveX(ctx context.Context) []*Script

SaveX is like Save, but panics if an error occurs.

type ScriptDelete

type ScriptDelete struct {
	// contains filtered or unexported fields
}

ScriptDelete is the builder for deleting a Script entity.

func (*ScriptDelete) Exec

func (_d *ScriptDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScriptDelete) ExecX

func (_d *ScriptDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ScriptDelete) Where

func (_d *ScriptDelete) Where(ps ...predicate.Script) *ScriptDelete

Where appends a list predicates to the ScriptDelete builder.

type ScriptDeleteOne

type ScriptDeleteOne struct {
	// contains filtered or unexported fields
}

ScriptDeleteOne is the builder for deleting a single Script entity.

func (*ScriptDeleteOne) Exec

func (_d *ScriptDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ScriptDeleteOne) ExecX

func (_d *ScriptDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptDeleteOne) Where

func (_d *ScriptDeleteOne) Where(ps ...predicate.Script) *ScriptDeleteOne

Where appends a list predicates to the ScriptDelete builder.

type ScriptEdges

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

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

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

func (_m *ScriptExecutionRecord) QueryScript() *ScriptQuery

QueryScript queries the "script" edge of the ScriptExecutionRecord entity.

func (*ScriptExecutionRecord) String

func (_m *ScriptExecutionRecord) String() string

String implements the fmt.Stringer.

func (*ScriptExecutionRecord) Unwrap

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

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

func (_m *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

type ScriptExecutionRecordClient struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordClient is a client for the ScriptExecutionRecord schema.

func NewScriptExecutionRecordClient

func NewScriptExecutionRecordClient(c config) *ScriptExecutionRecordClient

NewScriptExecutionRecordClient returns a client for the ScriptExecutionRecord from the given config.

func (*ScriptExecutionRecordClient) Create

Create returns a builder for creating a ScriptExecutionRecord entity.

func (*ScriptExecutionRecordClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ScriptExecutionRecord entities.

func (*ScriptExecutionRecordClient) Delete

Delete returns a delete builder for ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ScriptExecutionRecordClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ScriptExecutionRecordClient) Get

Get returns a ScriptExecutionRecord entity by its id.

func (*ScriptExecutionRecordClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ScriptExecutionRecordClient) Hooks

func (c *ScriptExecutionRecordClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScriptExecutionRecordClient) Intercept

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

func (c *ScriptExecutionRecordClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ScriptExecutionRecordClient) MapCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ScriptExecutionRecordClient) Query

Query returns a query builder for ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) QueryScript

QueryScript queries the script edge of a ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) Update

Update returns an update builder for ScriptExecutionRecord.

func (*ScriptExecutionRecordClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScriptExecutionRecordClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ScriptExecutionRecordClient) Use

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

type ScriptExecutionRecordCreate struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordCreate is the builder for creating a ScriptExecutionRecord entity.

func (*ScriptExecutionRecordCreate) Exec

Exec executes the query.

func (*ScriptExecutionRecordCreate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordCreate) Mutation

Mutation returns the ScriptExecutionRecordMutation object of the builder.

func (*ScriptExecutionRecordCreate) Save

Save creates the ScriptExecutionRecord in the database.

func (*ScriptExecutionRecordCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ScriptExecutionRecordCreate) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordCreate) SetExecuteResult

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordCreate) SetExecuteState

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordCreate) SetFileAddress

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordCreate) SetFkScriptID

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordCreate) SetID

SetID sets the "id" field.

func (*ScriptExecutionRecordCreate) SetNillableCreateTime

func (_c *ScriptExecutionRecordCreate) SetNillableCreateTime(v *time.Time) *ScriptExecutionRecordCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptExecutionRecordCreate) SetNillableScriptID

func (_c *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

func (_c *ScriptExecutionRecordCreate) SetNillableUpdateTime(v *time.Time) *ScriptExecutionRecordCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptExecutionRecordCreate) SetScript

SetScript sets the "script" edge to the Script entity.

func (*ScriptExecutionRecordCreate) SetScriptContent

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordCreate) SetScriptID

SetScriptID sets the "script" edge to the Script entity by ID.

func (*ScriptExecutionRecordCreate) SetScriptName

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordCreate) SetTaskNumber

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordCreate) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordCreate) SetUserID

SetUserID sets the "user_id" field.

type ScriptExecutionRecordCreateBulk

type ScriptExecutionRecordCreateBulk struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordCreateBulk is the builder for creating many ScriptExecutionRecord entities in bulk.

func (*ScriptExecutionRecordCreateBulk) Exec

Exec executes the query.

func (*ScriptExecutionRecordCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordCreateBulk) Save

Save creates the ScriptExecutionRecord entities in the database.

func (*ScriptExecutionRecordCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ScriptExecutionRecordDelete

type ScriptExecutionRecordDelete struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordDelete is the builder for deleting a ScriptExecutionRecord entity.

func (*ScriptExecutionRecordDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScriptExecutionRecordDelete) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordDelete) Where

Where appends a list predicates to the ScriptExecutionRecordDelete builder.

type ScriptExecutionRecordDeleteOne

type ScriptExecutionRecordDeleteOne struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordDeleteOne is the builder for deleting a single ScriptExecutionRecord entity.

func (*ScriptExecutionRecordDeleteOne) Exec

Exec executes the deletion query.

func (*ScriptExecutionRecordDeleteOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordDeleteOne) Where

Where appends a list predicates to the ScriptExecutionRecordDelete builder.

type ScriptExecutionRecordEdges

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

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

type ScriptExecutionRecordGroupBy struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordGroupBy is the group-by builder for ScriptExecutionRecord entities.

func (*ScriptExecutionRecordGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*ScriptExecutionRecordGroupBy) Bool

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

func (s *ScriptExecutionRecordGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Bools

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

func (s *ScriptExecutionRecordGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Float64

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

func (s *ScriptExecutionRecordGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Float64s

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

func (s *ScriptExecutionRecordGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Int

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

func (s *ScriptExecutionRecordGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Ints

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

func (s *ScriptExecutionRecordGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Scan

Scan applies the selector query and scans the result into the given value.

func (*ScriptExecutionRecordGroupBy) ScanX

func (s *ScriptExecutionRecordGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) String

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

func (s *ScriptExecutionRecordGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptExecutionRecordGroupBy) Strings

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

func (s *ScriptExecutionRecordGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptExecutionRecordMutation

type ScriptExecutionRecordMutation struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordMutation represents an operation that mutates the ScriptExecutionRecord nodes in the graph.

func (*ScriptExecutionRecordMutation) AddExecuteState

func (m *ScriptExecutionRecordMutation) AddExecuteState(i int32)

AddExecuteState adds i to the "execute_state" field.

func (*ScriptExecutionRecordMutation) AddField

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

func (m *ScriptExecutionRecordMutation) AddFkScriptID(i int32)

AddFkScriptID adds i to the "fk_script_id" field.

func (*ScriptExecutionRecordMutation) AddTaskNumber

func (m *ScriptExecutionRecordMutation) AddTaskNumber(i int32)

AddTaskNumber adds i to the "task_number" field.

func (*ScriptExecutionRecordMutation) AddedEdges

func (m *ScriptExecutionRecordMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScriptExecutionRecordMutation) AddedExecuteState

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

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

func (m *ScriptExecutionRecordMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScriptExecutionRecordMutation) AddedFkScriptID

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

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

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

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

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

func (m *ScriptExecutionRecordMutation) ClearScript()

ClearScript clears the "script" edge to the Script entity.

func (*ScriptExecutionRecordMutation) ClearedEdges

func (m *ScriptExecutionRecordMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScriptExecutionRecordMutation) ClearedFields

func (m *ScriptExecutionRecordMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScriptExecutionRecordMutation) 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 (*ScriptExecutionRecordMutation) CreateTime

func (m *ScriptExecutionRecordMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ScriptExecutionRecordMutation) EdgeCleared

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

func (m *ScriptExecutionRecordMutation) ExecuteResult() (r string, exists bool)

ExecuteResult returns the value of the "execute_result" field in the mutation.

func (*ScriptExecutionRecordMutation) ExecuteState

func (m *ScriptExecutionRecordMutation) ExecuteState() (r int32, exists bool)

ExecuteState returns the value of the "execute_state" field in the mutation.

func (*ScriptExecutionRecordMutation) Field

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

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

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

func (m *ScriptExecutionRecordMutation) FileAddress() (r string, exists bool)

FileAddress returns the value of the "file_address" field in the mutation.

func (*ScriptExecutionRecordMutation) FkScriptID

func (m *ScriptExecutionRecordMutation) FkScriptID() (r int32, exists bool)

FkScriptID returns the value of the "fk_script_id" field in the mutation.

func (*ScriptExecutionRecordMutation) ID

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

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

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

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

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

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

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

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

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

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

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

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

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

Op returns the operation name.

func (*ScriptExecutionRecordMutation) RemovedEdges

func (m *ScriptExecutionRecordMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScriptExecutionRecordMutation) RemovedIDs

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

func (m *ScriptExecutionRecordMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ScriptExecutionRecordMutation) ResetEdge

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

func (m *ScriptExecutionRecordMutation) ResetExecuteResult()

ResetExecuteResult resets all changes to the "execute_result" field.

func (*ScriptExecutionRecordMutation) ResetExecuteState

func (m *ScriptExecutionRecordMutation) ResetExecuteState()

ResetExecuteState resets all changes to the "execute_state" field.

func (*ScriptExecutionRecordMutation) ResetField

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

func (m *ScriptExecutionRecordMutation) ResetFileAddress()

ResetFileAddress resets all changes to the "file_address" field.

func (*ScriptExecutionRecordMutation) ResetFkScriptID

func (m *ScriptExecutionRecordMutation) ResetFkScriptID()

ResetFkScriptID resets all changes to the "fk_script_id" field.

func (*ScriptExecutionRecordMutation) ResetScript

func (m *ScriptExecutionRecordMutation) ResetScript()

ResetScript resets all changes to the "script" edge.

func (*ScriptExecutionRecordMutation) ResetScriptContent

func (m *ScriptExecutionRecordMutation) ResetScriptContent()

ResetScriptContent resets all changes to the "script_content" field.

func (*ScriptExecutionRecordMutation) ResetScriptName

func (m *ScriptExecutionRecordMutation) ResetScriptName()

ResetScriptName resets all changes to the "script_name" field.

func (*ScriptExecutionRecordMutation) ResetTaskNumber

func (m *ScriptExecutionRecordMutation) ResetTaskNumber()

ResetTaskNumber resets all changes to the "task_number" field.

func (*ScriptExecutionRecordMutation) ResetUpdateTime

func (m *ScriptExecutionRecordMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ScriptExecutionRecordMutation) ResetUserID

func (m *ScriptExecutionRecordMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ScriptExecutionRecordMutation) ScriptCleared

func (m *ScriptExecutionRecordMutation) ScriptCleared() bool

ScriptCleared reports if the "script" edge to the Script entity was cleared.

func (*ScriptExecutionRecordMutation) ScriptContent

func (m *ScriptExecutionRecordMutation) ScriptContent() (r string, exists bool)

ScriptContent returns the value of the "script_content" field in the mutation.

func (*ScriptExecutionRecordMutation) ScriptID

func (m *ScriptExecutionRecordMutation) ScriptID() (id int32, exists bool)

ScriptID returns the "script" edge ID in the mutation.

func (*ScriptExecutionRecordMutation) ScriptIDs

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

func (m *ScriptExecutionRecordMutation) ScriptName() (r string, exists bool)

ScriptName returns the value of the "script_name" field in the mutation.

func (*ScriptExecutionRecordMutation) SetCreateTime

func (m *ScriptExecutionRecordMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordMutation) SetExecuteResult

func (m *ScriptExecutionRecordMutation) SetExecuteResult(s string)

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordMutation) SetExecuteState

func (m *ScriptExecutionRecordMutation) SetExecuteState(i int32)

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordMutation) SetField

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

func (m *ScriptExecutionRecordMutation) SetFileAddress(s string)

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordMutation) SetFkScriptID

func (m *ScriptExecutionRecordMutation) SetFkScriptID(i int32)

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordMutation) SetID

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

func (m *ScriptExecutionRecordMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ScriptExecutionRecordMutation) SetScriptContent

func (m *ScriptExecutionRecordMutation) SetScriptContent(s string)

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordMutation) SetScriptID

func (m *ScriptExecutionRecordMutation) SetScriptID(id int32)

SetScriptID sets the "script" edge to the Script entity by id.

func (*ScriptExecutionRecordMutation) SetScriptName

func (m *ScriptExecutionRecordMutation) SetScriptName(s string)

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordMutation) SetTaskNumber

func (m *ScriptExecutionRecordMutation) SetTaskNumber(i int32)

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordMutation) SetUpdateTime

func (m *ScriptExecutionRecordMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordMutation) SetUserID

func (m *ScriptExecutionRecordMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*ScriptExecutionRecordMutation) TaskNumber

func (m *ScriptExecutionRecordMutation) TaskNumber() (r int32, exists bool)

TaskNumber returns the value of the "task_number" field in the mutation.

func (ScriptExecutionRecordMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScriptExecutionRecordMutation) Type

Type returns the node type of this mutation (ScriptExecutionRecord).

func (*ScriptExecutionRecordMutation) UpdateTime

func (m *ScriptExecutionRecordMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ScriptExecutionRecordMutation) UserID

func (m *ScriptExecutionRecordMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ScriptExecutionRecordMutation) Where

Where appends a list predicates to the ScriptExecutionRecordMutation builder.

func (*ScriptExecutionRecordMutation) WhereP

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

type ScriptExecutionRecordQuery struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordQuery is the builder for querying ScriptExecutionRecord entities.

func (*ScriptExecutionRecordQuery) Aggregate

Aggregate returns a ScriptExecutionRecordSelect configured with the given aggregations.

func (*ScriptExecutionRecordQuery) All

All executes the query and returns a list of ScriptExecutionRecords.

func (*ScriptExecutionRecordQuery) AllX

AllX is like All, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Clone

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

Count returns the count of the given query.

func (*ScriptExecutionRecordQuery) CountX

CountX is like Count, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Exist

Exist returns true if the query has elements in the graph.

func (*ScriptExecutionRecordQuery) ExistX

ExistX is like Exist, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) First

First returns the first ScriptExecutionRecord entity from the query. Returns a *NotFoundError when no ScriptExecutionRecord was found.

func (*ScriptExecutionRecordQuery) FirstID

func (_q *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

func (_q *ScriptExecutionRecordQuery) FirstIDX(ctx context.Context) int32

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) GroupBy

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

func (_q *ScriptExecutionRecordQuery) IDs(ctx context.Context) (ids []int32, err error)

IDs executes the query and returns a list of ScriptExecutionRecord IDs.

func (*ScriptExecutionRecordQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Limit

Limit the number of records to be returned by this query.

func (*ScriptExecutionRecordQuery) Offset

Offset to start from.

func (*ScriptExecutionRecordQuery) Only

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

func (_q *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

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ScriptExecutionRecordQuery) Order

Order specifies how the records should be ordered.

func (*ScriptExecutionRecordQuery) QueryScript

func (_q *ScriptExecutionRecordQuery) QueryScript() *ScriptQuery

QueryScript chains the current query on the "script" edge.

func (*ScriptExecutionRecordQuery) Select

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

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

Where adds a new predicate for the ScriptExecutionRecordQuery builder.

func (*ScriptExecutionRecordQuery) WithScript

func (_q *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

type ScriptExecutionRecordSelect struct {
	*ScriptExecutionRecordQuery
	// contains filtered or unexported fields
}

ScriptExecutionRecordSelect is the builder for selecting fields of ScriptExecutionRecord entities.

func (*ScriptExecutionRecordSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ScriptExecutionRecordSelect) Bool

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

func (s *ScriptExecutionRecordSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Bools

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

func (s *ScriptExecutionRecordSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Float64

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

func (s *ScriptExecutionRecordSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Float64s

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

func (s *ScriptExecutionRecordSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Int

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

func (s *ScriptExecutionRecordSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Ints

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

func (s *ScriptExecutionRecordSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*ScriptExecutionRecordSelect) ScanX

func (s *ScriptExecutionRecordSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) String

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

func (s *ScriptExecutionRecordSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptExecutionRecordSelect) Strings

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

func (s *ScriptExecutionRecordSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptExecutionRecordUpdate

type ScriptExecutionRecordUpdate struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordUpdate is the builder for updating ScriptExecutionRecord entities.

func (*ScriptExecutionRecordUpdate) AddExecuteState

AddExecuteState adds value to the "execute_state" field.

func (*ScriptExecutionRecordUpdate) AddFkScriptID

AddFkScriptID adds value to the "fk_script_id" field.

func (*ScriptExecutionRecordUpdate) AddTaskNumber

AddTaskNumber adds value to the "task_number" field.

func (*ScriptExecutionRecordUpdate) ClearScript

ClearScript clears the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdate) Exec

Exec executes the query.

func (*ScriptExecutionRecordUpdate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordUpdate) Mutation

Mutation returns the ScriptExecutionRecordMutation object of the builder.

func (*ScriptExecutionRecordUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScriptExecutionRecordUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ScriptExecutionRecordUpdate) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordUpdate) SetExecuteResult

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordUpdate) SetExecuteState

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordUpdate) SetFileAddress

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordUpdate) SetFkScriptID

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordUpdate) SetNillableCreateTime

func (_u *ScriptExecutionRecordUpdate) SetNillableCreateTime(v *time.Time) *ScriptExecutionRecordUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableExecuteResult

func (_u *ScriptExecutionRecordUpdate) SetNillableExecuteResult(v *string) *ScriptExecutionRecordUpdate

SetNillableExecuteResult sets the "execute_result" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableExecuteState

func (_u *ScriptExecutionRecordUpdate) SetNillableExecuteState(v *int32) *ScriptExecutionRecordUpdate

SetNillableExecuteState sets the "execute_state" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableFileAddress

func (_u *ScriptExecutionRecordUpdate) SetNillableFileAddress(v *string) *ScriptExecutionRecordUpdate

SetNillableFileAddress sets the "file_address" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableFkScriptID

func (_u *ScriptExecutionRecordUpdate) SetNillableFkScriptID(v *int32) *ScriptExecutionRecordUpdate

SetNillableFkScriptID sets the "fk_script_id" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableScriptContent

func (_u *ScriptExecutionRecordUpdate) SetNillableScriptContent(v *string) *ScriptExecutionRecordUpdate

SetNillableScriptContent sets the "script_content" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableScriptID

func (_u *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) SetNillableScriptName

func (_u *ScriptExecutionRecordUpdate) SetNillableScriptName(v *string) *ScriptExecutionRecordUpdate

SetNillableScriptName sets the "script_name" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableTaskNumber

func (_u *ScriptExecutionRecordUpdate) SetNillableTaskNumber(v *int32) *ScriptExecutionRecordUpdate

SetNillableTaskNumber sets the "task_number" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableUpdateTime

func (_u *ScriptExecutionRecordUpdate) SetNillableUpdateTime(v *time.Time) *ScriptExecutionRecordUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ScriptExecutionRecordUpdate) SetScript

SetScript sets the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdate) SetScriptContent

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordUpdate) SetScriptID

SetScriptID sets the "script" edge to the Script entity by ID.

func (*ScriptExecutionRecordUpdate) SetScriptName

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordUpdate) SetTaskNumber

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordUpdate) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*ScriptExecutionRecordUpdate) Where

Where appends a list predicates to the ScriptExecutionRecordUpdate builder.

type ScriptExecutionRecordUpdateOne

type ScriptExecutionRecordUpdateOne struct {
	// contains filtered or unexported fields
}

ScriptExecutionRecordUpdateOne is the builder for updating a single ScriptExecutionRecord entity.

func (*ScriptExecutionRecordUpdateOne) AddExecuteState

AddExecuteState adds value to the "execute_state" field.

func (*ScriptExecutionRecordUpdateOne) AddFkScriptID

AddFkScriptID adds value to the "fk_script_id" field.

func (*ScriptExecutionRecordUpdateOne) AddTaskNumber

AddTaskNumber adds value to the "task_number" field.

func (*ScriptExecutionRecordUpdateOne) ClearScript

ClearScript clears the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdateOne) Exec

Exec executes the query on the entity.

func (*ScriptExecutionRecordUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ScriptExecutionRecordUpdateOne) Mutation

Mutation returns the ScriptExecutionRecordMutation object of the builder.

func (*ScriptExecutionRecordUpdateOne) Save

Save executes the query and returns the updated ScriptExecutionRecord entity.

func (*ScriptExecutionRecordUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ScriptExecutionRecordUpdateOne) Select

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

SetCreateTime sets the "create_time" field.

func (*ScriptExecutionRecordUpdateOne) SetExecuteResult

SetExecuteResult sets the "execute_result" field.

func (*ScriptExecutionRecordUpdateOne) SetExecuteState

SetExecuteState sets the "execute_state" field.

func (*ScriptExecutionRecordUpdateOne) SetFileAddress

SetFileAddress sets the "file_address" field.

func (*ScriptExecutionRecordUpdateOne) SetFkScriptID

SetFkScriptID sets the "fk_script_id" field.

func (*ScriptExecutionRecordUpdateOne) SetNillableCreateTime

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableExecuteResult

func (_u *ScriptExecutionRecordUpdateOne) SetNillableExecuteResult(v *string) *ScriptExecutionRecordUpdateOne

SetNillableExecuteResult sets the "execute_result" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableExecuteState

func (_u *ScriptExecutionRecordUpdateOne) SetNillableExecuteState(v *int32) *ScriptExecutionRecordUpdateOne

SetNillableExecuteState sets the "execute_state" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableFileAddress

SetNillableFileAddress sets the "file_address" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableFkScriptID

SetNillableFkScriptID sets the "fk_script_id" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableScriptContent

func (_u *ScriptExecutionRecordUpdateOne) SetNillableScriptContent(v *string) *ScriptExecutionRecordUpdateOne

SetNillableScriptContent sets the "script_content" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableScriptID

SetNillableScriptID sets the "script" edge to the Script entity by ID if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableScriptName

SetNillableScriptName sets the "script_name" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableTaskNumber

SetNillableTaskNumber sets the "task_number" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableUpdateTime

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetNillableUserID

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ScriptExecutionRecordUpdateOne) SetScript

SetScript sets the "script" edge to the Script entity.

func (*ScriptExecutionRecordUpdateOne) SetScriptContent

SetScriptContent sets the "script_content" field.

func (*ScriptExecutionRecordUpdateOne) SetScriptID

SetScriptID sets the "script" edge to the Script entity by ID.

func (*ScriptExecutionRecordUpdateOne) SetScriptName

SetScriptName sets the "script_name" field.

func (*ScriptExecutionRecordUpdateOne) SetTaskNumber

SetTaskNumber sets the "task_number" field.

func (*ScriptExecutionRecordUpdateOne) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*ScriptExecutionRecordUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*ScriptExecutionRecordUpdateOne) Where

Where appends a list predicates to the ScriptExecutionRecordUpdate builder.

type ScriptExecutionRecords

type ScriptExecutionRecords []*ScriptExecutionRecord

ScriptExecutionRecords is a parsable slice of ScriptExecutionRecord.

type ScriptGroupBy

type ScriptGroupBy struct {
	// contains filtered or unexported fields
}

ScriptGroupBy is the group-by builder for Script entities.

func (*ScriptGroupBy) Aggregate

func (_g *ScriptGroupBy) Aggregate(fns ...AggregateFunc) *ScriptGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ScriptGroupBy) Bool

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

func (s *ScriptGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptGroupBy) Bools

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

func (s *ScriptGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptGroupBy) Float64

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

func (s *ScriptGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptGroupBy) Float64s

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

func (s *ScriptGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptGroupBy) Int

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

func (s *ScriptGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptGroupBy) Ints

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

func (s *ScriptGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptGroupBy) Scan

func (_g *ScriptGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptGroupBy) ScanX

func (s *ScriptGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptGroupBy) String

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

func (s *ScriptGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptGroupBy) Strings

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

func (s *ScriptGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptMutation

type ScriptMutation struct {
	// contains filtered or unexported fields
}

ScriptMutation represents an operation that mutates the Script nodes in the graph.

func (*ScriptMutation) AddField

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

func (m *ScriptMutation) AddScriptExecutionRecordIDs(ids ...int32)

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by ids.

func (*ScriptMutation) AddTaskNumber

func (m *ScriptMutation) AddTaskNumber(i int32)

AddTaskNumber adds i to the "task_number" field.

func (*ScriptMutation) AddedEdges

func (m *ScriptMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScriptMutation) AddedField

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

func (m *ScriptMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScriptMutation) AddedIDs

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

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

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

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

func (m *ScriptMutation) ClearScriptExecutionRecords()

ClearScriptExecutionRecords clears the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity.

func (*ScriptMutation) ClearedEdges

func (m *ScriptMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScriptMutation) ClearedFields

func (m *ScriptMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScriptMutation) Client

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

func (m *ScriptMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ScriptMutation) EdgeCleared

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

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

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

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

func (m *ScriptMutation) FileAddress() (r string, exists bool)

FileAddress returns the value of the "file_address" field in the mutation.

func (*ScriptMutation) ID

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

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

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

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

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

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

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

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

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

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

func (m *ScriptMutation) Op() Op

Op returns the operation name.

func (*ScriptMutation) RemoveScriptExecutionRecordIDs

func (m *ScriptMutation) RemoveScriptExecutionRecordIDs(ids ...int32)

RemoveScriptExecutionRecordIDs removes the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptMutation) RemovedEdges

func (m *ScriptMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScriptMutation) RemovedIDs

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

func (m *ScriptMutation) RemovedScriptExecutionRecordsIDs() (ids []int32)

RemovedScriptExecutionRecords returns the removed IDs of the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity.

func (*ScriptMutation) ResetCreateTime

func (m *ScriptMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ScriptMutation) ResetEdge

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

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

func (m *ScriptMutation) ResetFileAddress()

ResetFileAddress resets all changes to the "file_address" field.

func (*ScriptMutation) ResetScriptContent

func (m *ScriptMutation) ResetScriptContent()

ResetScriptContent resets all changes to the "script_content" field.

func (*ScriptMutation) ResetScriptExecutionRecords

func (m *ScriptMutation) ResetScriptExecutionRecords()

ResetScriptExecutionRecords resets all changes to the "scriptExecutionRecords" edge.

func (*ScriptMutation) ResetScriptName

func (m *ScriptMutation) ResetScriptName()

ResetScriptName resets all changes to the "script_name" field.

func (*ScriptMutation) ResetTaskNumber

func (m *ScriptMutation) ResetTaskNumber()

ResetTaskNumber resets all changes to the "task_number" field.

func (*ScriptMutation) ResetUpdateTime

func (m *ScriptMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ScriptMutation) ResetUserID

func (m *ScriptMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ScriptMutation) ScriptContent

func (m *ScriptMutation) ScriptContent() (r string, exists bool)

ScriptContent returns the value of the "script_content" field in the mutation.

func (*ScriptMutation) ScriptExecutionRecordsCleared

func (m *ScriptMutation) ScriptExecutionRecordsCleared() bool

ScriptExecutionRecordsCleared reports if the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity was cleared.

func (*ScriptMutation) ScriptExecutionRecordsIDs

func (m *ScriptMutation) ScriptExecutionRecordsIDs() (ids []int32)

ScriptExecutionRecordsIDs returns the "scriptExecutionRecords" edge IDs in the mutation.

func (*ScriptMutation) ScriptName

func (m *ScriptMutation) ScriptName() (r string, exists bool)

ScriptName returns the value of the "script_name" field in the mutation.

func (*ScriptMutation) SetCreateTime

func (m *ScriptMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ScriptMutation) SetField

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

func (m *ScriptMutation) SetFileAddress(s string)

SetFileAddress sets the "file_address" field.

func (*ScriptMutation) SetID

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

func (m *ScriptMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ScriptMutation) SetScriptContent

func (m *ScriptMutation) SetScriptContent(s string)

SetScriptContent sets the "script_content" field.

func (*ScriptMutation) SetScriptName

func (m *ScriptMutation) SetScriptName(s string)

SetScriptName sets the "script_name" field.

func (*ScriptMutation) SetTaskNumber

func (m *ScriptMutation) SetTaskNumber(i int32)

SetTaskNumber sets the "task_number" field.

func (*ScriptMutation) SetUpdateTime

func (m *ScriptMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ScriptMutation) SetUserID

func (m *ScriptMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*ScriptMutation) TaskNumber

func (m *ScriptMutation) TaskNumber() (r int32, exists bool)

TaskNumber returns the value of the "task_number" field in the mutation.

func (ScriptMutation) Tx

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

func (m *ScriptMutation) Type() string

Type returns the node type of this mutation (Script).

func (*ScriptMutation) UpdateTime

func (m *ScriptMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ScriptMutation) UserID

func (m *ScriptMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ScriptMutation) Where

func (m *ScriptMutation) Where(ps ...predicate.Script)

Where appends a list predicates to the ScriptMutation builder.

func (*ScriptMutation) WhereP

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

type ScriptQuery struct {
	// contains filtered or unexported fields
}

ScriptQuery is the builder for querying Script entities.

func (*ScriptQuery) Aggregate

func (_q *ScriptQuery) Aggregate(fns ...AggregateFunc) *ScriptSelect

Aggregate returns a ScriptSelect configured with the given aggregations.

func (*ScriptQuery) All

func (_q *ScriptQuery) All(ctx context.Context) ([]*Script, error)

All executes the query and returns a list of Scripts.

func (*ScriptQuery) AllX

func (_q *ScriptQuery) AllX(ctx context.Context) []*Script

AllX is like All, but panics if an error occurs.

func (*ScriptQuery) Clone

func (_q *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

func (_q *ScriptQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScriptQuery) CountX

func (_q *ScriptQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScriptQuery) Exist

func (_q *ScriptQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScriptQuery) ExistX

func (_q *ScriptQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScriptQuery) First

func (_q *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

func (_q *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

func (_q *ScriptQuery) FirstIDX(ctx context.Context) int32

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScriptQuery) FirstX

func (_q *ScriptQuery) FirstX(ctx context.Context) *Script

FirstX is like First, but panics if an error occurs.

func (*ScriptQuery) GroupBy

func (_q *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

func (_q *ScriptQuery) IDs(ctx context.Context) (ids []int32, err error)

IDs executes the query and returns a list of Script IDs.

func (*ScriptQuery) IDsX

func (_q *ScriptQuery) IDsX(ctx context.Context) []int32

IDsX is like IDs, but panics if an error occurs.

func (*ScriptQuery) Limit

func (_q *ScriptQuery) Limit(limit int) *ScriptQuery

Limit the number of records to be returned by this query.

func (*ScriptQuery) Offset

func (_q *ScriptQuery) Offset(offset int) *ScriptQuery

Offset to start from.

func (*ScriptQuery) Only

func (_q *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

func (_q *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

func (_q *ScriptQuery) OnlyIDX(ctx context.Context) int32

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScriptQuery) OnlyX

func (_q *ScriptQuery) OnlyX(ctx context.Context) *Script

OnlyX is like Only, but panics if an error occurs.

func (*ScriptQuery) Order

func (_q *ScriptQuery) Order(o ...script.OrderOption) *ScriptQuery

Order specifies how the records should be ordered.

func (*ScriptQuery) QueryScriptExecutionRecords

func (_q *ScriptQuery) QueryScriptExecutionRecords() *ScriptExecutionRecordQuery

QueryScriptExecutionRecords chains the current query on the "scriptExecutionRecords" edge.

func (*ScriptQuery) Select

func (_q *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

func (_q *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

func (_q *ScriptQuery) Where(ps ...predicate.Script) *ScriptQuery

Where adds a new predicate for the ScriptQuery builder.

func (*ScriptQuery) WithScriptExecutionRecords

func (_q *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

type ScriptSelect struct {
	*ScriptQuery
	// contains filtered or unexported fields
}

ScriptSelect is the builder for selecting fields of Script entities.

func (*ScriptSelect) Aggregate

func (_s *ScriptSelect) Aggregate(fns ...AggregateFunc) *ScriptSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ScriptSelect) Bool

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

func (s *ScriptSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptSelect) Bools

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

func (s *ScriptSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptSelect) Float64

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

func (s *ScriptSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptSelect) Float64s

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

func (s *ScriptSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptSelect) Int

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

func (s *ScriptSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptSelect) Ints

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

func (s *ScriptSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptSelect) Scan

func (_s *ScriptSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptSelect) ScanX

func (s *ScriptSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptSelect) String

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

func (s *ScriptSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptSelect) Strings

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

func (s *ScriptSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptUpdate

type ScriptUpdate struct {
	// contains filtered or unexported fields
}

ScriptUpdate is the builder for updating Script entities.

func (*ScriptUpdate) AddScriptExecutionRecordIDs

func (_u *ScriptUpdate) AddScriptExecutionRecordIDs(ids ...int32) *ScriptUpdate

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptUpdate) AddScriptExecutionRecords

func (_u *ScriptUpdate) AddScriptExecutionRecords(v ...*ScriptExecutionRecord) *ScriptUpdate

AddScriptExecutionRecords adds the "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdate) AddTaskNumber

func (_u *ScriptUpdate) AddTaskNumber(v int32) *ScriptUpdate

AddTaskNumber adds value to the "task_number" field.

func (*ScriptUpdate) ClearScriptExecutionRecords

func (_u *ScriptUpdate) ClearScriptExecutionRecords() *ScriptUpdate

ClearScriptExecutionRecords clears all "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdate) Exec

func (_u *ScriptUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptUpdate) ExecX

func (_u *ScriptUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptUpdate) Mutation

func (_u *ScriptUpdate) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptUpdate) RemoveScriptExecutionRecordIDs

func (_u *ScriptUpdate) RemoveScriptExecutionRecordIDs(ids ...int32) *ScriptUpdate

RemoveScriptExecutionRecordIDs removes the "scriptExecutionRecords" edge to ScriptExecutionRecord entities by IDs.

func (*ScriptUpdate) RemoveScriptExecutionRecords

func (_u *ScriptUpdate) RemoveScriptExecutionRecords(v ...*ScriptExecutionRecord) *ScriptUpdate

RemoveScriptExecutionRecords removes "scriptExecutionRecords" edges to ScriptExecutionRecord entities.

func (*ScriptUpdate) Save

func (_u *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

func (_u *ScriptUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ScriptUpdate) SetCreateTime

func (_u *ScriptUpdate) SetCreateTime(v time.Time) *ScriptUpdate

SetCreateTime sets the "create_time" field.

func (*ScriptUpdate) SetFileAddress

func (_u *ScriptUpdate) SetFileAddress(v string) *ScriptUpdate

SetFileAddress sets the "file_address" field.

func (*ScriptUpdate) SetNillableCreateTime

func (_u *ScriptUpdate) SetNillableCreateTime(v *time.Time) *ScriptUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptUpdate) SetNillableFileAddress

func (_u *ScriptUpdate) SetNillableFileAddress(v *string) *ScriptUpdate

SetNillableFileAddress sets the "file_address" field if the given value is not nil.

func (*ScriptUpdate) SetNillableScriptContent

func (_u *ScriptUpdate) SetNillableScriptContent(v *string) *ScriptUpdate

SetNillableScriptContent sets the "script_content" field if the given value is not nil.

func (*ScriptUpdate) SetNillableScriptName

func (_u *ScriptUpdate) SetNillableScriptName(v *string) *ScriptUpdate

SetNillableScriptName sets the "script_name" field if the given value is not nil.

func (*ScriptUpdate) SetNillableTaskNumber

func (_u *ScriptUpdate) SetNillableTaskNumber(v *int32) *ScriptUpdate

SetNillableTaskNumber sets the "task_number" field if the given value is not nil.

func (*ScriptUpdate) SetNillableUpdateTime

func (_u *ScriptUpdate) SetNillableUpdateTime(v *time.Time) *ScriptUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptUpdate) SetNillableUserID

func (_u *ScriptUpdate) SetNillableUserID(v *string) *ScriptUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ScriptUpdate) SetScriptContent

func (_u *ScriptUpdate) SetScriptContent(v string) *ScriptUpdate

SetScriptContent sets the "script_content" field.

func (*ScriptUpdate) SetScriptName

func (_u *ScriptUpdate) SetScriptName(v string) *ScriptUpdate

SetScriptName sets the "script_name" field.

func (*ScriptUpdate) SetTaskNumber

func (_u *ScriptUpdate) SetTaskNumber(v int32) *ScriptUpdate

SetTaskNumber sets the "task_number" field.

func (*ScriptUpdate) SetUpdateTime

func (_u *ScriptUpdate) SetUpdateTime(v time.Time) *ScriptUpdate

SetUpdateTime sets the "update_time" field.

func (*ScriptUpdate) SetUserID

func (_u *ScriptUpdate) SetUserID(v string) *ScriptUpdate

SetUserID sets the "user_id" field.

func (*ScriptUpdate) Where

func (_u *ScriptUpdate) Where(ps ...predicate.Script) *ScriptUpdate

Where appends a list predicates to the ScriptUpdate builder.

type ScriptUpdateOne

type ScriptUpdateOne struct {
	// contains filtered or unexported fields
}

ScriptUpdateOne is the builder for updating a single Script entity.

func (*ScriptUpdateOne) AddScriptExecutionRecordIDs

func (_u *ScriptUpdateOne) AddScriptExecutionRecordIDs(ids ...int32) *ScriptUpdateOne

AddScriptExecutionRecordIDs adds the "scriptExecutionRecords" edge to the ScriptExecutionRecord entity by IDs.

func (*ScriptUpdateOne) AddScriptExecutionRecords

func (_u *ScriptUpdateOne) AddScriptExecutionRecords(v ...*ScriptExecutionRecord) *ScriptUpdateOne

AddScriptExecutionRecords adds the "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdateOne) AddTaskNumber

func (_u *ScriptUpdateOne) AddTaskNumber(v int32) *ScriptUpdateOne

AddTaskNumber adds value to the "task_number" field.

func (*ScriptUpdateOne) ClearScriptExecutionRecords

func (_u *ScriptUpdateOne) ClearScriptExecutionRecords() *ScriptUpdateOne

ClearScriptExecutionRecords clears all "scriptExecutionRecords" edges to the ScriptExecutionRecord entity.

func (*ScriptUpdateOne) Exec

func (_u *ScriptUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ScriptUpdateOne) ExecX

func (_u *ScriptUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptUpdateOne) Mutation

func (_u *ScriptUpdateOne) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptUpdateOne) RemoveScriptExecutionRecordIDs

func (_u *ScriptUpdateOne) RemoveScriptExecutionRecordIDs(ids ...int32) *ScriptUpdateOne

RemoveScriptExecutionRecordIDs removes the "scriptExecutionRecords" edge to ScriptExecutionRecord entities by IDs.

func (*ScriptUpdateOne) RemoveScriptExecutionRecords

func (_u *ScriptUpdateOne) RemoveScriptExecutionRecords(v ...*ScriptExecutionRecord) *ScriptUpdateOne

RemoveScriptExecutionRecords removes "scriptExecutionRecords" edges to ScriptExecutionRecord entities.

func (*ScriptUpdateOne) Save

func (_u *ScriptUpdateOne) Save(ctx context.Context) (*Script, error)

Save executes the query and returns the updated Script entity.

func (*ScriptUpdateOne) SaveX

func (_u *ScriptUpdateOne) SaveX(ctx context.Context) *Script

SaveX is like Save, but panics if an error occurs.

func (*ScriptUpdateOne) Select

func (_u *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

func (_u *ScriptUpdateOne) SetCreateTime(v time.Time) *ScriptUpdateOne

SetCreateTime sets the "create_time" field.

func (*ScriptUpdateOne) SetFileAddress

func (_u *ScriptUpdateOne) SetFileAddress(v string) *ScriptUpdateOne

SetFileAddress sets the "file_address" field.

func (*ScriptUpdateOne) SetNillableCreateTime

func (_u *ScriptUpdateOne) SetNillableCreateTime(v *time.Time) *ScriptUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableFileAddress

func (_u *ScriptUpdateOne) SetNillableFileAddress(v *string) *ScriptUpdateOne

SetNillableFileAddress sets the "file_address" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableScriptContent

func (_u *ScriptUpdateOne) SetNillableScriptContent(v *string) *ScriptUpdateOne

SetNillableScriptContent sets the "script_content" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableScriptName

func (_u *ScriptUpdateOne) SetNillableScriptName(v *string) *ScriptUpdateOne

SetNillableScriptName sets the "script_name" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableTaskNumber

func (_u *ScriptUpdateOne) SetNillableTaskNumber(v *int32) *ScriptUpdateOne

SetNillableTaskNumber sets the "task_number" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableUpdateTime

func (_u *ScriptUpdateOne) SetNillableUpdateTime(v *time.Time) *ScriptUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableUserID

func (_u *ScriptUpdateOne) SetNillableUserID(v *string) *ScriptUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ScriptUpdateOne) SetScriptContent

func (_u *ScriptUpdateOne) SetScriptContent(v string) *ScriptUpdateOne

SetScriptContent sets the "script_content" field.

func (*ScriptUpdateOne) SetScriptName

func (_u *ScriptUpdateOne) SetScriptName(v string) *ScriptUpdateOne

SetScriptName sets the "script_name" field.

func (*ScriptUpdateOne) SetTaskNumber

func (_u *ScriptUpdateOne) SetTaskNumber(v int32) *ScriptUpdateOne

SetTaskNumber sets the "task_number" field.

func (*ScriptUpdateOne) SetUpdateTime

func (_u *ScriptUpdateOne) SetUpdateTime(v time.Time) *ScriptUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ScriptUpdateOne) SetUserID

func (_u *ScriptUpdateOne) SetUserID(v string) *ScriptUpdateOne

SetUserID sets the "user_id" field.

func (*ScriptUpdateOne) Where

func (_u *ScriptUpdateOne) Where(ps ...predicate.Script) *ScriptUpdateOne

Where appends a list predicates to the ScriptUpdate builder.

type Scripts

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 (_m *Storage) String() string

String implements the fmt.Stringer.

func (*Storage) Unwrap

func (_m *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 (_m *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 (_m *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(_m *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) MapCreateBulk

func (c *StorageClient) MapCreateBulk(slice any, setFunc func(*StorageCreate, int)) *StorageCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*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(_m *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 (_c *StorageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageCreate) ExecX

func (_c *StorageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageCreate) Mutation

func (_c *StorageCreate) Mutation() *StorageMutation

Mutation returns the StorageMutation object of the builder.

func (*StorageCreate) Save

func (_c *StorageCreate) Save(ctx context.Context) (*Storage, error)

Save creates the Storage in the database.

func (*StorageCreate) SaveX

func (_c *StorageCreate) SaveX(ctx context.Context) *Storage

SaveX calls Save and panics if Save returns an error.

func (*StorageCreate) SetCid

func (_c *StorageCreate) SetCid(v string) *StorageCreate

SetCid sets the "cid" field.

func (*StorageCreate) SetID

func (_c *StorageCreate) SetID(v uuid.UUID) *StorageCreate

SetID sets the "id" field.

func (*StorageCreate) SetLastModify

func (_c *StorageCreate) SetLastModify(v time.Time) *StorageCreate

SetLastModify sets the "last_modify" field.

func (*StorageCreate) SetName

func (_c *StorageCreate) SetName(v string) *StorageCreate

SetName sets the "name" field.

func (*StorageCreate) SetNillableID

func (_c *StorageCreate) SetNillableID(v *uuid.UUID) *StorageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*StorageCreate) SetNillableLastModify

func (_c *StorageCreate) SetNillableLastModify(v *time.Time) *StorageCreate

SetNillableLastModify sets the "last_modify" field if the given value is not nil.

func (*StorageCreate) SetNillableType

func (_c *StorageCreate) SetNillableType(v *int32) *StorageCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*StorageCreate) SetOwner

func (_c *StorageCreate) SetOwner(v string) *StorageCreate

SetOwner sets the "owner" field.

func (*StorageCreate) SetParentID

func (_c *StorageCreate) SetParentID(v string) *StorageCreate

SetParentID sets the "parent_id" field.

func (*StorageCreate) SetSize

func (_c *StorageCreate) SetSize(v int32) *StorageCreate

SetSize sets the "size" field.

func (*StorageCreate) SetType

func (_c *StorageCreate) SetType(v 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 (_c *StorageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageCreateBulk) ExecX

func (_c *StorageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageCreateBulk) Save

func (_c *StorageCreateBulk) Save(ctx context.Context) ([]*Storage, error)

Save creates the Storage entities in the database.

func (*StorageCreateBulk) SaveX

func (_c *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 (_d *StorageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StorageDelete) ExecX

func (_d *StorageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StorageDelete) Where

func (_d *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 (_d *StorageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*StorageDeleteOne) ExecX

func (_d *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 (_g *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 (_g *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 StorageProvider

type StorageProvider struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// agent 节点ID
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	// 提供状态: 0:未运行,1:启动中,2: 启动失败,3: 运行中,4: 运行失败
	Status consts.StorageProviderStatus `json:"status,omitempty"`
	// 存储节点master http地址
	MasterServer string `json:"master_server,omitempty"`
	// 存储volume的nat 映射IP
	PublicIP string `json:"public_ip,omitempty"`
	// 存储节点volume的http nat映射端口
	PublicPort int32 `json:"public_port,omitempty"`
	// 存储节点volume的grpc nat映射端口
	GrpcPort int32 `json:"grpc_port,omitempty"`
	// 创建时间
	CreatedTime time.Time `json:"created_time,omitempty"`
	// contains filtered or unexported fields
}

StorageProvider is the model entity for the StorageProvider schema.

func (*StorageProvider) String

func (_m *StorageProvider) String() string

String implements the fmt.Stringer.

func (*StorageProvider) Unwrap

func (_m *StorageProvider) Unwrap() *StorageProvider

Unwrap unwraps the StorageProvider 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 (*StorageProvider) Update

Update returns a builder for updating this StorageProvider. Note that you need to call StorageProvider.Unwrap() before calling this method if this StorageProvider was returned from a transaction, and the transaction was committed or rolled back.

func (*StorageProvider) Value

func (_m *StorageProvider) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the StorageProvider. This includes values selected through modifiers, order, etc.

type StorageProviderClient

type StorageProviderClient struct {
	// contains filtered or unexported fields
}

StorageProviderClient is a client for the StorageProvider schema.

func NewStorageProviderClient

func NewStorageProviderClient(c config) *StorageProviderClient

NewStorageProviderClient returns a client for the StorageProvider from the given config.

func (*StorageProviderClient) Create

Create returns a builder for creating a StorageProvider entity.

func (*StorageProviderClient) CreateBulk

CreateBulk returns a builder for creating a bulk of StorageProvider entities.

func (*StorageProviderClient) Delete

Delete returns a delete builder for StorageProvider.

func (*StorageProviderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StorageProviderClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*StorageProviderClient) Get

Get returns a StorageProvider entity by its id.

func (*StorageProviderClient) GetX

GetX is like Get, but panics if an error occurs.

func (*StorageProviderClient) Hooks

func (c *StorageProviderClient) Hooks() []Hook

Hooks returns the client hooks.

func (*StorageProviderClient) Intercept

func (c *StorageProviderClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `storageprovider.Intercept(f(g(h())))`.

func (*StorageProviderClient) Interceptors

func (c *StorageProviderClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*StorageProviderClient) MapCreateBulk

func (c *StorageProviderClient) MapCreateBulk(slice any, setFunc func(*StorageProviderCreate, int)) *StorageProviderCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*StorageProviderClient) Query

Query returns a query builder for StorageProvider.

func (*StorageProviderClient) Update

Update returns an update builder for StorageProvider.

func (*StorageProviderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*StorageProviderClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*StorageProviderClient) Use

func (c *StorageProviderClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `storageprovider.Hooks(f(g(h())))`.

type StorageProviderCreate

type StorageProviderCreate struct {
	// contains filtered or unexported fields
}

StorageProviderCreate is the builder for creating a StorageProvider entity.

func (*StorageProviderCreate) Exec

Exec executes the query.

func (*StorageProviderCreate) ExecX

func (_c *StorageProviderCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderCreate) Mutation

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderCreate) Save

Save creates the StorageProvider in the database.

func (*StorageProviderCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*StorageProviderCreate) SetAgentID

SetAgentID sets the "agent_id" field.

func (*StorageProviderCreate) SetCreatedTime

func (_c *StorageProviderCreate) SetCreatedTime(v time.Time) *StorageProviderCreate

SetCreatedTime sets the "created_time" field.

func (*StorageProviderCreate) SetGrpcPort

SetGrpcPort sets the "grpc_port" field.

func (*StorageProviderCreate) SetID

SetID sets the "id" field.

func (*StorageProviderCreate) SetMasterServer

func (_c *StorageProviderCreate) SetMasterServer(v string) *StorageProviderCreate

SetMasterServer sets the "master_server" field.

func (*StorageProviderCreate) SetNillableID

func (_c *StorageProviderCreate) SetNillableID(v *uuid.UUID) *StorageProviderCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*StorageProviderCreate) SetPublicIP

SetPublicIP sets the "public_ip" field.

func (*StorageProviderCreate) SetPublicPort

func (_c *StorageProviderCreate) SetPublicPort(v int32) *StorageProviderCreate

SetPublicPort sets the "public_port" field.

func (*StorageProviderCreate) SetStatus

SetStatus sets the "status" field.

type StorageProviderCreateBulk

type StorageProviderCreateBulk struct {
	// contains filtered or unexported fields
}

StorageProviderCreateBulk is the builder for creating many StorageProvider entities in bulk.

func (*StorageProviderCreateBulk) Exec

Exec executes the query.

func (*StorageProviderCreateBulk) ExecX

func (_c *StorageProviderCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderCreateBulk) Save

Save creates the StorageProvider entities in the database.

func (*StorageProviderCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type StorageProviderDelete

type StorageProviderDelete struct {
	// contains filtered or unexported fields
}

StorageProviderDelete is the builder for deleting a StorageProvider entity.

func (*StorageProviderDelete) Exec

func (_d *StorageProviderDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StorageProviderDelete) ExecX

func (_d *StorageProviderDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderDelete) Where

Where appends a list predicates to the StorageProviderDelete builder.

type StorageProviderDeleteOne

type StorageProviderDeleteOne struct {
	// contains filtered or unexported fields
}

StorageProviderDeleteOne is the builder for deleting a single StorageProvider entity.

func (*StorageProviderDeleteOne) Exec

Exec executes the deletion query.

func (*StorageProviderDeleteOne) ExecX

func (_d *StorageProviderDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderDeleteOne) Where

Where appends a list predicates to the StorageProviderDelete builder.

type StorageProviderGroupBy

type StorageProviderGroupBy struct {
	// contains filtered or unexported fields
}

StorageProviderGroupBy is the group-by builder for StorageProvider entities.

func (*StorageProviderGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*StorageProviderGroupBy) Bool

func (s *StorageProviderGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) BoolX

func (s *StorageProviderGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StorageProviderGroupBy) Bools

func (s *StorageProviderGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) BoolsX

func (s *StorageProviderGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StorageProviderGroupBy) Float64

func (s *StorageProviderGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) Float64X

func (s *StorageProviderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StorageProviderGroupBy) Float64s

func (s *StorageProviderGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) Float64sX

func (s *StorageProviderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StorageProviderGroupBy) Int

func (s *StorageProviderGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) IntX

func (s *StorageProviderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StorageProviderGroupBy) Ints

func (s *StorageProviderGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) IntsX

func (s *StorageProviderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StorageProviderGroupBy) Scan

func (_g *StorageProviderGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StorageProviderGroupBy) ScanX

func (s *StorageProviderGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StorageProviderGroupBy) String

func (s *StorageProviderGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) StringX

func (s *StorageProviderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StorageProviderGroupBy) Strings

func (s *StorageProviderGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) StringsX

func (s *StorageProviderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StorageProviderMutation

type StorageProviderMutation struct {
	// contains filtered or unexported fields
}

StorageProviderMutation represents an operation that mutates the StorageProvider nodes in the graph.

func (*StorageProviderMutation) AddField

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) AddGrpcPort

func (m *StorageProviderMutation) AddGrpcPort(i int32)

AddGrpcPort adds i to the "grpc_port" field.

func (*StorageProviderMutation) AddPublicPort

func (m *StorageProviderMutation) AddPublicPort(i int32)

AddPublicPort adds i to the "public_port" field.

func (*StorageProviderMutation) AddStatus

AddStatus adds cps to the "status" field.

func (*StorageProviderMutation) AddedEdges

func (m *StorageProviderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*StorageProviderMutation) AddedField

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) AddedFields

func (m *StorageProviderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*StorageProviderMutation) AddedGrpcPort

func (m *StorageProviderMutation) AddedGrpcPort() (r int32, exists bool)

AddedGrpcPort returns the value that was added to the "grpc_port" field in this mutation.

func (*StorageProviderMutation) AddedIDs

func (m *StorageProviderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*StorageProviderMutation) AddedPublicPort

func (m *StorageProviderMutation) AddedPublicPort() (r int32, exists bool)

AddedPublicPort returns the value that was added to the "public_port" field in this mutation.

func (*StorageProviderMutation) AddedStatus

func (m *StorageProviderMutation) AddedStatus() (r consts.StorageProviderStatus, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*StorageProviderMutation) AgentID

func (m *StorageProviderMutation) AgentID() (r uuid.UUID, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*StorageProviderMutation) ClearEdge

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) ClearField

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) ClearedEdges

func (m *StorageProviderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*StorageProviderMutation) ClearedFields

func (m *StorageProviderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (StorageProviderMutation) Client

func (m StorageProviderMutation) 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 (*StorageProviderMutation) CreatedTime

func (m *StorageProviderMutation) CreatedTime() (r time.Time, exists bool)

CreatedTime returns the value of the "created_time" field in the mutation.

func (*StorageProviderMutation) EdgeCleared

func (m *StorageProviderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*StorageProviderMutation) Field

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) FieldCleared

func (m *StorageProviderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*StorageProviderMutation) Fields

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) GrpcPort

func (m *StorageProviderMutation) GrpcPort() (r int32, exists bool)

GrpcPort returns the value of the "grpc_port" field in the mutation.

func (*StorageProviderMutation) ID

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) 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 (*StorageProviderMutation) MasterServer

func (m *StorageProviderMutation) MasterServer() (r string, exists bool)

MasterServer returns the value of the "master_server" field in the mutation.

func (*StorageProviderMutation) OldAgentID

func (m *StorageProviderMutation) OldAgentID(ctx context.Context) (v uuid.UUID, err error)

OldAgentID returns the old "agent_id" field's value of the StorageProvider entity. If the StorageProvider 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 (*StorageProviderMutation) OldCreatedTime

func (m *StorageProviderMutation) OldCreatedTime(ctx context.Context) (v time.Time, err error)

OldCreatedTime returns the old "created_time" field's value of the StorageProvider entity. If the StorageProvider 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 (*StorageProviderMutation) OldField

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) OldGrpcPort

func (m *StorageProviderMutation) OldGrpcPort(ctx context.Context) (v int32, err error)

OldGrpcPort returns the old "grpc_port" field's value of the StorageProvider entity. If the StorageProvider 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 (*StorageProviderMutation) OldMasterServer

func (m *StorageProviderMutation) OldMasterServer(ctx context.Context) (v string, err error)

OldMasterServer returns the old "master_server" field's value of the StorageProvider entity. If the StorageProvider 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 (*StorageProviderMutation) OldPublicIP

func (m *StorageProviderMutation) OldPublicIP(ctx context.Context) (v string, err error)

OldPublicIP returns the old "public_ip" field's value of the StorageProvider entity. If the StorageProvider 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 (*StorageProviderMutation) OldPublicPort

func (m *StorageProviderMutation) OldPublicPort(ctx context.Context) (v int32, err error)

OldPublicPort returns the old "public_port" field's value of the StorageProvider entity. If the StorageProvider 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 (*StorageProviderMutation) OldStatus

OldStatus returns the old "status" field's value of the StorageProvider entity. If the StorageProvider 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 (*StorageProviderMutation) Op

func (m *StorageProviderMutation) Op() Op

Op returns the operation name.

func (*StorageProviderMutation) PublicIP

func (m *StorageProviderMutation) PublicIP() (r string, exists bool)

PublicIP returns the value of the "public_ip" field in the mutation.

func (*StorageProviderMutation) PublicPort

func (m *StorageProviderMutation) PublicPort() (r int32, exists bool)

PublicPort returns the value of the "public_port" field in the mutation.

func (*StorageProviderMutation) RemovedEdges

func (m *StorageProviderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*StorageProviderMutation) RemovedIDs

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) ResetAgentID

func (m *StorageProviderMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*StorageProviderMutation) ResetCreatedTime

func (m *StorageProviderMutation) ResetCreatedTime()

ResetCreatedTime resets all changes to the "created_time" field.

func (*StorageProviderMutation) ResetEdge

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) ResetField

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) ResetGrpcPort

func (m *StorageProviderMutation) ResetGrpcPort()

ResetGrpcPort resets all changes to the "grpc_port" field.

func (*StorageProviderMutation) ResetMasterServer

func (m *StorageProviderMutation) ResetMasterServer()

ResetMasterServer resets all changes to the "master_server" field.

func (*StorageProviderMutation) ResetPublicIP

func (m *StorageProviderMutation) ResetPublicIP()

ResetPublicIP resets all changes to the "public_ip" field.

func (*StorageProviderMutation) ResetPublicPort

func (m *StorageProviderMutation) ResetPublicPort()

ResetPublicPort resets all changes to the "public_port" field.

func (*StorageProviderMutation) ResetStatus

func (m *StorageProviderMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*StorageProviderMutation) SetAgentID

func (m *StorageProviderMutation) SetAgentID(u uuid.UUID)

SetAgentID sets the "agent_id" field.

func (*StorageProviderMutation) SetCreatedTime

func (m *StorageProviderMutation) SetCreatedTime(t time.Time)

SetCreatedTime sets the "created_time" field.

func (*StorageProviderMutation) SetField

func (m *StorageProviderMutation) 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 (*StorageProviderMutation) SetGrpcPort

func (m *StorageProviderMutation) SetGrpcPort(i int32)

SetGrpcPort sets the "grpc_port" field.

func (*StorageProviderMutation) SetID

func (m *StorageProviderMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of StorageProvider entities.

func (*StorageProviderMutation) SetMasterServer

func (m *StorageProviderMutation) SetMasterServer(s string)

SetMasterServer sets the "master_server" field.

func (*StorageProviderMutation) SetOp

func (m *StorageProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*StorageProviderMutation) SetPublicIP

func (m *StorageProviderMutation) SetPublicIP(s string)

SetPublicIP sets the "public_ip" field.

func (*StorageProviderMutation) SetPublicPort

func (m *StorageProviderMutation) SetPublicPort(i int32)

SetPublicPort sets the "public_port" field.

func (*StorageProviderMutation) SetStatus

SetStatus sets the "status" field.

func (*StorageProviderMutation) Status

func (m *StorageProviderMutation) Status() (r consts.StorageProviderStatus, exists bool)

Status returns the value of the "status" field in the mutation.

func (StorageProviderMutation) Tx

func (m StorageProviderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*StorageProviderMutation) Type

func (m *StorageProviderMutation) Type() string

Type returns the node type of this mutation (StorageProvider).

func (*StorageProviderMutation) Where

Where appends a list predicates to the StorageProviderMutation builder.

func (*StorageProviderMutation) WhereP

func (m *StorageProviderMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the StorageProviderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type StorageProviderQuery

type StorageProviderQuery struct {
	// contains filtered or unexported fields
}

StorageProviderQuery is the builder for querying StorageProvider entities.

func (*StorageProviderQuery) Aggregate

Aggregate returns a StorageProviderSelect configured with the given aggregations.

func (*StorageProviderQuery) All

All executes the query and returns a list of StorageProviders.

func (*StorageProviderQuery) AllX

AllX is like All, but panics if an error occurs.

func (*StorageProviderQuery) Clone

Clone returns a duplicate of the StorageProviderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*StorageProviderQuery) Count

func (_q *StorageProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StorageProviderQuery) CountX

func (_q *StorageProviderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StorageProviderQuery) Exist

func (_q *StorageProviderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StorageProviderQuery) ExistX

func (_q *StorageProviderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StorageProviderQuery) First

First returns the first StorageProvider entity from the query. Returns a *NotFoundError when no StorageProvider was found.

func (*StorageProviderQuery) FirstID

func (_q *StorageProviderQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first StorageProvider ID from the query. Returns a *NotFoundError when no StorageProvider ID was found.

func (*StorageProviderQuery) FirstIDX

func (_q *StorageProviderQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*StorageProviderQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*StorageProviderQuery) GroupBy

func (_q *StorageProviderQuery) GroupBy(field string, fields ...string) *StorageProviderGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.StorageProvider.Query().
	GroupBy(storageprovider.FieldAgentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*StorageProviderQuery) IDs

func (_q *StorageProviderQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of StorageProvider IDs.

func (*StorageProviderQuery) IDsX

func (_q *StorageProviderQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*StorageProviderQuery) Limit

func (_q *StorageProviderQuery) Limit(limit int) *StorageProviderQuery

Limit the number of records to be returned by this query.

func (*StorageProviderQuery) Offset

func (_q *StorageProviderQuery) Offset(offset int) *StorageProviderQuery

Offset to start from.

func (*StorageProviderQuery) Only

Only returns a single StorageProvider entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one StorageProvider entity is found. Returns a *NotFoundError when no StorageProvider entities are found.

func (*StorageProviderQuery) OnlyID

func (_q *StorageProviderQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only StorageProvider ID in the query. Returns a *NotSingularError when more than one StorageProvider ID is found. Returns a *NotFoundError when no entities are found.

func (*StorageProviderQuery) OnlyIDX

func (_q *StorageProviderQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StorageProviderQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*StorageProviderQuery) Order

Order specifies how the records should be ordered.

func (*StorageProviderQuery) Select

func (_q *StorageProviderQuery) Select(fields ...string) *StorageProviderSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	AgentID uuid.UUID `json:"agent_id,omitempty"`
}

client.StorageProvider.Query().
	Select(storageprovider.FieldAgentID).
	Scan(ctx, &v)

func (*StorageProviderQuery) Unique

func (_q *StorageProviderQuery) Unique(unique bool) *StorageProviderQuery

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 (*StorageProviderQuery) Where

Where adds a new predicate for the StorageProviderQuery builder.

type StorageProviderSelect

type StorageProviderSelect struct {
	*StorageProviderQuery
	// contains filtered or unexported fields
}

StorageProviderSelect is the builder for selecting fields of StorageProvider entities.

func (*StorageProviderSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*StorageProviderSelect) Bool

func (s *StorageProviderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) BoolX

func (s *StorageProviderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StorageProviderSelect) Bools

func (s *StorageProviderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) BoolsX

func (s *StorageProviderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StorageProviderSelect) Float64

func (s *StorageProviderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) Float64X

func (s *StorageProviderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StorageProviderSelect) Float64s

func (s *StorageProviderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) Float64sX

func (s *StorageProviderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StorageProviderSelect) Int

func (s *StorageProviderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) IntX

func (s *StorageProviderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StorageProviderSelect) Ints

func (s *StorageProviderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) IntsX

func (s *StorageProviderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StorageProviderSelect) Scan

func (_s *StorageProviderSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StorageProviderSelect) ScanX

func (s *StorageProviderSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StorageProviderSelect) String

func (s *StorageProviderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) StringX

func (s *StorageProviderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StorageProviderSelect) Strings

func (s *StorageProviderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) StringsX

func (s *StorageProviderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StorageProviderUpdate

type StorageProviderUpdate struct {
	// contains filtered or unexported fields
}

StorageProviderUpdate is the builder for updating StorageProvider entities.

func (*StorageProviderUpdate) AddGrpcPort

AddGrpcPort adds value to the "grpc_port" field.

func (*StorageProviderUpdate) AddPublicPort

func (_u *StorageProviderUpdate) AddPublicPort(v int32) *StorageProviderUpdate

AddPublicPort adds value to the "public_port" field.

func (*StorageProviderUpdate) AddStatus

AddStatus adds value to the "status" field.

func (*StorageProviderUpdate) Exec

Exec executes the query.

func (*StorageProviderUpdate) ExecX

func (_u *StorageProviderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderUpdate) Mutation

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderUpdate) Save

func (_u *StorageProviderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*StorageProviderUpdate) SaveX

func (_u *StorageProviderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StorageProviderUpdate) SetAgentID

SetAgentID sets the "agent_id" field.

func (*StorageProviderUpdate) SetCreatedTime

func (_u *StorageProviderUpdate) SetCreatedTime(v time.Time) *StorageProviderUpdate

SetCreatedTime sets the "created_time" field.

func (*StorageProviderUpdate) SetGrpcPort

SetGrpcPort sets the "grpc_port" field.

func (*StorageProviderUpdate) SetMasterServer

func (_u *StorageProviderUpdate) SetMasterServer(v string) *StorageProviderUpdate

SetMasterServer sets the "master_server" field.

func (*StorageProviderUpdate) SetNillableAgentID

func (_u *StorageProviderUpdate) SetNillableAgentID(v *uuid.UUID) *StorageProviderUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableCreatedTime

func (_u *StorageProviderUpdate) SetNillableCreatedTime(v *time.Time) *StorageProviderUpdate

SetNillableCreatedTime sets the "created_time" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableGrpcPort

func (_u *StorageProviderUpdate) SetNillableGrpcPort(v *int32) *StorageProviderUpdate

SetNillableGrpcPort sets the "grpc_port" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableMasterServer

func (_u *StorageProviderUpdate) SetNillableMasterServer(v *string) *StorageProviderUpdate

SetNillableMasterServer sets the "master_server" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillablePublicIP

func (_u *StorageProviderUpdate) SetNillablePublicIP(v *string) *StorageProviderUpdate

SetNillablePublicIP sets the "public_ip" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillablePublicPort

func (_u *StorageProviderUpdate) SetNillablePublicPort(v *int32) *StorageProviderUpdate

SetNillablePublicPort sets the "public_port" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*StorageProviderUpdate) SetPublicIP

SetPublicIP sets the "public_ip" field.

func (*StorageProviderUpdate) SetPublicPort

func (_u *StorageProviderUpdate) SetPublicPort(v int32) *StorageProviderUpdate

SetPublicPort sets the "public_port" field.

func (*StorageProviderUpdate) SetStatus

SetStatus sets the "status" field.

func (*StorageProviderUpdate) Where

Where appends a list predicates to the StorageProviderUpdate builder.

type StorageProviderUpdateOne

type StorageProviderUpdateOne struct {
	// contains filtered or unexported fields
}

StorageProviderUpdateOne is the builder for updating a single StorageProvider entity.

func (*StorageProviderUpdateOne) AddGrpcPort

AddGrpcPort adds value to the "grpc_port" field.

func (*StorageProviderUpdateOne) AddPublicPort

AddPublicPort adds value to the "public_port" field.

func (*StorageProviderUpdateOne) AddStatus

AddStatus adds value to the "status" field.

func (*StorageProviderUpdateOne) Exec

Exec executes the query on the entity.

func (*StorageProviderUpdateOne) ExecX

func (_u *StorageProviderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderUpdateOne) Mutation

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderUpdateOne) Save

Save executes the query and returns the updated StorageProvider entity.

func (*StorageProviderUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*StorageProviderUpdateOne) Select

func (_u *StorageProviderUpdateOne) Select(field string, fields ...string) *StorageProviderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*StorageProviderUpdateOne) SetAgentID

SetAgentID sets the "agent_id" field.

func (*StorageProviderUpdateOne) SetCreatedTime

SetCreatedTime sets the "created_time" field.

func (*StorageProviderUpdateOne) SetGrpcPort

SetGrpcPort sets the "grpc_port" field.

func (*StorageProviderUpdateOne) SetMasterServer

SetMasterServer sets the "master_server" field.

func (*StorageProviderUpdateOne) SetNillableAgentID

func (_u *StorageProviderUpdateOne) SetNillableAgentID(v *uuid.UUID) *StorageProviderUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableCreatedTime

func (_u *StorageProviderUpdateOne) SetNillableCreatedTime(v *time.Time) *StorageProviderUpdateOne

SetNillableCreatedTime sets the "created_time" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableGrpcPort

func (_u *StorageProviderUpdateOne) SetNillableGrpcPort(v *int32) *StorageProviderUpdateOne

SetNillableGrpcPort sets the "grpc_port" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableMasterServer

func (_u *StorageProviderUpdateOne) SetNillableMasterServer(v *string) *StorageProviderUpdateOne

SetNillableMasterServer sets the "master_server" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillablePublicIP

func (_u *StorageProviderUpdateOne) SetNillablePublicIP(v *string) *StorageProviderUpdateOne

SetNillablePublicIP sets the "public_ip" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillablePublicPort

func (_u *StorageProviderUpdateOne) SetNillablePublicPort(v *int32) *StorageProviderUpdateOne

SetNillablePublicPort sets the "public_port" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetPublicIP

SetPublicIP sets the "public_ip" field.

func (*StorageProviderUpdateOne) SetPublicPort

SetPublicPort sets the "public_port" field.

func (*StorageProviderUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*StorageProviderUpdateOne) Where

Where appends a list predicates to the StorageProviderUpdate builder.

type StorageProviders

type StorageProviders []*StorageProvider

StorageProviders is a parsable slice of StorageProvider.

type StorageQuery

type StorageQuery struct {
	// contains filtered or unexported fields
}

StorageQuery is the builder for querying Storage entities.

func (*StorageQuery) Aggregate

func (_q *StorageQuery) Aggregate(fns ...AggregateFunc) *StorageSelect

Aggregate returns a StorageSelect configured with the given aggregations.

func (*StorageQuery) All

func (_q *StorageQuery) All(ctx context.Context) ([]*Storage, error)

All executes the query and returns a list of Storages.

func (*StorageQuery) AllX

func (_q *StorageQuery) AllX(ctx context.Context) []*Storage

AllX is like All, but panics if an error occurs.

func (*StorageQuery) Clone

func (_q *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 (_q *StorageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StorageQuery) CountX

func (_q *StorageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StorageQuery) Exist

func (_q *StorageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StorageQuery) ExistX

func (_q *StorageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StorageQuery) First

func (_q *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 (_q *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 (_q *StorageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*StorageQuery) FirstX

func (_q *StorageQuery) FirstX(ctx context.Context) *Storage

FirstX is like First, but panics if an error occurs.

func (*StorageQuery) GroupBy

func (_q *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 (_q *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 (_q *StorageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*StorageQuery) Limit

func (_q *StorageQuery) Limit(limit int) *StorageQuery

Limit the number of records to be returned by this query.

func (*StorageQuery) Offset

func (_q *StorageQuery) Offset(offset int) *StorageQuery

Offset to start from.

func (*StorageQuery) Only

func (_q *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 (_q *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 (_q *StorageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StorageQuery) OnlyX

func (_q *StorageQuery) OnlyX(ctx context.Context) *Storage

OnlyX is like Only, but panics if an error occurs.

func (*StorageQuery) Order

func (_q *StorageQuery) Order(o ...storage.OrderOption) *StorageQuery

Order specifies how the records should be ordered.

func (*StorageQuery) Select

func (_q *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 (_q *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 (_q *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 (_s *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 (_s *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 (_u *StorageUpdate) AddSize(v int32) *StorageUpdate

AddSize adds value to the "size" field.

func (*StorageUpdate) AddType

func (_u *StorageUpdate) AddType(v int32) *StorageUpdate

AddType adds value to the "type" field.

func (*StorageUpdate) Exec

func (_u *StorageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageUpdate) ExecX

func (_u *StorageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageUpdate) Mutation

func (_u *StorageUpdate) Mutation() *StorageMutation

Mutation returns the StorageMutation object of the builder.

func (*StorageUpdate) Save

func (_u *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 (_u *StorageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StorageUpdate) SetCid

func (_u *StorageUpdate) SetCid(v string) *StorageUpdate

SetCid sets the "cid" field.

func (*StorageUpdate) SetLastModify

func (_u *StorageUpdate) SetLastModify(v time.Time) *StorageUpdate

SetLastModify sets the "last_modify" field.

func (*StorageUpdate) SetName

func (_u *StorageUpdate) SetName(v string) *StorageUpdate

SetName sets the "name" field.

func (*StorageUpdate) SetNillableCid

func (_u *StorageUpdate) SetNillableCid(v *string) *StorageUpdate

SetNillableCid sets the "cid" field if the given value is not nil.

func (*StorageUpdate) SetNillableLastModify

func (_u *StorageUpdate) SetNillableLastModify(v *time.Time) *StorageUpdate

SetNillableLastModify sets the "last_modify" field if the given value is not nil.

func (*StorageUpdate) SetNillableName

func (_u *StorageUpdate) SetNillableName(v *string) *StorageUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*StorageUpdate) SetNillableOwner

func (_u *StorageUpdate) SetNillableOwner(v *string) *StorageUpdate

SetNillableOwner sets the "owner" field if the given value is not nil.

func (*StorageUpdate) SetNillableParentID

func (_u *StorageUpdate) SetNillableParentID(v *string) *StorageUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*StorageUpdate) SetNillableSize

func (_u *StorageUpdate) SetNillableSize(v *int32) *StorageUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*StorageUpdate) SetNillableType

func (_u *StorageUpdate) SetNillableType(v *int32) *StorageUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*StorageUpdate) SetOwner

func (_u *StorageUpdate) SetOwner(v string) *StorageUpdate

SetOwner sets the "owner" field.

func (*StorageUpdate) SetParentID

func (_u *StorageUpdate) SetParentID(v string) *StorageUpdate

SetParentID sets the "parent_id" field.

func (*StorageUpdate) SetSize

func (_u *StorageUpdate) SetSize(v int32) *StorageUpdate

SetSize sets the "size" field.

func (*StorageUpdate) SetType

func (_u *StorageUpdate) SetType(v int32) *StorageUpdate

SetType sets the "type" field.

func (*StorageUpdate) Where

func (_u *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 (_u *StorageUpdateOne) AddSize(v int32) *StorageUpdateOne

AddSize adds value to the "size" field.

func (*StorageUpdateOne) AddType

func (_u *StorageUpdateOne) AddType(v int32) *StorageUpdateOne

AddType adds value to the "type" field.

func (*StorageUpdateOne) Exec

func (_u *StorageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*StorageUpdateOne) ExecX

func (_u *StorageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageUpdateOne) Mutation

func (_u *StorageUpdateOne) Mutation() *StorageMutation

Mutation returns the StorageMutation object of the builder.

func (*StorageUpdateOne) Save

func (_u *StorageUpdateOne) Save(ctx context.Context) (*Storage, error)

Save executes the query and returns the updated Storage entity.

func (*StorageUpdateOne) SaveX

func (_u *StorageUpdateOne) SaveX(ctx context.Context) *Storage

SaveX is like Save, but panics if an error occurs.

func (*StorageUpdateOne) Select

func (_u *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 (_u *StorageUpdateOne) SetCid(v string) *StorageUpdateOne

SetCid sets the "cid" field.

func (*StorageUpdateOne) SetLastModify

func (_u *StorageUpdateOne) SetLastModify(v time.Time) *StorageUpdateOne

SetLastModify sets the "last_modify" field.

func (*StorageUpdateOne) SetName

func (_u *StorageUpdateOne) SetName(v string) *StorageUpdateOne

SetName sets the "name" field.

func (*StorageUpdateOne) SetNillableCid

func (_u *StorageUpdateOne) SetNillableCid(v *string) *StorageUpdateOne

SetNillableCid sets the "cid" field if the given value is not nil.

func (*StorageUpdateOne) SetNillableLastModify

func (_u *StorageUpdateOne) SetNillableLastModify(v *time.Time) *StorageUpdateOne

SetNillableLastModify sets the "last_modify" field if the given value is not nil.

func (*StorageUpdateOne) SetNillableName

func (_u *StorageUpdateOne) SetNillableName(v *string) *StorageUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*StorageUpdateOne) SetNillableOwner

func (_u *StorageUpdateOne) SetNillableOwner(v *string) *StorageUpdateOne

SetNillableOwner sets the "owner" field if the given value is not nil.

func (*StorageUpdateOne) SetNillableParentID

func (_u *StorageUpdateOne) SetNillableParentID(v *string) *StorageUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*StorageUpdateOne) SetNillableSize

func (_u *StorageUpdateOne) SetNillableSize(v *int32) *StorageUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*StorageUpdateOne) SetNillableType

func (_u *StorageUpdateOne) SetNillableType(v *int32) *StorageUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*StorageUpdateOne) SetOwner

func (_u *StorageUpdateOne) SetOwner(v string) *StorageUpdateOne

SetOwner sets the "owner" field.

func (*StorageUpdateOne) SetParentID

func (_u *StorageUpdateOne) SetParentID(v string) *StorageUpdateOne

SetParentID sets the "parent_id" field.

func (*StorageUpdateOne) SetSize

func (_u *StorageUpdateOne) SetSize(v int32) *StorageUpdateOne

SetSize sets the "size" field.

func (*StorageUpdateOne) SetType

func (_u *StorageUpdateOne) SetType(v 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 Task

type Task struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID string `json:"agent_id,omitempty"`
	//   VM_CREATE = 0; // 创建虚拟机
	//   VM_DELETE = 1;  // 删除虚拟机
	//   VM_START = 2; // 启动虚拟机
	//   VM_SHUTDOWN = 3;  //关闭虚拟机
	//   VM_RESTART = 4;  //关闭虚拟机
	//   VM_VNC_CONNECT = 5;  // vnc 连接
	//   NAT_PROXY_CREATE = 6; // nat 代理创建
	//   NAT_PROXY_DELETE = 7; // nat 代理删除
	//   NAT_VISITOR_CREATE = 8; // nat 访问创建
	//   NAT_VISITOR_DELETE = 9; // nat 访问删除
	Cmd int32 `json:"cmd,omitempty"`
	// 执行参数,nat 网络类型对应 NatProxyCreateVO, 虚拟机类型对应 ComputeInstanceTaskParamVO
	Params *string `json:"params,omitempty"`
	//   CREATED = 0; //创建
	//   EXECUTING = 1; //执行中
	//   EXECUTED = 2 ; // 执行成功
	//   FAILED = 3 ; // 执行失败
	Status int `json:"status,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

Task is the model entity for the Task schema.

func (*Task) String

func (_m *Task) String() string

String implements the fmt.Stringer.

func (*Task) Unwrap

func (_m *Task) Unwrap() *Task

Unwrap unwraps the Task entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Task) Update

func (_m *Task) Update() *TaskUpdateOne

Update returns a builder for updating this Task. Note that you need to call Task.Unwrap() before calling this method if this Task was returned from a transaction, and the transaction was committed or rolled back.

func (*Task) Value

func (_m *Task) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Task. This includes values selected through modifiers, order, etc.

type TaskClient

type TaskClient struct {
	// contains filtered or unexported fields
}

TaskClient is a client for the Task schema.

func NewTaskClient

func NewTaskClient(c config) *TaskClient

NewTaskClient returns a client for the Task from the given config.

func (*TaskClient) Create

func (c *TaskClient) Create() *TaskCreate

Create returns a builder for creating a Task entity.

func (*TaskClient) CreateBulk

func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk

CreateBulk returns a builder for creating a bulk of Task entities.

func (*TaskClient) Delete

func (c *TaskClient) Delete() *TaskDelete

Delete returns a delete builder for Task.

func (*TaskClient) DeleteOne

func (c *TaskClient) DeleteOne(_m *Task) *TaskDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TaskClient) DeleteOneID

func (c *TaskClient) DeleteOneID(id uuid.UUID) *TaskDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TaskClient) Get

func (c *TaskClient) Get(ctx context.Context, id uuid.UUID) (*Task, error)

Get returns a Task entity by its id.

func (*TaskClient) GetX

func (c *TaskClient) GetX(ctx context.Context, id uuid.UUID) *Task

GetX is like Get, but panics if an error occurs.

func (*TaskClient) Hooks

func (c *TaskClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TaskClient) Intercept

func (c *TaskClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `task.Intercept(f(g(h())))`.

func (*TaskClient) Interceptors

func (c *TaskClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TaskClient) MapCreateBulk

func (c *TaskClient) MapCreateBulk(slice any, setFunc func(*TaskCreate, int)) *TaskCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TaskClient) Query

func (c *TaskClient) Query() *TaskQuery

Query returns a query builder for Task.

func (*TaskClient) Update

func (c *TaskClient) Update() *TaskUpdate

Update returns an update builder for Task.

func (*TaskClient) UpdateOne

func (c *TaskClient) UpdateOne(_m *Task) *TaskUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskClient) UpdateOneID

func (c *TaskClient) UpdateOneID(id uuid.UUID) *TaskUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskClient) Use

func (c *TaskClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `task.Hooks(f(g(h())))`.

type TaskCreate

type TaskCreate struct {
	// contains filtered or unexported fields
}

TaskCreate is the builder for creating a Task entity.

func (*TaskCreate) Exec

func (_c *TaskCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreate) ExecX

func (_c *TaskCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskCreate) Mutation

func (_c *TaskCreate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskCreate) Save

func (_c *TaskCreate) Save(ctx context.Context) (*Task, error)

Save creates the Task in the database.

func (*TaskCreate) SaveX

func (_c *TaskCreate) SaveX(ctx context.Context) *Task

SaveX calls Save and panics if Save returns an error.

func (*TaskCreate) SetAgentID

func (_c *TaskCreate) SetAgentID(v string) *TaskCreate

SetAgentID sets the "agent_id" field.

func (*TaskCreate) SetCmd

func (_c *TaskCreate) SetCmd(v int32) *TaskCreate

SetCmd sets the "cmd" field.

func (*TaskCreate) SetCreateTime

func (_c *TaskCreate) SetCreateTime(v time.Time) *TaskCreate

SetCreateTime sets the "create_time" field.

func (*TaskCreate) SetID

func (_c *TaskCreate) SetID(v uuid.UUID) *TaskCreate

SetID sets the "id" field.

func (*TaskCreate) SetNillableCmd

func (_c *TaskCreate) SetNillableCmd(v *int32) *TaskCreate

SetNillableCmd sets the "cmd" field if the given value is not nil.

func (*TaskCreate) SetNillableCreateTime

func (_c *TaskCreate) SetNillableCreateTime(v *time.Time) *TaskCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskCreate) SetNillableID

func (_c *TaskCreate) SetNillableID(v *uuid.UUID) *TaskCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TaskCreate) SetParams

func (_c *TaskCreate) SetParams(v string) *TaskCreate

SetParams sets the "params" field.

func (*TaskCreate) SetStatus

func (_c *TaskCreate) SetStatus(v int) *TaskCreate

SetStatus sets the "status" field.

type TaskCreateBulk

type TaskCreateBulk struct {
	// contains filtered or unexported fields
}

TaskCreateBulk is the builder for creating many Task entities in bulk.

func (*TaskCreateBulk) Exec

func (_c *TaskCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreateBulk) ExecX

func (_c *TaskCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskCreateBulk) Save

func (_c *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error)

Save creates the Task entities in the database.

func (*TaskCreateBulk) SaveX

func (_c *TaskCreateBulk) SaveX(ctx context.Context) []*Task

SaveX is like Save, but panics if an error occurs.

type TaskDelete

type TaskDelete struct {
	// contains filtered or unexported fields
}

TaskDelete is the builder for deleting a Task entity.

func (*TaskDelete) Exec

func (_d *TaskDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TaskDelete) ExecX

func (_d *TaskDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TaskDelete) Where

func (_d *TaskDelete) Where(ps ...predicate.Task) *TaskDelete

Where appends a list predicates to the TaskDelete builder.

type TaskDeleteOne

type TaskDeleteOne struct {
	// contains filtered or unexported fields
}

TaskDeleteOne is the builder for deleting a single Task entity.

func (*TaskDeleteOne) Exec

func (_d *TaskDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskDeleteOne) ExecX

func (_d *TaskDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskDeleteOne) Where

func (_d *TaskDeleteOne) Where(ps ...predicate.Task) *TaskDeleteOne

Where appends a list predicates to the TaskDelete builder.

type TaskGroupBy

type TaskGroupBy struct {
	// contains filtered or unexported fields
}

TaskGroupBy is the group-by builder for Task entities.

func (*TaskGroupBy) Aggregate

func (_g *TaskGroupBy) Aggregate(fns ...AggregateFunc) *TaskGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TaskGroupBy) Bool

func (s *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) BoolX

func (s *TaskGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskGroupBy) Bools

func (s *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) BoolsX

func (s *TaskGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskGroupBy) Float64

func (s *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) Float64X

func (s *TaskGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskGroupBy) Float64s

func (s *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) Float64sX

func (s *TaskGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskGroupBy) Int

func (s *TaskGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) IntX

func (s *TaskGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskGroupBy) Ints

func (s *TaskGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) IntsX

func (s *TaskGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskGroupBy) Scan

func (_g *TaskGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TaskGroupBy) ScanX

func (s *TaskGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TaskGroupBy) String

func (s *TaskGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) StringX

func (s *TaskGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskGroupBy) Strings

func (s *TaskGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) StringsX

func (s *TaskGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskMutation

type TaskMutation struct {
	// contains filtered or unexported fields
}

TaskMutation represents an operation that mutates the Task nodes in the graph.

func (*TaskMutation) AddCmd

func (m *TaskMutation) AddCmd(i int32)

AddCmd adds i to the "cmd" field.

func (*TaskMutation) AddField

func (m *TaskMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TaskMutation) AddStatus

func (m *TaskMutation) AddStatus(i int)

AddStatus adds i to the "status" field.

func (*TaskMutation) AddedCmd

func (m *TaskMutation) AddedCmd() (r int32, exists bool)

AddedCmd returns the value that was added to the "cmd" field in this mutation.

func (*TaskMutation) AddedEdges

func (m *TaskMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TaskMutation) AddedField

func (m *TaskMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TaskMutation) AddedFields

func (m *TaskMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TaskMutation) AddedIDs

func (m *TaskMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TaskMutation) AddedStatus

func (m *TaskMutation) AddedStatus() (r int, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*TaskMutation) AgentID

func (m *TaskMutation) AgentID() (r string, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*TaskMutation) ClearEdge

func (m *TaskMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*TaskMutation) ClearField

func (m *TaskMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*TaskMutation) ClearedEdges

func (m *TaskMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TaskMutation) ClearedFields

func (m *TaskMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TaskMutation) Client

func (m TaskMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*TaskMutation) Cmd

func (m *TaskMutation) Cmd() (r int32, exists bool)

Cmd returns the value of the "cmd" field in the mutation.

func (*TaskMutation) CreateTime

func (m *TaskMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*TaskMutation) EdgeCleared

func (m *TaskMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TaskMutation) Field

func (m *TaskMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TaskMutation) FieldCleared

func (m *TaskMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TaskMutation) Fields

func (m *TaskMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*TaskMutation) ID

func (m *TaskMutation) ID() (id 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 (*TaskMutation) IDs

func (m *TaskMutation) 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 (*TaskMutation) OldAgentID

func (m *TaskMutation) OldAgentID(ctx context.Context) (v string, err error)

OldAgentID returns the old "agent_id" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldCmd

func (m *TaskMutation) OldCmd(ctx context.Context) (v int32, err error)

OldCmd returns the old "cmd" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldCreateTime

func (m *TaskMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldField

func (m *TaskMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*TaskMutation) OldParams

func (m *TaskMutation) OldParams(ctx context.Context) (v *string, err error)

OldParams returns the old "params" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldStatus

func (m *TaskMutation) OldStatus(ctx context.Context) (v int, err error)

OldStatus returns the old "status" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) Op

func (m *TaskMutation) Op() Op

Op returns the operation name.

func (*TaskMutation) Params

func (m *TaskMutation) Params() (r string, exists bool)

Params returns the value of the "params" field in the mutation.

func (*TaskMutation) RemovedEdges

func (m *TaskMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TaskMutation) RemovedIDs

func (m *TaskMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TaskMutation) ResetAgentID

func (m *TaskMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*TaskMutation) ResetCmd

func (m *TaskMutation) ResetCmd()

ResetCmd resets all changes to the "cmd" field.

func (*TaskMutation) ResetCreateTime

func (m *TaskMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TaskMutation) ResetEdge

func (m *TaskMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*TaskMutation) ResetField

func (m *TaskMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*TaskMutation) ResetParams

func (m *TaskMutation) ResetParams()

ResetParams resets all changes to the "params" field.

func (*TaskMutation) ResetStatus

func (m *TaskMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TaskMutation) SetAgentID

func (m *TaskMutation) SetAgentID(s string)

SetAgentID sets the "agent_id" field.

func (*TaskMutation) SetCmd

func (m *TaskMutation) SetCmd(i int32)

SetCmd sets the "cmd" field.

func (*TaskMutation) SetCreateTime

func (m *TaskMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TaskMutation) SetField

func (m *TaskMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TaskMutation) SetID

func (m *TaskMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Task entities.

func (*TaskMutation) SetOp

func (m *TaskMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TaskMutation) SetParams

func (m *TaskMutation) SetParams(s string)

SetParams sets the "params" field.

func (*TaskMutation) SetStatus

func (m *TaskMutation) SetStatus(i int)

SetStatus sets the "status" field.

func (*TaskMutation) Status

func (m *TaskMutation) Status() (r int, exists bool)

Status returns the value of the "status" field in the mutation.

func (TaskMutation) Tx

func (m TaskMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TaskMutation) Type

func (m *TaskMutation) Type() string

Type returns the node type of this mutation (Task).

func (*TaskMutation) Where

func (m *TaskMutation) Where(ps ...predicate.Task)

Where appends a list predicates to the TaskMutation builder.

func (*TaskMutation) WhereP

func (m *TaskMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TaskMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TaskQuery

type TaskQuery struct {
	// contains filtered or unexported fields
}

TaskQuery is the builder for querying Task entities.

func (*TaskQuery) Aggregate

func (_q *TaskQuery) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate returns a TaskSelect configured with the given aggregations.

func (*TaskQuery) All

func (_q *TaskQuery) All(ctx context.Context) ([]*Task, error)

All executes the query and returns a list of Tasks.

func (*TaskQuery) AllX

func (_q *TaskQuery) AllX(ctx context.Context) []*Task

AllX is like All, but panics if an error occurs.

func (*TaskQuery) Clone

func (_q *TaskQuery) Clone() *TaskQuery

Clone returns a duplicate of the TaskQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TaskQuery) Count

func (_q *TaskQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskQuery) CountX

func (_q *TaskQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TaskQuery) Exist

func (_q *TaskQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TaskQuery) ExistX

func (_q *TaskQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TaskQuery) First

func (_q *TaskQuery) First(ctx context.Context) (*Task, error)

First returns the first Task entity from the query. Returns a *NotFoundError when no Task was found.

func (*TaskQuery) FirstID

func (_q *TaskQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Task ID from the query. Returns a *NotFoundError when no Task ID was found.

func (*TaskQuery) FirstIDX

func (_q *TaskQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TaskQuery) FirstX

func (_q *TaskQuery) FirstX(ctx context.Context) *Task

FirstX is like First, but panics if an error occurs.

func (*TaskQuery) GroupBy

func (_q *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	AgentID string `json:"agent_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Task.Query().
	GroupBy(task.FieldAgentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskQuery) IDs

func (_q *TaskQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Task IDs.

func (*TaskQuery) IDsX

func (_q *TaskQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TaskQuery) Limit

func (_q *TaskQuery) Limit(limit int) *TaskQuery

Limit the number of records to be returned by this query.

func (*TaskQuery) Offset

func (_q *TaskQuery) Offset(offset int) *TaskQuery

Offset to start from.

func (*TaskQuery) Only

func (_q *TaskQuery) Only(ctx context.Context) (*Task, error)

Only returns a single Task entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Task entity is found. Returns a *NotFoundError when no Task entities are found.

func (*TaskQuery) OnlyID

func (_q *TaskQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Task ID in the query. Returns a *NotSingularError when more than one Task ID is found. Returns a *NotFoundError when no entities are found.

func (*TaskQuery) OnlyIDX

func (_q *TaskQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TaskQuery) OnlyX

func (_q *TaskQuery) OnlyX(ctx context.Context) *Task

OnlyX is like Only, but panics if an error occurs.

func (*TaskQuery) Order

func (_q *TaskQuery) Order(o ...task.OrderOption) *TaskQuery

Order specifies how the records should be ordered.

func (*TaskQuery) Select

func (_q *TaskQuery) Select(fields ...string) *TaskSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	AgentID string `json:"agent_id,omitempty"`
}

client.Task.Query().
	Select(task.FieldAgentID).
	Scan(ctx, &v)

func (*TaskQuery) Unique

func (_q *TaskQuery) Unique(unique bool) *TaskQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TaskQuery) Where

func (_q *TaskQuery) Where(ps ...predicate.Task) *TaskQuery

Where adds a new predicate for the TaskQuery builder.

type TaskSelect

type TaskSelect struct {
	*TaskQuery
	// contains filtered or unexported fields
}

TaskSelect is the builder for selecting fields of Task entities.

func (*TaskSelect) Aggregate

func (_s *TaskSelect) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TaskSelect) Bool

func (s *TaskSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolX

func (s *TaskSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskSelect) Bools

func (s *TaskSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolsX

func (s *TaskSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskSelect) Float64

func (s *TaskSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64X

func (s *TaskSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskSelect) Float64s

func (s *TaskSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64sX

func (s *TaskSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskSelect) Int

func (s *TaskSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntX

func (s *TaskSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskSelect) Ints

func (s *TaskSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntsX

func (s *TaskSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskSelect) Scan

func (_s *TaskSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TaskSelect) ScanX

func (s *TaskSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TaskSelect) String

func (s *TaskSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringX

func (s *TaskSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskSelect) Strings

func (s *TaskSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringsX

func (s *TaskSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskUpdate

type TaskUpdate struct {
	// contains filtered or unexported fields
}

TaskUpdate is the builder for updating Task entities.

func (*TaskUpdate) AddCmd

func (_u *TaskUpdate) AddCmd(v int32) *TaskUpdate

AddCmd adds value to the "cmd" field.

func (*TaskUpdate) AddStatus

func (_u *TaskUpdate) AddStatus(v int) *TaskUpdate

AddStatus adds value to the "status" field.

func (*TaskUpdate) Exec

func (_u *TaskUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpdate) ExecX

func (_u *TaskUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdate) Mutation

func (_u *TaskUpdate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdate) Save

func (_u *TaskUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TaskUpdate) SaveX

func (_u *TaskUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdate) SetAgentID

func (_u *TaskUpdate) SetAgentID(v string) *TaskUpdate

SetAgentID sets the "agent_id" field.

func (*TaskUpdate) SetCmd

func (_u *TaskUpdate) SetCmd(v int32) *TaskUpdate

SetCmd sets the "cmd" field.

func (*TaskUpdate) SetCreateTime

func (_u *TaskUpdate) SetCreateTime(v time.Time) *TaskUpdate

SetCreateTime sets the "create_time" field.

func (*TaskUpdate) SetNillableAgentID

func (_u *TaskUpdate) SetNillableAgentID(v *string) *TaskUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*TaskUpdate) SetNillableCmd

func (_u *TaskUpdate) SetNillableCmd(v *int32) *TaskUpdate

SetNillableCmd sets the "cmd" field if the given value is not nil.

func (*TaskUpdate) SetNillableCreateTime

func (_u *TaskUpdate) SetNillableCreateTime(v *time.Time) *TaskUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskUpdate) SetNillableParams

func (_u *TaskUpdate) SetNillableParams(v *string) *TaskUpdate

SetNillableParams sets the "params" field if the given value is not nil.

func (*TaskUpdate) SetNillableStatus

func (_u *TaskUpdate) SetNillableStatus(v *int) *TaskUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TaskUpdate) SetParams

func (_u *TaskUpdate) SetParams(v string) *TaskUpdate

SetParams sets the "params" field.

func (*TaskUpdate) SetStatus

func (_u *TaskUpdate) SetStatus(v int) *TaskUpdate

SetStatus sets the "status" field.

func (*TaskUpdate) Where

func (_u *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate

Where appends a list predicates to the TaskUpdate builder.

type TaskUpdateOne

type TaskUpdateOne struct {
	// contains filtered or unexported fields
}

TaskUpdateOne is the builder for updating a single Task entity.

func (*TaskUpdateOne) AddCmd

func (_u *TaskUpdateOne) AddCmd(v int32) *TaskUpdateOne

AddCmd adds value to the "cmd" field.

func (*TaskUpdateOne) AddStatus

func (_u *TaskUpdateOne) AddStatus(v int) *TaskUpdateOne

AddStatus adds value to the "status" field.

func (*TaskUpdateOne) Exec

func (_u *TaskUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskUpdateOne) ExecX

func (_u *TaskUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdateOne) Mutation

func (_u *TaskUpdateOne) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdateOne) Save

func (_u *TaskUpdateOne) Save(ctx context.Context) (*Task, error)

Save executes the query and returns the updated Task entity.

func (*TaskUpdateOne) SaveX

func (_u *TaskUpdateOne) SaveX(ctx context.Context) *Task

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdateOne) Select

func (_u *TaskUpdateOne) Select(field string, fields ...string) *TaskUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TaskUpdateOne) SetAgentID

func (_u *TaskUpdateOne) SetAgentID(v string) *TaskUpdateOne

SetAgentID sets the "agent_id" field.

func (*TaskUpdateOne) SetCmd

func (_u *TaskUpdateOne) SetCmd(v int32) *TaskUpdateOne

SetCmd sets the "cmd" field.

func (*TaskUpdateOne) SetCreateTime

func (_u *TaskUpdateOne) SetCreateTime(v time.Time) *TaskUpdateOne

SetCreateTime sets the "create_time" field.

func (*TaskUpdateOne) SetNillableAgentID

func (_u *TaskUpdateOne) SetNillableAgentID(v *string) *TaskUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCmd

func (_u *TaskUpdateOne) SetNillableCmd(v *int32) *TaskUpdateOne

SetNillableCmd sets the "cmd" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCreateTime

func (_u *TaskUpdateOne) SetNillableCreateTime(v *time.Time) *TaskUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableParams

func (_u *TaskUpdateOne) SetNillableParams(v *string) *TaskUpdateOne

SetNillableParams sets the "params" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableStatus

func (_u *TaskUpdateOne) SetNillableStatus(v *int) *TaskUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TaskUpdateOne) SetParams

func (_u *TaskUpdateOne) SetParams(v string) *TaskUpdateOne

SetParams sets the "params" field.

func (*TaskUpdateOne) SetStatus

func (_u *TaskUpdateOne) SetStatus(v int) *TaskUpdateOne

SetStatus sets the "status" field.

func (*TaskUpdateOne) Where

func (_u *TaskUpdateOne) Where(ps ...predicate.Task) *TaskUpdateOne

Where appends a list predicates to the TaskUpdate builder.

type Tasks

type Tasks []*Task

Tasks is a parsable slice of Task.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// AlipayOrderRollback is the client for interacting with the AlipayOrderRollback builders.
	AlipayOrderRollback *AlipayOrderRollbackClient
	// 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
	// ComputeSpecPrice is the client for interacting with the ComputeSpecPrice builders.
	ComputeSpecPrice *ComputeSpecPriceClient
	// Cycle is the client for interacting with the Cycle builders.
	Cycle *CycleClient
	// CycleOrder is the client for interacting with the CycleOrder builders.
	CycleOrder *CycleOrderClient
	// CycleRecharge is the client for interacting with the CycleRecharge builders.
	CycleRecharge *CycleRechargeClient
	// CycleRedeemCode is the client for interacting with the CycleRedeemCode builders.
	CycleRedeemCode *CycleRedeemCodeClient
	// CycleRenewal is the client for interacting with the CycleRenewal builders.
	CycleRenewal *CycleRenewalClient
	// CycleTransaction is the client for interacting with the CycleTransaction builders.
	CycleTransaction *CycleTransactionClient
	// DomainBinding is the client for interacting with the DomainBinding builders.
	DomainBinding *DomainBindingClient
	// Employee is the client for interacting with the Employee builders.
	Employee *EmployeeClient
	// Gateway is the client for interacting with the Gateway builders.
	Gateway *GatewayClient
	// GatewayPort is the client for interacting with the GatewayPort builders.
	GatewayPort *GatewayPortClient
	// NetworkMapping is the client for interacting with the NetworkMapping builders.
	NetworkMapping *NetworkMappingClient
	// S3Bucket is the client for interacting with the S3Bucket builders.
	S3Bucket *S3BucketClient
	// S3User is the client for interacting with the S3User builders.
	S3User *S3UserClient
	// 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
	// StorageProvider is the client for interacting with the StorageProvider builders.
	StorageProvider *StorageProviderClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserResourceLimit is the client for interacting with the UserResourceLimit builders.
	UserResourceLimit *UserResourceLimitClient
	// 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"`
	// 用户名
	Username string `json:"username,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 (_m *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (_m *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 (_m *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 (_m *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(_m *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) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(_m *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 (_c *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (_c *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (_c *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (_c *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (_c *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCountryCallCoding

func (_c *UserCreate) SetCountryCallCoding(v string) *UserCreate

SetCountryCallCoding sets the "country_call_coding" field.

func (*UserCreate) SetCreateDate

func (_c *UserCreate) SetCreateDate(v time.Time) *UserCreate

SetCreateDate sets the "create_date" field.

func (*UserCreate) SetID

func (_c *UserCreate) SetID(v uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIcon

func (_c *UserCreate) SetIcon(v string) *UserCreate

SetIcon sets the "icon" field.

func (*UserCreate) SetLastLoginDate

func (_c *UserCreate) SetLastLoginDate(v time.Time) *UserCreate

SetLastLoginDate sets the "last_login_date" field.

func (*UserCreate) SetName

func (_c *UserCreate) SetName(v string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableCreateDate

func (_c *UserCreate) SetNillableCreateDate(v *time.Time) *UserCreate

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (_c *UserCreate) SetNillableID(v *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableLastLoginDate

func (_c *UserCreate) SetNillableLastLoginDate(v *time.Time) *UserCreate

SetNillableLastLoginDate sets the "last_login_date" field if the given value is not nil.

func (*UserCreate) SetNillablePwdConfig

func (_c *UserCreate) SetNillablePwdConfig(v *bool) *UserCreate

SetNillablePwdConfig sets the "pwd_config" field if the given value is not nil.

func (*UserCreate) SetPassword

func (_c *UserCreate) SetPassword(v string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetPwdConfig

func (_c *UserCreate) SetPwdConfig(v bool) *UserCreate

SetPwdConfig sets the "pwd_config" field.

func (*UserCreate) SetTelephoneNumber

func (_c *UserCreate) SetTelephoneNumber(v string) *UserCreate

SetTelephoneNumber sets the "telephone_number" field.

func (*UserCreate) SetUsername

func (_c *UserCreate) SetUsername(v string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (_c *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (_c *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (_c *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 (_d *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (_d *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (_d *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 (_d *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (_d *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (_d *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 (_g *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 (_g *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

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) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PwdConfig

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

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) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" 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

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) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" 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) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (_q *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (_q *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (_q *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 (_q *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (_q *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (_q *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (_q *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (_q *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 (_q *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 (_q *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (_q *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (_q *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 {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (_q *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 (_q *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (_q *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (_q *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (_q *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 (_q *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 (_q *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (_q *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) Select

func (_q *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 {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (_q *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 (_q *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserResourceLimit

type UserResourceLimit struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// 用户id
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	// MaxCPU holds the value of the "max_cpu" field.
	MaxCPU int32 `json:"max_cpu,omitempty"`
	// MaxMemory holds the value of the "max_memory" field.
	MaxMemory int32 `json:"max_memory,omitempty"`
	// MaxNetworkMapping holds the value of the "max_network_mapping" field.
	MaxNetworkMapping int32 `json:"max_network_mapping,omitempty"`
	// contains filtered or unexported fields
}

UserResourceLimit is the model entity for the UserResourceLimit schema.

func (*UserResourceLimit) String

func (_m *UserResourceLimit) String() string

String implements the fmt.Stringer.

func (*UserResourceLimit) Unwrap

func (_m *UserResourceLimit) Unwrap() *UserResourceLimit

Unwrap unwraps the UserResourceLimit 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 (*UserResourceLimit) Update

Update returns a builder for updating this UserResourceLimit. Note that you need to call UserResourceLimit.Unwrap() before calling this method if this UserResourceLimit was returned from a transaction, and the transaction was committed or rolled back.

func (*UserResourceLimit) Value

func (_m *UserResourceLimit) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserResourceLimit. This includes values selected through modifiers, order, etc.

type UserResourceLimitClient

type UserResourceLimitClient struct {
	// contains filtered or unexported fields
}

UserResourceLimitClient is a client for the UserResourceLimit schema.

func NewUserResourceLimitClient

func NewUserResourceLimitClient(c config) *UserResourceLimitClient

NewUserResourceLimitClient returns a client for the UserResourceLimit from the given config.

func (*UserResourceLimitClient) Create

Create returns a builder for creating a UserResourceLimit entity.

func (*UserResourceLimitClient) CreateBulk

CreateBulk returns a builder for creating a bulk of UserResourceLimit entities.

func (*UserResourceLimitClient) Delete

Delete returns a delete builder for UserResourceLimit.

func (*UserResourceLimitClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserResourceLimitClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserResourceLimitClient) Get

Get returns a UserResourceLimit entity by its id.

func (*UserResourceLimitClient) GetX

GetX is like Get, but panics if an error occurs.

func (*UserResourceLimitClient) Hooks

func (c *UserResourceLimitClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserResourceLimitClient) Intercept

func (c *UserResourceLimitClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userresourcelimit.Intercept(f(g(h())))`.

func (*UserResourceLimitClient) Interceptors

func (c *UserResourceLimitClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserResourceLimitClient) MapCreateBulk

func (c *UserResourceLimitClient) MapCreateBulk(slice any, setFunc func(*UserResourceLimitCreate, int)) *UserResourceLimitCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserResourceLimitClient) Query

Query returns a query builder for UserResourceLimit.

func (*UserResourceLimitClient) Update

Update returns an update builder for UserResourceLimit.

func (*UserResourceLimitClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserResourceLimitClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*UserResourceLimitClient) Use

func (c *UserResourceLimitClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userresourcelimit.Hooks(f(g(h())))`.

type UserResourceLimitCreate

type UserResourceLimitCreate struct {
	// contains filtered or unexported fields
}

UserResourceLimitCreate is the builder for creating a UserResourceLimit entity.

func (*UserResourceLimitCreate) Exec

Exec executes the query.

func (*UserResourceLimitCreate) ExecX

func (_c *UserResourceLimitCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserResourceLimitCreate) Mutation

Mutation returns the UserResourceLimitMutation object of the builder.

func (*UserResourceLimitCreate) Save

Save creates the UserResourceLimit in the database.

func (*UserResourceLimitCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserResourceLimitCreate) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*UserResourceLimitCreate) SetID

SetID sets the "id" field.

func (*UserResourceLimitCreate) SetMaxCPU

SetMaxCPU sets the "max_cpu" field.

func (*UserResourceLimitCreate) SetMaxMemory

SetMaxMemory sets the "max_memory" field.

func (*UserResourceLimitCreate) SetMaxNetworkMapping

func (_c *UserResourceLimitCreate) SetMaxNetworkMapping(v int32) *UserResourceLimitCreate

SetMaxNetworkMapping sets the "max_network_mapping" field.

func (*UserResourceLimitCreate) SetNillableFkUserID

func (_c *UserResourceLimitCreate) SetNillableFkUserID(v *uuid.UUID) *UserResourceLimitCreate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*UserResourceLimitCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*UserResourceLimitCreate) SetNillableMaxCPU

func (_c *UserResourceLimitCreate) SetNillableMaxCPU(v *int32) *UserResourceLimitCreate

SetNillableMaxCPU sets the "max_cpu" field if the given value is not nil.

func (*UserResourceLimitCreate) SetNillableMaxMemory

func (_c *UserResourceLimitCreate) SetNillableMaxMemory(v *int32) *UserResourceLimitCreate

SetNillableMaxMemory sets the "max_memory" field if the given value is not nil.

func (*UserResourceLimitCreate) SetNillableMaxNetworkMapping

func (_c *UserResourceLimitCreate) SetNillableMaxNetworkMapping(v *int32) *UserResourceLimitCreate

SetNillableMaxNetworkMapping sets the "max_network_mapping" field if the given value is not nil.

type UserResourceLimitCreateBulk

type UserResourceLimitCreateBulk struct {
	// contains filtered or unexported fields
}

UserResourceLimitCreateBulk is the builder for creating many UserResourceLimit entities in bulk.

func (*UserResourceLimitCreateBulk) Exec

Exec executes the query.

func (*UserResourceLimitCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*UserResourceLimitCreateBulk) Save

Save creates the UserResourceLimit entities in the database.

func (*UserResourceLimitCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type UserResourceLimitDelete

type UserResourceLimitDelete struct {
	// contains filtered or unexported fields
}

UserResourceLimitDelete is the builder for deleting a UserResourceLimit entity.

func (*UserResourceLimitDelete) Exec

func (_d *UserResourceLimitDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserResourceLimitDelete) ExecX

func (_d *UserResourceLimitDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserResourceLimitDelete) Where

Where appends a list predicates to the UserResourceLimitDelete builder.

type UserResourceLimitDeleteOne

type UserResourceLimitDeleteOne struct {
	// contains filtered or unexported fields
}

UserResourceLimitDeleteOne is the builder for deleting a single UserResourceLimit entity.

func (*UserResourceLimitDeleteOne) Exec

Exec executes the deletion query.

func (*UserResourceLimitDeleteOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*UserResourceLimitDeleteOne) Where

Where appends a list predicates to the UserResourceLimitDelete builder.

type UserResourceLimitGroupBy

type UserResourceLimitGroupBy struct {
	// contains filtered or unexported fields
}

UserResourceLimitGroupBy is the group-by builder for UserResourceLimit entities.

func (*UserResourceLimitGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*UserResourceLimitGroupBy) Bool

func (s *UserResourceLimitGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) BoolX

func (s *UserResourceLimitGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserResourceLimitGroupBy) Bools

func (s *UserResourceLimitGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) BoolsX

func (s *UserResourceLimitGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserResourceLimitGroupBy) Float64

func (s *UserResourceLimitGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) Float64X

func (s *UserResourceLimitGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserResourceLimitGroupBy) Float64s

func (s *UserResourceLimitGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) Float64sX

func (s *UserResourceLimitGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserResourceLimitGroupBy) Int

func (s *UserResourceLimitGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) IntX

func (s *UserResourceLimitGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserResourceLimitGroupBy) Ints

func (s *UserResourceLimitGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) IntsX

func (s *UserResourceLimitGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserResourceLimitGroupBy) Scan

Scan applies the selector query and scans the result into the given value.

func (*UserResourceLimitGroupBy) ScanX

func (s *UserResourceLimitGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserResourceLimitGroupBy) String

func (s *UserResourceLimitGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) StringX

func (s *UserResourceLimitGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserResourceLimitGroupBy) Strings

func (s *UserResourceLimitGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitGroupBy) StringsX

func (s *UserResourceLimitGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserResourceLimitMutation

type UserResourceLimitMutation struct {
	// contains filtered or unexported fields
}

UserResourceLimitMutation represents an operation that mutates the UserResourceLimit nodes in the graph.

func (*UserResourceLimitMutation) AddField

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) AddMaxCPU

func (m *UserResourceLimitMutation) AddMaxCPU(i int32)

AddMaxCPU adds i to the "max_cpu" field.

func (*UserResourceLimitMutation) AddMaxMemory

func (m *UserResourceLimitMutation) AddMaxMemory(i int32)

AddMaxMemory adds i to the "max_memory" field.

func (*UserResourceLimitMutation) AddMaxNetworkMapping

func (m *UserResourceLimitMutation) AddMaxNetworkMapping(i int32)

AddMaxNetworkMapping adds i to the "max_network_mapping" field.

func (*UserResourceLimitMutation) AddedEdges

func (m *UserResourceLimitMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserResourceLimitMutation) AddedField

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) AddedFields

func (m *UserResourceLimitMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserResourceLimitMutation) AddedIDs

func (m *UserResourceLimitMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserResourceLimitMutation) AddedMaxCPU

func (m *UserResourceLimitMutation) AddedMaxCPU() (r int32, exists bool)

AddedMaxCPU returns the value that was added to the "max_cpu" field in this mutation.

func (*UserResourceLimitMutation) AddedMaxMemory

func (m *UserResourceLimitMutation) AddedMaxMemory() (r int32, exists bool)

AddedMaxMemory returns the value that was added to the "max_memory" field in this mutation.

func (*UserResourceLimitMutation) AddedMaxNetworkMapping

func (m *UserResourceLimitMutation) AddedMaxNetworkMapping() (r int32, exists bool)

AddedMaxNetworkMapping returns the value that was added to the "max_network_mapping" field in this mutation.

func (*UserResourceLimitMutation) ClearEdge

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) ClearField

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) ClearedEdges

func (m *UserResourceLimitMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserResourceLimitMutation) ClearedFields

func (m *UserResourceLimitMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserResourceLimitMutation) Client

func (m UserResourceLimitMutation) 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 (*UserResourceLimitMutation) EdgeCleared

func (m *UserResourceLimitMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserResourceLimitMutation) Field

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) FieldCleared

func (m *UserResourceLimitMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserResourceLimitMutation) Fields

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) FkUserID

func (m *UserResourceLimitMutation) FkUserID() (r uuid.UUID, exists bool)

FkUserID returns the value of the "fk_user_id" field in the mutation.

func (*UserResourceLimitMutation) ID

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) 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 (*UserResourceLimitMutation) MaxCPU

func (m *UserResourceLimitMutation) MaxCPU() (r int32, exists bool)

MaxCPU returns the value of the "max_cpu" field in the mutation.

func (*UserResourceLimitMutation) MaxMemory

func (m *UserResourceLimitMutation) MaxMemory() (r int32, exists bool)

MaxMemory returns the value of the "max_memory" field in the mutation.

func (*UserResourceLimitMutation) MaxNetworkMapping

func (m *UserResourceLimitMutation) MaxNetworkMapping() (r int32, exists bool)

MaxNetworkMapping returns the value of the "max_network_mapping" field in the mutation.

func (*UserResourceLimitMutation) OldField

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) OldFkUserID

func (m *UserResourceLimitMutation) OldFkUserID(ctx context.Context) (v uuid.UUID, err error)

OldFkUserID returns the old "fk_user_id" field's value of the UserResourceLimit entity. If the UserResourceLimit 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 (*UserResourceLimitMutation) OldMaxCPU

func (m *UserResourceLimitMutation) OldMaxCPU(ctx context.Context) (v int32, err error)

OldMaxCPU returns the old "max_cpu" field's value of the UserResourceLimit entity. If the UserResourceLimit 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 (*UserResourceLimitMutation) OldMaxMemory

func (m *UserResourceLimitMutation) OldMaxMemory(ctx context.Context) (v int32, err error)

OldMaxMemory returns the old "max_memory" field's value of the UserResourceLimit entity. If the UserResourceLimit 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 (*UserResourceLimitMutation) OldMaxNetworkMapping

func (m *UserResourceLimitMutation) OldMaxNetworkMapping(ctx context.Context) (v int32, err error)

OldMaxNetworkMapping returns the old "max_network_mapping" field's value of the UserResourceLimit entity. If the UserResourceLimit 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 (*UserResourceLimitMutation) Op

func (m *UserResourceLimitMutation) Op() Op

Op returns the operation name.

func (*UserResourceLimitMutation) RemovedEdges

func (m *UserResourceLimitMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserResourceLimitMutation) RemovedIDs

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) ResetEdge

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) ResetField

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) ResetFkUserID

func (m *UserResourceLimitMutation) ResetFkUserID()

ResetFkUserID resets all changes to the "fk_user_id" field.

func (*UserResourceLimitMutation) ResetMaxCPU

func (m *UserResourceLimitMutation) ResetMaxCPU()

ResetMaxCPU resets all changes to the "max_cpu" field.

func (*UserResourceLimitMutation) ResetMaxMemory

func (m *UserResourceLimitMutation) ResetMaxMemory()

ResetMaxMemory resets all changes to the "max_memory" field.

func (*UserResourceLimitMutation) ResetMaxNetworkMapping

func (m *UserResourceLimitMutation) ResetMaxNetworkMapping()

ResetMaxNetworkMapping resets all changes to the "max_network_mapping" field.

func (*UserResourceLimitMutation) SetField

func (m *UserResourceLimitMutation) 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 (*UserResourceLimitMutation) SetFkUserID

func (m *UserResourceLimitMutation) SetFkUserID(u uuid.UUID)

SetFkUserID sets the "fk_user_id" field.

func (*UserResourceLimitMutation) SetID

func (m *UserResourceLimitMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of UserResourceLimit entities.

func (*UserResourceLimitMutation) SetMaxCPU

func (m *UserResourceLimitMutation) SetMaxCPU(i int32)

SetMaxCPU sets the "max_cpu" field.

func (*UserResourceLimitMutation) SetMaxMemory

func (m *UserResourceLimitMutation) SetMaxMemory(i int32)

SetMaxMemory sets the "max_memory" field.

func (*UserResourceLimitMutation) SetMaxNetworkMapping

func (m *UserResourceLimitMutation) SetMaxNetworkMapping(i int32)

SetMaxNetworkMapping sets the "max_network_mapping" field.

func (*UserResourceLimitMutation) SetOp

func (m *UserResourceLimitMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (UserResourceLimitMutation) Tx

func (m UserResourceLimitMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserResourceLimitMutation) Type

Type returns the node type of this mutation (UserResourceLimit).

func (*UserResourceLimitMutation) Where

Where appends a list predicates to the UserResourceLimitMutation builder.

func (*UserResourceLimitMutation) WhereP

func (m *UserResourceLimitMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserResourceLimitMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserResourceLimitQuery

type UserResourceLimitQuery struct {
	// contains filtered or unexported fields
}

UserResourceLimitQuery is the builder for querying UserResourceLimit entities.

func (*UserResourceLimitQuery) Aggregate

Aggregate returns a UserResourceLimitSelect configured with the given aggregations.

func (*UserResourceLimitQuery) All

All executes the query and returns a list of UserResourceLimits.

func (*UserResourceLimitQuery) AllX

AllX is like All, but panics if an error occurs.

func (*UserResourceLimitQuery) Clone

Clone returns a duplicate of the UserResourceLimitQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserResourceLimitQuery) Count

func (_q *UserResourceLimitQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserResourceLimitQuery) CountX

func (_q *UserResourceLimitQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserResourceLimitQuery) Exist

func (_q *UserResourceLimitQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserResourceLimitQuery) ExistX

func (_q *UserResourceLimitQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserResourceLimitQuery) First

First returns the first UserResourceLimit entity from the query. Returns a *NotFoundError when no UserResourceLimit was found.

func (*UserResourceLimitQuery) FirstID

func (_q *UserResourceLimitQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first UserResourceLimit ID from the query. Returns a *NotFoundError when no UserResourceLimit ID was found.

func (*UserResourceLimitQuery) FirstIDX

func (_q *UserResourceLimitQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserResourceLimitQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*UserResourceLimitQuery) GroupBy

func (_q *UserResourceLimitQuery) GroupBy(field string, fields ...string) *UserResourceLimitGroupBy

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserResourceLimit.Query().
	GroupBy(userresourcelimit.FieldFkUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserResourceLimitQuery) IDs

func (_q *UserResourceLimitQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of UserResourceLimit IDs.

func (*UserResourceLimitQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*UserResourceLimitQuery) Limit

Limit the number of records to be returned by this query.

func (*UserResourceLimitQuery) Offset

Offset to start from.

func (*UserResourceLimitQuery) Only

Only returns a single UserResourceLimit entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserResourceLimit entity is found. Returns a *NotFoundError when no UserResourceLimit entities are found.

func (*UserResourceLimitQuery) OnlyID

func (_q *UserResourceLimitQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only UserResourceLimit ID in the query. Returns a *NotSingularError when more than one UserResourceLimit ID is found. Returns a *NotFoundError when no entities are found.

func (*UserResourceLimitQuery) OnlyIDX

func (_q *UserResourceLimitQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserResourceLimitQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*UserResourceLimitQuery) Order

Order specifies how the records should be ordered.

func (*UserResourceLimitQuery) Select

func (_q *UserResourceLimitQuery) Select(fields ...string) *UserResourceLimitSelect

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 {
	FkUserID uuid.UUID `json:"fk_user_id,omitempty"`
}

client.UserResourceLimit.Query().
	Select(userresourcelimit.FieldFkUserID).
	Scan(ctx, &v)

func (*UserResourceLimitQuery) Unique

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 (*UserResourceLimitQuery) Where

Where adds a new predicate for the UserResourceLimitQuery builder.

type UserResourceLimitSelect

type UserResourceLimitSelect struct {
	*UserResourceLimitQuery
	// contains filtered or unexported fields
}

UserResourceLimitSelect is the builder for selecting fields of UserResourceLimit entities.

func (*UserResourceLimitSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*UserResourceLimitSelect) Bool

func (s *UserResourceLimitSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) BoolX

func (s *UserResourceLimitSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserResourceLimitSelect) Bools

func (s *UserResourceLimitSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) BoolsX

func (s *UserResourceLimitSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserResourceLimitSelect) Float64

func (s *UserResourceLimitSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) Float64X

func (s *UserResourceLimitSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserResourceLimitSelect) Float64s

func (s *UserResourceLimitSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) Float64sX

func (s *UserResourceLimitSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserResourceLimitSelect) Int

func (s *UserResourceLimitSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) IntX

func (s *UserResourceLimitSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserResourceLimitSelect) Ints

func (s *UserResourceLimitSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) IntsX

func (s *UserResourceLimitSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserResourceLimitSelect) Scan

func (_s *UserResourceLimitSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserResourceLimitSelect) ScanX

func (s *UserResourceLimitSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserResourceLimitSelect) String

func (s *UserResourceLimitSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) StringX

func (s *UserResourceLimitSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserResourceLimitSelect) Strings

func (s *UserResourceLimitSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserResourceLimitSelect) StringsX

func (s *UserResourceLimitSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserResourceLimitUpdate

type UserResourceLimitUpdate struct {
	// contains filtered or unexported fields
}

UserResourceLimitUpdate is the builder for updating UserResourceLimit entities.

func (*UserResourceLimitUpdate) AddMaxCPU

AddMaxCPU adds value to the "max_cpu" field.

func (*UserResourceLimitUpdate) AddMaxMemory

AddMaxMemory adds value to the "max_memory" field.

func (*UserResourceLimitUpdate) AddMaxNetworkMapping

func (_u *UserResourceLimitUpdate) AddMaxNetworkMapping(v int32) *UserResourceLimitUpdate

AddMaxNetworkMapping adds value to the "max_network_mapping" field.

func (*UserResourceLimitUpdate) Exec

Exec executes the query.

func (*UserResourceLimitUpdate) ExecX

func (_u *UserResourceLimitUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserResourceLimitUpdate) Mutation

Mutation returns the UserResourceLimitMutation object of the builder.

func (*UserResourceLimitUpdate) Save

func (_u *UserResourceLimitUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserResourceLimitUpdate) SaveX

func (_u *UserResourceLimitUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserResourceLimitUpdate) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*UserResourceLimitUpdate) SetMaxCPU

SetMaxCPU sets the "max_cpu" field.

func (*UserResourceLimitUpdate) SetMaxMemory

SetMaxMemory sets the "max_memory" field.

func (*UserResourceLimitUpdate) SetMaxNetworkMapping

func (_u *UserResourceLimitUpdate) SetMaxNetworkMapping(v int32) *UserResourceLimitUpdate

SetMaxNetworkMapping sets the "max_network_mapping" field.

func (*UserResourceLimitUpdate) SetNillableFkUserID

func (_u *UserResourceLimitUpdate) SetNillableFkUserID(v *uuid.UUID) *UserResourceLimitUpdate

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*UserResourceLimitUpdate) SetNillableMaxCPU

func (_u *UserResourceLimitUpdate) SetNillableMaxCPU(v *int32) *UserResourceLimitUpdate

SetNillableMaxCPU sets the "max_cpu" field if the given value is not nil.

func (*UserResourceLimitUpdate) SetNillableMaxMemory

func (_u *UserResourceLimitUpdate) SetNillableMaxMemory(v *int32) *UserResourceLimitUpdate

SetNillableMaxMemory sets the "max_memory" field if the given value is not nil.

func (*UserResourceLimitUpdate) SetNillableMaxNetworkMapping

func (_u *UserResourceLimitUpdate) SetNillableMaxNetworkMapping(v *int32) *UserResourceLimitUpdate

SetNillableMaxNetworkMapping sets the "max_network_mapping" field if the given value is not nil.

func (*UserResourceLimitUpdate) Where

Where appends a list predicates to the UserResourceLimitUpdate builder.

type UserResourceLimitUpdateOne

type UserResourceLimitUpdateOne struct {
	// contains filtered or unexported fields
}

UserResourceLimitUpdateOne is the builder for updating a single UserResourceLimit entity.

func (*UserResourceLimitUpdateOne) AddMaxCPU

AddMaxCPU adds value to the "max_cpu" field.

func (*UserResourceLimitUpdateOne) AddMaxMemory

AddMaxMemory adds value to the "max_memory" field.

func (*UserResourceLimitUpdateOne) AddMaxNetworkMapping

func (_u *UserResourceLimitUpdateOne) AddMaxNetworkMapping(v int32) *UserResourceLimitUpdateOne

AddMaxNetworkMapping adds value to the "max_network_mapping" field.

func (*UserResourceLimitUpdateOne) Exec

Exec executes the query on the entity.

func (*UserResourceLimitUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*UserResourceLimitUpdateOne) Mutation

Mutation returns the UserResourceLimitMutation object of the builder.

func (*UserResourceLimitUpdateOne) Save

Save executes the query and returns the updated UserResourceLimit entity.

func (*UserResourceLimitUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*UserResourceLimitUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserResourceLimitUpdateOne) SetFkUserID

SetFkUserID sets the "fk_user_id" field.

func (*UserResourceLimitUpdateOne) SetMaxCPU

SetMaxCPU sets the "max_cpu" field.

func (*UserResourceLimitUpdateOne) SetMaxMemory

SetMaxMemory sets the "max_memory" field.

func (*UserResourceLimitUpdateOne) SetMaxNetworkMapping

func (_u *UserResourceLimitUpdateOne) SetMaxNetworkMapping(v int32) *UserResourceLimitUpdateOne

SetMaxNetworkMapping sets the "max_network_mapping" field.

func (*UserResourceLimitUpdateOne) SetNillableFkUserID

func (_u *UserResourceLimitUpdateOne) SetNillableFkUserID(v *uuid.UUID) *UserResourceLimitUpdateOne

SetNillableFkUserID sets the "fk_user_id" field if the given value is not nil.

func (*UserResourceLimitUpdateOne) SetNillableMaxCPU

func (_u *UserResourceLimitUpdateOne) SetNillableMaxCPU(v *int32) *UserResourceLimitUpdateOne

SetNillableMaxCPU sets the "max_cpu" field if the given value is not nil.

func (*UserResourceLimitUpdateOne) SetNillableMaxMemory

func (_u *UserResourceLimitUpdateOne) SetNillableMaxMemory(v *int32) *UserResourceLimitUpdateOne

SetNillableMaxMemory sets the "max_memory" field if the given value is not nil.

func (*UserResourceLimitUpdateOne) SetNillableMaxNetworkMapping

func (_u *UserResourceLimitUpdateOne) SetNillableMaxNetworkMapping(v *int32) *UserResourceLimitUpdateOne

SetNillableMaxNetworkMapping sets the "max_network_mapping" field if the given value is not nil.

func (*UserResourceLimitUpdateOne) Where

Where appends a list predicates to the UserResourceLimitUpdate builder.

type UserResourceLimits

type UserResourceLimits []*UserResourceLimit

UserResourceLimits is a parsable slice of UserResourceLimit.

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 (_s *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 (_s *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 (_u *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (_u *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (_u *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save

func (_u *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 (_u *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetCountryCallCoding

func (_u *UserUpdate) SetCountryCallCoding(v string) *UserUpdate

SetCountryCallCoding sets the "country_call_coding" field.

func (*UserUpdate) SetCreateDate

func (_u *UserUpdate) SetCreateDate(v time.Time) *UserUpdate

SetCreateDate sets the "create_date" field.

func (*UserUpdate) SetIcon

func (_u *UserUpdate) SetIcon(v string) *UserUpdate

SetIcon sets the "icon" field.

func (*UserUpdate) SetLastLoginDate

func (_u *UserUpdate) SetLastLoginDate(v time.Time) *UserUpdate

SetLastLoginDate sets the "last_login_date" field.

func (*UserUpdate) SetName

func (_u *UserUpdate) SetName(v string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableCountryCallCoding

func (_u *UserUpdate) SetNillableCountryCallCoding(v *string) *UserUpdate

SetNillableCountryCallCoding sets the "country_call_coding" field if the given value is not nil.

func (*UserUpdate) SetNillableCreateDate

func (_u *UserUpdate) SetNillableCreateDate(v *time.Time) *UserUpdate

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserUpdate) SetNillableIcon

func (_u *UserUpdate) SetNillableIcon(v *string) *UserUpdate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*UserUpdate) SetNillableLastLoginDate

func (_u *UserUpdate) SetNillableLastLoginDate(v *time.Time) *UserUpdate

SetNillableLastLoginDate sets the "last_login_date" field if the given value is not nil.

func (*UserUpdate) SetNillableName

func (_u *UserUpdate) SetNillableName(v *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (_u *UserUpdate) SetNillablePassword(v *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillablePwdConfig

func (_u *UserUpdate) SetNillablePwdConfig(v *bool) *UserUpdate

SetNillablePwdConfig sets the "pwd_config" field if the given value is not nil.

func (*UserUpdate) SetNillableTelephoneNumber

func (_u *UserUpdate) SetNillableTelephoneNumber(v *string) *UserUpdate

SetNillableTelephoneNumber sets the "telephone_number" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (_u *UserUpdate) SetNillableUsername(v *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (_u *UserUpdate) SetPassword(v string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetPwdConfig

func (_u *UserUpdate) SetPwdConfig(v bool) *UserUpdate

SetPwdConfig sets the "pwd_config" field.

func (*UserUpdate) SetTelephoneNumber

func (_u *UserUpdate) SetTelephoneNumber(v string) *UserUpdate

SetTelephoneNumber sets the "telephone_number" field.

func (*UserUpdate) SetUsername

func (_u *UserUpdate) SetUsername(v string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (_u *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 (_u *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (_u *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (_u *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save

func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (_u *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (_u *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 (_u *UserUpdateOne) SetCountryCallCoding(v string) *UserUpdateOne

SetCountryCallCoding sets the "country_call_coding" field.

func (*UserUpdateOne) SetCreateDate

func (_u *UserUpdateOne) SetCreateDate(v time.Time) *UserUpdateOne

SetCreateDate sets the "create_date" field.

func (*UserUpdateOne) SetIcon

func (_u *UserUpdateOne) SetIcon(v string) *UserUpdateOne

SetIcon sets the "icon" field.

func (*UserUpdateOne) SetLastLoginDate

func (_u *UserUpdateOne) SetLastLoginDate(v time.Time) *UserUpdateOne

SetLastLoginDate sets the "last_login_date" field.

func (*UserUpdateOne) SetName

func (_u *UserUpdateOne) SetName(v string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableCountryCallCoding

func (_u *UserUpdateOne) SetNillableCountryCallCoding(v *string) *UserUpdateOne

SetNillableCountryCallCoding sets the "country_call_coding" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCreateDate

func (_u *UserUpdateOne) SetNillableCreateDate(v *time.Time) *UserUpdateOne

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIcon

func (_u *UserUpdateOne) SetNillableIcon(v *string) *UserUpdateOne

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastLoginDate

func (_u *UserUpdateOne) SetNillableLastLoginDate(v *time.Time) *UserUpdateOne

SetNillableLastLoginDate sets the "last_login_date" field if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (_u *UserUpdateOne) SetNillableName(v *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (_u *UserUpdateOne) SetNillablePassword(v *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePwdConfig

func (_u *UserUpdateOne) SetNillablePwdConfig(v *bool) *UserUpdateOne

SetNillablePwdConfig sets the "pwd_config" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTelephoneNumber

func (_u *UserUpdateOne) SetNillableTelephoneNumber(v *string) *UserUpdateOne

SetNillableTelephoneNumber sets the "telephone_number" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (_u *UserUpdateOne) SetNillableUsername(v *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (_u *UserUpdateOne) SetPassword(v string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetPwdConfig

func (_u *UserUpdateOne) SetPwdConfig(v bool) *UserUpdateOne

SetPwdConfig sets the "pwd_config" field.

func (*UserUpdateOne) SetTelephoneNumber

func (_u *UserUpdateOne) SetTelephoneNumber(v string) *UserUpdateOne

SetTelephoneNumber sets the "telephone_number" field.

func (*UserUpdateOne) SetUsername

func (_u *UserUpdateOne) SetUsername(v string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (_u *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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL