Documentation ¶
Index ¶
- Constants
- Variables
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageDetails
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Task
- type TaskClient
- func (c *TaskClient) Create() *TaskCreate
- func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk
- func (c *TaskClient) Delete() *TaskDelete
- func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne
- func (c *TaskClient) DeleteOneID(id uint64) *TaskDeleteOne
- func (c *TaskClient) Get(ctx context.Context, id uint64) (*Task, error)
- func (c *TaskClient) GetX(ctx context.Context, id uint64) *Task
- func (c *TaskClient) Hooks() []Hook
- func (c *TaskClient) Intercept(interceptors ...Interceptor)
- func (c *TaskClient) Interceptors() []Interceptor
- func (c *TaskClient) Query() *TaskQuery
- func (c *TaskClient) QueryTaskLogs(t *Task) *TaskLogQuery
- func (c *TaskClient) Update() *TaskUpdate
- func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne
- func (c *TaskClient) UpdateOneID(id uint64) *TaskUpdateOne
- func (c *TaskClient) Use(hooks ...Hook)
- type TaskCreate
- func (tc *TaskCreate) AddTaskLogIDs(ids ...uint64) *TaskCreate
- func (tc *TaskCreate) AddTaskLogs(t ...*TaskLog) *TaskCreate
- func (tc *TaskCreate) Exec(ctx context.Context) error
- func (tc *TaskCreate) ExecX(ctx context.Context)
- func (tc *TaskCreate) Mutation() *TaskMutation
- func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)
- func (tc *TaskCreate) SaveX(ctx context.Context) *Task
- func (tc *TaskCreate) SetCreatedAt(t time.Time) *TaskCreate
- func (tc *TaskCreate) SetCronExpression(s string) *TaskCreate
- func (tc *TaskCreate) SetID(u uint64) *TaskCreate
- func (tc *TaskCreate) SetName(s string) *TaskCreate
- func (tc *TaskCreate) SetNillableCreatedAt(t *time.Time) *TaskCreate
- func (tc *TaskCreate) SetNillableStatus(u *uint8) *TaskCreate
- func (tc *TaskCreate) SetNillableUpdatedAt(t *time.Time) *TaskCreate
- func (tc *TaskCreate) SetPattern(s string) *TaskCreate
- func (tc *TaskCreate) SetPayload(s string) *TaskCreate
- func (tc *TaskCreate) SetStatus(u uint8) *TaskCreate
- func (tc *TaskCreate) SetTaskGroup(s string) *TaskCreate
- func (tc *TaskCreate) SetUpdatedAt(t time.Time) *TaskCreate
- type TaskCreateBulk
- type TaskDelete
- type TaskDeleteOne
- type TaskEdges
- type TaskGroupBy
- func (tgb *TaskGroupBy) Aggregate(fns ...AggregateFunc) *TaskGroupBy
- func (s *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TaskGroupBy) BoolX(ctx context.Context) bool
- func (s *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TaskGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TaskGroupBy) Float64X(ctx context.Context) float64
- func (s *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TaskGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TaskGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TaskGroupBy) IntX(ctx context.Context) int
- func (s *TaskGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TaskGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TaskGroupBy) Scan(ctx context.Context, v any) error
- func (s *TaskGroupBy) ScanX(ctx context.Context, v any)
- func (s *TaskGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TaskGroupBy) StringX(ctx context.Context) string
- func (s *TaskGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TaskGroupBy) StringsX(ctx context.Context) []string
- type TaskLog
- type TaskLogClient
- func (c *TaskLogClient) Create() *TaskLogCreate
- func (c *TaskLogClient) CreateBulk(builders ...*TaskLogCreate) *TaskLogCreateBulk
- func (c *TaskLogClient) Delete() *TaskLogDelete
- func (c *TaskLogClient) DeleteOne(tl *TaskLog) *TaskLogDeleteOne
- func (c *TaskLogClient) DeleteOneID(id uint64) *TaskLogDeleteOne
- func (c *TaskLogClient) Get(ctx context.Context, id uint64) (*TaskLog, error)
- func (c *TaskLogClient) GetX(ctx context.Context, id uint64) *TaskLog
- func (c *TaskLogClient) Hooks() []Hook
- func (c *TaskLogClient) Intercept(interceptors ...Interceptor)
- func (c *TaskLogClient) Interceptors() []Interceptor
- func (c *TaskLogClient) Query() *TaskLogQuery
- func (c *TaskLogClient) QueryTasks(tl *TaskLog) *TaskQuery
- func (c *TaskLogClient) Update() *TaskLogUpdate
- func (c *TaskLogClient) UpdateOne(tl *TaskLog) *TaskLogUpdateOne
- func (c *TaskLogClient) UpdateOneID(id uint64) *TaskLogUpdateOne
- func (c *TaskLogClient) Use(hooks ...Hook)
- type TaskLogCreate
- func (tlc *TaskLogCreate) Exec(ctx context.Context) error
- func (tlc *TaskLogCreate) ExecX(ctx context.Context)
- func (tlc *TaskLogCreate) Mutation() *TaskLogMutation
- func (tlc *TaskLogCreate) Save(ctx context.Context) (*TaskLog, error)
- func (tlc *TaskLogCreate) SaveX(ctx context.Context) *TaskLog
- func (tlc *TaskLogCreate) SetFinishedAt(t time.Time) *TaskLogCreate
- func (tlc *TaskLogCreate) SetID(u uint64) *TaskLogCreate
- func (tlc *TaskLogCreate) SetNillableStartedAt(t *time.Time) *TaskLogCreate
- func (tlc *TaskLogCreate) SetNillableTasksID(id *uint64) *TaskLogCreate
- func (tlc *TaskLogCreate) SetResult(u uint8) *TaskLogCreate
- func (tlc *TaskLogCreate) SetStartedAt(t time.Time) *TaskLogCreate
- func (tlc *TaskLogCreate) SetTasks(t *Task) *TaskLogCreate
- func (tlc *TaskLogCreate) SetTasksID(id uint64) *TaskLogCreate
- type TaskLogCreateBulk
- type TaskLogDelete
- type TaskLogDeleteOne
- type TaskLogEdges
- type TaskLogGroupBy
- func (tlgb *TaskLogGroupBy) Aggregate(fns ...AggregateFunc) *TaskLogGroupBy
- func (s *TaskLogGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TaskLogGroupBy) BoolX(ctx context.Context) bool
- func (s *TaskLogGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TaskLogGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TaskLogGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TaskLogGroupBy) Float64X(ctx context.Context) float64
- func (s *TaskLogGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TaskLogGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TaskLogGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TaskLogGroupBy) IntX(ctx context.Context) int
- func (s *TaskLogGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TaskLogGroupBy) IntsX(ctx context.Context) []int
- func (tlgb *TaskLogGroupBy) Scan(ctx context.Context, v any) error
- func (s *TaskLogGroupBy) ScanX(ctx context.Context, v any)
- func (s *TaskLogGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TaskLogGroupBy) StringX(ctx context.Context) string
- func (s *TaskLogGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TaskLogGroupBy) StringsX(ctx context.Context) []string
- type TaskLogMutation
- func (m *TaskLogMutation) AddField(name string, value ent.Value) error
- func (m *TaskLogMutation) AddResult(u int8)
- func (m *TaskLogMutation) AddedEdges() []string
- func (m *TaskLogMutation) AddedField(name string) (ent.Value, bool)
- func (m *TaskLogMutation) AddedFields() []string
- func (m *TaskLogMutation) AddedIDs(name string) []ent.Value
- func (m *TaskLogMutation) AddedResult() (r int8, exists bool)
- func (m *TaskLogMutation) ClearEdge(name string) error
- func (m *TaskLogMutation) ClearField(name string) error
- func (m *TaskLogMutation) ClearTasks()
- func (m *TaskLogMutation) ClearedEdges() []string
- func (m *TaskLogMutation) ClearedFields() []string
- func (m TaskLogMutation) Client() *Client
- func (m *TaskLogMutation) EdgeCleared(name string) bool
- func (m *TaskLogMutation) Field(name string) (ent.Value, bool)
- func (m *TaskLogMutation) FieldCleared(name string) bool
- func (m *TaskLogMutation) Fields() []string
- func (m *TaskLogMutation) FinishedAt() (r time.Time, exists bool)
- func (m *TaskLogMutation) ID() (id uint64, exists bool)
- func (m *TaskLogMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *TaskLogMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TaskLogMutation) OldFinishedAt(ctx context.Context) (v time.Time, err error)
- func (m *TaskLogMutation) OldResult(ctx context.Context) (v uint8, err error)
- func (m *TaskLogMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)
- func (m *TaskLogMutation) Op() Op
- func (m *TaskLogMutation) RemovedEdges() []string
- func (m *TaskLogMutation) RemovedIDs(name string) []ent.Value
- func (m *TaskLogMutation) ResetEdge(name string) error
- func (m *TaskLogMutation) ResetField(name string) error
- func (m *TaskLogMutation) ResetFinishedAt()
- func (m *TaskLogMutation) ResetResult()
- func (m *TaskLogMutation) ResetStartedAt()
- func (m *TaskLogMutation) ResetTasks()
- func (m *TaskLogMutation) Result() (r uint8, exists bool)
- func (m *TaskLogMutation) SetField(name string, value ent.Value) error
- func (m *TaskLogMutation) SetFinishedAt(t time.Time)
- func (m *TaskLogMutation) SetID(id uint64)
- func (m *TaskLogMutation) SetOp(op Op)
- func (m *TaskLogMutation) SetResult(u uint8)
- func (m *TaskLogMutation) SetStartedAt(t time.Time)
- func (m *TaskLogMutation) SetTasksID(id uint64)
- func (m *TaskLogMutation) StartedAt() (r time.Time, exists bool)
- func (m *TaskLogMutation) TasksCleared() bool
- func (m *TaskLogMutation) TasksID() (id uint64, exists bool)
- func (m *TaskLogMutation) TasksIDs() (ids []uint64)
- func (m TaskLogMutation) Tx() (*Tx, error)
- func (m *TaskLogMutation) Type() string
- func (m *TaskLogMutation) Where(ps ...predicate.TaskLog)
- func (m *TaskLogMutation) WhereP(ps ...func(*sql.Selector))
- type TaskLogPageList
- type TaskLogPager
- type TaskLogPaginateOption
- type TaskLogQuery
- func (tlq *TaskLogQuery) Aggregate(fns ...AggregateFunc) *TaskLogSelect
- func (tlq *TaskLogQuery) All(ctx context.Context) ([]*TaskLog, error)
- func (tlq *TaskLogQuery) AllX(ctx context.Context) []*TaskLog
- func (tlq *TaskLogQuery) Clone() *TaskLogQuery
- func (tlq *TaskLogQuery) Count(ctx context.Context) (int, error)
- func (tlq *TaskLogQuery) CountX(ctx context.Context) int
- func (tlq *TaskLogQuery) Exist(ctx context.Context) (bool, error)
- func (tlq *TaskLogQuery) ExistX(ctx context.Context) bool
- func (tlq *TaskLogQuery) First(ctx context.Context) (*TaskLog, error)
- func (tlq *TaskLogQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (tlq *TaskLogQuery) FirstIDX(ctx context.Context) uint64
- func (tlq *TaskLogQuery) FirstX(ctx context.Context) *TaskLog
- func (tlq *TaskLogQuery) GroupBy(field string, fields ...string) *TaskLogGroupBy
- func (tlq *TaskLogQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (tlq *TaskLogQuery) IDsX(ctx context.Context) []uint64
- func (tlq *TaskLogQuery) Limit(limit int) *TaskLogQuery
- func (tlq *TaskLogQuery) Offset(offset int) *TaskLogQuery
- func (tlq *TaskLogQuery) Only(ctx context.Context) (*TaskLog, error)
- func (tlq *TaskLogQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (tlq *TaskLogQuery) OnlyIDX(ctx context.Context) uint64
- func (tlq *TaskLogQuery) OnlyX(ctx context.Context) *TaskLog
- func (tlq *TaskLogQuery) Order(o ...OrderFunc) *TaskLogQuery
- func (tl *TaskLogQuery) Page(ctx context.Context, pageNum uint64, pageSize uint64, ...) (*TaskLogPageList, error)
- func (tlq *TaskLogQuery) QueryTasks() *TaskQuery
- func (tlq *TaskLogQuery) Select(fields ...string) *TaskLogSelect
- func (tlq *TaskLogQuery) Unique(unique bool) *TaskLogQuery
- func (tlq *TaskLogQuery) Where(ps ...predicate.TaskLog) *TaskLogQuery
- func (tlq *TaskLogQuery) WithTasks(opts ...func(*TaskQuery)) *TaskLogQuery
- type TaskLogSelect
- func (tls *TaskLogSelect) Aggregate(fns ...AggregateFunc) *TaskLogSelect
- func (s *TaskLogSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TaskLogSelect) BoolX(ctx context.Context) bool
- func (s *TaskLogSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TaskLogSelect) BoolsX(ctx context.Context) []bool
- func (s *TaskLogSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TaskLogSelect) Float64X(ctx context.Context) float64
- func (s *TaskLogSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TaskLogSelect) Float64sX(ctx context.Context) []float64
- func (s *TaskLogSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TaskLogSelect) IntX(ctx context.Context) int
- func (s *TaskLogSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TaskLogSelect) IntsX(ctx context.Context) []int
- func (tls *TaskLogSelect) Scan(ctx context.Context, v any) error
- func (s *TaskLogSelect) ScanX(ctx context.Context, v any)
- func (s *TaskLogSelect) String(ctx context.Context) (_ string, err error)
- func (s *TaskLogSelect) StringX(ctx context.Context) string
- func (s *TaskLogSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TaskLogSelect) StringsX(ctx context.Context) []string
- type TaskLogUpdate
- func (tlu *TaskLogUpdate) AddResult(u int8) *TaskLogUpdate
- func (tlu *TaskLogUpdate) ClearTasks() *TaskLogUpdate
- func (tlu *TaskLogUpdate) Exec(ctx context.Context) error
- func (tlu *TaskLogUpdate) ExecX(ctx context.Context)
- func (tlu *TaskLogUpdate) Mutation() *TaskLogMutation
- func (tlu *TaskLogUpdate) Save(ctx context.Context) (int, error)
- func (tlu *TaskLogUpdate) SaveX(ctx context.Context) int
- func (tlu *TaskLogUpdate) SetFinishedAt(t time.Time) *TaskLogUpdate
- func (tlu *TaskLogUpdate) SetNillableTasksID(id *uint64) *TaskLogUpdate
- func (tl *TaskLogUpdate) SetNotEmptyResult(value uint8) *TaskLogUpdate
- func (tlu *TaskLogUpdate) SetResult(u uint8) *TaskLogUpdate
- func (tlu *TaskLogUpdate) SetTasks(t *Task) *TaskLogUpdate
- func (tlu *TaskLogUpdate) SetTasksID(id uint64) *TaskLogUpdate
- func (tlu *TaskLogUpdate) Where(ps ...predicate.TaskLog) *TaskLogUpdate
- type TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) AddResult(u int8) *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) ClearTasks() *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) Exec(ctx context.Context) error
- func (tluo *TaskLogUpdateOne) ExecX(ctx context.Context)
- func (tluo *TaskLogUpdateOne) Mutation() *TaskLogMutation
- func (tluo *TaskLogUpdateOne) Save(ctx context.Context) (*TaskLog, error)
- func (tluo *TaskLogUpdateOne) SaveX(ctx context.Context) *TaskLog
- func (tluo *TaskLogUpdateOne) Select(field string, fields ...string) *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) SetFinishedAt(t time.Time) *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) SetNillableTasksID(id *uint64) *TaskLogUpdateOne
- func (tl *TaskLogUpdateOne) SetNotEmptyResult(value uint8) *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) SetResult(u uint8) *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) SetTasks(t *Task) *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) SetTasksID(id uint64) *TaskLogUpdateOne
- func (tluo *TaskLogUpdateOne) Where(ps ...predicate.TaskLog) *TaskLogUpdateOne
- type TaskLogs
- type TaskMutation
- func (m *TaskMutation) AddField(name string, value ent.Value) error
- func (m *TaskMutation) AddStatus(u int8)
- func (m *TaskMutation) AddTaskLogIDs(ids ...uint64)
- func (m *TaskMutation) AddedEdges() []string
- func (m *TaskMutation) AddedField(name string) (ent.Value, bool)
- func (m *TaskMutation) AddedFields() []string
- func (m *TaskMutation) AddedIDs(name string) []ent.Value
- func (m *TaskMutation) AddedStatus() (r int8, exists bool)
- func (m *TaskMutation) ClearEdge(name string) error
- func (m *TaskMutation) ClearField(name string) error
- func (m *TaskMutation) ClearStatus()
- func (m *TaskMutation) ClearTaskLogs()
- func (m *TaskMutation) ClearedEdges() []string
- func (m *TaskMutation) ClearedFields() []string
- func (m TaskMutation) Client() *Client
- func (m *TaskMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TaskMutation) CronExpression() (r string, exists bool)
- func (m *TaskMutation) EdgeCleared(name string) bool
- func (m *TaskMutation) Field(name string) (ent.Value, bool)
- func (m *TaskMutation) FieldCleared(name string) bool
- func (m *TaskMutation) Fields() []string
- func (m *TaskMutation) ID() (id uint64, exists bool)
- func (m *TaskMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *TaskMutation) Name() (r string, exists bool)
- func (m *TaskMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TaskMutation) OldCronExpression(ctx context.Context) (v string, err error)
- func (m *TaskMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TaskMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TaskMutation) OldPattern(ctx context.Context) (v string, err error)
- func (m *TaskMutation) OldPayload(ctx context.Context) (v string, err error)
- func (m *TaskMutation) OldStatus(ctx context.Context) (v uint8, err error)
- func (m *TaskMutation) OldTaskGroup(ctx context.Context) (v string, err error)
- func (m *TaskMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TaskMutation) Op() Op
- func (m *TaskMutation) Pattern() (r string, exists bool)
- func (m *TaskMutation) Payload() (r string, exists bool)
- func (m *TaskMutation) RemoveTaskLogIDs(ids ...uint64)
- func (m *TaskMutation) RemovedEdges() []string
- func (m *TaskMutation) RemovedIDs(name string) []ent.Value
- func (m *TaskMutation) RemovedTaskLogsIDs() (ids []uint64)
- func (m *TaskMutation) ResetCreatedAt()
- func (m *TaskMutation) ResetCronExpression()
- func (m *TaskMutation) ResetEdge(name string) error
- func (m *TaskMutation) ResetField(name string) error
- func (m *TaskMutation) ResetName()
- func (m *TaskMutation) ResetPattern()
- func (m *TaskMutation) ResetPayload()
- func (m *TaskMutation) ResetStatus()
- func (m *TaskMutation) ResetTaskGroup()
- func (m *TaskMutation) ResetTaskLogs()
- func (m *TaskMutation) ResetUpdatedAt()
- func (m *TaskMutation) SetCreatedAt(t time.Time)
- func (m *TaskMutation) SetCronExpression(s string)
- func (m *TaskMutation) SetField(name string, value ent.Value) error
- func (m *TaskMutation) SetID(id uint64)
- func (m *TaskMutation) SetName(s string)
- func (m *TaskMutation) SetOp(op Op)
- func (m *TaskMutation) SetPattern(s string)
- func (m *TaskMutation) SetPayload(s string)
- func (m *TaskMutation) SetStatus(u uint8)
- func (m *TaskMutation) SetTaskGroup(s string)
- func (m *TaskMutation) SetUpdatedAt(t time.Time)
- func (m *TaskMutation) Status() (r uint8, exists bool)
- func (m *TaskMutation) StatusCleared() bool
- func (m *TaskMutation) TaskGroup() (r string, exists bool)
- func (m *TaskMutation) TaskLogsCleared() bool
- func (m *TaskMutation) TaskLogsIDs() (ids []uint64)
- func (m TaskMutation) Tx() (*Tx, error)
- func (m *TaskMutation) Type() string
- func (m *TaskMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *TaskMutation) Where(ps ...predicate.Task)
- func (m *TaskMutation) WhereP(ps ...func(*sql.Selector))
- type TaskPageList
- type TaskPager
- type TaskPaginateOption
- type TaskQuery
- func (tq *TaskQuery) Aggregate(fns ...AggregateFunc) *TaskSelect
- func (tq *TaskQuery) All(ctx context.Context) ([]*Task, error)
- func (tq *TaskQuery) AllX(ctx context.Context) []*Task
- func (tq *TaskQuery) Clone() *TaskQuery
- func (tq *TaskQuery) Count(ctx context.Context) (int, error)
- func (tq *TaskQuery) CountX(ctx context.Context) int
- func (tq *TaskQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TaskQuery) ExistX(ctx context.Context) bool
- func (tq *TaskQuery) First(ctx context.Context) (*Task, error)
- func (tq *TaskQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (tq *TaskQuery) FirstIDX(ctx context.Context) uint64
- func (tq *TaskQuery) FirstX(ctx context.Context) *Task
- func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy
- func (tq *TaskQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (tq *TaskQuery) IDsX(ctx context.Context) []uint64
- func (tq *TaskQuery) Limit(limit int) *TaskQuery
- func (tq *TaskQuery) Offset(offset int) *TaskQuery
- func (tq *TaskQuery) Only(ctx context.Context) (*Task, error)
- func (tq *TaskQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (tq *TaskQuery) OnlyIDX(ctx context.Context) uint64
- func (tq *TaskQuery) OnlyX(ctx context.Context) *Task
- func (tq *TaskQuery) Order(o ...OrderFunc) *TaskQuery
- func (t *TaskQuery) Page(ctx context.Context, pageNum uint64, pageSize uint64, ...) (*TaskPageList, error)
- func (tq *TaskQuery) QueryTaskLogs() *TaskLogQuery
- func (tq *TaskQuery) Select(fields ...string) *TaskSelect
- func (tq *TaskQuery) Unique(unique bool) *TaskQuery
- func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery
- func (tq *TaskQuery) WithTaskLogs(opts ...func(*TaskLogQuery)) *TaskQuery
- type TaskSelect
- func (ts *TaskSelect) Aggregate(fns ...AggregateFunc) *TaskSelect
- func (s *TaskSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TaskSelect) BoolX(ctx context.Context) bool
- func (s *TaskSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TaskSelect) BoolsX(ctx context.Context) []bool
- func (s *TaskSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TaskSelect) Float64X(ctx context.Context) float64
- func (s *TaskSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TaskSelect) Float64sX(ctx context.Context) []float64
- func (s *TaskSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TaskSelect) IntX(ctx context.Context) int
- func (s *TaskSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TaskSelect) IntsX(ctx context.Context) []int
- func (ts *TaskSelect) Scan(ctx context.Context, v any) error
- func (s *TaskSelect) ScanX(ctx context.Context, v any)
- func (s *TaskSelect) String(ctx context.Context) (_ string, err error)
- func (s *TaskSelect) StringX(ctx context.Context) string
- func (s *TaskSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TaskSelect) StringsX(ctx context.Context) []string
- type TaskUpdate
- func (tu *TaskUpdate) AddStatus(u int8) *TaskUpdate
- func (tu *TaskUpdate) AddTaskLogIDs(ids ...uint64) *TaskUpdate
- func (tu *TaskUpdate) AddTaskLogs(t ...*TaskLog) *TaskUpdate
- func (tu *TaskUpdate) ClearStatus() *TaskUpdate
- func (tu *TaskUpdate) ClearTaskLogs() *TaskUpdate
- func (tu *TaskUpdate) Exec(ctx context.Context) error
- func (tu *TaskUpdate) ExecX(ctx context.Context)
- func (tu *TaskUpdate) Mutation() *TaskMutation
- func (tu *TaskUpdate) RemoveTaskLogIDs(ids ...uint64) *TaskUpdate
- func (tu *TaskUpdate) RemoveTaskLogs(t ...*TaskLog) *TaskUpdate
- func (tu *TaskUpdate) Save(ctx context.Context) (int, error)
- func (tu *TaskUpdate) SaveX(ctx context.Context) int
- func (tu *TaskUpdate) SetCronExpression(s string) *TaskUpdate
- func (tu *TaskUpdate) SetName(s string) *TaskUpdate
- func (tu *TaskUpdate) SetNillableStatus(u *uint8) *TaskUpdate
- func (t *TaskUpdate) SetNotEmptyCronExpression(value string) *TaskUpdate
- func (t *TaskUpdate) SetNotEmptyName(value string) *TaskUpdate
- func (t *TaskUpdate) SetNotEmptyPattern(value string) *TaskUpdate
- func (t *TaskUpdate) SetNotEmptyPayload(value string) *TaskUpdate
- func (t *TaskUpdate) SetNotEmptyStatus(value uint8) *TaskUpdate
- func (t *TaskUpdate) SetNotEmptyTaskGroup(value string) *TaskUpdate
- func (tu *TaskUpdate) SetPattern(s string) *TaskUpdate
- func (tu *TaskUpdate) SetPayload(s string) *TaskUpdate
- func (tu *TaskUpdate) SetStatus(u uint8) *TaskUpdate
- func (tu *TaskUpdate) SetTaskGroup(s string) *TaskUpdate
- func (tu *TaskUpdate) SetUpdatedAt(t time.Time) *TaskUpdate
- func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate
- type TaskUpdateOne
- func (tuo *TaskUpdateOne) AddStatus(u int8) *TaskUpdateOne
- func (tuo *TaskUpdateOne) AddTaskLogIDs(ids ...uint64) *TaskUpdateOne
- func (tuo *TaskUpdateOne) AddTaskLogs(t ...*TaskLog) *TaskUpdateOne
- func (tuo *TaskUpdateOne) ClearStatus() *TaskUpdateOne
- func (tuo *TaskUpdateOne) ClearTaskLogs() *TaskUpdateOne
- func (tuo *TaskUpdateOne) Exec(ctx context.Context) error
- func (tuo *TaskUpdateOne) ExecX(ctx context.Context)
- func (tuo *TaskUpdateOne) Mutation() *TaskMutation
- func (tuo *TaskUpdateOne) RemoveTaskLogIDs(ids ...uint64) *TaskUpdateOne
- func (tuo *TaskUpdateOne) RemoveTaskLogs(t ...*TaskLog) *TaskUpdateOne
- func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)
- func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task
- func (tuo *TaskUpdateOne) Select(field string, fields ...string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetCronExpression(s string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetName(s string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetNillableStatus(u *uint8) *TaskUpdateOne
- func (t *TaskUpdateOne) SetNotEmptyCronExpression(value string) *TaskUpdateOne
- func (t *TaskUpdateOne) SetNotEmptyName(value string) *TaskUpdateOne
- func (t *TaskUpdateOne) SetNotEmptyPattern(value string) *TaskUpdateOne
- func (t *TaskUpdateOne) SetNotEmptyPayload(value string) *TaskUpdateOne
- func (t *TaskUpdateOne) SetNotEmptyStatus(value uint8) *TaskUpdateOne
- func (t *TaskUpdateOne) SetNotEmptyTaskGroup(value string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetPattern(s string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetPayload(s string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetStatus(u uint8) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetTaskGroup(s string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetUpdatedAt(t time.Time) *TaskUpdateOne
- func (tuo *TaskUpdateOne) Where(ps ...predicate.Task) *TaskUpdateOne
- type Tasks
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
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 ¶
var DefaultTaskLogOrder = Desc(tasklog.FieldID)
DefaultTaskLogOrder is the default ordering of TaskLog.
var DefaultTaskOrder = Desc(task.FieldID)
DefaultTaskOrder is the default ordering of Task.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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 ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Task. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
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.
type CommitHook ¶
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 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 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 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 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 PageDetails ¶
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
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 ¶
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.
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 ¶
Rollbacker is the interface that wraps the Rollback method.
type Task ¶
type Task struct { // ID of the ent. ID uint64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. 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) QueryTaskLogs ¶
func (t *Task) QueryTaskLogs() *TaskLogQuery
QueryTaskLogs queries the "task_logs" edge of the Task entity.
func (*Task) Unwrap ¶
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.
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) GetX ¶
func (c *TaskClient) GetX(ctx context.Context, id uint64) *Task
GetX is like Get, but panics if an error occurs.
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) Query ¶
func (c *TaskClient) Query() *TaskQuery
Query returns a query builder for Task.
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) ExecX ¶
func (tc *TaskCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TaskCreate) Mutation ¶
func (tc *TaskCreate) Mutation() *TaskMutation
Mutation returns the TaskMutation object of the builder.
func (*TaskCreate) Save ¶
func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)
Save creates the Task in the database.
func (*TaskCreate) SaveX ¶
func (tc *TaskCreate) SaveX(ctx context.Context) *Task
SaveX calls Save and panics if Save returns an error.
func (*TaskCreate) 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) 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) ExecX ¶
func (tcb *TaskCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TaskDelete ¶
type TaskDelete struct {
// contains filtered or unexported fields
}
TaskDelete is the builder for deleting a Task entity.
func (*TaskDelete) Exec ¶
func (td *TaskDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TaskDelete) ExecX ¶
func (td *TaskDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TaskDelete) Where ¶
func (td *TaskDelete) Where(ps ...predicate.Task) *TaskDelete
Where appends a list predicates to the TaskDelete builder.
type TaskDeleteOne ¶
type TaskDeleteOne struct {
// contains filtered or unexported fields
}
TaskDeleteOne is the builder for deleting a single Task entity.
func (*TaskDeleteOne) Exec ¶
func (tdo *TaskDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TaskDeleteOne) ExecX ¶
func (tdo *TaskDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TaskDeleteOne) Where ¶
func (tdo *TaskDeleteOne) Where(ps ...predicate.Task) *TaskDeleteOne
Where appends a list predicates to the TaskDelete builder.
type TaskEdges ¶
type TaskEdges struct { // 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 ¶
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TaskGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TaskGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TaskGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TaskGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TaskGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) QueryTasks ¶
QueryTasks queries the "tasks" edge of the TaskLog entity.
func (*TaskLog) Unwrap ¶
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.
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) 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) Query ¶
func (c *TaskLogClient) Query() *TaskLogQuery
Query returns a query builder for TaskLog.
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) 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) 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) 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) ExecX ¶
func (tlcb *TaskLogCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, 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) ExecX ¶
func (tld *TaskLogDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TaskLogGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TaskLogGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TaskLogGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TaskLogGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TaskLogGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) 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 ¶
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 ¶
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 ¶
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) 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 OrderFunc 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) 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 ...OrderFunc) *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) 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TaskLogSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TaskLogSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TaskLogSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TaskLogSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TaskLogSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) 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) 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) 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) SetNotEmptyResult ¶
func (tl *TaskLogUpdate) SetNotEmptyResult(value uint8) *TaskLogUpdate
set field if value is not empty. e.g. string does not equal to ""
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) 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) 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) 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) SetNotEmptyResult ¶
func (tl *TaskLogUpdateOne) SetNotEmptyResult(value uint8) *TaskLogUpdateOne
set field if value is not empty. e.g. string does not equal to ""
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 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) 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 ¶
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 ¶
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 ¶
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) 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) 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 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) Clone ¶
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) First ¶
First returns the first Task entity from the query. Returns a *NotFoundError when no Task was found.
func (*TaskQuery) FirstID ¶
FirstID returns the first Task ID from the query. Returns a *NotFoundError when no Task ID was found.
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) Only ¶
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 ¶
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) Page ¶
func (t *TaskQuery) Page( ctx context.Context, pageNum uint64, pageSize uint64, opts ...TaskPaginateOption, ) (*TaskPageList, error)
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 ¶
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) 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TaskSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TaskSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TaskSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TaskSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TaskSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) 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) 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) SetNillableStatus ¶
func (tu *TaskUpdate) SetNillableStatus(u *uint8) *TaskUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*TaskUpdate) SetNotEmptyCronExpression ¶
func (t *TaskUpdate) SetNotEmptyCronExpression(value string) *TaskUpdate
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdate) SetNotEmptyName ¶
func (t *TaskUpdate) SetNotEmptyName(value string) *TaskUpdate
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdate) SetNotEmptyPattern ¶
func (t *TaskUpdate) SetNotEmptyPattern(value string) *TaskUpdate
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdate) SetNotEmptyPayload ¶
func (t *TaskUpdate) SetNotEmptyPayload(value string) *TaskUpdate
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdate) SetNotEmptyStatus ¶
func (t *TaskUpdate) SetNotEmptyStatus(value uint8) *TaskUpdate
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdate) SetNotEmptyTaskGroup ¶
func (t *TaskUpdate) SetNotEmptyTaskGroup(value string) *TaskUpdate
set field if value is not empty. e.g. string does not equal to ""
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) 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) 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) SetNillableStatus ¶
func (tuo *TaskUpdateOne) SetNillableStatus(u *uint8) *TaskUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*TaskUpdateOne) SetNotEmptyCronExpression ¶
func (t *TaskUpdateOne) SetNotEmptyCronExpression(value string) *TaskUpdateOne
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdateOne) SetNotEmptyName ¶
func (t *TaskUpdateOne) SetNotEmptyName(value string) *TaskUpdateOne
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdateOne) SetNotEmptyPattern ¶
func (t *TaskUpdateOne) SetNotEmptyPattern(value string) *TaskUpdateOne
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdateOne) SetNotEmptyPayload ¶
func (t *TaskUpdateOne) SetNotEmptyPayload(value string) *TaskUpdateOne
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdateOne) SetNotEmptyStatus ¶
func (t *TaskUpdateOne) SetNotEmptyStatus(value uint8) *TaskUpdateOne
set field if value is not empty. e.g. string does not equal to ""
func (*TaskUpdateOne) SetNotEmptyTaskGroup ¶
func (t *TaskUpdateOne) SetNotEmptyTaskGroup(value string) *TaskUpdateOne
set field if value is not empty. e.g. string does not equal to ""
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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
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 ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
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.