ent

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeTask    = "Task"
	TypeTaskLog = "TaskLog"
)

Variables

View Source
var DefaultTaskLogOrder = Desc(tasklog.FieldID)

DefaultTaskLogOrder is the default ordering of TaskLog.

View Source
var DefaultTaskOrder = Desc(task.FieldID)

DefaultTaskOrder is the default ordering of Task.

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// TaskLog is the client for interacting with the TaskLog builders.
	TaskLog *TaskLogClient
	// 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().
	Task.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type 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 OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

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 PageDetails

type PageDetails struct {
	Page  uint64 `json:"page"`
	Size  uint64 `json:"size"`
	Total uint64 `json:"total"`
}

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type Task

type Task struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Task Name | 任务名称
	Name string `json:"name,omitempty"`
	// Task Group | 任务分组
	TaskGroup string `json:"task_group,omitempty"`
	// Cron expression | 定时任务表达式
	CronExpression string `json:"cron_expression,omitempty"`
	// Cron Pattern | 任务的模式 (用于区分和确定要执行的任务)
	Pattern string `json:"pattern,omitempty"`
	// The data used in cron (JSON string) | 任务需要的数据(JSON 字符串)
	Payload string `json:"payload,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskQuery when eager-loading is set.
	Edges TaskEdges `json:"edges"`
	// contains filtered or unexported fields
}

Task is the model entity for the Task schema.

func (*Task) ExecContext

func (c *Task) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Task) QueryContext

func (c *Task) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Task) QueryTaskLogs

func (t *Task) QueryTaskLogs() *TaskLogQuery

QueryTaskLogs queries the "task_logs" edge of the Task entity.

func (*Task) String

func (t *Task) String() string

String implements the fmt.Stringer.

func (*Task) Unwrap

func (t *Task) Unwrap() *Task

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

func (*Task) Update

func (t *Task) Update() *TaskUpdateOne

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

func (*Task) Value

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

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

type TaskClient

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

TaskClient is a client for the Task schema.

func NewTaskClient

func NewTaskClient(c config) *TaskClient

NewTaskClient returns a client for the Task from the given config.

func (*TaskClient) Create

func (c *TaskClient) Create() *TaskCreate

Create returns a builder for creating a Task entity.

func (*TaskClient) CreateBulk

func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk

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

func (*TaskClient) Delete

func (c *TaskClient) Delete() *TaskDelete

Delete returns a delete builder for Task.

func (*TaskClient) DeleteOne

func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TaskClient) DeleteOneID

func (c *TaskClient) DeleteOneID(id uint64) *TaskDeleteOne

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

func (*TaskClient) ExecContext

func (c *TaskClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskClient) Get

func (c *TaskClient) Get(ctx context.Context, id uint64) (*Task, error)

Get returns a Task entity by its id.

func (*TaskClient) GetX

func (c *TaskClient) GetX(ctx context.Context, id uint64) *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) QueryContext

func (c *TaskClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskClient) QueryTaskLogs

func (c *TaskClient) QueryTaskLogs(t *Task) *TaskLogQuery

QueryTaskLogs queries the task_logs edge of a Task.

func (*TaskClient) Update

func (c *TaskClient) Update() *TaskUpdate

Update returns an update builder for Task.

func (*TaskClient) UpdateOne

func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskClient) UpdateOneID

func (c *TaskClient) UpdateOneID(id uint64) *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) AddTaskLogIDs

func (tc *TaskCreate) AddTaskLogIDs(ids ...uint64) *TaskCreate

AddTaskLogIDs adds the "task_logs" edge to the TaskLog entity by IDs.

func (*TaskCreate) AddTaskLogs

func (tc *TaskCreate) AddTaskLogs(t ...*TaskLog) *TaskCreate

AddTaskLogs adds the "task_logs" edges to the TaskLog entity.

func (*TaskCreate) Exec

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

Exec executes the query.

func (*TaskCreate) ExecContext

func (c *TaskCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskCreate) ExecX

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

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

func (*TaskCreate) Mutation

func (tc *TaskCreate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskCreate) QueryContext

func (c *TaskCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskCreate) Save

func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)

Save creates the Task in the database.

func (*TaskCreate) SaveX

func (tc *TaskCreate) SaveX(ctx context.Context) *Task

SaveX calls Save and panics if Save returns an error.

func (*TaskCreate) SetCreatedAt

func (tc *TaskCreate) SetCreatedAt(t time.Time) *TaskCreate

SetCreatedAt sets the "created_at" field.

func (*TaskCreate) SetCronExpression

func (tc *TaskCreate) SetCronExpression(s string) *TaskCreate

SetCronExpression sets the "cron_expression" field.

func (*TaskCreate) SetID

func (tc *TaskCreate) SetID(u uint64) *TaskCreate

SetID sets the "id" field.

func (*TaskCreate) SetName

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

SetName sets the "name" field.

func (*TaskCreate) SetNillableCreatedAt

func (tc *TaskCreate) SetNillableCreatedAt(t *time.Time) *TaskCreate

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

func (*TaskCreate) SetNillableStatus

func (tc *TaskCreate) SetNillableStatus(u *uint8) *TaskCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TaskCreate) SetNillableUpdatedAt

func (tc *TaskCreate) SetNillableUpdatedAt(t *time.Time) *TaskCreate

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

func (*TaskCreate) SetNotNilCronExpression

func (t *TaskCreate) SetNotNilCronExpression(value *string) *TaskCreate

set field if value's pointer is not nil.

func (*TaskCreate) SetNotNilName

func (t *TaskCreate) SetNotNilName(value *string) *TaskCreate

set field if value's pointer is not nil.

func (*TaskCreate) SetNotNilPattern

func (t *TaskCreate) SetNotNilPattern(value *string) *TaskCreate

set field if value's pointer is not nil.

func (*TaskCreate) SetNotNilPayload

func (t *TaskCreate) SetNotNilPayload(value *string) *TaskCreate

set field if value's pointer is not nil.

func (*TaskCreate) SetNotNilStatus

func (t *TaskCreate) SetNotNilStatus(value *uint8) *TaskCreate

set field if value's pointer is not nil.

func (*TaskCreate) SetNotNilTaskGroup

func (t *TaskCreate) SetNotNilTaskGroup(value *string) *TaskCreate

set field if value's pointer is not nil.

func (*TaskCreate) SetNotNilUpdatedAt

func (t *TaskCreate) SetNotNilUpdatedAt(value *time.Time) *TaskCreate

set field if value's pointer is not nil.

func (*TaskCreate) SetPattern

func (tc *TaskCreate) SetPattern(s string) *TaskCreate

SetPattern sets the "pattern" field.

func (*TaskCreate) SetPayload

func (tc *TaskCreate) SetPayload(s string) *TaskCreate

SetPayload sets the "payload" field.

func (*TaskCreate) SetStatus

func (tc *TaskCreate) SetStatus(u uint8) *TaskCreate

SetStatus sets the "status" field.

func (*TaskCreate) SetTaskGroup

func (tc *TaskCreate) SetTaskGroup(s string) *TaskCreate

SetTaskGroup sets the "task_group" field.

func (*TaskCreate) SetUpdatedAt

func (tc *TaskCreate) SetUpdatedAt(t time.Time) *TaskCreate

SetUpdatedAt sets the "updated_at" field.

type TaskCreateBulk

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

TaskCreateBulk is the builder for creating many Task entities in bulk.

func (*TaskCreateBulk) Exec

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

Exec executes the query.

func (*TaskCreateBulk) ExecContext

func (c *TaskCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskCreateBulk) ExecX

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

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

func (*TaskCreateBulk) QueryContext

func (c *TaskCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskCreateBulk) Save

func (tcb *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error)

Save creates the Task entities in the database.

func (*TaskCreateBulk) SaveX

func (tcb *TaskCreateBulk) SaveX(ctx context.Context) []*Task

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

type TaskDelete

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

TaskDelete is the builder for deleting a Task entity.

func (*TaskDelete) Exec

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

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

func (*TaskDelete) ExecContext

func (c *TaskDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskDelete) ExecX

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

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

func (*TaskDelete) QueryContext

func (c *TaskDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskDelete) Where

func (td *TaskDelete) Where(ps ...predicate.Task) *TaskDelete

Where appends a list predicates to the TaskDelete builder.

type TaskDeleteOne

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

TaskDeleteOne is the builder for deleting a single Task entity.

func (*TaskDeleteOne) Exec

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

Exec executes the deletion query.

func (*TaskDeleteOne) ExecX

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

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

func (*TaskDeleteOne) Where

func (tdo *TaskDeleteOne) Where(ps ...predicate.Task) *TaskDeleteOne

Where appends a list predicates to the TaskDelete builder.

type TaskEdges

type TaskEdges struct {
	// TaskLogs holds the value of the task_logs edge.
	TaskLogs []*TaskLog `json:"task_logs,omitempty"`
	// contains filtered or unexported fields
}

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

func (TaskEdges) TaskLogsOrErr

func (e TaskEdges) TaskLogsOrErr() ([]*TaskLog, error)

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

type TaskGroupBy

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

TaskGroupBy is the group-by builder for Task entities.

func (*TaskGroupBy) Aggregate

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

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

func (*TaskGroupBy) Bool

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

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

func (*TaskGroupBy) BoolX

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

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

func (*TaskGroupBy) Bools

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

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

func (*TaskGroupBy) BoolsX

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

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

func (*TaskGroupBy) Float64

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

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

func (*TaskGroupBy) Float64X

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

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

func (*TaskGroupBy) Float64s

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

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

func (*TaskGroupBy) Float64sX

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

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

func (*TaskGroupBy) Int

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

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

func (*TaskGroupBy) IntX

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

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

func (*TaskGroupBy) Ints

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

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

func (*TaskGroupBy) IntsX

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

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

func (*TaskGroupBy) Scan

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

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

func (*TaskGroupBy) ScanX

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

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

func (*TaskGroupBy) String

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

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

func (*TaskGroupBy) StringX

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

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

func (*TaskGroupBy) Strings

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

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

func (*TaskGroupBy) StringsX

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

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

type TaskLog

type TaskLog struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Task Started Time | 任务启动时间
	StartedAt time.Time `json:"started_at,omitempty"`
	// Task Finished Time | 任务完成时间
	FinishedAt time.Time `json:"finished_at,omitempty"`
	// The Task Process Result | 任务执行结果
	Result uint8 `json:"result,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskLogQuery when eager-loading is set.
	Edges TaskLogEdges `json:"edges"`
	// contains filtered or unexported fields
}

