Documentation ¶
Index ¶
- Constants
- 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 Chunk
- type ChunkClient
- func (c *ChunkClient) Create() *ChunkCreate
- func (c *ChunkClient) CreateBulk(builders ...*ChunkCreate) *ChunkCreateBulk
- func (c *ChunkClient) Delete() *ChunkDelete
- func (c *ChunkClient) DeleteOne(ch *Chunk) *ChunkDeleteOne
- func (c *ChunkClient) DeleteOneID(id string) *ChunkDeleteOne
- func (c *ChunkClient) Get(ctx context.Context, id string) (*Chunk, error)
- func (c *ChunkClient) GetX(ctx context.Context, id string) *Chunk
- func (c *ChunkClient) Hooks() []Hook
- func (c *ChunkClient) Query() *ChunkQuery
- func (c *ChunkClient) QueryWorker(ch *Chunk) *WorkerQuery
- func (c *ChunkClient) Update() *ChunkUpdate
- func (c *ChunkClient) UpdateOne(ch *Chunk) *ChunkUpdateOne
- func (c *ChunkClient) UpdateOneID(id string) *ChunkUpdateOne
- func (c *ChunkClient) Use(hooks ...Hook)
- type ChunkCreate
- func (cc *ChunkCreate) Exec(ctx context.Context) error
- func (cc *ChunkCreate) ExecX(ctx context.Context)
- func (cc *ChunkCreate) Mutation() *ChunkMutation
- func (cc *ChunkCreate) Save(ctx context.Context) (*Chunk, error)
- func (cc *ChunkCreate) SaveX(ctx context.Context) *Chunk
- func (cc *ChunkCreate) SetCreatedAt(t time.Time) *ChunkCreate
- func (cc *ChunkCreate) SetID(s string) *ChunkCreate
- func (cc *ChunkCreate) SetLeaseExpiresAt(t time.Time) *ChunkCreate
- func (cc *ChunkCreate) SetNillableCreatedAt(t *time.Time) *ChunkCreate
- func (cc *ChunkCreate) SetNillableLeaseExpiresAt(t *time.Time) *ChunkCreate
- func (cc *ChunkCreate) SetNillableSha256Content(s *string) *ChunkCreate
- func (cc *ChunkCreate) SetNillableSha256Input(s *string) *ChunkCreate
- func (cc *ChunkCreate) SetNillableSha256Output(s *string) *ChunkCreate
- func (cc *ChunkCreate) SetNillableSizeContent(i *int64) *ChunkCreate
- func (cc *ChunkCreate) SetNillableSizeInput(i *int64) *ChunkCreate
- func (cc *ChunkCreate) SetNillableSizeOutput(i *int64) *ChunkCreate
- func (cc *ChunkCreate) SetNillableState(c *chunk.State) *ChunkCreate
- func (cc *ChunkCreate) SetNillableUpdatedAt(t *time.Time) *ChunkCreate
- func (cc *ChunkCreate) SetNillableWorkerID(id *uuid.UUID) *ChunkCreate
- func (cc *ChunkCreate) SetSha256Content(s string) *ChunkCreate
- func (cc *ChunkCreate) SetSha256Input(s string) *ChunkCreate
- func (cc *ChunkCreate) SetSha256Output(s string) *ChunkCreate
- func (cc *ChunkCreate) SetSizeContent(i int64) *ChunkCreate
- func (cc *ChunkCreate) SetSizeInput(i int64) *ChunkCreate
- func (cc *ChunkCreate) SetSizeOutput(i int64) *ChunkCreate
- func (cc *ChunkCreate) SetStart(t time.Time) *ChunkCreate
- func (cc *ChunkCreate) SetState(c chunk.State) *ChunkCreate
- func (cc *ChunkCreate) SetUpdatedAt(t time.Time) *ChunkCreate
- func (cc *ChunkCreate) SetWorker(w *Worker) *ChunkCreate
- func (cc *ChunkCreate) SetWorkerID(id uuid.UUID) *ChunkCreate
- type ChunkCreateBulk
- type ChunkDelete
- type ChunkDeleteOne
- type ChunkEdges
- type ChunkGroupBy
- func (cgb *ChunkGroupBy) Aggregate(fns ...AggregateFunc) *ChunkGroupBy
- func (cgb *ChunkGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (cgb *ChunkGroupBy) BoolX(ctx context.Context) bool
- func (cgb *ChunkGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (cgb *ChunkGroupBy) BoolsX(ctx context.Context) []bool
- func (cgb *ChunkGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (cgb *ChunkGroupBy) Float64X(ctx context.Context) float64
- func (cgb *ChunkGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (cgb *ChunkGroupBy) Float64sX(ctx context.Context) []float64
- func (cgb *ChunkGroupBy) Int(ctx context.Context) (_ int, err error)
- func (cgb *ChunkGroupBy) IntX(ctx context.Context) int
- func (cgb *ChunkGroupBy) Ints(ctx context.Context) ([]int, error)
- func (cgb *ChunkGroupBy) IntsX(ctx context.Context) []int
- func (cgb *ChunkGroupBy) Scan(ctx context.Context, v interface{}) error
- func (cgb *ChunkGroupBy) ScanX(ctx context.Context, v interface{})
- func (cgb *ChunkGroupBy) String(ctx context.Context) (_ string, err error)
- func (cgb *ChunkGroupBy) StringX(ctx context.Context) string
- func (cgb *ChunkGroupBy) Strings(ctx context.Context) ([]string, error)
- func (cgb *ChunkGroupBy) StringsX(ctx context.Context) []string
- type ChunkMutation
- func (m *ChunkMutation) AddField(name string, value ent.Value) error
- func (m *ChunkMutation) AddSizeContent(i int64)
- func (m *ChunkMutation) AddSizeInput(i int64)
- func (m *ChunkMutation) AddSizeOutput(i int64)
- func (m *ChunkMutation) AddedEdges() []string
- func (m *ChunkMutation) AddedField(name string) (ent.Value, bool)
- func (m *ChunkMutation) AddedFields() []string
- func (m *ChunkMutation) AddedIDs(name string) []ent.Value
- func (m *ChunkMutation) AddedSizeContent() (r int64, exists bool)
- func (m *ChunkMutation) AddedSizeInput() (r int64, exists bool)
- func (m *ChunkMutation) AddedSizeOutput() (r int64, exists bool)
- func (m *ChunkMutation) ClearEdge(name string) error
- func (m *ChunkMutation) ClearField(name string) error
- func (m *ChunkMutation) ClearLeaseExpiresAt()
- func (m *ChunkMutation) ClearSha256Content()
- func (m *ChunkMutation) ClearSha256Input()
- func (m *ChunkMutation) ClearSha256Output()
- func (m *ChunkMutation) ClearSizeContent()
- func (m *ChunkMutation) ClearSizeInput()
- func (m *ChunkMutation) ClearSizeOutput()
- func (m *ChunkMutation) ClearWorker()
- func (m *ChunkMutation) ClearedEdges() []string
- func (m *ChunkMutation) ClearedFields() []string
- func (m ChunkMutation) Client() *Client
- func (m *ChunkMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ChunkMutation) EdgeCleared(name string) bool
- func (m *ChunkMutation) Field(name string) (ent.Value, bool)
- func (m *ChunkMutation) FieldCleared(name string) bool
- func (m *ChunkMutation) Fields() []string
- func (m *ChunkMutation) ID() (id string, exists bool)
- func (m *ChunkMutation) LeaseExpiresAt() (r time.Time, exists bool)
- func (m *ChunkMutation) LeaseExpiresAtCleared() bool
- func (m *ChunkMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ChunkMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ChunkMutation) OldLeaseExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *ChunkMutation) OldSha256Content(ctx context.Context) (v *string, err error)
- func (m *ChunkMutation) OldSha256Input(ctx context.Context) (v *string, err error)
- func (m *ChunkMutation) OldSha256Output(ctx context.Context) (v *string, err error)
- func (m *ChunkMutation) OldSizeContent(ctx context.Context) (v int64, err error)
- func (m *ChunkMutation) OldSizeInput(ctx context.Context) (v int64, err error)
- func (m *ChunkMutation) OldSizeOutput(ctx context.Context) (v int64, err error)
- func (m *ChunkMutation) OldStart(ctx context.Context) (v time.Time, err error)
- func (m *ChunkMutation) OldState(ctx context.Context) (v chunk.State, err error)
- func (m *ChunkMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ChunkMutation) Op() Op
- func (m *ChunkMutation) RemovedEdges() []string
- func (m *ChunkMutation) RemovedIDs(name string) []ent.Value
- func (m *ChunkMutation) ResetCreatedAt()
- func (m *ChunkMutation) ResetEdge(name string) error
- func (m *ChunkMutation) ResetField(name string) error
- func (m *ChunkMutation) ResetLeaseExpiresAt()
- func (m *ChunkMutation) ResetSha256Content()
- func (m *ChunkMutation) ResetSha256Input()
- func (m *ChunkMutation) ResetSha256Output()
- func (m *ChunkMutation) ResetSizeContent()
- func (m *ChunkMutation) ResetSizeInput()
- func (m *ChunkMutation) ResetSizeOutput()
- func (m *ChunkMutation) ResetStart()
- func (m *ChunkMutation) ResetState()
- func (m *ChunkMutation) ResetUpdatedAt()
- func (m *ChunkMutation) ResetWorker()
- func (m *ChunkMutation) SetCreatedAt(t time.Time)
- func (m *ChunkMutation) SetField(name string, value ent.Value) error
- func (m *ChunkMutation) SetID(id string)
- func (m *ChunkMutation) SetLeaseExpiresAt(t time.Time)
- func (m *ChunkMutation) SetSha256Content(s string)
- func (m *ChunkMutation) SetSha256Input(s string)
- func (m *ChunkMutation) SetSha256Output(s string)
- func (m *ChunkMutation) SetSizeContent(i int64)
- func (m *ChunkMutation) SetSizeInput(i int64)
- func (m *ChunkMutation) SetSizeOutput(i int64)
- func (m *ChunkMutation) SetStart(t time.Time)
- func (m *ChunkMutation) SetState(c chunk.State)
- func (m *ChunkMutation) SetUpdatedAt(t time.Time)
- func (m *ChunkMutation) SetWorkerID(id uuid.UUID)
- func (m *ChunkMutation) Sha256Content() (r string, exists bool)
- func (m *ChunkMutation) Sha256ContentCleared() bool
- func (m *ChunkMutation) Sha256Input() (r string, exists bool)
- func (m *ChunkMutation) Sha256InputCleared() bool
- func (m *ChunkMutation) Sha256Output() (r string, exists bool)
- func (m *ChunkMutation) Sha256OutputCleared() bool
- func (m *ChunkMutation) SizeContent() (r int64, exists bool)
- func (m *ChunkMutation) SizeContentCleared() bool
- func (m *ChunkMutation) SizeInput() (r int64, exists bool)
- func (m *ChunkMutation) SizeInputCleared() bool
- func (m *ChunkMutation) SizeOutput() (r int64, exists bool)
- func (m *ChunkMutation) SizeOutputCleared() bool
- func (m *ChunkMutation) Start() (r time.Time, exists bool)
- func (m *ChunkMutation) State() (r chunk.State, exists bool)
- func (m ChunkMutation) Tx() (*Tx, error)
- func (m *ChunkMutation) Type() string
- func (m *ChunkMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ChunkMutation) Where(ps ...predicate.Chunk)
- func (m *ChunkMutation) WorkerCleared() bool
- func (m *ChunkMutation) WorkerID() (id uuid.UUID, exists bool)
- func (m *ChunkMutation) WorkerIDs() (ids []uuid.UUID)
- type ChunkQuery
- func (cq *ChunkQuery) All(ctx context.Context) ([]*Chunk, error)
- func (cq *ChunkQuery) AllX(ctx context.Context) []*Chunk
- func (cq *ChunkQuery) Clone() *ChunkQuery
- func (cq *ChunkQuery) Count(ctx context.Context) (int, error)
- func (cq *ChunkQuery) CountX(ctx context.Context) int
- func (cq *ChunkQuery) Exist(ctx context.Context) (bool, error)
- func (cq *ChunkQuery) ExistX(ctx context.Context) bool
- func (cq *ChunkQuery) First(ctx context.Context) (*Chunk, error)
- func (cq *ChunkQuery) FirstID(ctx context.Context) (id string, err error)
- func (cq *ChunkQuery) FirstIDX(ctx context.Context) string
- func (cq *ChunkQuery) FirstX(ctx context.Context) *Chunk
- func (cq *ChunkQuery) ForShare(opts ...sql.LockOption) *ChunkQuery
- func (cq *ChunkQuery) ForUpdate(opts ...sql.LockOption) *ChunkQuery
- func (cq *ChunkQuery) GroupBy(field string, fields ...string) *ChunkGroupBy
- func (cq *ChunkQuery) IDs(ctx context.Context) ([]string, error)
- func (cq *ChunkQuery) IDsX(ctx context.Context) []string
- func (cq *ChunkQuery) Limit(limit int) *ChunkQuery
- func (cq *ChunkQuery) Offset(offset int) *ChunkQuery
- func (cq *ChunkQuery) Only(ctx context.Context) (*Chunk, error)
- func (cq *ChunkQuery) OnlyID(ctx context.Context) (id string, err error)
- func (cq *ChunkQuery) OnlyIDX(ctx context.Context) string
- func (cq *ChunkQuery) OnlyX(ctx context.Context) *Chunk
- func (cq *ChunkQuery) Order(o ...OrderFunc) *ChunkQuery
- func (cq *ChunkQuery) QueryWorker() *WorkerQuery
- func (cq *ChunkQuery) Select(fields ...string) *ChunkSelect
- func (cq *ChunkQuery) Unique(unique bool) *ChunkQuery
- func (cq *ChunkQuery) Where(ps ...predicate.Chunk) *ChunkQuery
- func (cq *ChunkQuery) WithWorker(opts ...func(*WorkerQuery)) *ChunkQuery
- type ChunkSelect
- func (cs *ChunkSelect) Bool(ctx context.Context) (_ bool, err error)
- func (cs *ChunkSelect) BoolX(ctx context.Context) bool
- func (cs *ChunkSelect) Bools(ctx context.Context) ([]bool, error)
- func (cs *ChunkSelect) BoolsX(ctx context.Context) []bool
- func (cs *ChunkSelect) Float64(ctx context.Context) (_ float64, err error)
- func (cs *ChunkSelect) Float64X(ctx context.Context) float64
- func (cs *ChunkSelect) Float64s(ctx context.Context) ([]float64, error)
- func (cs *ChunkSelect) Float64sX(ctx context.Context) []float64
- func (cs *ChunkSelect) Int(ctx context.Context) (_ int, err error)
- func (cs *ChunkSelect) IntX(ctx context.Context) int
- func (cs *ChunkSelect) Ints(ctx context.Context) ([]int, error)
- func (cs *ChunkSelect) IntsX(ctx context.Context) []int
- func (cs *ChunkSelect) Scan(ctx context.Context, v interface{}) error
- func (cs *ChunkSelect) ScanX(ctx context.Context, v interface{})
- func (cs *ChunkSelect) String(ctx context.Context) (_ string, err error)
- func (cs *ChunkSelect) StringX(ctx context.Context) string
- func (cs *ChunkSelect) Strings(ctx context.Context) ([]string, error)
- func (cs *ChunkSelect) StringsX(ctx context.Context) []string
- type ChunkUpdate
- func (cu *ChunkUpdate) AddSizeContent(i int64) *ChunkUpdate
- func (cu *ChunkUpdate) AddSizeInput(i int64) *ChunkUpdate
- func (cu *ChunkUpdate) AddSizeOutput(i int64) *ChunkUpdate
- func (cu *ChunkUpdate) ClearLeaseExpiresAt() *ChunkUpdate
- func (cu *ChunkUpdate) ClearSha256Content() *ChunkUpdate
- func (cu *ChunkUpdate) ClearSha256Input() *ChunkUpdate
- func (cu *ChunkUpdate) ClearSha256Output() *ChunkUpdate
- func (cu *ChunkUpdate) ClearSizeContent() *ChunkUpdate
- func (cu *ChunkUpdate) ClearSizeInput() *ChunkUpdate
- func (cu *ChunkUpdate) ClearSizeOutput() *ChunkUpdate
- func (cu *ChunkUpdate) ClearWorker() *ChunkUpdate
- func (cu *ChunkUpdate) Exec(ctx context.Context) error
- func (cu *ChunkUpdate) ExecX(ctx context.Context)
- func (cu *ChunkUpdate) Mutation() *ChunkMutation
- func (cu *ChunkUpdate) Save(ctx context.Context) (int, error)
- func (cu *ChunkUpdate) SaveX(ctx context.Context) int
- func (cu *ChunkUpdate) SetLeaseExpiresAt(t time.Time) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableLeaseExpiresAt(t *time.Time) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableSha256Content(s *string) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableSha256Input(s *string) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableSha256Output(s *string) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableSizeContent(i *int64) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableSizeInput(i *int64) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableSizeOutput(i *int64) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableState(c *chunk.State) *ChunkUpdate
- func (cu *ChunkUpdate) SetNillableWorkerID(id *uuid.UUID) *ChunkUpdate
- func (cu *ChunkUpdate) SetSha256Content(s string) *ChunkUpdate
- func (cu *ChunkUpdate) SetSha256Input(s string) *ChunkUpdate
- func (cu *ChunkUpdate) SetSha256Output(s string) *ChunkUpdate
- func (cu *ChunkUpdate) SetSizeContent(i int64) *ChunkUpdate
- func (cu *ChunkUpdate) SetSizeInput(i int64) *ChunkUpdate
- func (cu *ChunkUpdate) SetSizeOutput(i int64) *ChunkUpdate
- func (cu *ChunkUpdate) SetStart(t time.Time) *ChunkUpdate
- func (cu *ChunkUpdate) SetState(c chunk.State) *ChunkUpdate
- func (cu *ChunkUpdate) SetUpdatedAt(t time.Time) *ChunkUpdate
- func (cu *ChunkUpdate) SetWorker(w *Worker) *ChunkUpdate
- func (cu *ChunkUpdate) SetWorkerID(id uuid.UUID) *ChunkUpdate
- func (cu *ChunkUpdate) Where(ps ...predicate.Chunk) *ChunkUpdate
- type ChunkUpdateOne
- func (cuo *ChunkUpdateOne) AddSizeContent(i int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) AddSizeInput(i int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) AddSizeOutput(i int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearLeaseExpiresAt() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearSha256Content() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearSha256Input() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearSha256Output() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearSizeContent() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearSizeInput() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearSizeOutput() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) ClearWorker() *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) Exec(ctx context.Context) error
- func (cuo *ChunkUpdateOne) ExecX(ctx context.Context)
- func (cuo *ChunkUpdateOne) Mutation() *ChunkMutation
- func (cuo *ChunkUpdateOne) Save(ctx context.Context) (*Chunk, error)
- func (cuo *ChunkUpdateOne) SaveX(ctx context.Context) *Chunk
- func (cuo *ChunkUpdateOne) Select(field string, fields ...string) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetLeaseExpiresAt(t time.Time) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableLeaseExpiresAt(t *time.Time) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableSha256Content(s *string) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableSha256Input(s *string) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableSha256Output(s *string) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableSizeContent(i *int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableSizeInput(i *int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableSizeOutput(i *int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableState(c *chunk.State) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetNillableWorkerID(id *uuid.UUID) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetSha256Content(s string) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetSha256Input(s string) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetSha256Output(s string) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetSizeContent(i int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetSizeInput(i int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetSizeOutput(i int64) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetStart(t time.Time) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetState(c chunk.State) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetUpdatedAt(t time.Time) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetWorker(w *Worker) *ChunkUpdateOne
- func (cuo *ChunkUpdateOne) SetWorkerID(id uuid.UUID) *ChunkUpdateOne
- type Chunks
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type ValidationError
- type Value
- type Worker
- type WorkerClient
- func (c *WorkerClient) Create() *WorkerCreate
- func (c *WorkerClient) CreateBulk(builders ...*WorkerCreate) *WorkerCreateBulk
- func (c *WorkerClient) Delete() *WorkerDelete
- func (c *WorkerClient) DeleteOne(w *Worker) *WorkerDeleteOne
- func (c *WorkerClient) DeleteOneID(id uuid.UUID) *WorkerDeleteOne
- func (c *WorkerClient) Get(ctx context.Context, id uuid.UUID) (*Worker, error)
- func (c *WorkerClient) GetX(ctx context.Context, id uuid.UUID) *Worker
- func (c *WorkerClient) Hooks() []Hook
- func (c *WorkerClient) Query() *WorkerQuery
- func (c *WorkerClient) QueryChunks(w *Worker) *ChunkQuery
- func (c *WorkerClient) Update() *WorkerUpdate
- func (c *WorkerClient) UpdateOne(w *Worker) *WorkerUpdateOne
- func (c *WorkerClient) UpdateOneID(id uuid.UUID) *WorkerUpdateOne
- func (c *WorkerClient) Use(hooks ...Hook)
- type WorkerCreate
- func (wc *WorkerCreate) AddChunkIDs(ids ...string) *WorkerCreate
- func (wc *WorkerCreate) AddChunks(c ...*Chunk) *WorkerCreate
- func (wc *WorkerCreate) Exec(ctx context.Context) error
- func (wc *WorkerCreate) ExecX(ctx context.Context)
- func (wc *WorkerCreate) Mutation() *WorkerMutation
- func (wc *WorkerCreate) Save(ctx context.Context) (*Worker, error)
- func (wc *WorkerCreate) SaveX(ctx context.Context) *Worker
- func (wc *WorkerCreate) SetCreatedAt(t time.Time) *WorkerCreate
- func (wc *WorkerCreate) SetID(u uuid.UUID) *WorkerCreate
- func (wc *WorkerCreate) SetName(s string) *WorkerCreate
- func (wc *WorkerCreate) SetNillableCreatedAt(t *time.Time) *WorkerCreate
- func (wc *WorkerCreate) SetNillableUpdatedAt(t *time.Time) *WorkerCreate
- func (wc *WorkerCreate) SetToken(s string) *WorkerCreate
- func (wc *WorkerCreate) SetUpdatedAt(t time.Time) *WorkerCreate
- type WorkerCreateBulk
- type WorkerDelete
- type WorkerDeleteOne
- type WorkerEdges
- type WorkerGroupBy
- func (wgb *WorkerGroupBy) Aggregate(fns ...AggregateFunc) *WorkerGroupBy
- func (wgb *WorkerGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (wgb *WorkerGroupBy) BoolX(ctx context.Context) bool
- func (wgb *WorkerGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (wgb *WorkerGroupBy) BoolsX(ctx context.Context) []bool
- func (wgb *WorkerGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (wgb *WorkerGroupBy) Float64X(ctx context.Context) float64
- func (wgb *WorkerGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (wgb *WorkerGroupBy) Float64sX(ctx context.Context) []float64
- func (wgb *WorkerGroupBy) Int(ctx context.Context) (_ int, err error)
- func (wgb *WorkerGroupBy) IntX(ctx context.Context) int
- func (wgb *WorkerGroupBy) Ints(ctx context.Context) ([]int, error)
- func (wgb *WorkerGroupBy) IntsX(ctx context.Context) []int
- func (wgb *WorkerGroupBy) Scan(ctx context.Context, v interface{}) error
- func (wgb *WorkerGroupBy) ScanX(ctx context.Context, v interface{})
- func (wgb *WorkerGroupBy) String(ctx context.Context) (_ string, err error)
- func (wgb *WorkerGroupBy) StringX(ctx context.Context) string
- func (wgb *WorkerGroupBy) Strings(ctx context.Context) ([]string, error)
- func (wgb *WorkerGroupBy) StringsX(ctx context.Context) []string
- type WorkerMutation
- func (m *WorkerMutation) AddChunkIDs(ids ...string)
- func (m *WorkerMutation) AddField(name string, value ent.Value) error
- func (m *WorkerMutation) AddedEdges() []string
- func (m *WorkerMutation) AddedField(name string) (ent.Value, bool)
- func (m *WorkerMutation) AddedFields() []string
- func (m *WorkerMutation) AddedIDs(name string) []ent.Value
- func (m *WorkerMutation) ChunksCleared() bool
- func (m *WorkerMutation) ChunksIDs() (ids []string)
- func (m *WorkerMutation) ClearChunks()
- func (m *WorkerMutation) ClearEdge(name string) error
- func (m *WorkerMutation) ClearField(name string) error
- func (m *WorkerMutation) ClearedEdges() []string
- func (m *WorkerMutation) ClearedFields() []string
- func (m WorkerMutation) Client() *Client
- func (m *WorkerMutation) CreatedAt() (r time.Time, exists bool)
- func (m *WorkerMutation) EdgeCleared(name string) bool
- func (m *WorkerMutation) Field(name string) (ent.Value, bool)
- func (m *WorkerMutation) FieldCleared(name string) bool
- func (m *WorkerMutation) Fields() []string
- func (m *WorkerMutation) ID() (id uuid.UUID, exists bool)
- func (m *WorkerMutation) Name() (r string, exists bool)
- func (m *WorkerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *WorkerMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *WorkerMutation) OldName(ctx context.Context) (v string, err error)
- func (m *WorkerMutation) OldToken(ctx context.Context) (v string, err error)
- func (m *WorkerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *WorkerMutation) Op() Op
- func (m *WorkerMutation) RemoveChunkIDs(ids ...string)
- func (m *WorkerMutation) RemovedChunksIDs() (ids []string)
- func (m *WorkerMutation) RemovedEdges() []string
- func (m *WorkerMutation) RemovedIDs(name string) []ent.Value
- func (m *WorkerMutation) ResetChunks()
- func (m *WorkerMutation) ResetCreatedAt()
- func (m *WorkerMutation) ResetEdge(name string) error
- func (m *WorkerMutation) ResetField(name string) error
- func (m *WorkerMutation) ResetName()
- func (m *WorkerMutation) ResetToken()
- func (m *WorkerMutation) ResetUpdatedAt()
- func (m *WorkerMutation) SetCreatedAt(t time.Time)
- func (m *WorkerMutation) SetField(name string, value ent.Value) error
- func (m *WorkerMutation) SetID(id uuid.UUID)
- func (m *WorkerMutation) SetName(s string)
- func (m *WorkerMutation) SetToken(s string)
- func (m *WorkerMutation) SetUpdatedAt(t time.Time)
- func (m *WorkerMutation) Token() (r string, exists bool)
- func (m WorkerMutation) Tx() (*Tx, error)
- func (m *WorkerMutation) Type() string
- func (m *WorkerMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *WorkerMutation) Where(ps ...predicate.Worker)
- type WorkerQuery
- func (wq *WorkerQuery) All(ctx context.Context) ([]*Worker, error)
- func (wq *WorkerQuery) AllX(ctx context.Context) []*Worker
- func (wq *WorkerQuery) Clone() *WorkerQuery
- func (wq *WorkerQuery) Count(ctx context.Context) (int, error)
- func (wq *WorkerQuery) CountX(ctx context.Context) int
- func (wq *WorkerQuery) Exist(ctx context.Context) (bool, error)
- func (wq *WorkerQuery) ExistX(ctx context.Context) bool
- func (wq *WorkerQuery) First(ctx context.Context) (*Worker, error)
- func (wq *WorkerQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (wq *WorkerQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (wq *WorkerQuery) FirstX(ctx context.Context) *Worker
- func (wq *WorkerQuery) ForShare(opts ...sql.LockOption) *WorkerQuery
- func (wq *WorkerQuery) ForUpdate(opts ...sql.LockOption) *WorkerQuery
- func (wq *WorkerQuery) GroupBy(field string, fields ...string) *WorkerGroupBy
- func (wq *WorkerQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (wq *WorkerQuery) IDsX(ctx context.Context) []uuid.UUID
- func (wq *WorkerQuery) Limit(limit int) *WorkerQuery
- func (wq *WorkerQuery) Offset(offset int) *WorkerQuery
- func (wq *WorkerQuery) Only(ctx context.Context) (*Worker, error)
- func (wq *WorkerQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (wq *WorkerQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (wq *WorkerQuery) OnlyX(ctx context.Context) *Worker
- func (wq *WorkerQuery) Order(o ...OrderFunc) *WorkerQuery
- func (wq *WorkerQuery) QueryChunks() *ChunkQuery
- func (wq *WorkerQuery) Select(fields ...string) *WorkerSelect
- func (wq *WorkerQuery) Unique(unique bool) *WorkerQuery
- func (wq *WorkerQuery) Where(ps ...predicate.Worker) *WorkerQuery
- func (wq *WorkerQuery) WithChunks(opts ...func(*ChunkQuery)) *WorkerQuery
- type WorkerSelect
- func (ws *WorkerSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ws *WorkerSelect) BoolX(ctx context.Context) bool
- func (ws *WorkerSelect) Bools(ctx context.Context) ([]bool, error)
- func (ws *WorkerSelect) BoolsX(ctx context.Context) []bool
- func (ws *WorkerSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ws *WorkerSelect) Float64X(ctx context.Context) float64
- func (ws *WorkerSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ws *WorkerSelect) Float64sX(ctx context.Context) []float64
- func (ws *WorkerSelect) Int(ctx context.Context) (_ int, err error)
- func (ws *WorkerSelect) IntX(ctx context.Context) int
- func (ws *WorkerSelect) Ints(ctx context.Context) ([]int, error)
- func (ws *WorkerSelect) IntsX(ctx context.Context) []int
- func (ws *WorkerSelect) Scan(ctx context.Context, v interface{}) error
- func (ws *WorkerSelect) ScanX(ctx context.Context, v interface{})
- func (ws *WorkerSelect) String(ctx context.Context) (_ string, err error)
- func (ws *WorkerSelect) StringX(ctx context.Context) string
- func (ws *WorkerSelect) Strings(ctx context.Context) ([]string, error)
- func (ws *WorkerSelect) StringsX(ctx context.Context) []string
- type WorkerUpdate
- func (wu *WorkerUpdate) AddChunkIDs(ids ...string) *WorkerUpdate
- func (wu *WorkerUpdate) AddChunks(c ...*Chunk) *WorkerUpdate
- func (wu *WorkerUpdate) ClearChunks() *WorkerUpdate
- func (wu *WorkerUpdate) Exec(ctx context.Context) error
- func (wu *WorkerUpdate) ExecX(ctx context.Context)
- func (wu *WorkerUpdate) Mutation() *WorkerMutation
- func (wu *WorkerUpdate) RemoveChunkIDs(ids ...string) *WorkerUpdate
- func (wu *WorkerUpdate) RemoveChunks(c ...*Chunk) *WorkerUpdate
- func (wu *WorkerUpdate) Save(ctx context.Context) (int, error)
- func (wu *WorkerUpdate) SaveX(ctx context.Context) int
- func (wu *WorkerUpdate) SetName(s string) *WorkerUpdate
- func (wu *WorkerUpdate) SetToken(s string) *WorkerUpdate
- func (wu *WorkerUpdate) SetUpdatedAt(t time.Time) *WorkerUpdate
- func (wu *WorkerUpdate) Where(ps ...predicate.Worker) *WorkerUpdate
- type WorkerUpdateOne
- func (wuo *WorkerUpdateOne) AddChunkIDs(ids ...string) *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) AddChunks(c ...*Chunk) *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) ClearChunks() *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) Exec(ctx context.Context) error
- func (wuo *WorkerUpdateOne) ExecX(ctx context.Context)
- func (wuo *WorkerUpdateOne) Mutation() *WorkerMutation
- func (wuo *WorkerUpdateOne) RemoveChunkIDs(ids ...string) *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) RemoveChunks(c ...*Chunk) *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) Save(ctx context.Context) (*Worker, error)
- func (wuo *WorkerUpdateOne) SaveX(ctx context.Context) *Worker
- func (wuo *WorkerUpdateOne) Select(field string, fields ...string) *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) SetName(s string) *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) SetToken(s string) *WorkerUpdateOne
- func (wuo *WorkerUpdateOne) SetUpdatedAt(t time.Time) *WorkerUpdateOne
- type Workers
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeChunk = "Chunk" TypeWorker = "Worker" )
Variables ¶
This section is empty.
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 Chunk ¶
type Chunk struct { // ID of the ent. // Like 2006-01-02T15 ID string `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. // Time when entity was created. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // Time when entity was updated. UpdatedAt time.Time `json:"updated_at,omitempty"` // Start holds the value of the "start" field. // Minimum possible time of entry in chunk Start time.Time `json:"start,omitempty"` // LeaseExpiresAt holds the value of the "lease_expires_at" field. // State expiration like heartbeat LeaseExpiresAt time.Time `json:"lease_expires_at,omitempty"` // State holds the value of the "state" field. State chunk.State `json:"state,omitempty"` // SizeInput holds the value of the "size_input" field. SizeInput int64 `json:"size_input,omitempty"` // SizeContent holds the value of the "size_content" field. SizeContent int64 `json:"size_content,omitempty"` // SizeOutput holds the value of the "size_output" field. SizeOutput int64 `json:"size_output,omitempty"` // Sha256Input holds the value of the "sha256_input" field. Sha256Input *string `json:"sha256_input,omitempty"` // Sha256Content holds the value of the "sha256_content" field. Sha256Content *string `json:"sha256_content,omitempty"` // Sha256Output holds the value of the "sha256_output" field. Sha256Output *string `json:"sha256_output,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ChunkQuery when eager-loading is set. Edges ChunkEdges `json:"edges"` // contains filtered or unexported fields }
Chunk is the model entity for the Chunk schema.
func (*Chunk) QueryWorker ¶
func (c *Chunk) QueryWorker() *WorkerQuery
QueryWorker queries the "worker" edge of the Chunk entity.
func (*Chunk) Unwrap ¶
Unwrap unwraps the Chunk 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 (*Chunk) Update ¶
func (c *Chunk) Update() *ChunkUpdateOne
Update returns a builder for updating this Chunk. Note that you need to call Chunk.Unwrap() before calling this method if this Chunk was returned from a transaction, and the transaction was committed or rolled back.
type ChunkClient ¶
type ChunkClient struct {
// contains filtered or unexported fields
}
ChunkClient is a client for the Chunk schema.
func NewChunkClient ¶
func NewChunkClient(c config) *ChunkClient
NewChunkClient returns a client for the Chunk from the given config.
func (*ChunkClient) Create ¶
func (c *ChunkClient) Create() *ChunkCreate
Create returns a create builder for Chunk.
func (*ChunkClient) CreateBulk ¶
func (c *ChunkClient) CreateBulk(builders ...*ChunkCreate) *ChunkCreateBulk
CreateBulk returns a builder for creating a bulk of Chunk entities.
func (*ChunkClient) Delete ¶
func (c *ChunkClient) Delete() *ChunkDelete
Delete returns a delete builder for Chunk.
func (*ChunkClient) DeleteOne ¶
func (c *ChunkClient) DeleteOne(ch *Chunk) *ChunkDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*ChunkClient) DeleteOneID ¶
func (c *ChunkClient) DeleteOneID(id string) *ChunkDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*ChunkClient) GetX ¶
func (c *ChunkClient) GetX(ctx context.Context, id string) *Chunk
GetX is like Get, but panics if an error occurs.
func (*ChunkClient) Query ¶
func (c *ChunkClient) Query() *ChunkQuery
Query returns a query builder for Chunk.
func (*ChunkClient) QueryWorker ¶
func (c *ChunkClient) QueryWorker(ch *Chunk) *WorkerQuery
QueryWorker queries the worker edge of a Chunk.
func (*ChunkClient) Update ¶
func (c *ChunkClient) Update() *ChunkUpdate
Update returns an update builder for Chunk.
func (*ChunkClient) UpdateOne ¶
func (c *ChunkClient) UpdateOne(ch *Chunk) *ChunkUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ChunkClient) UpdateOneID ¶
func (c *ChunkClient) UpdateOneID(id string) *ChunkUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ChunkClient) Use ¶
func (c *ChunkClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chunk.Hooks(f(g(h())))`.
type ChunkCreate ¶
type ChunkCreate struct {
// contains filtered or unexported fields
}
ChunkCreate is the builder for creating a Chunk entity.
func (*ChunkCreate) Exec ¶
func (cc *ChunkCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChunkCreate) ExecX ¶
func (cc *ChunkCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChunkCreate) Mutation ¶
func (cc *ChunkCreate) Mutation() *ChunkMutation
Mutation returns the ChunkMutation object of the builder.
func (*ChunkCreate) Save ¶
func (cc *ChunkCreate) Save(ctx context.Context) (*Chunk, error)
Save creates the Chunk in the database.
func (*ChunkCreate) SaveX ¶
func (cc *ChunkCreate) SaveX(ctx context.Context) *Chunk
SaveX calls Save and panics if Save returns an error.
func (*ChunkCreate) SetCreatedAt ¶
func (cc *ChunkCreate) SetCreatedAt(t time.Time) *ChunkCreate
SetCreatedAt sets the "created_at" field.
func (*ChunkCreate) SetID ¶
func (cc *ChunkCreate) SetID(s string) *ChunkCreate
SetID sets the "id" field.
func (*ChunkCreate) SetLeaseExpiresAt ¶
func (cc *ChunkCreate) SetLeaseExpiresAt(t time.Time) *ChunkCreate
SetLeaseExpiresAt sets the "lease_expires_at" field.
func (*ChunkCreate) SetNillableCreatedAt ¶
func (cc *ChunkCreate) SetNillableCreatedAt(t *time.Time) *ChunkCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ChunkCreate) SetNillableLeaseExpiresAt ¶
func (cc *ChunkCreate) SetNillableLeaseExpiresAt(t *time.Time) *ChunkCreate
SetNillableLeaseExpiresAt sets the "lease_expires_at" field if the given value is not nil.
func (*ChunkCreate) SetNillableSha256Content ¶
func (cc *ChunkCreate) SetNillableSha256Content(s *string) *ChunkCreate
SetNillableSha256Content sets the "sha256_content" field if the given value is not nil.
func (*ChunkCreate) SetNillableSha256Input ¶
func (cc *ChunkCreate) SetNillableSha256Input(s *string) *ChunkCreate
SetNillableSha256Input sets the "sha256_input" field if the given value is not nil.
func (*ChunkCreate) SetNillableSha256Output ¶
func (cc *ChunkCreate) SetNillableSha256Output(s *string) *ChunkCreate
SetNillableSha256Output sets the "sha256_output" field if the given value is not nil.
func (*ChunkCreate) SetNillableSizeContent ¶
func (cc *ChunkCreate) SetNillableSizeContent(i *int64) *ChunkCreate
SetNillableSizeContent sets the "size_content" field if the given value is not nil.
func (*ChunkCreate) SetNillableSizeInput ¶
func (cc *ChunkCreate) SetNillableSizeInput(i *int64) *ChunkCreate
SetNillableSizeInput sets the "size_input" field if the given value is not nil.
func (*ChunkCreate) SetNillableSizeOutput ¶
func (cc *ChunkCreate) SetNillableSizeOutput(i *int64) *ChunkCreate
SetNillableSizeOutput sets the "size_output" field if the given value is not nil.
func (*ChunkCreate) SetNillableState ¶
func (cc *ChunkCreate) SetNillableState(c *chunk.State) *ChunkCreate
SetNillableState sets the "state" field if the given value is not nil.
func (*ChunkCreate) SetNillableUpdatedAt ¶
func (cc *ChunkCreate) SetNillableUpdatedAt(t *time.Time) *ChunkCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ChunkCreate) SetNillableWorkerID ¶
func (cc *ChunkCreate) SetNillableWorkerID(id *uuid.UUID) *ChunkCreate
SetNillableWorkerID sets the "worker" edge to the Worker entity by ID if the given value is not nil.
func (*ChunkCreate) SetSha256Content ¶
func (cc *ChunkCreate) SetSha256Content(s string) *ChunkCreate
SetSha256Content sets the "sha256_content" field.
func (*ChunkCreate) SetSha256Input ¶
func (cc *ChunkCreate) SetSha256Input(s string) *ChunkCreate
SetSha256Input sets the "sha256_input" field.
func (*ChunkCreate) SetSha256Output ¶
func (cc *ChunkCreate) SetSha256Output(s string) *ChunkCreate
SetSha256Output sets the "sha256_output" field.
func (*ChunkCreate) SetSizeContent ¶
func (cc *ChunkCreate) SetSizeContent(i int64) *ChunkCreate
SetSizeContent sets the "size_content" field.
func (*ChunkCreate) SetSizeInput ¶
func (cc *ChunkCreate) SetSizeInput(i int64) *ChunkCreate
SetSizeInput sets the "size_input" field.
func (*ChunkCreate) SetSizeOutput ¶
func (cc *ChunkCreate) SetSizeOutput(i int64) *ChunkCreate
SetSizeOutput sets the "size_output" field.
func (*ChunkCreate) SetStart ¶
func (cc *ChunkCreate) SetStart(t time.Time) *ChunkCreate
SetStart sets the "start" field.
func (*ChunkCreate) SetState ¶
func (cc *ChunkCreate) SetState(c chunk.State) *ChunkCreate
SetState sets the "state" field.
func (*ChunkCreate) SetUpdatedAt ¶
func (cc *ChunkCreate) SetUpdatedAt(t time.Time) *ChunkCreate
SetUpdatedAt sets the "updated_at" field.
func (*ChunkCreate) SetWorker ¶
func (cc *ChunkCreate) SetWorker(w *Worker) *ChunkCreate
SetWorker sets the "worker" edge to the Worker entity.
func (*ChunkCreate) SetWorkerID ¶
func (cc *ChunkCreate) SetWorkerID(id uuid.UUID) *ChunkCreate
SetWorkerID sets the "worker" edge to the Worker entity by ID.
type ChunkCreateBulk ¶
type ChunkCreateBulk struct {
// contains filtered or unexported fields
}
ChunkCreateBulk is the builder for creating many Chunk entities in bulk.
func (*ChunkCreateBulk) Exec ¶
func (ccb *ChunkCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ChunkCreateBulk) ExecX ¶
func (ccb *ChunkCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ChunkDelete ¶
type ChunkDelete struct {
// contains filtered or unexported fields
}
ChunkDelete is the builder for deleting a Chunk entity.
func (*ChunkDelete) Exec ¶
func (cd *ChunkDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ChunkDelete) ExecX ¶
func (cd *ChunkDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ChunkDelete) Where ¶
func (cd *ChunkDelete) Where(ps ...predicate.Chunk) *ChunkDelete
Where appends a list predicates to the ChunkDelete builder.
type ChunkDeleteOne ¶
type ChunkDeleteOne struct {
// contains filtered or unexported fields
}
ChunkDeleteOne is the builder for deleting a single Chunk entity.
func (*ChunkDeleteOne) Exec ¶
func (cdo *ChunkDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ChunkDeleteOne) ExecX ¶
func (cdo *ChunkDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ChunkEdges ¶
type ChunkEdges struct { // Worker holds the value of the worker edge. Worker *Worker `json:"worker,omitempty"` // contains filtered or unexported fields }
ChunkEdges holds the relations/edges for other nodes in the graph.
func (ChunkEdges) WorkerOrErr ¶
func (e ChunkEdges) WorkerOrErr() (*Worker, error)
WorkerOrErr returns the Worker value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ChunkGroupBy ¶
type ChunkGroupBy struct {
// contains filtered or unexported fields
}
ChunkGroupBy is the group-by builder for Chunk entities.
func (*ChunkGroupBy) Aggregate ¶
func (cgb *ChunkGroupBy) Aggregate(fns ...AggregateFunc) *ChunkGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ChunkGroupBy) Bool ¶
func (cgb *ChunkGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ChunkGroupBy) BoolX ¶
func (cgb *ChunkGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ChunkGroupBy) Bools ¶
func (cgb *ChunkGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*ChunkGroupBy) BoolsX ¶
func (cgb *ChunkGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ChunkGroupBy) Float64 ¶
func (cgb *ChunkGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ChunkGroupBy) Float64X ¶
func (cgb *ChunkGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ChunkGroupBy) Float64s ¶
func (cgb *ChunkGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*ChunkGroupBy) Float64sX ¶
func (cgb *ChunkGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ChunkGroupBy) Int ¶
func (cgb *ChunkGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ChunkGroupBy) IntX ¶
func (cgb *ChunkGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ChunkGroupBy) Ints ¶
func (cgb *ChunkGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*ChunkGroupBy) IntsX ¶
func (cgb *ChunkGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ChunkGroupBy) Scan ¶
func (cgb *ChunkGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*ChunkGroupBy) ScanX ¶
func (cgb *ChunkGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ChunkGroupBy) String ¶
func (cgb *ChunkGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ChunkGroupBy) StringX ¶
func (cgb *ChunkGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ChunkMutation ¶
type ChunkMutation struct {
// contains filtered or unexported fields
}
ChunkMutation represents an operation that mutates the Chunk nodes in the graph.
func (*ChunkMutation) AddField ¶
func (m *ChunkMutation) 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 (*ChunkMutation) AddSizeContent ¶
func (m *ChunkMutation) AddSizeContent(i int64)
AddSizeContent adds i to the "size_content" field.
func (*ChunkMutation) AddSizeInput ¶
func (m *ChunkMutation) AddSizeInput(i int64)
AddSizeInput adds i to the "size_input" field.
func (*ChunkMutation) AddSizeOutput ¶
func (m *ChunkMutation) AddSizeOutput(i int64)
AddSizeOutput adds i to the "size_output" field.
func (*ChunkMutation) AddedEdges ¶
func (m *ChunkMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ChunkMutation) AddedField ¶
func (m *ChunkMutation) 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 (*ChunkMutation) AddedFields ¶
func (m *ChunkMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ChunkMutation) AddedIDs ¶
func (m *ChunkMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ChunkMutation) AddedSizeContent ¶
func (m *ChunkMutation) AddedSizeContent() (r int64, exists bool)
AddedSizeContent returns the value that was added to the "size_content" field in this mutation.
func (*ChunkMutation) AddedSizeInput ¶
func (m *ChunkMutation) AddedSizeInput() (r int64, exists bool)
AddedSizeInput returns the value that was added to the "size_input" field in this mutation.
func (*ChunkMutation) AddedSizeOutput ¶
func (m *ChunkMutation) AddedSizeOutput() (r int64, exists bool)
AddedSizeOutput returns the value that was added to the "size_output" field in this mutation.
func (*ChunkMutation) ClearEdge ¶
func (m *ChunkMutation) 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 (*ChunkMutation) ClearField ¶
func (m *ChunkMutation) 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 (*ChunkMutation) ClearLeaseExpiresAt ¶
func (m *ChunkMutation) ClearLeaseExpiresAt()
ClearLeaseExpiresAt clears the value of the "lease_expires_at" field.
func (*ChunkMutation) ClearSha256Content ¶
func (m *ChunkMutation) ClearSha256Content()
ClearSha256Content clears the value of the "sha256_content" field.
func (*ChunkMutation) ClearSha256Input ¶
func (m *ChunkMutation) ClearSha256Input()
ClearSha256Input clears the value of the "sha256_input" field.
func (*ChunkMutation) ClearSha256Output ¶
func (m *ChunkMutation) ClearSha256Output()
ClearSha256Output clears the value of the "sha256_output" field.
func (*ChunkMutation) ClearSizeContent ¶
func (m *ChunkMutation) ClearSizeContent()
ClearSizeContent clears the value of the "size_content" field.
func (*ChunkMutation) ClearSizeInput ¶
func (m *ChunkMutation) ClearSizeInput()
ClearSizeInput clears the value of the "size_input" field.
func (*ChunkMutation) ClearSizeOutput ¶
func (m *ChunkMutation) ClearSizeOutput()
ClearSizeOutput clears the value of the "size_output" field.
func (*ChunkMutation) ClearWorker ¶
func (m *ChunkMutation) ClearWorker()
ClearWorker clears the "worker" edge to the Worker entity.
func (*ChunkMutation) ClearedEdges ¶
func (m *ChunkMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ChunkMutation) ClearedFields ¶
func (m *ChunkMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ChunkMutation) Client ¶
func (m ChunkMutation) 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 (*ChunkMutation) CreatedAt ¶
func (m *ChunkMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ChunkMutation) EdgeCleared ¶
func (m *ChunkMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ChunkMutation) Field ¶
func (m *ChunkMutation) 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 (*ChunkMutation) FieldCleared ¶
func (m *ChunkMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ChunkMutation) Fields ¶
func (m *ChunkMutation) 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 (*ChunkMutation) ID ¶
func (m *ChunkMutation) ID() (id string, 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 (*ChunkMutation) LeaseExpiresAt ¶
func (m *ChunkMutation) LeaseExpiresAt() (r time.Time, exists bool)
LeaseExpiresAt returns the value of the "lease_expires_at" field in the mutation.
func (*ChunkMutation) LeaseExpiresAtCleared ¶
func (m *ChunkMutation) LeaseExpiresAtCleared() bool
LeaseExpiresAtCleared returns if the "lease_expires_at" field was cleared in this mutation.
func (*ChunkMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) 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 (*ChunkMutation) OldLeaseExpiresAt ¶
OldLeaseExpiresAt returns the old "lease_expires_at" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldSha256Content ¶
func (m *ChunkMutation) OldSha256Content(ctx context.Context) (v *string, err error)
OldSha256Content returns the old "sha256_content" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldSha256Input ¶
func (m *ChunkMutation) OldSha256Input(ctx context.Context) (v *string, err error)
OldSha256Input returns the old "sha256_input" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldSha256Output ¶
func (m *ChunkMutation) OldSha256Output(ctx context.Context) (v *string, err error)
OldSha256Output returns the old "sha256_output" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldSizeContent ¶
func (m *ChunkMutation) OldSizeContent(ctx context.Context) (v int64, err error)
OldSizeContent returns the old "size_content" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldSizeInput ¶
func (m *ChunkMutation) OldSizeInput(ctx context.Context) (v int64, err error)
OldSizeInput returns the old "size_input" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldSizeOutput ¶
func (m *ChunkMutation) OldSizeOutput(ctx context.Context) (v int64, err error)
OldSizeOutput returns the old "size_output" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldStart ¶
OldStart returns the old "start" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldState ¶
OldState returns the old "state" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Chunk entity. If the Chunk object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ChunkMutation) RemovedEdges ¶
func (m *ChunkMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ChunkMutation) RemovedIDs ¶
func (m *ChunkMutation) 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 (*ChunkMutation) ResetCreatedAt ¶
func (m *ChunkMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ChunkMutation) ResetEdge ¶
func (m *ChunkMutation) 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 (*ChunkMutation) ResetField ¶
func (m *ChunkMutation) 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 (*ChunkMutation) ResetLeaseExpiresAt ¶
func (m *ChunkMutation) ResetLeaseExpiresAt()
ResetLeaseExpiresAt resets all changes to the "lease_expires_at" field.
func (*ChunkMutation) ResetSha256Content ¶
func (m *ChunkMutation) ResetSha256Content()
ResetSha256Content resets all changes to the "sha256_content" field.
func (*ChunkMutation) ResetSha256Input ¶
func (m *ChunkMutation) ResetSha256Input()
ResetSha256Input resets all changes to the "sha256_input" field.
func (*ChunkMutation) ResetSha256Output ¶
func (m *ChunkMutation) ResetSha256Output()
ResetSha256Output resets all changes to the "sha256_output" field.
func (*ChunkMutation) ResetSizeContent ¶
func (m *ChunkMutation) ResetSizeContent()
ResetSizeContent resets all changes to the "size_content" field.
func (*ChunkMutation) ResetSizeInput ¶
func (m *ChunkMutation) ResetSizeInput()
ResetSizeInput resets all changes to the "size_input" field.
func (*ChunkMutation) ResetSizeOutput ¶
func (m *ChunkMutation) ResetSizeOutput()
ResetSizeOutput resets all changes to the "size_output" field.
func (*ChunkMutation) ResetStart ¶
func (m *ChunkMutation) ResetStart()
ResetStart resets all changes to the "start" field.
func (*ChunkMutation) ResetState ¶
func (m *ChunkMutation) ResetState()
ResetState resets all changes to the "state" field.
func (*ChunkMutation) ResetUpdatedAt ¶
func (m *ChunkMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ChunkMutation) ResetWorker ¶
func (m *ChunkMutation) ResetWorker()
ResetWorker resets all changes to the "worker" edge.
func (*ChunkMutation) SetCreatedAt ¶
func (m *ChunkMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ChunkMutation) SetField ¶
func (m *ChunkMutation) 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 (*ChunkMutation) SetID ¶
func (m *ChunkMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Chunk entities.
func (*ChunkMutation) SetLeaseExpiresAt ¶
func (m *ChunkMutation) SetLeaseExpiresAt(t time.Time)
SetLeaseExpiresAt sets the "lease_expires_at" field.
func (*ChunkMutation) SetSha256Content ¶
func (m *ChunkMutation) SetSha256Content(s string)
SetSha256Content sets the "sha256_content" field.
func (*ChunkMutation) SetSha256Input ¶
func (m *ChunkMutation) SetSha256Input(s string)
SetSha256Input sets the "sha256_input" field.
func (*ChunkMutation) SetSha256Output ¶
func (m *ChunkMutation) SetSha256Output(s string)
SetSha256Output sets the "sha256_output" field.
func (*ChunkMutation) SetSizeContent ¶
func (m *ChunkMutation) SetSizeContent(i int64)
SetSizeContent sets the "size_content" field.
func (*ChunkMutation) SetSizeInput ¶
func (m *ChunkMutation) SetSizeInput(i int64)
SetSizeInput sets the "size_input" field.
func (*ChunkMutation) SetSizeOutput ¶
func (m *ChunkMutation) SetSizeOutput(i int64)
SetSizeOutput sets the "size_output" field.
func (*ChunkMutation) SetStart ¶
func (m *ChunkMutation) SetStart(t time.Time)
SetStart sets the "start" field.
func (*ChunkMutation) SetState ¶
func (m *ChunkMutation) SetState(c chunk.State)
SetState sets the "state" field.
func (*ChunkMutation) SetUpdatedAt ¶
func (m *ChunkMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ChunkMutation) SetWorkerID ¶
func (m *ChunkMutation) SetWorkerID(id uuid.UUID)
SetWorkerID sets the "worker" edge to the Worker entity by id.
func (*ChunkMutation) Sha256Content ¶
func (m *ChunkMutation) Sha256Content() (r string, exists bool)
Sha256Content returns the value of the "sha256_content" field in the mutation.
func (*ChunkMutation) Sha256ContentCleared ¶
func (m *ChunkMutation) Sha256ContentCleared() bool
Sha256ContentCleared returns if the "sha256_content" field was cleared in this mutation.
func (*ChunkMutation) Sha256Input ¶
func (m *ChunkMutation) Sha256Input() (r string, exists bool)
Sha256Input returns the value of the "sha256_input" field in the mutation.
func (*ChunkMutation) Sha256InputCleared ¶
func (m *ChunkMutation) Sha256InputCleared() bool
Sha256InputCleared returns if the "sha256_input" field was cleared in this mutation.
func (*ChunkMutation) Sha256Output ¶
func (m *ChunkMutation) Sha256Output() (r string, exists bool)
Sha256Output returns the value of the "sha256_output" field in the mutation.
func (*ChunkMutation) Sha256OutputCleared ¶
func (m *ChunkMutation) Sha256OutputCleared() bool
Sha256OutputCleared returns if the "sha256_output" field was cleared in this mutation.
func (*ChunkMutation) SizeContent ¶
func (m *ChunkMutation) SizeContent() (r int64, exists bool)
SizeContent returns the value of the "size_content" field in the mutation.
func (*ChunkMutation) SizeContentCleared ¶
func (m *ChunkMutation) SizeContentCleared() bool
SizeContentCleared returns if the "size_content" field was cleared in this mutation.
func (*ChunkMutation) SizeInput ¶
func (m *ChunkMutation) SizeInput() (r int64, exists bool)
SizeInput returns the value of the "size_input" field in the mutation.
func (*ChunkMutation) SizeInputCleared ¶
func (m *ChunkMutation) SizeInputCleared() bool
SizeInputCleared returns if the "size_input" field was cleared in this mutation.
func (*ChunkMutation) SizeOutput ¶
func (m *ChunkMutation) SizeOutput() (r int64, exists bool)
SizeOutput returns the value of the "size_output" field in the mutation.
func (*ChunkMutation) SizeOutputCleared ¶
func (m *ChunkMutation) SizeOutputCleared() bool
SizeOutputCleared returns if the "size_output" field was cleared in this mutation.
func (*ChunkMutation) Start ¶
func (m *ChunkMutation) Start() (r time.Time, exists bool)
Start returns the value of the "start" field in the mutation.
func (*ChunkMutation) State ¶
func (m *ChunkMutation) State() (r chunk.State, exists bool)
State returns the value of the "state" field in the mutation.
func (ChunkMutation) Tx ¶
func (m ChunkMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ChunkMutation) Type ¶
func (m *ChunkMutation) Type() string
Type returns the node type of this mutation (Chunk).
func (*ChunkMutation) UpdatedAt ¶
func (m *ChunkMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ChunkMutation) Where ¶
func (m *ChunkMutation) Where(ps ...predicate.Chunk)
Where appends a list predicates to the ChunkMutation builder.
func (*ChunkMutation) WorkerCleared ¶
func (m *ChunkMutation) WorkerCleared() bool
WorkerCleared reports if the "worker" edge to the Worker entity was cleared.
func (*ChunkMutation) WorkerID ¶
func (m *ChunkMutation) WorkerID() (id uuid.UUID, exists bool)
WorkerID returns the "worker" edge ID in the mutation.
func (*ChunkMutation) WorkerIDs ¶
func (m *ChunkMutation) WorkerIDs() (ids []uuid.UUID)
WorkerIDs returns the "worker" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use WorkerID instead. It exists only for internal usage by the builders.
type ChunkQuery ¶
type ChunkQuery struct {
// contains filtered or unexported fields
}
ChunkQuery is the builder for querying Chunk entities.
func (*ChunkQuery) All ¶
func (cq *ChunkQuery) All(ctx context.Context) ([]*Chunk, error)
All executes the query and returns a list of Chunks.
func (*ChunkQuery) AllX ¶
func (cq *ChunkQuery) AllX(ctx context.Context) []*Chunk
AllX is like All, but panics if an error occurs.
func (*ChunkQuery) Clone ¶
func (cq *ChunkQuery) Clone() *ChunkQuery
Clone returns a duplicate of the ChunkQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ChunkQuery) Count ¶
func (cq *ChunkQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ChunkQuery) CountX ¶
func (cq *ChunkQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ChunkQuery) Exist ¶
func (cq *ChunkQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ChunkQuery) ExistX ¶
func (cq *ChunkQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ChunkQuery) First ¶
func (cq *ChunkQuery) First(ctx context.Context) (*Chunk, error)
First returns the first Chunk entity from the query. Returns a *NotFoundError when no Chunk was found.
func (*ChunkQuery) FirstID ¶
func (cq *ChunkQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Chunk ID from the query. Returns a *NotFoundError when no Chunk ID was found.
func (*ChunkQuery) FirstIDX ¶
func (cq *ChunkQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*ChunkQuery) FirstX ¶
func (cq *ChunkQuery) FirstX(ctx context.Context) *Chunk
FirstX is like First, but panics if an error occurs.
func (*ChunkQuery) ForShare ¶
func (cq *ChunkQuery) ForShare(opts ...sql.LockOption) *ChunkQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*ChunkQuery) ForUpdate ¶
func (cq *ChunkQuery) ForUpdate(opts ...sql.LockOption) *ChunkQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*ChunkQuery) GroupBy ¶
func (cq *ChunkQuery) GroupBy(field string, fields ...string) *ChunkGroupBy
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.Chunk.Query(). GroupBy(chunk.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ChunkQuery) IDs ¶
func (cq *ChunkQuery) IDs(ctx context.Context) ([]string, error)
IDs executes the query and returns a list of Chunk IDs.
func (*ChunkQuery) IDsX ¶
func (cq *ChunkQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*ChunkQuery) Limit ¶
func (cq *ChunkQuery) Limit(limit int) *ChunkQuery
Limit adds a limit step to the query.
func (*ChunkQuery) Offset ¶
func (cq *ChunkQuery) Offset(offset int) *ChunkQuery
Offset adds an offset step to the query.
func (*ChunkQuery) Only ¶
func (cq *ChunkQuery) Only(ctx context.Context) (*Chunk, error)
Only returns a single Chunk entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Chunk entity is not found. Returns a *NotFoundError when no Chunk entities are found.
func (*ChunkQuery) OnlyID ¶
func (cq *ChunkQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Chunk ID in the query. Returns a *NotSingularError when exactly one Chunk ID is not found. Returns a *NotFoundError when no entities are found.
func (*ChunkQuery) OnlyIDX ¶
func (cq *ChunkQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ChunkQuery) OnlyX ¶
func (cq *ChunkQuery) OnlyX(ctx context.Context) *Chunk
OnlyX is like Only, but panics if an error occurs.
func (*ChunkQuery) Order ¶
func (cq *ChunkQuery) Order(o ...OrderFunc) *ChunkQuery
Order adds an order step to the query.
func (*ChunkQuery) QueryWorker ¶
func (cq *ChunkQuery) QueryWorker() *WorkerQuery
QueryWorker chains the current query on the "worker" edge.
func (*ChunkQuery) Select ¶
func (cq *ChunkQuery) Select(fields ...string) *ChunkSelect
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.Chunk.Query(). Select(chunk.FieldCreatedAt). Scan(ctx, &v)
func (*ChunkQuery) Unique ¶
func (cq *ChunkQuery) Unique(unique bool) *ChunkQuery
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 (*ChunkQuery) Where ¶
func (cq *ChunkQuery) Where(ps ...predicate.Chunk) *ChunkQuery
Where adds a new predicate for the ChunkQuery builder.
func (*ChunkQuery) WithWorker ¶
func (cq *ChunkQuery) WithWorker(opts ...func(*WorkerQuery)) *ChunkQuery
WithWorker tells the query-builder to eager-load the nodes that are connected to the "worker" edge. The optional arguments are used to configure the query builder of the edge.
type ChunkSelect ¶
type ChunkSelect struct { *ChunkQuery // contains filtered or unexported fields }
ChunkSelect is the builder for selecting fields of Chunk entities.
func (*ChunkSelect) Bool ¶
func (cs *ChunkSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChunkSelect) BoolX ¶
func (cs *ChunkSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ChunkSelect) Bools ¶
func (cs *ChunkSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChunkSelect) BoolsX ¶
func (cs *ChunkSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ChunkSelect) Float64 ¶
func (cs *ChunkSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChunkSelect) Float64X ¶
func (cs *ChunkSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ChunkSelect) Float64s ¶
func (cs *ChunkSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChunkSelect) Float64sX ¶
func (cs *ChunkSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ChunkSelect) Int ¶
func (cs *ChunkSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChunkSelect) IntX ¶
func (cs *ChunkSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ChunkSelect) Ints ¶
func (cs *ChunkSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChunkSelect) IntsX ¶
func (cs *ChunkSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ChunkSelect) Scan ¶
func (cs *ChunkSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*ChunkSelect) ScanX ¶
func (cs *ChunkSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ChunkSelect) String ¶
func (cs *ChunkSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*ChunkSelect) StringX ¶
func (cs *ChunkSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ChunkUpdate ¶
type ChunkUpdate struct {
// contains filtered or unexported fields
}
ChunkUpdate is the builder for updating Chunk entities.
func (*ChunkUpdate) AddSizeContent ¶
func (cu *ChunkUpdate) AddSizeContent(i int64) *ChunkUpdate
AddSizeContent adds i to the "size_content" field.
func (*ChunkUpdate) AddSizeInput ¶
func (cu *ChunkUpdate) AddSizeInput(i int64) *ChunkUpdate
AddSizeInput adds i to the "size_input" field.
func (*ChunkUpdate) AddSizeOutput ¶
func (cu *ChunkUpdate) AddSizeOutput(i int64) *ChunkUpdate
AddSizeOutput adds i to the "size_output" field.
func (*ChunkUpdate) ClearLeaseExpiresAt ¶
func (cu *ChunkUpdate) ClearLeaseExpiresAt() *ChunkUpdate
ClearLeaseExpiresAt clears the value of the "lease_expires_at" field.
func (*ChunkUpdate) ClearSha256Content ¶
func (cu *ChunkUpdate) ClearSha256Content() *ChunkUpdate
ClearSha256Content clears the value of the "sha256_content" field.
func (*ChunkUpdate) ClearSha256Input ¶
func (cu *ChunkUpdate) ClearSha256Input() *ChunkUpdate
ClearSha256Input clears the value of the "sha256_input" field.
func (*ChunkUpdate) ClearSha256Output ¶
func (cu *ChunkUpdate) ClearSha256Output() *ChunkUpdate
ClearSha256Output clears the value of the "sha256_output" field.
func (*ChunkUpdate) ClearSizeContent ¶
func (cu *ChunkUpdate) ClearSizeContent() *ChunkUpdate
ClearSizeContent clears the value of the "size_content" field.
func (*ChunkUpdate) ClearSizeInput ¶
func (cu *ChunkUpdate) ClearSizeInput() *ChunkUpdate
ClearSizeInput clears the value of the "size_input" field.
func (*ChunkUpdate) ClearSizeOutput ¶
func (cu *ChunkUpdate) ClearSizeOutput() *ChunkUpdate
ClearSizeOutput clears the value of the "size_output" field.
func (*ChunkUpdate) ClearWorker ¶
func (cu *ChunkUpdate) ClearWorker() *ChunkUpdate
ClearWorker clears the "worker" edge to the Worker entity.
func (*ChunkUpdate) Exec ¶
func (cu *ChunkUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChunkUpdate) ExecX ¶
func (cu *ChunkUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChunkUpdate) Mutation ¶
func (cu *ChunkUpdate) Mutation() *ChunkMutation
Mutation returns the ChunkMutation object of the builder.
func (*ChunkUpdate) Save ¶
func (cu *ChunkUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ChunkUpdate) SaveX ¶
func (cu *ChunkUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ChunkUpdate) SetLeaseExpiresAt ¶
func (cu *ChunkUpdate) SetLeaseExpiresAt(t time.Time) *ChunkUpdate
SetLeaseExpiresAt sets the "lease_expires_at" field.
func (*ChunkUpdate) SetNillableLeaseExpiresAt ¶
func (cu *ChunkUpdate) SetNillableLeaseExpiresAt(t *time.Time) *ChunkUpdate
SetNillableLeaseExpiresAt sets the "lease_expires_at" field if the given value is not nil.
func (*ChunkUpdate) SetNillableSha256Content ¶
func (cu *ChunkUpdate) SetNillableSha256Content(s *string) *ChunkUpdate
SetNillableSha256Content sets the "sha256_content" field if the given value is not nil.
func (*ChunkUpdate) SetNillableSha256Input ¶
func (cu *ChunkUpdate) SetNillableSha256Input(s *string) *ChunkUpdate
SetNillableSha256Input sets the "sha256_input" field if the given value is not nil.
func (*ChunkUpdate) SetNillableSha256Output ¶
func (cu *ChunkUpdate) SetNillableSha256Output(s *string) *ChunkUpdate
SetNillableSha256Output sets the "sha256_output" field if the given value is not nil.
func (*ChunkUpdate) SetNillableSizeContent ¶
func (cu *ChunkUpdate) SetNillableSizeContent(i *int64) *ChunkUpdate
SetNillableSizeContent sets the "size_content" field if the given value is not nil.
func (*ChunkUpdate) SetNillableSizeInput ¶
func (cu *ChunkUpdate) SetNillableSizeInput(i *int64) *ChunkUpdate
SetNillableSizeInput sets the "size_input" field if the given value is not nil.
func (*ChunkUpdate) SetNillableSizeOutput ¶
func (cu *ChunkUpdate) SetNillableSizeOutput(i *int64) *ChunkUpdate
SetNillableSizeOutput sets the "size_output" field if the given value is not nil.
func (*ChunkUpdate) SetNillableState ¶
func (cu *ChunkUpdate) SetNillableState(c *chunk.State) *ChunkUpdate
SetNillableState sets the "state" field if the given value is not nil.
func (*ChunkUpdate) SetNillableWorkerID ¶
func (cu *ChunkUpdate) SetNillableWorkerID(id *uuid.UUID) *ChunkUpdate
SetNillableWorkerID sets the "worker" edge to the Worker entity by ID if the given value is not nil.
func (*ChunkUpdate) SetSha256Content ¶
func (cu *ChunkUpdate) SetSha256Content(s string) *ChunkUpdate
SetSha256Content sets the "sha256_content" field.
func (*ChunkUpdate) SetSha256Input ¶
func (cu *ChunkUpdate) SetSha256Input(s string) *ChunkUpdate
SetSha256Input sets the "sha256_input" field.
func (*ChunkUpdate) SetSha256Output ¶
func (cu *ChunkUpdate) SetSha256Output(s string) *ChunkUpdate
SetSha256Output sets the "sha256_output" field.
func (*ChunkUpdate) SetSizeContent ¶
func (cu *ChunkUpdate) SetSizeContent(i int64) *ChunkUpdate
SetSizeContent sets the "size_content" field.
func (*ChunkUpdate) SetSizeInput ¶
func (cu *ChunkUpdate) SetSizeInput(i int64) *ChunkUpdate
SetSizeInput sets the "size_input" field.
func (*ChunkUpdate) SetSizeOutput ¶
func (cu *ChunkUpdate) SetSizeOutput(i int64) *ChunkUpdate
SetSizeOutput sets the "size_output" field.
func (*ChunkUpdate) SetStart ¶
func (cu *ChunkUpdate) SetStart(t time.Time) *ChunkUpdate
SetStart sets the "start" field.
func (*ChunkUpdate) SetState ¶
func (cu *ChunkUpdate) SetState(c chunk.State) *ChunkUpdate
SetState sets the "state" field.
func (*ChunkUpdate) SetUpdatedAt ¶
func (cu *ChunkUpdate) SetUpdatedAt(t time.Time) *ChunkUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ChunkUpdate) SetWorker ¶
func (cu *ChunkUpdate) SetWorker(w *Worker) *ChunkUpdate
SetWorker sets the "worker" edge to the Worker entity.
func (*ChunkUpdate) SetWorkerID ¶
func (cu *ChunkUpdate) SetWorkerID(id uuid.UUID) *ChunkUpdate
SetWorkerID sets the "worker" edge to the Worker entity by ID.
func (*ChunkUpdate) Where ¶
func (cu *ChunkUpdate) Where(ps ...predicate.Chunk) *ChunkUpdate
Where appends a list predicates to the ChunkUpdate builder.
type ChunkUpdateOne ¶
type ChunkUpdateOne struct {
// contains filtered or unexported fields
}
ChunkUpdateOne is the builder for updating a single Chunk entity.
func (*ChunkUpdateOne) AddSizeContent ¶
func (cuo *ChunkUpdateOne) AddSizeContent(i int64) *ChunkUpdateOne
AddSizeContent adds i to the "size_content" field.
func (*ChunkUpdateOne) AddSizeInput ¶
func (cuo *ChunkUpdateOne) AddSizeInput(i int64) *ChunkUpdateOne
AddSizeInput adds i to the "size_input" field.
func (*ChunkUpdateOne) AddSizeOutput ¶
func (cuo *ChunkUpdateOne) AddSizeOutput(i int64) *ChunkUpdateOne
AddSizeOutput adds i to the "size_output" field.
func (*ChunkUpdateOne) ClearLeaseExpiresAt ¶
func (cuo *ChunkUpdateOne) ClearLeaseExpiresAt() *ChunkUpdateOne
ClearLeaseExpiresAt clears the value of the "lease_expires_at" field.
func (*ChunkUpdateOne) ClearSha256Content ¶
func (cuo *ChunkUpdateOne) ClearSha256Content() *ChunkUpdateOne
ClearSha256Content clears the value of the "sha256_content" field.
func (*ChunkUpdateOne) ClearSha256Input ¶
func (cuo *ChunkUpdateOne) ClearSha256Input() *ChunkUpdateOne
ClearSha256Input clears the value of the "sha256_input" field.
func (*ChunkUpdateOne) ClearSha256Output ¶
func (cuo *ChunkUpdateOne) ClearSha256Output() *ChunkUpdateOne
ClearSha256Output clears the value of the "sha256_output" field.
func (*ChunkUpdateOne) ClearSizeContent ¶
func (cuo *ChunkUpdateOne) ClearSizeContent() *ChunkUpdateOne
ClearSizeContent clears the value of the "size_content" field.
func (*ChunkUpdateOne) ClearSizeInput ¶
func (cuo *ChunkUpdateOne) ClearSizeInput() *ChunkUpdateOne
ClearSizeInput clears the value of the "size_input" field.
func (*ChunkUpdateOne) ClearSizeOutput ¶
func (cuo *ChunkUpdateOne) ClearSizeOutput() *ChunkUpdateOne
ClearSizeOutput clears the value of the "size_output" field.
func (*ChunkUpdateOne) ClearWorker ¶
func (cuo *ChunkUpdateOne) ClearWorker() *ChunkUpdateOne
ClearWorker clears the "worker" edge to the Worker entity.
func (*ChunkUpdateOne) Exec ¶
func (cuo *ChunkUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ChunkUpdateOne) ExecX ¶
func (cuo *ChunkUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChunkUpdateOne) Mutation ¶
func (cuo *ChunkUpdateOne) Mutation() *ChunkMutation
Mutation returns the ChunkMutation object of the builder.
func (*ChunkUpdateOne) Save ¶
func (cuo *ChunkUpdateOne) Save(ctx context.Context) (*Chunk, error)
Save executes the query and returns the updated Chunk entity.
func (*ChunkUpdateOne) SaveX ¶
func (cuo *ChunkUpdateOne) SaveX(ctx context.Context) *Chunk
SaveX is like Save, but panics if an error occurs.
func (*ChunkUpdateOne) Select ¶
func (cuo *ChunkUpdateOne) Select(field string, fields ...string) *ChunkUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ChunkUpdateOne) SetLeaseExpiresAt ¶
func (cuo *ChunkUpdateOne) SetLeaseExpiresAt(t time.Time) *ChunkUpdateOne
SetLeaseExpiresAt sets the "lease_expires_at" field.
func (*ChunkUpdateOne) SetNillableLeaseExpiresAt ¶
func (cuo *ChunkUpdateOne) SetNillableLeaseExpiresAt(t *time.Time) *ChunkUpdateOne
SetNillableLeaseExpiresAt sets the "lease_expires_at" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableSha256Content ¶
func (cuo *ChunkUpdateOne) SetNillableSha256Content(s *string) *ChunkUpdateOne
SetNillableSha256Content sets the "sha256_content" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableSha256Input ¶
func (cuo *ChunkUpdateOne) SetNillableSha256Input(s *string) *ChunkUpdateOne
SetNillableSha256Input sets the "sha256_input" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableSha256Output ¶
func (cuo *ChunkUpdateOne) SetNillableSha256Output(s *string) *ChunkUpdateOne
SetNillableSha256Output sets the "sha256_output" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableSizeContent ¶
func (cuo *ChunkUpdateOne) SetNillableSizeContent(i *int64) *ChunkUpdateOne
SetNillableSizeContent sets the "size_content" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableSizeInput ¶
func (cuo *ChunkUpdateOne) SetNillableSizeInput(i *int64) *ChunkUpdateOne
SetNillableSizeInput sets the "size_input" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableSizeOutput ¶
func (cuo *ChunkUpdateOne) SetNillableSizeOutput(i *int64) *ChunkUpdateOne
SetNillableSizeOutput sets the "size_output" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableState ¶
func (cuo *ChunkUpdateOne) SetNillableState(c *chunk.State) *ChunkUpdateOne
SetNillableState sets the "state" field if the given value is not nil.
func (*ChunkUpdateOne) SetNillableWorkerID ¶
func (cuo *ChunkUpdateOne) SetNillableWorkerID(id *uuid.UUID) *ChunkUpdateOne
SetNillableWorkerID sets the "worker" edge to the Worker entity by ID if the given value is not nil.
func (*ChunkUpdateOne) SetSha256Content ¶
func (cuo *ChunkUpdateOne) SetSha256Content(s string) *ChunkUpdateOne
SetSha256Content sets the "sha256_content" field.
func (*ChunkUpdateOne) SetSha256Input ¶
func (cuo *ChunkUpdateOne) SetSha256Input(s string) *ChunkUpdateOne
SetSha256Input sets the "sha256_input" field.
func (*ChunkUpdateOne) SetSha256Output ¶
func (cuo *ChunkUpdateOne) SetSha256Output(s string) *ChunkUpdateOne
SetSha256Output sets the "sha256_output" field.
func (*ChunkUpdateOne) SetSizeContent ¶
func (cuo *ChunkUpdateOne) SetSizeContent(i int64) *ChunkUpdateOne
SetSizeContent sets the "size_content" field.
func (*ChunkUpdateOne) SetSizeInput ¶
func (cuo *ChunkUpdateOne) SetSizeInput(i int64) *ChunkUpdateOne
SetSizeInput sets the "size_input" field.
func (*ChunkUpdateOne) SetSizeOutput ¶
func (cuo *ChunkUpdateOne) SetSizeOutput(i int64) *ChunkUpdateOne
SetSizeOutput sets the "size_output" field.
func (*ChunkUpdateOne) SetStart ¶
func (cuo *ChunkUpdateOne) SetStart(t time.Time) *ChunkUpdateOne
SetStart sets the "start" field.
func (*ChunkUpdateOne) SetState ¶
func (cuo *ChunkUpdateOne) SetState(c chunk.State) *ChunkUpdateOne
SetState sets the "state" field.
func (*ChunkUpdateOne) SetUpdatedAt ¶
func (cuo *ChunkUpdateOne) SetUpdatedAt(t time.Time) *ChunkUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ChunkUpdateOne) SetWorker ¶
func (cuo *ChunkUpdateOne) SetWorker(w *Worker) *ChunkUpdateOne
SetWorker sets the "worker" edge to the Worker entity.
func (*ChunkUpdateOne) SetWorkerID ¶
func (cuo *ChunkUpdateOne) SetWorkerID(id uuid.UUID) *ChunkUpdateOne
SetWorkerID sets the "worker" edge to the Worker entity by ID.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Chunk is the client for interacting with the Chunk builders. Chunk *ChunkClient // Worker is the client for interacting with the Worker builders. Worker *WorkerClient // 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(). Chunk. Query(). Count(ctx)
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(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 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 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(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 Rollbacker method.
type Tx ¶
type Tx struct { // Chunk is the client for interacting with the Chunk builders. Chunk *ChunkClient // Worker is the client for interacting with the Worker builders. Worker *WorkerClient // 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 fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Worker ¶
type Worker struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. // Time when entity was created. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // Time when entity was updated. UpdatedAt time.Time `json:"updated_at,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Token holds the value of the "token" field. Token string `json:"token,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the WorkerQuery when eager-loading is set. Edges WorkerEdges `json:"edges"` // contains filtered or unexported fields }
Worker is the model entity for the Worker schema.
func (*Worker) QueryChunks ¶
func (w *Worker) QueryChunks() *ChunkQuery
QueryChunks queries the "chunks" edge of the Worker entity.
func (*Worker) Unwrap ¶
Unwrap unwraps the Worker 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 (*Worker) Update ¶
func (w *Worker) Update() *WorkerUpdateOne
Update returns a builder for updating this Worker. Note that you need to call Worker.Unwrap() before calling this method if this Worker was returned from a transaction, and the transaction was committed or rolled back.
type WorkerClient ¶
type WorkerClient struct {
// contains filtered or unexported fields
}
WorkerClient is a client for the Worker schema.
func NewWorkerClient ¶
func NewWorkerClient(c config) *WorkerClient
NewWorkerClient returns a client for the Worker from the given config.
func (*WorkerClient) Create ¶
func (c *WorkerClient) Create() *WorkerCreate
Create returns a create builder for Worker.
func (*WorkerClient) CreateBulk ¶
func (c *WorkerClient) CreateBulk(builders ...*WorkerCreate) *WorkerCreateBulk
CreateBulk returns a builder for creating a bulk of Worker entities.
func (*WorkerClient) Delete ¶
func (c *WorkerClient) Delete() *WorkerDelete
Delete returns a delete builder for Worker.
func (*WorkerClient) DeleteOne ¶
func (c *WorkerClient) DeleteOne(w *Worker) *WorkerDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*WorkerClient) DeleteOneID ¶
func (c *WorkerClient) DeleteOneID(id uuid.UUID) *WorkerDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*WorkerClient) Query ¶
func (c *WorkerClient) Query() *WorkerQuery
Query returns a query builder for Worker.
func (*WorkerClient) QueryChunks ¶
func (c *WorkerClient) QueryChunks(w *Worker) *ChunkQuery
QueryChunks queries the chunks edge of a Worker.
func (*WorkerClient) Update ¶
func (c *WorkerClient) Update() *WorkerUpdate
Update returns an update builder for Worker.
func (*WorkerClient) UpdateOne ¶
func (c *WorkerClient) UpdateOne(w *Worker) *WorkerUpdateOne
UpdateOne returns an update builder for the given entity.
func (*WorkerClient) UpdateOneID ¶
func (c *WorkerClient) UpdateOneID(id uuid.UUID) *WorkerUpdateOne
UpdateOneID returns an update builder for the given id.
func (*WorkerClient) Use ¶
func (c *WorkerClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `worker.Hooks(f(g(h())))`.
type WorkerCreate ¶
type WorkerCreate struct {
// contains filtered or unexported fields
}
WorkerCreate is the builder for creating a Worker entity.
func (*WorkerCreate) AddChunkIDs ¶
func (wc *WorkerCreate) AddChunkIDs(ids ...string) *WorkerCreate
AddChunkIDs adds the "chunks" edge to the Chunk entity by IDs.
func (*WorkerCreate) AddChunks ¶
func (wc *WorkerCreate) AddChunks(c ...*Chunk) *WorkerCreate
AddChunks adds the "chunks" edges to the Chunk entity.
func (*WorkerCreate) Exec ¶
func (wc *WorkerCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*WorkerCreate) ExecX ¶
func (wc *WorkerCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WorkerCreate) Mutation ¶
func (wc *WorkerCreate) Mutation() *WorkerMutation
Mutation returns the WorkerMutation object of the builder.
func (*WorkerCreate) Save ¶
func (wc *WorkerCreate) Save(ctx context.Context) (*Worker, error)
Save creates the Worker in the database.
func (*WorkerCreate) SaveX ¶
func (wc *WorkerCreate) SaveX(ctx context.Context) *Worker
SaveX calls Save and panics if Save returns an error.
func (*WorkerCreate) SetCreatedAt ¶
func (wc *WorkerCreate) SetCreatedAt(t time.Time) *WorkerCreate
SetCreatedAt sets the "created_at" field.
func (*WorkerCreate) SetID ¶
func (wc *WorkerCreate) SetID(u uuid.UUID) *WorkerCreate
SetID sets the "id" field.
func (*WorkerCreate) SetName ¶
func (wc *WorkerCreate) SetName(s string) *WorkerCreate
SetName sets the "name" field.
func (*WorkerCreate) SetNillableCreatedAt ¶
func (wc *WorkerCreate) SetNillableCreatedAt(t *time.Time) *WorkerCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*WorkerCreate) SetNillableUpdatedAt ¶
func (wc *WorkerCreate) SetNillableUpdatedAt(t *time.Time) *WorkerCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*WorkerCreate) SetToken ¶
func (wc *WorkerCreate) SetToken(s string) *WorkerCreate
SetToken sets the "token" field.
func (*WorkerCreate) SetUpdatedAt ¶
func (wc *WorkerCreate) SetUpdatedAt(t time.Time) *WorkerCreate
SetUpdatedAt sets the "updated_at" field.
type WorkerCreateBulk ¶
type WorkerCreateBulk struct {
// contains filtered or unexported fields
}
WorkerCreateBulk is the builder for creating many Worker entities in bulk.
func (*WorkerCreateBulk) Exec ¶
func (wcb *WorkerCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*WorkerCreateBulk) ExecX ¶
func (wcb *WorkerCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type WorkerDelete ¶
type WorkerDelete struct {
// contains filtered or unexported fields
}
WorkerDelete is the builder for deleting a Worker entity.
func (*WorkerDelete) Exec ¶
func (wd *WorkerDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*WorkerDelete) ExecX ¶
func (wd *WorkerDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*WorkerDelete) Where ¶
func (wd *WorkerDelete) Where(ps ...predicate.Worker) *WorkerDelete
Where appends a list predicates to the WorkerDelete builder.
type WorkerDeleteOne ¶
type WorkerDeleteOne struct {
// contains filtered or unexported fields
}
WorkerDeleteOne is the builder for deleting a single Worker entity.
func (*WorkerDeleteOne) Exec ¶
func (wdo *WorkerDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*WorkerDeleteOne) ExecX ¶
func (wdo *WorkerDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type WorkerEdges ¶
type WorkerEdges struct { // Chunks holds the value of the chunks edge. Chunks []*Chunk `json:"chunks,omitempty"` // contains filtered or unexported fields }
WorkerEdges holds the relations/edges for other nodes in the graph.
func (WorkerEdges) ChunksOrErr ¶
func (e WorkerEdges) ChunksOrErr() ([]*Chunk, error)
ChunksOrErr returns the Chunks value or an error if the edge was not loaded in eager-loading.
type WorkerGroupBy ¶
type WorkerGroupBy struct {
// contains filtered or unexported fields
}
WorkerGroupBy is the group-by builder for Worker entities.
func (*WorkerGroupBy) Aggregate ¶
func (wgb *WorkerGroupBy) Aggregate(fns ...AggregateFunc) *WorkerGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*WorkerGroupBy) Bool ¶
func (wgb *WorkerGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*WorkerGroupBy) BoolX ¶
func (wgb *WorkerGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*WorkerGroupBy) Bools ¶
func (wgb *WorkerGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*WorkerGroupBy) BoolsX ¶
func (wgb *WorkerGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*WorkerGroupBy) Float64 ¶
func (wgb *WorkerGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*WorkerGroupBy) Float64X ¶
func (wgb *WorkerGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*WorkerGroupBy) Float64s ¶
func (wgb *WorkerGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*WorkerGroupBy) Float64sX ¶
func (wgb *WorkerGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*WorkerGroupBy) Int ¶
func (wgb *WorkerGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*WorkerGroupBy) IntX ¶
func (wgb *WorkerGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*WorkerGroupBy) Ints ¶
func (wgb *WorkerGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*WorkerGroupBy) IntsX ¶
func (wgb *WorkerGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*WorkerGroupBy) Scan ¶
func (wgb *WorkerGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*WorkerGroupBy) ScanX ¶
func (wgb *WorkerGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*WorkerGroupBy) String ¶
func (wgb *WorkerGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*WorkerGroupBy) StringX ¶
func (wgb *WorkerGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type WorkerMutation ¶
type WorkerMutation struct {
// contains filtered or unexported fields
}
WorkerMutation represents an operation that mutates the Worker nodes in the graph.
func (*WorkerMutation) AddChunkIDs ¶
func (m *WorkerMutation) AddChunkIDs(ids ...string)
AddChunkIDs adds the "chunks" edge to the Chunk entity by ids.
func (*WorkerMutation) AddField ¶
func (m *WorkerMutation) 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 (*WorkerMutation) AddedEdges ¶
func (m *WorkerMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*WorkerMutation) AddedField ¶
func (m *WorkerMutation) 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 (*WorkerMutation) AddedFields ¶
func (m *WorkerMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*WorkerMutation) AddedIDs ¶
func (m *WorkerMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*WorkerMutation) ChunksCleared ¶
func (m *WorkerMutation) ChunksCleared() bool
ChunksCleared reports if the "chunks" edge to the Chunk entity was cleared.
func (*WorkerMutation) ChunksIDs ¶
func (m *WorkerMutation) ChunksIDs() (ids []string)
ChunksIDs returns the "chunks" edge IDs in the mutation.
func (*WorkerMutation) ClearChunks ¶
func (m *WorkerMutation) ClearChunks()
ClearChunks clears the "chunks" edge to the Chunk entity.
func (*WorkerMutation) ClearEdge ¶
func (m *WorkerMutation) 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 (*WorkerMutation) ClearField ¶
func (m *WorkerMutation) 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 (*WorkerMutation) ClearedEdges ¶
func (m *WorkerMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*WorkerMutation) ClearedFields ¶
func (m *WorkerMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (WorkerMutation) Client ¶
func (m WorkerMutation) 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 (*WorkerMutation) CreatedAt ¶
func (m *WorkerMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*WorkerMutation) EdgeCleared ¶
func (m *WorkerMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*WorkerMutation) Field ¶
func (m *WorkerMutation) 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 (*WorkerMutation) FieldCleared ¶
func (m *WorkerMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*WorkerMutation) Fields ¶
func (m *WorkerMutation) 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 (*WorkerMutation) ID ¶
func (m *WorkerMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*WorkerMutation) Name ¶
func (m *WorkerMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*WorkerMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Worker entity. If the Worker object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*WorkerMutation) 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 (*WorkerMutation) OldName ¶
func (m *WorkerMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Worker entity. If the Worker object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*WorkerMutation) OldToken ¶
func (m *WorkerMutation) OldToken(ctx context.Context) (v string, err error)
OldToken returns the old "token" field's value of the Worker entity. If the Worker object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*WorkerMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Worker entity. If the Worker object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*WorkerMutation) RemoveChunkIDs ¶
func (m *WorkerMutation) RemoveChunkIDs(ids ...string)
RemoveChunkIDs removes the "chunks" edge to the Chunk entity by IDs.
func (*WorkerMutation) RemovedChunksIDs ¶
func (m *WorkerMutation) RemovedChunksIDs() (ids []string)
RemovedChunks returns the removed IDs of the "chunks" edge to the Chunk entity.
func (*WorkerMutation) RemovedEdges ¶
func (m *WorkerMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*WorkerMutation) RemovedIDs ¶
func (m *WorkerMutation) 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 (*WorkerMutation) ResetChunks ¶
func (m *WorkerMutation) ResetChunks()
ResetChunks resets all changes to the "chunks" edge.
func (*WorkerMutation) ResetCreatedAt ¶
func (m *WorkerMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*WorkerMutation) ResetEdge ¶
func (m *WorkerMutation) 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 (*WorkerMutation) ResetField ¶
func (m *WorkerMutation) 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 (*WorkerMutation) ResetName ¶
func (m *WorkerMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*WorkerMutation) ResetToken ¶
func (m *WorkerMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*WorkerMutation) ResetUpdatedAt ¶
func (m *WorkerMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*WorkerMutation) SetCreatedAt ¶
func (m *WorkerMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*WorkerMutation) SetField ¶
func (m *WorkerMutation) 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 (*WorkerMutation) SetID ¶
func (m *WorkerMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Worker entities.
func (*WorkerMutation) SetName ¶
func (m *WorkerMutation) SetName(s string)
SetName sets the "name" field.
func (*WorkerMutation) SetToken ¶
func (m *WorkerMutation) SetToken(s string)
SetToken sets the "token" field.
func (*WorkerMutation) SetUpdatedAt ¶
func (m *WorkerMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*WorkerMutation) Token ¶
func (m *WorkerMutation) Token() (r string, exists bool)
Token returns the value of the "token" field in the mutation.
func (WorkerMutation) Tx ¶
func (m WorkerMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*WorkerMutation) Type ¶
func (m *WorkerMutation) Type() string
Type returns the node type of this mutation (Worker).
func (*WorkerMutation) UpdatedAt ¶
func (m *WorkerMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*WorkerMutation) Where ¶
func (m *WorkerMutation) Where(ps ...predicate.Worker)
Where appends a list predicates to the WorkerMutation builder.
type WorkerQuery ¶
type WorkerQuery struct {
// contains filtered or unexported fields
}
WorkerQuery is the builder for querying Worker entities.
func (*WorkerQuery) All ¶
func (wq *WorkerQuery) All(ctx context.Context) ([]*Worker, error)
All executes the query and returns a list of Workers.
func (*WorkerQuery) AllX ¶
func (wq *WorkerQuery) AllX(ctx context.Context) []*Worker
AllX is like All, but panics if an error occurs.
func (*WorkerQuery) Clone ¶
func (wq *WorkerQuery) Clone() *WorkerQuery
Clone returns a duplicate of the WorkerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*WorkerQuery) Count ¶
func (wq *WorkerQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*WorkerQuery) CountX ¶
func (wq *WorkerQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*WorkerQuery) Exist ¶
func (wq *WorkerQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*WorkerQuery) ExistX ¶
func (wq *WorkerQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*WorkerQuery) First ¶
func (wq *WorkerQuery) First(ctx context.Context) (*Worker, error)
First returns the first Worker entity from the query. Returns a *NotFoundError when no Worker was found.
func (*WorkerQuery) FirstID ¶
FirstID returns the first Worker ID from the query. Returns a *NotFoundError when no Worker ID was found.
func (*WorkerQuery) FirstIDX ¶
func (wq *WorkerQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*WorkerQuery) FirstX ¶
func (wq *WorkerQuery) FirstX(ctx context.Context) *Worker
FirstX is like First, but panics if an error occurs.
func (*WorkerQuery) ForShare ¶
func (wq *WorkerQuery) ForShare(opts ...sql.LockOption) *WorkerQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*WorkerQuery) ForUpdate ¶
func (wq *WorkerQuery) ForUpdate(opts ...sql.LockOption) *WorkerQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*WorkerQuery) GroupBy ¶
func (wq *WorkerQuery) GroupBy(field string, fields ...string) *WorkerGroupBy
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.Worker.Query(). GroupBy(worker.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*WorkerQuery) IDsX ¶
func (wq *WorkerQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*WorkerQuery) Limit ¶
func (wq *WorkerQuery) Limit(limit int) *WorkerQuery
Limit adds a limit step to the query.
func (*WorkerQuery) Offset ¶
func (wq *WorkerQuery) Offset(offset int) *WorkerQuery
Offset adds an offset step to the query.
func (*WorkerQuery) Only ¶
func (wq *WorkerQuery) Only(ctx context.Context) (*Worker, error)
Only returns a single Worker entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Worker entity is not found. Returns a *NotFoundError when no Worker entities are found.
func (*WorkerQuery) OnlyID ¶
OnlyID is like Only, but returns the only Worker ID in the query. Returns a *NotSingularError when exactly one Worker ID is not found. Returns a *NotFoundError when no entities are found.
func (*WorkerQuery) OnlyIDX ¶
func (wq *WorkerQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*WorkerQuery) OnlyX ¶
func (wq *WorkerQuery) OnlyX(ctx context.Context) *Worker
OnlyX is like Only, but panics if an error occurs.
func (*WorkerQuery) Order ¶
func (wq *WorkerQuery) Order(o ...OrderFunc) *WorkerQuery
Order adds an order step to the query.
func (*WorkerQuery) QueryChunks ¶
func (wq *WorkerQuery) QueryChunks() *ChunkQuery
QueryChunks chains the current query on the "chunks" edge.
func (*WorkerQuery) Select ¶
func (wq *WorkerQuery) Select(fields ...string) *WorkerSelect
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.Worker.Query(). Select(worker.FieldCreatedAt). Scan(ctx, &v)
func (*WorkerQuery) Unique ¶
func (wq *WorkerQuery) Unique(unique bool) *WorkerQuery
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 (*WorkerQuery) Where ¶
func (wq *WorkerQuery) Where(ps ...predicate.Worker) *WorkerQuery
Where adds a new predicate for the WorkerQuery builder.
func (*WorkerQuery) WithChunks ¶
func (wq *WorkerQuery) WithChunks(opts ...func(*ChunkQuery)) *WorkerQuery
WithChunks tells the query-builder to eager-load the nodes that are connected to the "chunks" edge. The optional arguments are used to configure the query builder of the edge.
type WorkerSelect ¶
type WorkerSelect struct { *WorkerQuery // contains filtered or unexported fields }
WorkerSelect is the builder for selecting fields of Worker entities.
func (*WorkerSelect) Bool ¶
func (ws *WorkerSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*WorkerSelect) BoolX ¶
func (ws *WorkerSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*WorkerSelect) Bools ¶
func (ws *WorkerSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*WorkerSelect) BoolsX ¶
func (ws *WorkerSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*WorkerSelect) Float64 ¶
func (ws *WorkerSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*WorkerSelect) Float64X ¶
func (ws *WorkerSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*WorkerSelect) Float64s ¶
func (ws *WorkerSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*WorkerSelect) Float64sX ¶
func (ws *WorkerSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*WorkerSelect) Int ¶
func (ws *WorkerSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*WorkerSelect) IntX ¶
func (ws *WorkerSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*WorkerSelect) Ints ¶
func (ws *WorkerSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*WorkerSelect) IntsX ¶
func (ws *WorkerSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*WorkerSelect) Scan ¶
func (ws *WorkerSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*WorkerSelect) ScanX ¶
func (ws *WorkerSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*WorkerSelect) String ¶
func (ws *WorkerSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*WorkerSelect) StringX ¶
func (ws *WorkerSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type WorkerUpdate ¶
type WorkerUpdate struct {
// contains filtered or unexported fields
}
WorkerUpdate is the builder for updating Worker entities.
func (*WorkerUpdate) AddChunkIDs ¶
func (wu *WorkerUpdate) AddChunkIDs(ids ...string) *WorkerUpdate
AddChunkIDs adds the "chunks" edge to the Chunk entity by IDs.
func (*WorkerUpdate) AddChunks ¶
func (wu *WorkerUpdate) AddChunks(c ...*Chunk) *WorkerUpdate
AddChunks adds the "chunks" edges to the Chunk entity.
func (*WorkerUpdate) ClearChunks ¶
func (wu *WorkerUpdate) ClearChunks() *WorkerUpdate
ClearChunks clears all "chunks" edges to the Chunk entity.
func (*WorkerUpdate) Exec ¶
func (wu *WorkerUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*WorkerUpdate) ExecX ¶
func (wu *WorkerUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WorkerUpdate) Mutation ¶
func (wu *WorkerUpdate) Mutation() *WorkerMutation
Mutation returns the WorkerMutation object of the builder.
func (*WorkerUpdate) RemoveChunkIDs ¶
func (wu *WorkerUpdate) RemoveChunkIDs(ids ...string) *WorkerUpdate
RemoveChunkIDs removes the "chunks" edge to Chunk entities by IDs.
func (*WorkerUpdate) RemoveChunks ¶
func (wu *WorkerUpdate) RemoveChunks(c ...*Chunk) *WorkerUpdate
RemoveChunks removes "chunks" edges to Chunk entities.
func (*WorkerUpdate) Save ¶
func (wu *WorkerUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*WorkerUpdate) SaveX ¶
func (wu *WorkerUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*WorkerUpdate) SetName ¶
func (wu *WorkerUpdate) SetName(s string) *WorkerUpdate
SetName sets the "name" field.
func (*WorkerUpdate) SetToken ¶
func (wu *WorkerUpdate) SetToken(s string) *WorkerUpdate
SetToken sets the "token" field.
func (*WorkerUpdate) SetUpdatedAt ¶
func (wu *WorkerUpdate) SetUpdatedAt(t time.Time) *WorkerUpdate
SetUpdatedAt sets the "updated_at" field.
func (*WorkerUpdate) Where ¶
func (wu *WorkerUpdate) Where(ps ...predicate.Worker) *WorkerUpdate
Where appends a list predicates to the WorkerUpdate builder.
type WorkerUpdateOne ¶
type WorkerUpdateOne struct {
// contains filtered or unexported fields
}
WorkerUpdateOne is the builder for updating a single Worker entity.
func (*WorkerUpdateOne) AddChunkIDs ¶
func (wuo *WorkerUpdateOne) AddChunkIDs(ids ...string) *WorkerUpdateOne
AddChunkIDs adds the "chunks" edge to the Chunk entity by IDs.
func (*WorkerUpdateOne) AddChunks ¶
func (wuo *WorkerUpdateOne) AddChunks(c ...*Chunk) *WorkerUpdateOne
AddChunks adds the "chunks" edges to the Chunk entity.
func (*WorkerUpdateOne) ClearChunks ¶
func (wuo *WorkerUpdateOne) ClearChunks() *WorkerUpdateOne
ClearChunks clears all "chunks" edges to the Chunk entity.
func (*WorkerUpdateOne) Exec ¶
func (wuo *WorkerUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*WorkerUpdateOne) ExecX ¶
func (wuo *WorkerUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WorkerUpdateOne) Mutation ¶
func (wuo *WorkerUpdateOne) Mutation() *WorkerMutation
Mutation returns the WorkerMutation object of the builder.
func (*WorkerUpdateOne) RemoveChunkIDs ¶
func (wuo *WorkerUpdateOne) RemoveChunkIDs(ids ...string) *WorkerUpdateOne
RemoveChunkIDs removes the "chunks" edge to Chunk entities by IDs.
func (*WorkerUpdateOne) RemoveChunks ¶
func (wuo *WorkerUpdateOne) RemoveChunks(c ...*Chunk) *WorkerUpdateOne
RemoveChunks removes "chunks" edges to Chunk entities.
func (*WorkerUpdateOne) Save ¶
func (wuo *WorkerUpdateOne) Save(ctx context.Context) (*Worker, error)
Save executes the query and returns the updated Worker entity.
func (*WorkerUpdateOne) SaveX ¶
func (wuo *WorkerUpdateOne) SaveX(ctx context.Context) *Worker
SaveX is like Save, but panics if an error occurs.
func (*WorkerUpdateOne) Select ¶
func (wuo *WorkerUpdateOne) Select(field string, fields ...string) *WorkerUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*WorkerUpdateOne) SetName ¶
func (wuo *WorkerUpdateOne) SetName(s string) *WorkerUpdateOne
SetName sets the "name" field.
func (*WorkerUpdateOne) SetToken ¶
func (wuo *WorkerUpdateOne) SetToken(s string) *WorkerUpdateOne
SetToken sets the "token" field.
func (*WorkerUpdateOne) SetUpdatedAt ¶
func (wuo *WorkerUpdateOne) SetUpdatedAt(t time.Time) *WorkerUpdateOne
SetUpdatedAt sets the "updated_at" field.