Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- 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 Job
- type JobClient
- func (c *JobClient) Create() *JobCreate
- func (c *JobClient) CreateBulk(builders ...*JobCreate) *JobCreateBulk
- func (c *JobClient) Delete() *JobDelete
- func (c *JobClient) DeleteOne(j *Job) *JobDeleteOne
- func (c *JobClient) DeleteOneID(id uint64) *JobDeleteOne
- func (c *JobClient) Get(ctx context.Context, id uint64) (*Job, error)
- func (c *JobClient) GetX(ctx context.Context, id uint64) *Job
- func (c *JobClient) Hooks() []Hook
- func (c *JobClient) Intercept(interceptors ...Interceptor)
- func (c *JobClient) Interceptors() []Interceptor
- func (c *JobClient) MapCreateBulk(slice any, setFunc func(*JobCreate, int)) *JobCreateBulk
- func (c *JobClient) Query() *JobQuery
- func (c *JobClient) Update() *JobUpdate
- func (c *JobClient) UpdateOne(j *Job) *JobUpdateOne
- func (c *JobClient) UpdateOneID(id uint64) *JobUpdateOne
- func (c *JobClient) Use(hooks ...Hook)
- type JobCreate
- func (jc *JobCreate) Exec(ctx context.Context) error
- func (jc *JobCreate) ExecX(ctx context.Context)
- func (jc *JobCreate) Mutation() *JobMutation
- func (jc *JobCreate) Save(ctx context.Context) (*Job, error)
- func (jc *JobCreate) SaveX(ctx context.Context) *Job
- func (jc *JobCreate) SetBody(s string) *JobCreate
- func (jc *JobCreate) SetCreatedAt(t time.Time) *JobCreate
- func (jc *JobCreate) SetError(s string) *JobCreate
- func (jc *JobCreate) SetFinishedAt(t time.Time) *JobCreate
- func (jc *JobCreate) SetNillableBody(s *string) *JobCreate
- func (jc *JobCreate) SetNillableCreatedAt(t *time.Time) *JobCreate
- func (jc *JobCreate) SetNillableError(s *string) *JobCreate
- func (jc *JobCreate) SetNillableFinishedAt(t *time.Time) *JobCreate
- func (jc *JobCreate) SetNillablePriority(u *uint) *JobCreate
- func (jc *JobCreate) SetNillableQueueName(s *string) *JobCreate
- func (jc *JobCreate) SetNillableRefID(s *string) *JobCreate
- func (jc *JobCreate) SetNillableRetryTimes(u *uint) *JobCreate
- func (jc *JobCreate) SetNillableScheduledAt(t *time.Time) *JobCreate
- func (jc *JobCreate) SetNillableStatus(j *job.Status) *JobCreate
- func (jc *JobCreate) SetNillableUpdatedAt(t *time.Time) *JobCreate
- func (jc *JobCreate) SetPriority(u uint) *JobCreate
- func (jc *JobCreate) SetQueueName(s string) *JobCreate
- func (jc *JobCreate) SetRefID(s string) *JobCreate
- func (jc *JobCreate) SetRetryTimes(u uint) *JobCreate
- func (jc *JobCreate) SetScheduledAt(t time.Time) *JobCreate
- func (jc *JobCreate) SetStatus(j job.Status) *JobCreate
- func (jc *JobCreate) SetUpdatedAt(t time.Time) *JobCreate
- type JobCreateBulk
- type JobDelete
- type JobDeleteOne
- type JobGroupBy
- func (jgb *JobGroupBy) Aggregate(fns ...AggregateFunc) *JobGroupBy
- func (s *JobGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *JobGroupBy) BoolX(ctx context.Context) bool
- func (s *JobGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *JobGroupBy) BoolsX(ctx context.Context) []bool
- func (s *JobGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *JobGroupBy) Float64X(ctx context.Context) float64
- func (s *JobGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *JobGroupBy) Float64sX(ctx context.Context) []float64
- func (s *JobGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *JobGroupBy) IntX(ctx context.Context) int
- func (s *JobGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *JobGroupBy) IntsX(ctx context.Context) []int
- func (jgb *JobGroupBy) Scan(ctx context.Context, v any) error
- func (s *JobGroupBy) ScanX(ctx context.Context, v any)
- func (s *JobGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *JobGroupBy) StringX(ctx context.Context) string
- func (s *JobGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *JobGroupBy) StringsX(ctx context.Context) []string
- type JobMutation
- func (m *JobMutation) AddField(name string, value ent.Value) error
- func (m *JobMutation) AddPriority(u int)
- func (m *JobMutation) AddRetryTimes(u int)
- func (m *JobMutation) AddedEdges() []string
- func (m *JobMutation) AddedField(name string) (ent.Value, bool)
- func (m *JobMutation) AddedFields() []string
- func (m *JobMutation) AddedIDs(name string) []ent.Value
- func (m *JobMutation) AddedPriority() (r int, exists bool)
- func (m *JobMutation) AddedRetryTimes() (r int, exists bool)
- func (m *JobMutation) Body() (r string, exists bool)
- func (m *JobMutation) BodyCleared() bool
- func (m *JobMutation) ClearBody()
- func (m *JobMutation) ClearEdge(name string) error
- func (m *JobMutation) ClearError()
- func (m *JobMutation) ClearField(name string) error
- func (m *JobMutation) ClearFinishedAt()
- func (m *JobMutation) ClearedEdges() []string
- func (m *JobMutation) ClearedFields() []string
- func (m JobMutation) Client() *Client
- func (m *JobMutation) CreatedAt() (r time.Time, exists bool)
- func (m *JobMutation) EdgeCleared(name string) bool
- func (m *JobMutation) Error() (r string, exists bool)
- func (m *JobMutation) ErrorCleared() bool
- func (m *JobMutation) Field(name string) (ent.Value, bool)
- func (m *JobMutation) FieldCleared(name string) bool
- func (m *JobMutation) Fields() []string
- func (m *JobMutation) FinishedAt() (r time.Time, exists bool)
- func (m *JobMutation) FinishedAtCleared() bool
- func (m *JobMutation) ID() (id uint64, exists bool)
- func (m *JobMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *JobMutation) OldBody(ctx context.Context) (v string, err error)
- func (m *JobMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *JobMutation) OldError(ctx context.Context) (v string, err error)
- func (m *JobMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *JobMutation) OldFinishedAt(ctx context.Context) (v time.Time, err error)
- func (m *JobMutation) OldPriority(ctx context.Context) (v uint, err error)
- func (m *JobMutation) OldQueueName(ctx context.Context) (v string, err error)
- func (m *JobMutation) OldRefID(ctx context.Context) (v string, err error)
- func (m *JobMutation) OldRetryTimes(ctx context.Context) (v uint, err error)
- func (m *JobMutation) OldScheduledAt(ctx context.Context) (v time.Time, err error)
- func (m *JobMutation) OldStatus(ctx context.Context) (v job.Status, err error)
- func (m *JobMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *JobMutation) Op() Op
- func (m *JobMutation) Priority() (r uint, exists bool)
- func (m *JobMutation) QueueName() (r string, exists bool)
- func (m *JobMutation) RefID() (r string, exists bool)
- func (m *JobMutation) RemovedEdges() []string
- func (m *JobMutation) RemovedIDs(name string) []ent.Value
- func (m *JobMutation) ResetBody()
- func (m *JobMutation) ResetCreatedAt()
- func (m *JobMutation) ResetEdge(name string) error
- func (m *JobMutation) ResetError()
- func (m *JobMutation) ResetField(name string) error
- func (m *JobMutation) ResetFinishedAt()
- func (m *JobMutation) ResetPriority()
- func (m *JobMutation) ResetQueueName()
- func (m *JobMutation) ResetRefID()
- func (m *JobMutation) ResetRetryTimes()
- func (m *JobMutation) ResetScheduledAt()
- func (m *JobMutation) ResetStatus()
- func (m *JobMutation) ResetUpdatedAt()
- func (m *JobMutation) RetryTimes() (r uint, exists bool)
- func (m *JobMutation) ScheduledAt() (r time.Time, exists bool)
- func (m *JobMutation) SetBody(s string)
- func (m *JobMutation) SetCreatedAt(t time.Time)
- func (m *JobMutation) SetError(s string)
- func (m *JobMutation) SetField(name string, value ent.Value) error
- func (m *JobMutation) SetFinishedAt(t time.Time)
- func (m *JobMutation) SetOp(op Op)
- func (m *JobMutation) SetPriority(u uint)
- func (m *JobMutation) SetQueueName(s string)
- func (m *JobMutation) SetRefID(s string)
- func (m *JobMutation) SetRetryTimes(u uint)
- func (m *JobMutation) SetScheduledAt(t time.Time)
- func (m *JobMutation) SetStatus(j job.Status)
- func (m *JobMutation) SetUpdatedAt(t time.Time)
- func (m *JobMutation) Status() (r job.Status, exists bool)
- func (m JobMutation) Tx() (*Tx, error)
- func (m *JobMutation) Type() string
- func (m *JobMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *JobMutation) Where(ps ...predicate.Job)
- func (m *JobMutation) WhereP(ps ...func(*sql.Selector))
- type JobQuery
- func (jq *JobQuery) Aggregate(fns ...AggregateFunc) *JobSelect
- func (jq *JobQuery) All(ctx context.Context) ([]*Job, error)
- func (jq *JobQuery) AllX(ctx context.Context) []*Job
- func (jq *JobQuery) Clone() *JobQuery
- func (jq *JobQuery) Count(ctx context.Context) (int, error)
- func (jq *JobQuery) CountX(ctx context.Context) int
- func (jq *JobQuery) Exist(ctx context.Context) (bool, error)
- func (jq *JobQuery) ExistX(ctx context.Context) bool
- func (jq *JobQuery) First(ctx context.Context) (*Job, error)
- func (jq *JobQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (jq *JobQuery) FirstIDX(ctx context.Context) uint64
- func (jq *JobQuery) FirstX(ctx context.Context) *Job
- func (jq *JobQuery) GroupBy(field string, fields ...string) *JobGroupBy
- func (jq *JobQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (jq *JobQuery) IDsX(ctx context.Context) []uint64
- func (jq *JobQuery) Limit(limit int) *JobQuery
- func (jq *JobQuery) Offset(offset int) *JobQuery
- func (jq *JobQuery) Only(ctx context.Context) (*Job, error)
- func (jq *JobQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (jq *JobQuery) OnlyIDX(ctx context.Context) uint64
- func (jq *JobQuery) OnlyX(ctx context.Context) *Job
- func (jq *JobQuery) Order(o ...job.OrderOption) *JobQuery
- func (jq *JobQuery) Select(fields ...string) *JobSelect
- func (jq *JobQuery) Unique(unique bool) *JobQuery
- func (jq *JobQuery) Where(ps ...predicate.Job) *JobQuery
- type JobSelect
- func (js *JobSelect) Aggregate(fns ...AggregateFunc) *JobSelect
- func (s *JobSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *JobSelect) BoolX(ctx context.Context) bool
- func (s *JobSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *JobSelect) BoolsX(ctx context.Context) []bool
- func (s *JobSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *JobSelect) Float64X(ctx context.Context) float64
- func (s *JobSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *JobSelect) Float64sX(ctx context.Context) []float64
- func (s *JobSelect) Int(ctx context.Context) (_ int, err error)
- func (s *JobSelect) IntX(ctx context.Context) int
- func (s *JobSelect) Ints(ctx context.Context) ([]int, error)
- func (s *JobSelect) IntsX(ctx context.Context) []int
- func (js *JobSelect) Scan(ctx context.Context, v any) error
- func (s *JobSelect) ScanX(ctx context.Context, v any)
- func (s *JobSelect) String(ctx context.Context) (_ string, err error)
- func (s *JobSelect) StringX(ctx context.Context) string
- func (s *JobSelect) Strings(ctx context.Context) ([]string, error)
- func (s *JobSelect) StringsX(ctx context.Context) []string
- type JobUpdate
- func (ju *JobUpdate) AddPriority(u int) *JobUpdate
- func (ju *JobUpdate) AddRetryTimes(u int) *JobUpdate
- func (ju *JobUpdate) ClearBody() *JobUpdate
- func (ju *JobUpdate) ClearError() *JobUpdate
- func (ju *JobUpdate) ClearFinishedAt() *JobUpdate
- func (ju *JobUpdate) Exec(ctx context.Context) error
- func (ju *JobUpdate) ExecX(ctx context.Context)
- func (ju *JobUpdate) Mutation() *JobMutation
- func (ju *JobUpdate) Save(ctx context.Context) (int, error)
- func (ju *JobUpdate) SaveX(ctx context.Context) int
- func (ju *JobUpdate) SetBody(s string) *JobUpdate
- func (ju *JobUpdate) SetCreatedAt(t time.Time) *JobUpdate
- func (ju *JobUpdate) SetError(s string) *JobUpdate
- func (ju *JobUpdate) SetFinishedAt(t time.Time) *JobUpdate
- func (ju *JobUpdate) SetNillableBody(s *string) *JobUpdate
- func (ju *JobUpdate) SetNillableCreatedAt(t *time.Time) *JobUpdate
- func (ju *JobUpdate) SetNillableError(s *string) *JobUpdate
- func (ju *JobUpdate) SetNillableFinishedAt(t *time.Time) *JobUpdate
- func (ju *JobUpdate) SetNillablePriority(u *uint) *JobUpdate
- func (ju *JobUpdate) SetNillableQueueName(s *string) *JobUpdate
- func (ju *JobUpdate) SetNillableRefID(s *string) *JobUpdate
- func (ju *JobUpdate) SetNillableRetryTimes(u *uint) *JobUpdate
- func (ju *JobUpdate) SetNillableScheduledAt(t *time.Time) *JobUpdate
- func (ju *JobUpdate) SetNillableStatus(j *job.Status) *JobUpdate
- func (ju *JobUpdate) SetPriority(u uint) *JobUpdate
- func (ju *JobUpdate) SetQueueName(s string) *JobUpdate
- func (ju *JobUpdate) SetRefID(s string) *JobUpdate
- func (ju *JobUpdate) SetRetryTimes(u uint) *JobUpdate
- func (ju *JobUpdate) SetScheduledAt(t time.Time) *JobUpdate
- func (ju *JobUpdate) SetStatus(j job.Status) *JobUpdate
- func (ju *JobUpdate) SetUpdatedAt(t time.Time) *JobUpdate
- func (ju *JobUpdate) Where(ps ...predicate.Job) *JobUpdate
- type JobUpdateOne
- func (juo *JobUpdateOne) AddPriority(u int) *JobUpdateOne
- func (juo *JobUpdateOne) AddRetryTimes(u int) *JobUpdateOne
- func (juo *JobUpdateOne) ClearBody() *JobUpdateOne
- func (juo *JobUpdateOne) ClearError() *JobUpdateOne
- func (juo *JobUpdateOne) ClearFinishedAt() *JobUpdateOne
- func (juo *JobUpdateOne) Exec(ctx context.Context) error
- func (juo *JobUpdateOne) ExecX(ctx context.Context)
- func (juo *JobUpdateOne) Mutation() *JobMutation
- func (juo *JobUpdateOne) Save(ctx context.Context) (*Job, error)
- func (juo *JobUpdateOne) SaveX(ctx context.Context) *Job
- func (juo *JobUpdateOne) Select(field string, fields ...string) *JobUpdateOne
- func (juo *JobUpdateOne) SetBody(s string) *JobUpdateOne
- func (juo *JobUpdateOne) SetCreatedAt(t time.Time) *JobUpdateOne
- func (juo *JobUpdateOne) SetError(s string) *JobUpdateOne
- func (juo *JobUpdateOne) SetFinishedAt(t time.Time) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableBody(s *string) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableCreatedAt(t *time.Time) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableError(s *string) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableFinishedAt(t *time.Time) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillablePriority(u *uint) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableQueueName(s *string) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableRefID(s *string) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableRetryTimes(u *uint) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableScheduledAt(t *time.Time) *JobUpdateOne
- func (juo *JobUpdateOne) SetNillableStatus(j *job.Status) *JobUpdateOne
- func (juo *JobUpdateOne) SetPriority(u uint) *JobUpdateOne
- func (juo *JobUpdateOne) SetQueueName(s string) *JobUpdateOne
- func (juo *JobUpdateOne) SetRefID(s string) *JobUpdateOne
- func (juo *JobUpdateOne) SetRetryTimes(u uint) *JobUpdateOne
- func (juo *JobUpdateOne) SetScheduledAt(t time.Time) *JobUpdateOne
- func (juo *JobUpdateOne) SetStatus(j job.Status) *JobUpdateOne
- func (juo *JobUpdateOne) SetUpdatedAt(t time.Time) *JobUpdateOne
- func (juo *JobUpdateOne) Where(ps ...predicate.Job) *JobUpdateOne
- type Jobs
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- 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. TypeJob = "Job" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func 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 // Job is the client for interacting with the Job builders. Job *JobClient // 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(). Job. 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 Job ¶
type Job 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 holds the value of the "status" field. Status job.Status `json:"status,omitempty"` // QueueName holds the value of the "queue_name" field. QueueName string `json:"queue_name,omitempty"` // RefID holds the value of the "ref_id" field. RefID string `json:"ref_id,omitempty"` // Priority holds the value of the "priority" field. Priority uint `json:"priority,omitempty"` // RetryTimes holds the value of the "retry_times" field. RetryTimes uint `json:"retry_times,omitempty"` // Body holds the value of the "body" field. Body string `json:"body,omitempty"` // Error holds the value of the "error" field. Error string `json:"error,omitempty"` // ScheduledAt holds the value of the "scheduled_at" field. ScheduledAt time.Time `json:"scheduled_at,omitempty"` // FinishedAt holds the value of the "finished_at" field. FinishedAt time.Time `json:"finished_at,omitempty"` // contains filtered or unexported fields }
Job is the model entity for the Job schema.
func (*Job) Unwrap ¶
Unwrap unwraps the Job entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Job) Update ¶
func (j *Job) Update() *JobUpdateOne
Update returns a builder for updating this Job. Note that you need to call Job.Unwrap() before calling this method if this Job was returned from a transaction, and the transaction was committed or rolled back.
type JobClient ¶
type JobClient struct {
// contains filtered or unexported fields
}
JobClient is a client for the Job schema.
func NewJobClient ¶
func NewJobClient(c config) *JobClient
NewJobClient returns a client for the Job from the given config.
func (*JobClient) CreateBulk ¶
func (c *JobClient) CreateBulk(builders ...*JobCreate) *JobCreateBulk
CreateBulk returns a builder for creating a bulk of Job entities.
func (*JobClient) DeleteOne ¶
func (c *JobClient) DeleteOne(j *Job) *JobDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*JobClient) DeleteOneID ¶
func (c *JobClient) DeleteOneID(id uint64) *JobDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*JobClient) Intercept ¶
func (c *JobClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `job.Intercept(f(g(h())))`.
func (*JobClient) Interceptors ¶
func (c *JobClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*JobClient) MapCreateBulk ¶
func (c *JobClient) MapCreateBulk(slice any, setFunc func(*JobCreate, int)) *JobCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*JobClient) UpdateOne ¶
func (c *JobClient) UpdateOne(j *Job) *JobUpdateOne
UpdateOne returns an update builder for the given entity.
func (*JobClient) UpdateOneID ¶
func (c *JobClient) UpdateOneID(id uint64) *JobUpdateOne
UpdateOneID returns an update builder for the given id.
type JobCreate ¶
type JobCreate struct {
// contains filtered or unexported fields
}
JobCreate is the builder for creating a Job entity.
func (*JobCreate) Mutation ¶
func (jc *JobCreate) Mutation() *JobMutation
Mutation returns the JobMutation object of the builder.
func (*JobCreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*JobCreate) SetFinishedAt ¶
SetFinishedAt sets the "finished_at" field.
func (*JobCreate) SetNillableBody ¶
SetNillableBody sets the "body" field if the given value is not nil.
func (*JobCreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*JobCreate) SetNillableError ¶
SetNillableError sets the "error" field if the given value is not nil.
func (*JobCreate) SetNillableFinishedAt ¶
SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.
func (*JobCreate) SetNillablePriority ¶
SetNillablePriority sets the "priority" field if the given value is not nil.
func (*JobCreate) SetNillableQueueName ¶
SetNillableQueueName sets the "queue_name" field if the given value is not nil.
func (*JobCreate) SetNillableRefID ¶
SetNillableRefID sets the "ref_id" field if the given value is not nil.
func (*JobCreate) SetNillableRetryTimes ¶
SetNillableRetryTimes sets the "retry_times" field if the given value is not nil.
func (*JobCreate) SetNillableScheduledAt ¶
SetNillableScheduledAt sets the "scheduled_at" field if the given value is not nil.
func (*JobCreate) SetNillableStatus ¶
SetNillableStatus sets the "status" field if the given value is not nil.
func (*JobCreate) SetNillableUpdatedAt ¶
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*JobCreate) SetPriority ¶
SetPriority sets the "priority" field.
func (*JobCreate) SetQueueName ¶
SetQueueName sets the "queue_name" field.
func (*JobCreate) SetRetryTimes ¶
SetRetryTimes sets the "retry_times" field.
func (*JobCreate) SetScheduledAt ¶
SetScheduledAt sets the "scheduled_at" field.
type JobCreateBulk ¶
type JobCreateBulk struct {
// contains filtered or unexported fields
}
JobCreateBulk is the builder for creating many Job entities in bulk.
func (*JobCreateBulk) Exec ¶
func (jcb *JobCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*JobCreateBulk) ExecX ¶
func (jcb *JobCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type JobDelete ¶
type JobDelete struct {
// contains filtered or unexported fields
}
JobDelete is the builder for deleting a Job entity.
func (*JobDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type JobDeleteOne ¶
type JobDeleteOne struct {
// contains filtered or unexported fields
}
JobDeleteOne is the builder for deleting a single Job entity.
func (*JobDeleteOne) Exec ¶
func (jdo *JobDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*JobDeleteOne) ExecX ¶
func (jdo *JobDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JobDeleteOne) Where ¶
func (jdo *JobDeleteOne) Where(ps ...predicate.Job) *JobDeleteOne
Where appends a list predicates to the JobDelete builder.
type JobGroupBy ¶
type JobGroupBy struct {
// contains filtered or unexported fields
}
JobGroupBy is the group-by builder for Job entities.
func (*JobGroupBy) Aggregate ¶
func (jgb *JobGroupBy) Aggregate(fns ...AggregateFunc) *JobGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*JobGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*JobGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*JobGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*JobGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*JobGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*JobGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*JobGroupBy) Scan ¶
func (jgb *JobGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*JobGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type JobMutation ¶
type JobMutation struct {
// contains filtered or unexported fields
}
JobMutation represents an operation that mutates the Job nodes in the graph.
func (*JobMutation) AddField ¶
func (m *JobMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*JobMutation) AddPriority ¶
func (m *JobMutation) AddPriority(u int)
AddPriority adds u to the "priority" field.
func (*JobMutation) AddRetryTimes ¶
func (m *JobMutation) AddRetryTimes(u int)
AddRetryTimes adds u to the "retry_times" field.
func (*JobMutation) AddedEdges ¶
func (m *JobMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*JobMutation) AddedField ¶
func (m *JobMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*JobMutation) AddedFields ¶
func (m *JobMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*JobMutation) AddedIDs ¶
func (m *JobMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*JobMutation) AddedPriority ¶
func (m *JobMutation) AddedPriority() (r int, exists bool)
AddedPriority returns the value that was added to the "priority" field in this mutation.
func (*JobMutation) AddedRetryTimes ¶
func (m *JobMutation) AddedRetryTimes() (r int, exists bool)
AddedRetryTimes returns the value that was added to the "retry_times" field in this mutation.
func (*JobMutation) Body ¶
func (m *JobMutation) Body() (r string, exists bool)
Body returns the value of the "body" field in the mutation.
func (*JobMutation) BodyCleared ¶
func (m *JobMutation) BodyCleared() bool
BodyCleared returns if the "body" field was cleared in this mutation.
func (*JobMutation) ClearBody ¶
func (m *JobMutation) ClearBody()
ClearBody clears the value of the "body" field.
func (*JobMutation) ClearEdge ¶
func (m *JobMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*JobMutation) ClearError ¶
func (m *JobMutation) ClearError()
ClearError clears the value of the "error" field.
func (*JobMutation) ClearField ¶
func (m *JobMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*JobMutation) ClearFinishedAt ¶
func (m *JobMutation) ClearFinishedAt()
ClearFinishedAt clears the value of the "finished_at" field.
func (*JobMutation) ClearedEdges ¶
func (m *JobMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*JobMutation) ClearedFields ¶
func (m *JobMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (JobMutation) Client ¶
func (m JobMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*JobMutation) CreatedAt ¶
func (m *JobMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*JobMutation) EdgeCleared ¶
func (m *JobMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*JobMutation) Error ¶
func (m *JobMutation) Error() (r string, exists bool)
Error returns the value of the "error" field in the mutation.
func (*JobMutation) ErrorCleared ¶
func (m *JobMutation) ErrorCleared() bool
ErrorCleared returns if the "error" field was cleared in this mutation.
func (*JobMutation) Field ¶
func (m *JobMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*JobMutation) FieldCleared ¶
func (m *JobMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*JobMutation) Fields ¶
func (m *JobMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*JobMutation) FinishedAt ¶
func (m *JobMutation) FinishedAt() (r time.Time, exists bool)
FinishedAt returns the value of the "finished_at" field in the mutation.
func (*JobMutation) FinishedAtCleared ¶
func (m *JobMutation) FinishedAtCleared() bool
FinishedAtCleared returns if the "finished_at" field was cleared in this mutation.
func (*JobMutation) ID ¶
func (m *JobMutation) 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 (*JobMutation) IDs ¶
func (m *JobMutation) 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 (*JobMutation) OldBody ¶
func (m *JobMutation) OldBody(ctx context.Context) (v string, err error)
OldBody returns the old "body" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldError ¶
func (m *JobMutation) OldError(ctx context.Context) (v string, err error)
OldError returns the old "error" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*JobMutation) OldFinishedAt ¶
OldFinishedAt returns the old "finished_at" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldPriority ¶
func (m *JobMutation) OldPriority(ctx context.Context) (v uint, err error)
OldPriority returns the old "priority" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldQueueName ¶
func (m *JobMutation) OldQueueName(ctx context.Context) (v string, err error)
OldQueueName returns the old "queue_name" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldRefID ¶
func (m *JobMutation) OldRefID(ctx context.Context) (v string, err error)
OldRefID returns the old "ref_id" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldRetryTimes ¶
func (m *JobMutation) OldRetryTimes(ctx context.Context) (v uint, err error)
OldRetryTimes returns the old "retry_times" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldScheduledAt ¶
OldScheduledAt returns the old "scheduled_at" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldStatus ¶
OldStatus returns the old "status" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Job entity. If the Job object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*JobMutation) Priority ¶
func (m *JobMutation) Priority() (r uint, exists bool)
Priority returns the value of the "priority" field in the mutation.
func (*JobMutation) QueueName ¶
func (m *JobMutation) QueueName() (r string, exists bool)
QueueName returns the value of the "queue_name" field in the mutation.
func (*JobMutation) RefID ¶
func (m *JobMutation) RefID() (r string, exists bool)
RefID returns the value of the "ref_id" field in the mutation.
func (*JobMutation) RemovedEdges ¶
func (m *JobMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*JobMutation) RemovedIDs ¶
func (m *JobMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*JobMutation) ResetBody ¶
func (m *JobMutation) ResetBody()
ResetBody resets all changes to the "body" field.
func (*JobMutation) ResetCreatedAt ¶
func (m *JobMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*JobMutation) ResetEdge ¶
func (m *JobMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*JobMutation) ResetError ¶
func (m *JobMutation) ResetError()
ResetError resets all changes to the "error" field.
func (*JobMutation) ResetField ¶
func (m *JobMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*JobMutation) ResetFinishedAt ¶
func (m *JobMutation) ResetFinishedAt()
ResetFinishedAt resets all changes to the "finished_at" field.
func (*JobMutation) ResetPriority ¶
func (m *JobMutation) ResetPriority()
ResetPriority resets all changes to the "priority" field.
func (*JobMutation) ResetQueueName ¶
func (m *JobMutation) ResetQueueName()
ResetQueueName resets all changes to the "queue_name" field.
func (*JobMutation) ResetRefID ¶
func (m *JobMutation) ResetRefID()
ResetRefID resets all changes to the "ref_id" field.
func (*JobMutation) ResetRetryTimes ¶
func (m *JobMutation) ResetRetryTimes()
ResetRetryTimes resets all changes to the "retry_times" field.
func (*JobMutation) ResetScheduledAt ¶
func (m *JobMutation) ResetScheduledAt()
ResetScheduledAt resets all changes to the "scheduled_at" field.
func (*JobMutation) ResetStatus ¶
func (m *JobMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*JobMutation) ResetUpdatedAt ¶
func (m *JobMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*JobMutation) RetryTimes ¶
func (m *JobMutation) RetryTimes() (r uint, exists bool)
RetryTimes returns the value of the "retry_times" field in the mutation.
func (*JobMutation) ScheduledAt ¶
func (m *JobMutation) ScheduledAt() (r time.Time, exists bool)
ScheduledAt returns the value of the "scheduled_at" field in the mutation.
func (*JobMutation) SetBody ¶
func (m *JobMutation) SetBody(s string)
SetBody sets the "body" field.
func (*JobMutation) SetCreatedAt ¶
func (m *JobMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*JobMutation) SetError ¶
func (m *JobMutation) SetError(s string)
SetError sets the "error" field.
func (*JobMutation) SetField ¶
func (m *JobMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*JobMutation) SetFinishedAt ¶
func (m *JobMutation) SetFinishedAt(t time.Time)
SetFinishedAt sets the "finished_at" field.
func (*JobMutation) SetOp ¶
func (m *JobMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*JobMutation) SetPriority ¶
func (m *JobMutation) SetPriority(u uint)
SetPriority sets the "priority" field.
func (*JobMutation) SetQueueName ¶
func (m *JobMutation) SetQueueName(s string)
SetQueueName sets the "queue_name" field.
func (*JobMutation) SetRefID ¶
func (m *JobMutation) SetRefID(s string)
SetRefID sets the "ref_id" field.
func (*JobMutation) SetRetryTimes ¶
func (m *JobMutation) SetRetryTimes(u uint)
SetRetryTimes sets the "retry_times" field.
func (*JobMutation) SetScheduledAt ¶
func (m *JobMutation) SetScheduledAt(t time.Time)
SetScheduledAt sets the "scheduled_at" field.
func (*JobMutation) SetStatus ¶
func (m *JobMutation) SetStatus(j job.Status)
SetStatus sets the "status" field.
func (*JobMutation) SetUpdatedAt ¶
func (m *JobMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*JobMutation) Status ¶
func (m *JobMutation) Status() (r job.Status, exists bool)
Status returns the value of the "status" field in the mutation.
func (JobMutation) Tx ¶
func (m JobMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*JobMutation) Type ¶
func (m *JobMutation) Type() string
Type returns the node type of this mutation (Job).
func (*JobMutation) UpdatedAt ¶
func (m *JobMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*JobMutation) Where ¶
func (m *JobMutation) Where(ps ...predicate.Job)
Where appends a list predicates to the JobMutation builder.
func (*JobMutation) WhereP ¶
func (m *JobMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the JobMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type JobQuery ¶
type JobQuery struct {
// contains filtered or unexported fields
}
JobQuery is the builder for querying Job entities.
func (*JobQuery) Aggregate ¶
func (jq *JobQuery) Aggregate(fns ...AggregateFunc) *JobSelect
Aggregate returns a JobSelect configured with the given aggregations.
func (*JobQuery) Clone ¶
Clone returns a duplicate of the JobQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*JobQuery) First ¶
First returns the first Job entity from the query. Returns a *NotFoundError when no Job was found.
func (*JobQuery) FirstID ¶
FirstID returns the first Job ID from the query. Returns a *NotFoundError when no Job ID was found.
func (*JobQuery) GroupBy ¶
func (jq *JobQuery) GroupBy(field string, fields ...string) *JobGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Job.Query(). GroupBy(job.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*JobQuery) Only ¶
Only returns a single Job entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Job entity is found. Returns a *NotFoundError when no Job entities are found.
func (*JobQuery) OnlyID ¶
OnlyID is like Only, but returns the only Job ID in the query. Returns a *NotSingularError when more than one Job ID is found. Returns a *NotFoundError when no entities are found.
func (*JobQuery) Order ¶
func (jq *JobQuery) Order(o ...job.OrderOption) *JobQuery
Order specifies how the records should be ordered.
func (*JobQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Job.Query(). Select(job.FieldCreatedAt). Scan(ctx, &v)
type JobSelect ¶
type JobSelect struct { *JobQuery // contains filtered or unexported fields }
JobSelect is the builder for selecting fields of Job entities.
func (*JobSelect) Aggregate ¶
func (js *JobSelect) Aggregate(fns ...AggregateFunc) *JobSelect
Aggregate adds the given aggregation functions to the selector query.
func (*JobSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*JobSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*JobSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*JobSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*JobSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*JobSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*JobSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type JobUpdate ¶
type JobUpdate struct {
// contains filtered or unexported fields
}
JobUpdate is the builder for updating Job entities.
func (*JobUpdate) AddPriority ¶
AddPriority adds u to the "priority" field.
func (*JobUpdate) AddRetryTimes ¶
AddRetryTimes adds u to the "retry_times" field.
func (*JobUpdate) ClearError ¶
ClearError clears the value of the "error" field.
func (*JobUpdate) ClearFinishedAt ¶
ClearFinishedAt clears the value of the "finished_at" field.
func (*JobUpdate) Mutation ¶
func (ju *JobUpdate) Mutation() *JobMutation
Mutation returns the JobMutation object of the builder.
func (*JobUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*JobUpdate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*JobUpdate) SetFinishedAt ¶
SetFinishedAt sets the "finished_at" field.
func (*JobUpdate) SetNillableBody ¶
SetNillableBody sets the "body" field if the given value is not nil.
func (*JobUpdate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*JobUpdate) SetNillableError ¶
SetNillableError sets the "error" field if the given value is not nil.
func (*JobUpdate) SetNillableFinishedAt ¶
SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.
func (*JobUpdate) SetNillablePriority ¶
SetNillablePriority sets the "priority" field if the given value is not nil.
func (*JobUpdate) SetNillableQueueName ¶
SetNillableQueueName sets the "queue_name" field if the given value is not nil.
func (*JobUpdate) SetNillableRefID ¶
SetNillableRefID sets the "ref_id" field if the given value is not nil.
func (*JobUpdate) SetNillableRetryTimes ¶
SetNillableRetryTimes sets the "retry_times" field if the given value is not nil.
func (*JobUpdate) SetNillableScheduledAt ¶
SetNillableScheduledAt sets the "scheduled_at" field if the given value is not nil.
func (*JobUpdate) SetNillableStatus ¶
SetNillableStatus sets the "status" field if the given value is not nil.
func (*JobUpdate) SetPriority ¶
SetPriority sets the "priority" field.
func (*JobUpdate) SetQueueName ¶
SetQueueName sets the "queue_name" field.
func (*JobUpdate) SetRetryTimes ¶
SetRetryTimes sets the "retry_times" field.
func (*JobUpdate) SetScheduledAt ¶
SetScheduledAt sets the "scheduled_at" field.
func (*JobUpdate) SetUpdatedAt ¶
SetUpdatedAt sets the "updated_at" field.
type JobUpdateOne ¶
type JobUpdateOne struct {
// contains filtered or unexported fields
}
JobUpdateOne is the builder for updating a single Job entity.
func (*JobUpdateOne) AddPriority ¶
func (juo *JobUpdateOne) AddPriority(u int) *JobUpdateOne
AddPriority adds u to the "priority" field.
func (*JobUpdateOne) AddRetryTimes ¶
func (juo *JobUpdateOne) AddRetryTimes(u int) *JobUpdateOne
AddRetryTimes adds u to the "retry_times" field.
func (*JobUpdateOne) ClearBody ¶
func (juo *JobUpdateOne) ClearBody() *JobUpdateOne
ClearBody clears the value of the "body" field.
func (*JobUpdateOne) ClearError ¶
func (juo *JobUpdateOne) ClearError() *JobUpdateOne
ClearError clears the value of the "error" field.
func (*JobUpdateOne) ClearFinishedAt ¶
func (juo *JobUpdateOne) ClearFinishedAt() *JobUpdateOne
ClearFinishedAt clears the value of the "finished_at" field.
func (*JobUpdateOne) Exec ¶
func (juo *JobUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*JobUpdateOne) ExecX ¶
func (juo *JobUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JobUpdateOne) Mutation ¶
func (juo *JobUpdateOne) Mutation() *JobMutation
Mutation returns the JobMutation object of the builder.
func (*JobUpdateOne) Save ¶
func (juo *JobUpdateOne) Save(ctx context.Context) (*Job, error)
Save executes the query and returns the updated Job entity.
func (*JobUpdateOne) SaveX ¶
func (juo *JobUpdateOne) SaveX(ctx context.Context) *Job
SaveX is like Save, but panics if an error occurs.
func (*JobUpdateOne) Select ¶
func (juo *JobUpdateOne) Select(field string, fields ...string) *JobUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*JobUpdateOne) SetBody ¶
func (juo *JobUpdateOne) SetBody(s string) *JobUpdateOne
SetBody sets the "body" field.
func (*JobUpdateOne) SetCreatedAt ¶
func (juo *JobUpdateOne) SetCreatedAt(t time.Time) *JobUpdateOne
SetCreatedAt sets the "created_at" field.
func (*JobUpdateOne) SetError ¶
func (juo *JobUpdateOne) SetError(s string) *JobUpdateOne
SetError sets the "error" field.
func (*JobUpdateOne) SetFinishedAt ¶
func (juo *JobUpdateOne) SetFinishedAt(t time.Time) *JobUpdateOne
SetFinishedAt sets the "finished_at" field.
func (*JobUpdateOne) SetNillableBody ¶
func (juo *JobUpdateOne) SetNillableBody(s *string) *JobUpdateOne
SetNillableBody sets the "body" field if the given value is not nil.
func (*JobUpdateOne) SetNillableCreatedAt ¶
func (juo *JobUpdateOne) SetNillableCreatedAt(t *time.Time) *JobUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*JobUpdateOne) SetNillableError ¶
func (juo *JobUpdateOne) SetNillableError(s *string) *JobUpdateOne
SetNillableError sets the "error" field if the given value is not nil.
func (*JobUpdateOne) SetNillableFinishedAt ¶
func (juo *JobUpdateOne) SetNillableFinishedAt(t *time.Time) *JobUpdateOne
SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.
func (*JobUpdateOne) SetNillablePriority ¶
func (juo *JobUpdateOne) SetNillablePriority(u *uint) *JobUpdateOne
SetNillablePriority sets the "priority" field if the given value is not nil.
func (*JobUpdateOne) SetNillableQueueName ¶
func (juo *JobUpdateOne) SetNillableQueueName(s *string) *JobUpdateOne
SetNillableQueueName sets the "queue_name" field if the given value is not nil.
func (*JobUpdateOne) SetNillableRefID ¶
func (juo *JobUpdateOne) SetNillableRefID(s *string) *JobUpdateOne
SetNillableRefID sets the "ref_id" field if the given value is not nil.
func (*JobUpdateOne) SetNillableRetryTimes ¶
func (juo *JobUpdateOne) SetNillableRetryTimes(u *uint) *JobUpdateOne
SetNillableRetryTimes sets the "retry_times" field if the given value is not nil.
func (*JobUpdateOne) SetNillableScheduledAt ¶
func (juo *JobUpdateOne) SetNillableScheduledAt(t *time.Time) *JobUpdateOne
SetNillableScheduledAt sets the "scheduled_at" field if the given value is not nil.
func (*JobUpdateOne) SetNillableStatus ¶
func (juo *JobUpdateOne) SetNillableStatus(j *job.Status) *JobUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*JobUpdateOne) SetPriority ¶
func (juo *JobUpdateOne) SetPriority(u uint) *JobUpdateOne
SetPriority sets the "priority" field.
func (*JobUpdateOne) SetQueueName ¶
func (juo *JobUpdateOne) SetQueueName(s string) *JobUpdateOne
SetQueueName sets the "queue_name" field.
func (*JobUpdateOne) SetRefID ¶
func (juo *JobUpdateOne) SetRefID(s string) *JobUpdateOne
SetRefID sets the "ref_id" field.
func (*JobUpdateOne) SetRetryTimes ¶
func (juo *JobUpdateOne) SetRetryTimes(u uint) *JobUpdateOne
SetRetryTimes sets the "retry_times" field.
func (*JobUpdateOne) SetScheduledAt ¶
func (juo *JobUpdateOne) SetScheduledAt(t time.Time) *JobUpdateOne
SetScheduledAt sets the "scheduled_at" field.
func (*JobUpdateOne) SetStatus ¶
func (juo *JobUpdateOne) SetStatus(j job.Status) *JobUpdateOne
SetStatus sets the "status" field.
func (*JobUpdateOne) SetUpdatedAt ¶
func (juo *JobUpdateOne) SetUpdatedAt(t time.Time) *JobUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*JobUpdateOne) Where ¶
func (juo *JobUpdateOne) Where(ps ...predicate.Job) *JobUpdateOne
Where appends a list predicates to the JobUpdate builder.
type 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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Job is the client for interacting with the Job builders. Job *JobClient // 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.