TaskLog is the model entity for the TaskLog schema.

func (*TaskLog) ExecContext

func (c *TaskLog) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLog) QueryContext

func (c *TaskLog) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLog) QueryTasks

func (tl *TaskLog) QueryTasks() *TaskQuery

QueryTasks queries the "tasks" edge of the TaskLog entity.

func (*TaskLog) String

func (tl *TaskLog) String() string

String implements the fmt.Stringer.

func (*TaskLog) Unwrap

func (tl *TaskLog) Unwrap() *TaskLog

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

func (tl *TaskLog) Update() *TaskLogUpdateOne

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

func (*TaskLog) Value

func (tl *TaskLog) Value(name string) (ent.Value, error)

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

type TaskLogClient

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

TaskLogClient is a client for the TaskLog schema.

func NewTaskLogClient

func NewTaskLogClient(c config) *TaskLogClient

NewTaskLogClient returns a client for the TaskLog from the given config.

func (*TaskLogClient) Create

func (c *TaskLogClient) Create() *TaskLogCreate

Create returns a builder for creating a TaskLog entity.

func (*TaskLogClient) CreateBulk

func (c *TaskLogClient) CreateBulk(builders ...*TaskLogCreate) *TaskLogCreateBulk

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

func (*TaskLogClient) Delete

func (c *TaskLogClient) Delete() *TaskLogDelete

Delete returns a delete builder for TaskLog.

func (*TaskLogClient) DeleteOne

func (c *TaskLogClient) DeleteOne(tl *TaskLog) *TaskLogDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TaskLogClient) DeleteOneID

func (c *TaskLogClient) DeleteOneID(id uint64) *TaskLogDeleteOne

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

func (*TaskLogClient) ExecContext

func (c *TaskLogClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogClient) Get

func (c *TaskLogClient) Get(ctx context.Context, id uint64) (*TaskLog, error)

Get returns a TaskLog entity by its id.

func (*TaskLogClient) GetX

func (c *TaskLogClient) GetX(ctx context.Context, id uint64) *TaskLog

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

func (*TaskLogClient) Hooks

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

Hooks returns the client hooks.

func (*TaskLogClient) Intercept

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

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

func (*TaskLogClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TaskLogClient) MapCreateBulk

func (c *TaskLogClient) MapCreateBulk(slice any, setFunc func(*TaskLogCreate, int)) *TaskLogCreateBulk

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

func (c *TaskLogClient) Query() *TaskLogQuery

Query returns a query builder for TaskLog.

func (*TaskLogClient) QueryContext

func (c *TaskLogClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogClient) QueryTasks

func (c *TaskLogClient) QueryTasks(tl *TaskLog) *TaskQuery

QueryTasks queries the tasks edge of a TaskLog.

func (*TaskLogClient) Update

func (c *TaskLogClient) Update() *TaskLogUpdate

Update returns an update builder for TaskLog.

func (*TaskLogClient) UpdateOne

func (c *TaskLogClient) UpdateOne(tl *TaskLog) *TaskLogUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskLogClient) UpdateOneID

func (c *TaskLogClient) UpdateOneID(id uint64) *TaskLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskLogClient) Use

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

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

type TaskLogCreate

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

TaskLogCreate is the builder for creating a TaskLog entity.

func (*TaskLogCreate) Exec

func (tlc *TaskLogCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskLogCreate) ExecContext

func (c *TaskLogCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogCreate) ExecX

func (tlc *TaskLogCreate) ExecX(ctx context.Context)

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

func (*TaskLogCreate) Mutation

func (tlc *TaskLogCreate) Mutation() *TaskLogMutation

Mutation returns the TaskLogMutation object of the builder.

func (*TaskLogCreate) QueryContext

func (c *TaskLogCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogCreate) Save

func (tlc *TaskLogCreate) Save(ctx context.Context) (*TaskLog, error)

Save creates the TaskLog in the database.

func (*TaskLogCreate) SaveX

func (tlc *TaskLogCreate) SaveX(ctx context.Context) *TaskLog

SaveX calls Save and panics if Save returns an error.

func (*TaskLogCreate) SetFinishedAt

func (tlc *TaskLogCreate) SetFinishedAt(t time.Time) *TaskLogCreate

SetFinishedAt sets the "finished_at" field.

func (*TaskLogCreate) SetID

func (tlc *TaskLogCreate) SetID(u uint64) *TaskLogCreate

SetID sets the "id" field.

func (*TaskLogCreate) SetNillableStartedAt

func (tlc *TaskLogCreate) SetNillableStartedAt(t *time.Time) *TaskLogCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*TaskLogCreate) SetNillableTasksID

func (tlc *TaskLogCreate) SetNillableTasksID(id *uint64) *TaskLogCreate

SetNillableTasksID sets the "tasks" edge to the Task entity by ID if the given value is not nil.

func (*TaskLogCreate) SetNotNilFinishedAt

func (tl *TaskLogCreate) SetNotNilFinishedAt(value *time.Time) *TaskLogCreate

set field if value's pointer is not nil.

func (*TaskLogCreate) SetNotNilResult

func (tl *TaskLogCreate) SetNotNilResult(value *uint8) *TaskLogCreate

set field if value's pointer is not nil.

func (*TaskLogCreate) SetResult

func (tlc *TaskLogCreate) SetResult(u uint8) *TaskLogCreate

SetResult sets the "result" field.

func (*TaskLogCreate) SetStartedAt

func (tlc *TaskLogCreate) SetStartedAt(t time.Time) *TaskLogCreate

SetStartedAt sets the "started_at" field.

func (*TaskLogCreate) SetTasks

func (tlc *TaskLogCreate) SetTasks(t *Task) *TaskLogCreate

SetTasks sets the "tasks" edge to the Task entity.

func (*TaskLogCreate) SetTasksID

func (tlc *TaskLogCreate) SetTasksID(id uint64) *TaskLogCreate

SetTasksID sets the "tasks" edge to the Task entity by ID.

type TaskLogCreateBulk

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

TaskLogCreateBulk is the builder for creating many TaskLog entities in bulk.

func (*TaskLogCreateBulk) Exec

func (tlcb *TaskLogCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskLogCreateBulk) ExecContext

func (c *TaskLogCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogCreateBulk) ExecX

func (tlcb *TaskLogCreateBulk) ExecX(ctx context.Context)

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

func (*TaskLogCreateBulk) QueryContext

func (c *TaskLogCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogCreateBulk) Save

func (tlcb *TaskLogCreateBulk) Save(ctx context.Context) ([]*TaskLog, error)

Save creates the TaskLog entities in the database.

func (*TaskLogCreateBulk) SaveX

func (tlcb *TaskLogCreateBulk) SaveX(ctx context.Context) []*TaskLog

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

type TaskLogDelete

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

TaskLogDelete is the builder for deleting a TaskLog entity.

func (*TaskLogDelete) Exec

func (tld *TaskLogDelete) Exec(ctx context.Context) (int, error)

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

func (*TaskLogDelete) ExecContext

func (c *TaskLogDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogDelete) ExecX

func (tld *TaskLogDelete) ExecX(ctx context.Context) int

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

func (*TaskLogDelete) QueryContext

func (c *TaskLogDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogDelete) Where

func (tld *TaskLogDelete) Where(ps ...predicate.TaskLog) *TaskLogDelete

Where appends a list predicates to the TaskLogDelete builder.

type TaskLogDeleteOne

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

TaskLogDeleteOne is the builder for deleting a single TaskLog entity.

func (*TaskLogDeleteOne) Exec

func (tldo *TaskLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskLogDeleteOne) ExecX

func (tldo *TaskLogDeleteOne) ExecX(ctx context.Context)

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

func (*TaskLogDeleteOne) Where

func (tldo *TaskLogDeleteOne) Where(ps ...predicate.TaskLog) *TaskLogDeleteOne

Where appends a list predicates to the TaskLogDelete builder.

type TaskLogEdges

type TaskLogEdges struct {
	// Tasks holds the value of the tasks edge.
	Tasks *Task `json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

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

func (TaskLogEdges) TasksOrErr

func (e TaskLogEdges) TasksOrErr() (*Task, error)

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

type TaskLogGroupBy

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

TaskLogGroupBy is the group-by builder for TaskLog entities.

func (*TaskLogGroupBy) Aggregate

func (tlgb *TaskLogGroupBy) Aggregate(fns ...AggregateFunc) *TaskLogGroupBy

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

func (*TaskLogGroupBy) Bool

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

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

func (*TaskLogGroupBy) BoolX

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

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

func (*TaskLogGroupBy) Bools

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

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

func (*TaskLogGroupBy) BoolsX

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

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

func (*TaskLogGroupBy) Float64

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

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

func (*TaskLogGroupBy) Float64X

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

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

func (*TaskLogGroupBy) Float64s

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

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

func (*TaskLogGroupBy) Float64sX

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

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

func (*TaskLogGroupBy) Int

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

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

func (*TaskLogGroupBy) IntX

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

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

func (*TaskLogGroupBy) Ints

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

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

func (*TaskLogGroupBy) IntsX

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

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

func (*TaskLogGroupBy) Scan

func (tlgb *TaskLogGroupBy) Scan(ctx context.Context, v any) error

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

func (*TaskLogGroupBy) ScanX

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

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

func (*TaskLogGroupBy) String

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

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

func (*TaskLogGroupBy) StringX

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

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

func (*TaskLogGroupBy) Strings

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

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

func (*TaskLogGroupBy) StringsX

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

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

type TaskLogMutation

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

TaskLogMutation represents an operation that mutates the TaskLog nodes in the graph.

func (*TaskLogMutation) AddField

func (m *TaskLogMutation) 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 (*TaskLogMutation) AddResult

func (m *TaskLogMutation) AddResult(u int8)

AddResult adds u to the "result" field.

func (*TaskLogMutation) AddedEdges

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

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

func (*TaskLogMutation) AddedField

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

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

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

func (*TaskLogMutation) AddedIDs

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

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

func (*TaskLogMutation) AddedResult

func (m *TaskLogMutation) AddedResult() (r int8, exists bool)

AddedResult returns the value that was added to the "result" field in this mutation.

func (*TaskLogMutation) ClearEdge

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

func (m *TaskLogMutation) 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 (*TaskLogMutation) ClearTasks

func (m *TaskLogMutation) ClearTasks()

ClearTasks clears the "tasks" edge to the Task entity.

func (*TaskLogMutation) ClearedEdges

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

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

func (*TaskLogMutation) ClearedFields

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

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

func (TaskLogMutation) Client

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

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

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

func (*TaskLogMutation) ExecContext

func (c *TaskLogMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogMutation) Field

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

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

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

func (*TaskLogMutation) Fields

func (m *TaskLogMutation) 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 (*TaskLogMutation) FinishedAt

func (m *TaskLogMutation) FinishedAt() (r time.Time, exists bool)

FinishedAt returns the value of the "finished_at" field in the mutation.

func (*TaskLogMutation) ID

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

func (m *TaskLogMutation) IDs(ctx context.Context) ([]uint64, 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 (*TaskLogMutation) OldField

func (m *TaskLogMutation) 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 (*TaskLogMutation) OldFinishedAt

func (m *TaskLogMutation) OldFinishedAt(ctx context.Context) (v time.Time, err error)

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

func (*TaskLogMutation) OldResult

func (m *TaskLogMutation) OldResult(ctx context.Context) (v uint8, err error)

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

func (*TaskLogMutation) OldStartedAt

func (m *TaskLogMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

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

func (*TaskLogMutation) Op

func (m *TaskLogMutation) Op() Op

Op returns the operation name.

func (*TaskLogMutation) QueryContext

func (c *TaskLogMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogMutation) RemovedEdges

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

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

func (*TaskLogMutation) RemovedIDs

func (m *TaskLogMutation) 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 (*TaskLogMutation) ResetEdge

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

func (m *TaskLogMutation) 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 (*TaskLogMutation) ResetFinishedAt

func (m *TaskLogMutation) ResetFinishedAt()

ResetFinishedAt resets all changes to the "finished_at" field.

func (*TaskLogMutation) ResetResult

func (m *TaskLogMutation) ResetResult()

ResetResult resets all changes to the "result" field.

func (*TaskLogMutation) ResetStartedAt

func (m *TaskLogMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*TaskLogMutation) ResetTasks

func (m *TaskLogMutation) ResetTasks()

ResetTasks resets all changes to the "tasks" edge.

func (*TaskLogMutation) Result

func (m *TaskLogMutation) Result() (r uint8, exists bool)

Result returns the value of the "result" field in the mutation.

func (*TaskLogMutation) SetField

func (m *TaskLogMutation) 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 (*TaskLogMutation) SetFinishedAt

func (m *TaskLogMutation) SetFinishedAt(t time.Time)

SetFinishedAt sets the "finished_at" field.

func (*TaskLogMutation) SetID

func (m *TaskLogMutation) SetID(id uint64)

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

func (*TaskLogMutation) SetOp

func (m *TaskLogMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TaskLogMutation) SetResult

func (m *TaskLogMutation) SetResult(u uint8)

SetResult sets the "result" field.

func (*TaskLogMutation) SetStartedAt

func (m *TaskLogMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*TaskLogMutation) SetTasksID

func (m *TaskLogMutation) SetTasksID(id uint64)

SetTasksID sets the "tasks" edge to the Task entity by id.

func (*TaskLogMutation) StartedAt

func (m *TaskLogMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*TaskLogMutation) TasksCleared

func (m *TaskLogMutation) TasksCleared() bool

TasksCleared reports if the "tasks" edge to the Task entity was cleared.

func (*TaskLogMutation) TasksID

func (m *TaskLogMutation) TasksID() (id uint64, exists bool)

TasksID returns the "tasks" edge ID in the mutation.

func (*TaskLogMutation) TasksIDs

func (m *TaskLogMutation) TasksIDs() (ids []uint64)

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

func (TaskLogMutation) Tx

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

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

func (*TaskLogMutation) Type

func (m *TaskLogMutation) Type() string

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

func (*TaskLogMutation) Where

func (m *TaskLogMutation) Where(ps ...predicate.TaskLog)

Where appends a list predicates to the TaskLogMutation builder.

func (*TaskLogMutation) WhereP

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

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

type TaskLogPageList

type TaskLogPageList struct {
	List        []*TaskLog   `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

TaskLogPageList is TaskLog PageList result.

type TaskLogPager

type TaskLogPager struct {
	Order  tasklog.OrderOption
	Filter func(*TaskLogQuery) (*TaskLogQuery, error)
}

func (*TaskLogPager) ApplyFilter

func (p *TaskLogPager) ApplyFilter(query *TaskLogQuery) (*TaskLogQuery, error)

type TaskLogPaginateOption

type TaskLogPaginateOption func(*TaskLogPager)

TaskLogPaginateOption enables pagination customization.

type TaskLogQuery

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

TaskLogQuery is the builder for querying TaskLog entities.

func (*TaskLogQuery) Aggregate

func (tlq *TaskLogQuery) Aggregate(fns ...AggregateFunc) *TaskLogSelect

Aggregate returns a TaskLogSelect configured with the given aggregations.

func (*TaskLogQuery) All

func (tlq *TaskLogQuery) All(ctx context.Context) ([]*TaskLog, error)

All executes the query and returns a list of TaskLogs.

func (*TaskLogQuery) AllX

func (tlq *TaskLogQuery) AllX(ctx context.Context) []*TaskLog

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

func (*TaskLogQuery) Clone

func (tlq *TaskLogQuery) Clone() *TaskLogQuery

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

func (*TaskLogQuery) Count

func (tlq *TaskLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskLogQuery) CountX

func (tlq *TaskLogQuery) CountX(ctx context.Context) int

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

func (*TaskLogQuery) ExecContext

func (c *TaskLogQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogQuery) Exist

func (tlq *TaskLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*TaskLogQuery) ExistX

func (tlq *TaskLogQuery) ExistX(ctx context.Context) bool

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

func (*TaskLogQuery) First

func (tlq *TaskLogQuery) First(ctx context.Context) (*TaskLog, error)

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

func (*TaskLogQuery) FirstID

func (tlq *TaskLogQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*TaskLogQuery) FirstIDX

func (tlq *TaskLogQuery) FirstIDX(ctx context.Context) uint64

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

func (*TaskLogQuery) FirstX

func (tlq *TaskLogQuery) FirstX(ctx context.Context) *TaskLog

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

func (*TaskLogQuery) GroupBy

func (tlq *TaskLogQuery) GroupBy(field string, fields ...string) *TaskLogGroupBy

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

client.TaskLog.Query().
	GroupBy(tasklog.FieldStartedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskLogQuery) IDs

func (tlq *TaskLogQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*TaskLogQuery) IDsX

func (tlq *TaskLogQuery) IDsX(ctx context.Context) []uint64

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

func (*TaskLogQuery) Limit

func (tlq *TaskLogQuery) Limit(limit int) *TaskLogQuery

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

func (*TaskLogQuery) Offset

func (tlq *TaskLogQuery) Offset(offset int) *TaskLogQuery

Offset to start from.

func (*TaskLogQuery) Only

func (tlq *TaskLogQuery) Only(ctx context.Context) (*TaskLog, error)

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

func (*TaskLogQuery) OnlyID

func (tlq *TaskLogQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*TaskLogQuery) OnlyIDX

func (tlq *TaskLogQuery) OnlyIDX(ctx context.Context) uint64

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

func (*TaskLogQuery) OnlyX

func (tlq *TaskLogQuery) OnlyX(ctx context.Context) *TaskLog

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

func (*TaskLogQuery) Order

func (tlq *TaskLogQuery) Order(o ...tasklog.OrderOption) *TaskLogQuery

Order specifies how the records should be ordered.

func (*TaskLogQuery) Page

func (tl *TaskLogQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...TaskLogPaginateOption,
) (*TaskLogPageList, error)

func (*TaskLogQuery) QueryContext

func (c *TaskLogQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogQuery) QueryTasks

func (tlq *TaskLogQuery) QueryTasks() *TaskQuery

QueryTasks chains the current query on the "tasks" edge.

func (*TaskLogQuery) Select

func (tlq *TaskLogQuery) Select(fields ...string) *TaskLogSelect

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

client.TaskLog.Query().
	Select(tasklog.FieldStartedAt).
	Scan(ctx, &v)

func (*TaskLogQuery) Unique

func (tlq *TaskLogQuery) Unique(unique bool) *TaskLogQuery

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

func (tlq *TaskLogQuery) Where(ps ...predicate.TaskLog) *TaskLogQuery

Where adds a new predicate for the TaskLogQuery builder.

func (*TaskLogQuery) WithTasks

func (tlq *TaskLogQuery) WithTasks(opts ...func(*TaskQuery)) *TaskLogQuery

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

type TaskLogSelect

type TaskLogSelect struct {
	*TaskLogQuery
	// contains filtered or unexported fields
}

TaskLogSelect is the builder for selecting fields of TaskLog entities.

func (*TaskLogSelect) Aggregate

func (tls *TaskLogSelect) Aggregate(fns ...AggregateFunc) *TaskLogSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TaskLogSelect) Bool

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

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

func (*TaskLogSelect) BoolX

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

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

func (*TaskLogSelect) Bools

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

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

func (*TaskLogSelect) BoolsX

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

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

func (TaskLogSelect) ExecContext

func (c TaskLogSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogSelect) Float64

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

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

func (*TaskLogSelect) Float64X

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

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

func (*TaskLogSelect) Float64s

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

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

func (*TaskLogSelect) Float64sX

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

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

func (*TaskLogSelect) Int

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

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

func (*TaskLogSelect) IntX

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

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

func (*TaskLogSelect) Ints

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

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

func (*TaskLogSelect) IntsX

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

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

func (TaskLogSelect) QueryContext

func (c TaskLogSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogSelect) Scan

func (tls *TaskLogSelect) Scan(ctx context.Context, v any) error

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

func (*TaskLogSelect) ScanX

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

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

func (*TaskLogSelect) String

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

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

func (*TaskLogSelect) StringX

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

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

func (*TaskLogSelect) Strings

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

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

func (*TaskLogSelect) StringsX

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

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

type TaskLogUpdate

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

TaskLogUpdate is the builder for updating TaskLog entities.

func (*TaskLogUpdate) AddResult

func (tlu *TaskLogUpdate) AddResult(u int8) *TaskLogUpdate

AddResult adds u to the "result" field.

func (*TaskLogUpdate) ClearTasks

func (tlu *TaskLogUpdate) ClearTasks() *TaskLogUpdate

ClearTasks clears the "tasks" edge to the Task entity.

func (*TaskLogUpdate) Exec

func (tlu *TaskLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskLogUpdate) ExecContext

func (c *TaskLogUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogUpdate) ExecX

func (tlu *TaskLogUpdate) ExecX(ctx context.Context)

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

func (*TaskLogUpdate) Mutation

func (tlu *TaskLogUpdate) Mutation() *TaskLogMutation

Mutation returns the TaskLogMutation object of the builder.

func (*TaskLogUpdate) QueryContext

func (c *TaskLogUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogUpdate) Save

func (tlu *TaskLogUpdate) Save(ctx context.Context) (int, error)

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

func (*TaskLogUpdate) SaveX

func (tlu *TaskLogUpdate) SaveX(ctx context.Context) int

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

func (*TaskLogUpdate) SetFinishedAt

func (tlu *TaskLogUpdate) SetFinishedAt(t time.Time) *TaskLogUpdate

SetFinishedAt sets the "finished_at" field.

func (*TaskLogUpdate) SetNillableFinishedAt

func (tlu *TaskLogUpdate) SetNillableFinishedAt(t *time.Time) *TaskLogUpdate

SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.

func (*TaskLogUpdate) SetNillableResult

func (tlu *TaskLogUpdate) SetNillableResult(u *uint8) *TaskLogUpdate

SetNillableResult sets the "result" field if the given value is not nil.

func (*TaskLogUpdate) SetNillableTasksID

func (tlu *TaskLogUpdate) SetNillableTasksID(id *uint64) *TaskLogUpdate

SetNillableTasksID sets the "tasks" edge to the Task entity by ID if the given value is not nil.

func (*TaskLogUpdate) SetNotNilFinishedAt

func (tl *TaskLogUpdate) SetNotNilFinishedAt(value *time.Time) *TaskLogUpdate

set field if value's pointer is not nil.

func (*TaskLogUpdate) SetNotNilResult

func (tl *TaskLogUpdate) SetNotNilResult(value *uint8) *TaskLogUpdate

set field if value's pointer is not nil.

func (*TaskLogUpdate) SetResult

func (tlu *TaskLogUpdate) SetResult(u uint8) *TaskLogUpdate

SetResult sets the "result" field.

func (*TaskLogUpdate) SetTasks

func (tlu *TaskLogUpdate) SetTasks(t *Task) *TaskLogUpdate

SetTasks sets the "tasks" edge to the Task entity.

func (*TaskLogUpdate) SetTasksID

func (tlu *TaskLogUpdate) SetTasksID(id uint64) *TaskLogUpdate

SetTasksID sets the "tasks" edge to the Task entity by ID.

func (*TaskLogUpdate) Where

func (tlu *TaskLogUpdate) Where(ps ...predicate.TaskLog) *TaskLogUpdate

Where appends a list predicates to the TaskLogUpdate builder.

type TaskLogUpdateOne

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

TaskLogUpdateOne is the builder for updating a single TaskLog entity.

func (*TaskLogUpdateOne) AddResult

func (tluo *TaskLogUpdateOne) AddResult(u int8) *TaskLogUpdateOne

AddResult adds u to the "result" field.

func (*TaskLogUpdateOne) ClearTasks

func (tluo *TaskLogUpdateOne) ClearTasks() *TaskLogUpdateOne

ClearTasks clears the "tasks" edge to the Task entity.

func (*TaskLogUpdateOne) Exec

func (tluo *TaskLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskLogUpdateOne) ExecContext

func (c *TaskLogUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskLogUpdateOne) ExecX

func (tluo *TaskLogUpdateOne) ExecX(ctx context.Context)

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

func (*TaskLogUpdateOne) Mutation

func (tluo *TaskLogUpdateOne) Mutation() *TaskLogMutation

Mutation returns the TaskLogMutation object of the builder.

func (*TaskLogUpdateOne) QueryContext

func (c *TaskLogUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskLogUpdateOne) Save

func (tluo *TaskLogUpdateOne) Save(ctx context.Context) (*TaskLog, error)

Save executes the query and returns the updated TaskLog entity.

func (*TaskLogUpdateOne) SaveX

func (tluo *TaskLogUpdateOne) SaveX(ctx context.Context) *TaskLog

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

func (*TaskLogUpdateOne) Select

func (tluo *TaskLogUpdateOne) Select(field string, fields ...string) *TaskLogUpdateOne

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

func (*TaskLogUpdateOne) SetFinishedAt

func (tluo *TaskLogUpdateOne) SetFinishedAt(t time.Time) *TaskLogUpdateOne

SetFinishedAt sets the "finished_at" field.

func (*TaskLogUpdateOne) SetNillableFinishedAt

func (tluo *TaskLogUpdateOne) SetNillableFinishedAt(t *time.Time) *TaskLogUpdateOne

SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.

func (*TaskLogUpdateOne) SetNillableResult

func (tluo *TaskLogUpdateOne) SetNillableResult(u *uint8) *TaskLogUpdateOne

SetNillableResult sets the "result" field if the given value is not nil.

func (*TaskLogUpdateOne) SetNillableTasksID

func (tluo *TaskLogUpdateOne) SetNillableTasksID(id *uint64) *TaskLogUpdateOne

SetNillableTasksID sets the "tasks" edge to the Task entity by ID if the given value is not nil.

func (*TaskLogUpdateOne) SetNotNilFinishedAt

func (tl *TaskLogUpdateOne) SetNotNilFinishedAt(value *time.Time) *TaskLogUpdateOne

set field if value's pointer is not nil.

func (*TaskLogUpdateOne) SetNotNilResult

func (tl *TaskLogUpdateOne) SetNotNilResult(value *uint8) *TaskLogUpdateOne

set field if value's pointer is not nil.

func (*TaskLogUpdateOne) SetResult

func (tluo *TaskLogUpdateOne) SetResult(u uint8) *TaskLogUpdateOne

SetResult sets the "result" field.

func (*TaskLogUpdateOne) SetTasks

func (tluo *TaskLogUpdateOne) SetTasks(t *Task) *TaskLogUpdateOne

SetTasks sets the "tasks" edge to the Task entity.

func (*TaskLogUpdateOne) SetTasksID

func (tluo *TaskLogUpdateOne) SetTasksID(id uint64) *TaskLogUpdateOne

SetTasksID sets the "tasks" edge to the Task entity by ID.

func (*TaskLogUpdateOne) Where

func (tluo *TaskLogUpdateOne) Where(ps ...predicate.TaskLog) *TaskLogUpdateOne

Where appends a list predicates to the TaskLogUpdate builder.

type TaskLogs

type TaskLogs []*TaskLog

TaskLogs is a parsable slice of TaskLog.

type TaskMutation

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

TaskMutation represents an operation that mutates the Task nodes in the graph.

func (*TaskMutation) AddField

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

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

func (*TaskMutation) AddStatus

func (m *TaskMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*TaskMutation) AddTaskLogIDs

func (m *TaskMutation) AddTaskLogIDs(ids ...uint64)

AddTaskLogIDs adds the "task_logs" edge to the TaskLog entity by ids.

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 int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this 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) ClearStatus

func (m *TaskMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*TaskMutation) ClearTaskLogs

func (m *TaskMutation) ClearTaskLogs()

ClearTaskLogs clears the "task_logs" edge to the TaskLog entity.

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

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

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

func (*TaskMutation) CronExpression

func (m *TaskMutation) CronExpression() (r string, exists bool)

CronExpression returns the value of the "cron_expression" 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) ExecContext

func (c *TaskMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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 uint64, 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) ([]uint64, 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) Name

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

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

func (*TaskMutation) OldCreatedAt

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

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

func (*TaskMutation) OldCronExpression

func (m *TaskMutation) OldCronExpression(ctx context.Context) (v string, err error)

OldCronExpression returns the old "cron_expression" 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) OldName

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

OldName returns the old "name" 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) OldPattern

func (m *TaskMutation) OldPattern(ctx context.Context) (v string, err error)

OldPattern returns the old "pattern" 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) OldPayload

func (m *TaskMutation) OldPayload(ctx context.Context) (v string, err error)

OldPayload returns the old "payload" 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 uint8, 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) OldTaskGroup

func (m *TaskMutation) OldTaskGroup(ctx context.Context) (v string, err error)

OldTaskGroup returns the old "task_group" 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) OldUpdatedAt

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

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

func (*TaskMutation) Op

func (m *TaskMutation) Op() Op

Op returns the operation name.

func (*TaskMutation) Pattern

func (m *TaskMutation) Pattern() (r string, exists bool)

Pattern returns the value of the "pattern" field in the mutation.

func (*TaskMutation) Payload

func (m *TaskMutation) Payload() (r string, exists bool)

Payload returns the value of the "payload" field in the mutation.

func (*TaskMutation) QueryContext

func (c *TaskMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskMutation) RemoveTaskLogIDs

func (m *TaskMutation) RemoveTaskLogIDs(ids ...uint64)

RemoveTaskLogIDs removes the "task_logs" edge to the TaskLog entity by IDs.

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

func (m *TaskMutation) RemovedTaskLogsIDs() (ids []uint64)

RemovedTaskLogs returns the removed IDs of the "task_logs" edge to the TaskLog entity.

func (*TaskMutation) ResetCreatedAt

func (m *TaskMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TaskMutation) ResetCronExpression

func (m *TaskMutation) ResetCronExpression()

ResetCronExpression resets all changes to the "cron_expression" 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) ResetName

func (m *TaskMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TaskMutation) ResetPattern

func (m *TaskMutation) ResetPattern()

ResetPattern resets all changes to the "pattern" field.

func (*TaskMutation) ResetPayload

func (m *TaskMutation) ResetPayload()

ResetPayload resets all changes to the "payload" field.

func (*TaskMutation) ResetStatus

func (m *TaskMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TaskMutation) ResetTaskGroup

func (m *TaskMutation) ResetTaskGroup()

ResetTaskGroup resets all changes to the "task_group" field.

func (*TaskMutation) ResetTaskLogs

func (m *TaskMutation) ResetTaskLogs()

ResetTaskLogs resets all changes to the "task_logs" edge.

func (*TaskMutation) ResetUpdatedAt

func (m *TaskMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TaskMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TaskMutation) SetCronExpression

func (m *TaskMutation) SetCronExpression(s string)

SetCronExpression sets the "cron_expression" 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 uint64)

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

func (*TaskMutation) SetName

func (m *TaskMutation) SetName(s string)

SetName sets the "name" field.

func (*TaskMutation) SetOp

func (m *TaskMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TaskMutation) SetPattern

func (m *TaskMutation) SetPattern(s string)

SetPattern sets the "pattern" field.

func (*TaskMutation) SetPayload

func (m *TaskMutation) SetPayload(s string)

SetPayload sets the "payload" field.

func (*TaskMutation) SetStatus

func (m *TaskMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*TaskMutation) SetTaskGroup

func (m *TaskMutation) SetTaskGroup(s string)

SetTaskGroup sets the "task_group" field.

func (*TaskMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*TaskMutation) Status

func (m *TaskMutation) Status() (r uint8, exists bool)

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

func (*TaskMutation) StatusCleared

func (m *TaskMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*TaskMutation) TaskGroup

func (m *TaskMutation) TaskGroup() (r string, exists bool)

TaskGroup returns the value of the "task_group" field in the mutation.

func (*TaskMutation) TaskLogsCleared

func (m *TaskMutation) TaskLogsCleared() bool

TaskLogsCleared reports if the "task_logs" edge to the TaskLog entity was cleared.

func (*TaskMutation) TaskLogsIDs

func (m *TaskMutation) TaskLogsIDs() (ids []uint64)

TaskLogsIDs returns the "task_logs" edge IDs 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) UpdatedAt

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

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

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 TaskPageList

type TaskPageList struct {
	List        []*Task      `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

TaskPageList is Task PageList result.

type TaskPager

type TaskPager struct {
	Order  task.OrderOption
	Filter func(*TaskQuery) (*TaskQuery, error)
}

func (*TaskPager) ApplyFilter

func (p *TaskPager) ApplyFilter(query *TaskQuery) (*TaskQuery, error)

type TaskPaginateOption

type TaskPaginateOption func(*TaskPager)

TaskPaginateOption enables pagination customization.

type TaskQuery

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

TaskQuery is the builder for querying Task entities.

func (*TaskQuery) Aggregate

func (tq *TaskQuery) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate returns a TaskSelect configured with the given aggregations.

func (*TaskQuery) All

func (tq *TaskQuery) All(ctx context.Context) ([]*Task, error)

All executes the query and returns a list of Tasks.

func (*TaskQuery) AllX

func (tq *TaskQuery) AllX(ctx context.Context) []*Task

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

func (*TaskQuery) Clone

func (tq *TaskQuery) Clone() *TaskQuery

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

func (*TaskQuery) Count

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

Count returns the count of the given query.

func (*TaskQuery) CountX

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

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

func (*TaskQuery) ExecContext

func (c *TaskQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskQuery) Exist

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

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

func (*TaskQuery) ExistX

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

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

func (*TaskQuery) First

func (tq *TaskQuery) First(ctx context.Context) (*Task, error)

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

func (*TaskQuery) FirstID

func (tq *TaskQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*TaskQuery) FirstIDX

func (tq *TaskQuery) FirstIDX(ctx context.Context) uint64

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

func (*TaskQuery) FirstX

func (tq *TaskQuery) FirstX(ctx context.Context) *Task

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

func (*TaskQuery) GroupBy

func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Task.Query().
	GroupBy(task.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskQuery) IDs

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

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

func (*TaskQuery) IDsX

func (tq *TaskQuery) IDsX(ctx context.Context) []uint64

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

func (*TaskQuery) Limit

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

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

func (*TaskQuery) Offset

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

Offset to start from.

func (*TaskQuery) Only

func (tq *TaskQuery) Only(ctx context.Context) (*Task, error)

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

func (*TaskQuery) OnlyID

func (tq *TaskQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*TaskQuery) OnlyIDX

func (tq *TaskQuery) OnlyIDX(ctx context.Context) uint64

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

func (*TaskQuery) OnlyX

func (tq *TaskQuery) OnlyX(ctx context.Context) *Task

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

func (*TaskQuery) Order

func (tq *TaskQuery) Order(o ...task.OrderOption) *TaskQuery

Order specifies how the records should be ordered.

func (*TaskQuery) Page

func (t *TaskQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...TaskPaginateOption,
) (*TaskPageList, error)

func (*TaskQuery) QueryContext

func (c *TaskQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskQuery) QueryTaskLogs

func (tq *TaskQuery) QueryTaskLogs() *TaskLogQuery

QueryTaskLogs chains the current query on the "task_logs" edge.

func (*TaskQuery) Select

func (tq *TaskQuery) Select(fields ...string) *TaskSelect

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Task.Query().
	Select(task.FieldCreatedAt).
	Scan(ctx, &v)

func (*TaskQuery) Unique

func (tq *TaskQuery) Unique(unique bool) *TaskQuery

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

func (*TaskQuery) Where

func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery

Where adds a new predicate for the TaskQuery builder.

func (*TaskQuery) WithTaskLogs

func (tq *TaskQuery) WithTaskLogs(opts ...func(*TaskLogQuery)) *TaskQuery

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

type TaskSelect

type TaskSelect struct {
	*TaskQuery
	// contains filtered or unexported fields
}

TaskSelect is the builder for selecting fields of Task entities.

func (*TaskSelect) Aggregate

func (ts *TaskSelect) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TaskSelect) Bool

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

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

func (*TaskSelect) BoolX

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

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

func (*TaskSelect) Bools

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

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

func (*TaskSelect) BoolsX

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

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

func (TaskSelect) ExecContext

func (c TaskSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c TaskSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskSelect) Scan

func (ts *TaskSelect) Scan(ctx context.Context, v any) error

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

func (*TaskSelect) ScanX

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

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

func (*TaskSelect) String

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

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

func (*TaskSelect) StringX

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

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

func (*TaskSelect) Strings

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

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

func (*TaskSelect) StringsX

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

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

type TaskUpdate

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

TaskUpdate is the builder for updating Task entities.

func (*TaskUpdate) AddStatus

func (tu *TaskUpdate) AddStatus(u int8) *TaskUpdate

AddStatus adds u to the "status" field.

func (*TaskUpdate) AddTaskLogIDs

func (tu *TaskUpdate) AddTaskLogIDs(ids ...uint64) *TaskUpdate

AddTaskLogIDs adds the "task_logs" edge to the TaskLog entity by IDs.

func (*TaskUpdate) AddTaskLogs

func (tu *TaskUpdate) AddTaskLogs(t ...*TaskLog) *TaskUpdate

AddTaskLogs adds the "task_logs" edges to the TaskLog entity.

func (*TaskUpdate) ClearStatus

func (tu *TaskUpdate) ClearStatus() *TaskUpdate

ClearStatus clears the value of the "status" field.

func (*TaskUpdate) ClearTaskLogs

func (tu *TaskUpdate) ClearTaskLogs() *TaskUpdate

ClearTaskLogs clears all "task_logs" edges to the TaskLog entity.

func (*TaskUpdate) Exec

func (tu *TaskUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpdate) ExecContext

func (c *TaskUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskUpdate) ExecX

func (tu *TaskUpdate) ExecX(ctx context.Context)

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

func (*TaskUpdate) Mutation

func (tu *TaskUpdate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdate) QueryContext

func (c *TaskUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskUpdate) RemoveTaskLogIDs

func (tu *TaskUpdate) RemoveTaskLogIDs(ids ...uint64) *TaskUpdate

RemoveTaskLogIDs removes the "task_logs" edge to TaskLog entities by IDs.

func (*TaskUpdate) RemoveTaskLogs

func (tu *TaskUpdate) RemoveTaskLogs(t ...*TaskLog) *TaskUpdate

RemoveTaskLogs removes "task_logs" edges to TaskLog entities.

func (*TaskUpdate) Save

func (tu *TaskUpdate) Save(ctx context.Context) (int, error)

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

func (*TaskUpdate) SaveX

func (tu *TaskUpdate) SaveX(ctx context.Context) int

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

func (*TaskUpdate) SetCronExpression

func (tu *TaskUpdate) SetCronExpression(s string) *TaskUpdate

SetCronExpression sets the "cron_expression" field.

func (*TaskUpdate) SetName

func (tu *TaskUpdate) SetName(s string) *TaskUpdate

SetName sets the "name" field.

func (*TaskUpdate) SetNillableCronExpression

func (tu *TaskUpdate) SetNillableCronExpression(s *string) *TaskUpdate

SetNillableCronExpression sets the "cron_expression" field if the given value is not nil.

func (*TaskUpdate) SetNillableName

func (tu *TaskUpdate) SetNillableName(s *string) *TaskUpdate

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

func (*TaskUpdate) SetNillablePattern

func (tu *TaskUpdate) SetNillablePattern(s *string) *TaskUpdate

SetNillablePattern sets the "pattern" field if the given value is not nil.

func (*TaskUpdate) SetNillablePayload

func (tu *TaskUpdate) SetNillablePayload(s *string) *TaskUpdate

SetNillablePayload sets the "payload" field if the given value is not nil.

func (*TaskUpdate) SetNillableStatus

func (tu *TaskUpdate) SetNillableStatus(u *uint8) *TaskUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TaskUpdate) SetNillableTaskGroup

func (tu *TaskUpdate) SetNillableTaskGroup(s *string) *TaskUpdate

SetNillableTaskGroup sets the "task_group" field if the given value is not nil.

func (*TaskUpdate) SetNotNilCronExpression

func (t *TaskUpdate) SetNotNilCronExpression(value *string) *TaskUpdate

set field if value's pointer is not nil.

func (*TaskUpdate) SetNotNilName

func (t *TaskUpdate) SetNotNilName(value *string) *TaskUpdate

set field if value's pointer is not nil.

func (*TaskUpdate) SetNotNilPattern

func (t *TaskUpdate) SetNotNilPattern(value *string) *TaskUpdate

set field if value's pointer is not nil.

func (*TaskUpdate) SetNotNilPayload

func (t *TaskUpdate) SetNotNilPayload(value *string) *TaskUpdate

set field if value's pointer is not nil.

func (*TaskUpdate) SetNotNilStatus

func (t *TaskUpdate) SetNotNilStatus(value *uint8) *TaskUpdate

set field if value's pointer is not nil.

func (*TaskUpdate) SetNotNilTaskGroup

func (t *TaskUpdate) SetNotNilTaskGroup(value *string) *TaskUpdate

set field if value's pointer is not nil.

func (*TaskUpdate) SetNotNilUpdatedAt

func (t *TaskUpdate) SetNotNilUpdatedAt(value *time.Time) *TaskUpdate

set field if value's pointer is not nil.

func (*TaskUpdate) SetPattern

func (tu *TaskUpdate) SetPattern(s string) *TaskUpdate

SetPattern sets the "pattern" field.

func (*TaskUpdate) SetPayload

func (tu *TaskUpdate) SetPayload(s string) *TaskUpdate

SetPayload sets the "payload" field.

func (*TaskUpdate) SetStatus

func (tu *TaskUpdate) SetStatus(u uint8) *TaskUpdate

SetStatus sets the "status" field.

func (*TaskUpdate) SetTaskGroup

func (tu *TaskUpdate) SetTaskGroup(s string) *TaskUpdate

SetTaskGroup sets the "task_group" field.

func (*TaskUpdate) SetUpdatedAt

func (tu *TaskUpdate) SetUpdatedAt(t time.Time) *TaskUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TaskUpdate) Where

func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate

Where appends a list predicates to the TaskUpdate builder.

type TaskUpdateOne

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

TaskUpdateOne is the builder for updating a single Task entity.

func (*TaskUpdateOne) AddStatus

func (tuo *TaskUpdateOne) AddStatus(u int8) *TaskUpdateOne

AddStatus adds u to the "status" field.

func (*TaskUpdateOne) AddTaskLogIDs

func (tuo *TaskUpdateOne) AddTaskLogIDs(ids ...uint64) *TaskUpdateOne

AddTaskLogIDs adds the "task_logs" edge to the TaskLog entity by IDs.

func (*TaskUpdateOne) AddTaskLogs

func (tuo *TaskUpdateOne) AddTaskLogs(t ...*TaskLog) *TaskUpdateOne

AddTaskLogs adds the "task_logs" edges to the TaskLog entity.

func (*TaskUpdateOne) ClearStatus

func (tuo *TaskUpdateOne) ClearStatus() *TaskUpdateOne

ClearStatus clears the value of the "status" field.

func (*TaskUpdateOne) ClearTaskLogs

func (tuo *TaskUpdateOne) ClearTaskLogs() *TaskUpdateOne

ClearTaskLogs clears all "task_logs" edges to the TaskLog entity.

func (*TaskUpdateOne) Exec

func (tuo *TaskUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskUpdateOne) ExecContext

func (c *TaskUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TaskUpdateOne) ExecX

func (tuo *TaskUpdateOne) ExecX(ctx context.Context)

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

func (*TaskUpdateOne) Mutation

func (tuo *TaskUpdateOne) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdateOne) QueryContext

func (c *TaskUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TaskUpdateOne) RemoveTaskLogIDs

func (tuo *TaskUpdateOne) RemoveTaskLogIDs(ids ...uint64) *TaskUpdateOne

RemoveTaskLogIDs removes the "task_logs" edge to TaskLog entities by IDs.

func (*TaskUpdateOne) RemoveTaskLogs

func (tuo *TaskUpdateOne) RemoveTaskLogs(t ...*TaskLog) *TaskUpdateOne

RemoveTaskLogs removes "task_logs" edges to TaskLog entities.

func (*TaskUpdateOne) Save

func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)

Save executes the query and returns the updated Task entity.

func (*TaskUpdateOne) SaveX

func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task

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

func (*TaskUpdateOne) Select

func (tuo *TaskUpdateOne) Select(field string, fields ...string) *TaskUpdateOne

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

func (*TaskUpdateOne) SetCronExpression

func (tuo *TaskUpdateOne) SetCronExpression(s string) *TaskUpdateOne

SetCronExpression sets the "cron_expression" field.

func (*TaskUpdateOne) SetName

func (tuo *TaskUpdateOne) SetName(s string) *TaskUpdateOne

SetName sets the "name" field.

func (*TaskUpdateOne) SetNillableCronExpression

func (tuo *TaskUpdateOne) SetNillableCronExpression(s *string) *TaskUpdateOne

SetNillableCronExpression sets the "cron_expression" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableName

func (tuo *TaskUpdateOne) SetNillableName(s *string) *TaskUpdateOne

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

func (*TaskUpdateOne) SetNillablePattern

func (tuo *TaskUpdateOne) SetNillablePattern(s *string) *TaskUpdateOne

SetNillablePattern sets the "pattern" field if the given value is not nil.

func (*TaskUpdateOne) SetNillablePayload

func (tuo *TaskUpdateOne) SetNillablePayload(s *string) *TaskUpdateOne

SetNillablePayload sets the "payload" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableStatus

func (tuo *TaskUpdateOne) SetNillableStatus(u *uint8) *TaskUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableTaskGroup

func (tuo *TaskUpdateOne) SetNillableTaskGroup(s *string) *TaskUpdateOne

SetNillableTaskGroup sets the "task_group" field if the given value is not nil.

func (*TaskUpdateOne) SetNotNilCronExpression

func (t *TaskUpdateOne) SetNotNilCronExpression(value *string) *TaskUpdateOne

set field if value's pointer is not nil.

func (*TaskUpdateOne) SetNotNilName

func (t *TaskUpdateOne) SetNotNilName(value *string) *TaskUpdateOne

set field if value's pointer is not nil.

func (*TaskUpdateOne) SetNotNilPattern

func (t *TaskUpdateOne) SetNotNilPattern(value *string) *TaskUpdateOne

set field if value's pointer is not nil.

func (*TaskUpdateOne) SetNotNilPayload

func (t *TaskUpdateOne) SetNotNilPayload(value *string) *TaskUpdateOne

set field if value's pointer is not nil.

func (*TaskUpdateOne) SetNotNilStatus

func (t *TaskUpdateOne) SetNotNilStatus(value *uint8) *TaskUpdateOne

set field if value's pointer is not nil.

func (*TaskUpdateOne) SetNotNilTaskGroup

func (t *TaskUpdateOne) SetNotNilTaskGroup(value *string) *TaskUpdateOne

set field if value's pointer is not nil.

func (*TaskUpdateOne) SetNotNilUpdatedAt

func (t *TaskUpdateOne) SetNotNilUpdatedAt(value *time.Time) *TaskUpdateOne

set field if value's pointer is not nil.

func (*TaskUpdateOne) SetPattern

func (tuo *TaskUpdateOne) SetPattern(s string) *TaskUpdateOne

SetPattern sets the "pattern" field.

func (*TaskUpdateOne) SetPayload

func (tuo *TaskUpdateOne) SetPayload(s string) *TaskUpdateOne

SetPayload sets the "payload" field.

func (*TaskUpdateOne) SetStatus

func (tuo *TaskUpdateOne) SetStatus(u uint8) *TaskUpdateOne

SetStatus sets the "status" field.

func (*TaskUpdateOne) SetTaskGroup

func (tuo *TaskUpdateOne) SetTaskGroup(s string) *TaskUpdateOne

SetTaskGroup sets the "task_group" field.

func (*TaskUpdateOne) SetUpdatedAt

func (tuo *TaskUpdateOne) SetUpdatedAt(t time.Time) *TaskUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TaskUpdateOne) Where

func (tuo *TaskUpdateOne) Where(ps ...predicate.Task) *TaskUpdateOne

Where appends a list predicates to the TaskUpdate builder.

type Tasks

type Tasks []*Task

Tasks is a parsable slice of Task.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// TaskLog is the client for interacting with the TaskLog builders.
	TaskLog *TaskLogClient
	// 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) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL