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 Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Screenshot
- type ScreenshotClient
- func (c *ScreenshotClient) Create() *ScreenshotCreate
- func (c *ScreenshotClient) CreateBulk(builders ...*ScreenshotCreate) *ScreenshotCreateBulk
- func (c *ScreenshotClient) Delete() *ScreenshotDelete
- func (c *ScreenshotClient) DeleteOne(s *Screenshot) *ScreenshotDeleteOne
- func (c *ScreenshotClient) DeleteOneID(id uuid.UUID) *ScreenshotDeleteOne
- func (c *ScreenshotClient) Get(ctx context.Context, id uuid.UUID) (*Screenshot, error)
- func (c *ScreenshotClient) GetX(ctx context.Context, id uuid.UUID) *Screenshot
- func (c *ScreenshotClient) Hooks() []Hook
- func (c *ScreenshotClient) Intercept(interceptors ...Interceptor)
- func (c *ScreenshotClient) Interceptors() []Interceptor
- func (c *ScreenshotClient) Query() *ScreenshotQuery
- func (c *ScreenshotClient) Update() *ScreenshotUpdate
- func (c *ScreenshotClient) UpdateOne(s *Screenshot) *ScreenshotUpdateOne
- func (c *ScreenshotClient) UpdateOneID(id uuid.UUID) *ScreenshotUpdateOne
- func (c *ScreenshotClient) Use(hooks ...Hook)
- type ScreenshotCreate
- func (sc *ScreenshotCreate) Exec(ctx context.Context) error
- func (sc *ScreenshotCreate) ExecX(ctx context.Context)
- func (sc *ScreenshotCreate) Mutation() *ScreenshotMutation
- func (sc *ScreenshotCreate) Save(ctx context.Context) (*Screenshot, error)
- func (sc *ScreenshotCreate) SaveX(ctx context.Context) *Screenshot
- func (sc *ScreenshotCreate) SetCreatedAt(t time.Time) *ScreenshotCreate
- func (sc *ScreenshotCreate) SetID(u uuid.UUID) *ScreenshotCreate
- func (sc *ScreenshotCreate) SetNillableStoredPath(s *string) *ScreenshotCreate
- func (sc *ScreenshotCreate) SetStatus(m models.Status) *ScreenshotCreate
- func (sc *ScreenshotCreate) SetStoredPath(s string) *ScreenshotCreate
- func (sc *ScreenshotCreate) SetURL(s string) *ScreenshotCreate
- type ScreenshotCreateBulk
- type ScreenshotDelete
- type ScreenshotDeleteOne
- type ScreenshotGroupBy
- func (sgb *ScreenshotGroupBy) Aggregate(fns ...AggregateFunc) *ScreenshotGroupBy
- func (s *ScreenshotGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ScreenshotGroupBy) BoolX(ctx context.Context) bool
- func (s *ScreenshotGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ScreenshotGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ScreenshotGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ScreenshotGroupBy) Float64X(ctx context.Context) float64
- func (s *ScreenshotGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ScreenshotGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ScreenshotGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ScreenshotGroupBy) IntX(ctx context.Context) int
- func (s *ScreenshotGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ScreenshotGroupBy) IntsX(ctx context.Context) []int
- func (sgb *ScreenshotGroupBy) Scan(ctx context.Context, v any) error
- func (s *ScreenshotGroupBy) ScanX(ctx context.Context, v any)
- func (s *ScreenshotGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ScreenshotGroupBy) StringX(ctx context.Context) string
- func (s *ScreenshotGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ScreenshotGroupBy) StringsX(ctx context.Context) []string
- type ScreenshotMutation
- func (m *ScreenshotMutation) AddField(name string, value ent.Value) error
- func (m *ScreenshotMutation) AddedEdges() []string
- func (m *ScreenshotMutation) AddedField(name string) (ent.Value, bool)
- func (m *ScreenshotMutation) AddedFields() []string
- func (m *ScreenshotMutation) AddedIDs(name string) []ent.Value
- func (m *ScreenshotMutation) ClearEdge(name string) error
- func (m *ScreenshotMutation) ClearField(name string) error
- func (m *ScreenshotMutation) ClearStoredPath()
- func (m *ScreenshotMutation) ClearedEdges() []string
- func (m *ScreenshotMutation) ClearedFields() []string
- func (m ScreenshotMutation) Client() *Client
- func (m *ScreenshotMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ScreenshotMutation) EdgeCleared(name string) bool
- func (m *ScreenshotMutation) Field(name string) (ent.Value, bool)
- func (m *ScreenshotMutation) FieldCleared(name string) bool
- func (m *ScreenshotMutation) Fields() []string
- func (m *ScreenshotMutation) ID() (id uuid.UUID, exists bool)
- func (m *ScreenshotMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *ScreenshotMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ScreenshotMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ScreenshotMutation) OldStatus(ctx context.Context) (v models.Status, err error)
- func (m *ScreenshotMutation) OldStoredPath(ctx context.Context) (v *string, err error)
- func (m *ScreenshotMutation) OldURL(ctx context.Context) (v string, err error)
- func (m *ScreenshotMutation) Op() Op
- func (m *ScreenshotMutation) RemovedEdges() []string
- func (m *ScreenshotMutation) RemovedIDs(name string) []ent.Value
- func (m *ScreenshotMutation) ResetCreatedAt()
- func (m *ScreenshotMutation) ResetEdge(name string) error
- func (m *ScreenshotMutation) ResetField(name string) error
- func (m *ScreenshotMutation) ResetStatus()
- func (m *ScreenshotMutation) ResetStoredPath()
- func (m *ScreenshotMutation) ResetURL()
- func (m *ScreenshotMutation) SetCreatedAt(t time.Time)
- func (m *ScreenshotMutation) SetField(name string, value ent.Value) error
- func (m *ScreenshotMutation) SetID(id uuid.UUID)
- func (m *ScreenshotMutation) SetOp(op Op)
- func (m *ScreenshotMutation) SetStatus(value models.Status)
- func (m *ScreenshotMutation) SetStoredPath(s string)
- func (m *ScreenshotMutation) SetURL(s string)
- func (m *ScreenshotMutation) Status() (r models.Status, exists bool)
- func (m *ScreenshotMutation) StoredPath() (r string, exists bool)
- func (m *ScreenshotMutation) StoredPathCleared() bool
- func (m ScreenshotMutation) Tx() (*Tx, error)
- func (m *ScreenshotMutation) Type() string
- func (m *ScreenshotMutation) URL() (r string, exists bool)
- func (m *ScreenshotMutation) Where(ps ...predicate.Screenshot)
- func (m *ScreenshotMutation) WhereP(ps ...func(*sql.Selector))
- type ScreenshotQuery
- func (sq *ScreenshotQuery) Aggregate(fns ...AggregateFunc) *ScreenshotSelect
- func (sq *ScreenshotQuery) All(ctx context.Context) ([]*Screenshot, error)
- func (sq *ScreenshotQuery) AllX(ctx context.Context) []*Screenshot
- func (sq *ScreenshotQuery) Clone() *ScreenshotQuery
- func (sq *ScreenshotQuery) Count(ctx context.Context) (int, error)
- func (sq *ScreenshotQuery) CountX(ctx context.Context) int
- func (sq *ScreenshotQuery) Exist(ctx context.Context) (bool, error)
- func (sq *ScreenshotQuery) ExistX(ctx context.Context) bool
- func (sq *ScreenshotQuery) First(ctx context.Context) (*Screenshot, error)
- func (sq *ScreenshotQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (sq *ScreenshotQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (sq *ScreenshotQuery) FirstX(ctx context.Context) *Screenshot
- func (sq *ScreenshotQuery) GroupBy(field string, fields ...string) *ScreenshotGroupBy
- func (sq *ScreenshotQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (sq *ScreenshotQuery) IDsX(ctx context.Context) []uuid.UUID
- func (sq *ScreenshotQuery) Limit(limit int) *ScreenshotQuery
- func (sq *ScreenshotQuery) Offset(offset int) *ScreenshotQuery
- func (sq *ScreenshotQuery) Only(ctx context.Context) (*Screenshot, error)
- func (sq *ScreenshotQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (sq *ScreenshotQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (sq *ScreenshotQuery) OnlyX(ctx context.Context) *Screenshot
- func (sq *ScreenshotQuery) Order(o ...OrderFunc) *ScreenshotQuery
- func (sq *ScreenshotQuery) Select(fields ...string) *ScreenshotSelect
- func (sq *ScreenshotQuery) Unique(unique bool) *ScreenshotQuery
- func (sq *ScreenshotQuery) Where(ps ...predicate.Screenshot) *ScreenshotQuery
- type ScreenshotSelect
- func (ss *ScreenshotSelect) Aggregate(fns ...AggregateFunc) *ScreenshotSelect
- func (s *ScreenshotSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ScreenshotSelect) BoolX(ctx context.Context) bool
- func (s *ScreenshotSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ScreenshotSelect) BoolsX(ctx context.Context) []bool
- func (s *ScreenshotSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ScreenshotSelect) Float64X(ctx context.Context) float64
- func (s *ScreenshotSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ScreenshotSelect) Float64sX(ctx context.Context) []float64
- func (s *ScreenshotSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ScreenshotSelect) IntX(ctx context.Context) int
- func (s *ScreenshotSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ScreenshotSelect) IntsX(ctx context.Context) []int
- func (ss *ScreenshotSelect) Scan(ctx context.Context, v any) error
- func (s *ScreenshotSelect) ScanX(ctx context.Context, v any)
- func (s *ScreenshotSelect) String(ctx context.Context) (_ string, err error)
- func (s *ScreenshotSelect) StringX(ctx context.Context) string
- func (s *ScreenshotSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ScreenshotSelect) StringsX(ctx context.Context) []string
- type ScreenshotUpdate
- func (su *ScreenshotUpdate) ClearStoredPath() *ScreenshotUpdate
- func (su *ScreenshotUpdate) Exec(ctx context.Context) error
- func (su *ScreenshotUpdate) ExecX(ctx context.Context)
- func (su *ScreenshotUpdate) Mutation() *ScreenshotMutation
- func (su *ScreenshotUpdate) Save(ctx context.Context) (int, error)
- func (su *ScreenshotUpdate) SaveX(ctx context.Context) int
- func (su *ScreenshotUpdate) SetCreatedAt(t time.Time) *ScreenshotUpdate
- func (su *ScreenshotUpdate) SetNillableStoredPath(s *string) *ScreenshotUpdate
- func (su *ScreenshotUpdate) SetStatus(m models.Status) *ScreenshotUpdate
- func (su *ScreenshotUpdate) SetStoredPath(s string) *ScreenshotUpdate
- func (su *ScreenshotUpdate) SetURL(s string) *ScreenshotUpdate
- func (su *ScreenshotUpdate) Where(ps ...predicate.Screenshot) *ScreenshotUpdate
- type ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) ClearStoredPath() *ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) Exec(ctx context.Context) error
- func (suo *ScreenshotUpdateOne) ExecX(ctx context.Context)
- func (suo *ScreenshotUpdateOne) Mutation() *ScreenshotMutation
- func (suo *ScreenshotUpdateOne) Save(ctx context.Context) (*Screenshot, error)
- func (suo *ScreenshotUpdateOne) SaveX(ctx context.Context) *Screenshot
- func (suo *ScreenshotUpdateOne) Select(field string, fields ...string) *ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) SetCreatedAt(t time.Time) *ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) SetNillableStoredPath(s *string) *ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) SetStatus(m models.Status) *ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) SetStoredPath(s string) *ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) SetURL(s string) *ScreenshotUpdateOne
- func (suo *ScreenshotUpdateOne) Where(ps ...predicate.Screenshot) *ScreenshotUpdateOne
- type Screenshots
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeScreenshot = "Screenshot" )
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 Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Screenshot is the client for interacting with the Screenshot builders. Screenshot *ScreenshotClient // 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(). Screenshot. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Screenshot ¶
type Screenshot struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Status holds the value of the "status" field. Status models.Status `json:"status,omitempty"` // URL holds the value of the "url" field. URL string `json:"url,omitempty"` // StoredPath holds the value of the "stored_path" field. StoredPath *string `json:"stored_path,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // contains filtered or unexported fields }
Screenshot is the model entity for the Screenshot schema.
func (*Screenshot) String ¶
func (s *Screenshot) String() string
String implements the fmt.Stringer.
func (*Screenshot) Unwrap ¶
func (s *Screenshot) Unwrap() *Screenshot
Unwrap unwraps the Screenshot 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 (*Screenshot) Update ¶
func (s *Screenshot) Update() *ScreenshotUpdateOne
Update returns a builder for updating this Screenshot. Note that you need to call Screenshot.Unwrap() before calling this method if this Screenshot was returned from a transaction, and the transaction was committed or rolled back.
type ScreenshotClient ¶
type ScreenshotClient struct {
// contains filtered or unexported fields
}
ScreenshotClient is a client for the Screenshot schema.
func NewScreenshotClient ¶
func NewScreenshotClient(c config) *ScreenshotClient
NewScreenshotClient returns a client for the Screenshot from the given config.
func (*ScreenshotClient) Create ¶
func (c *ScreenshotClient) Create() *ScreenshotCreate
Create returns a builder for creating a Screenshot entity.
func (*ScreenshotClient) CreateBulk ¶
func (c *ScreenshotClient) CreateBulk(builders ...*ScreenshotCreate) *ScreenshotCreateBulk
CreateBulk returns a builder for creating a bulk of Screenshot entities.
func (*ScreenshotClient) Delete ¶
func (c *ScreenshotClient) Delete() *ScreenshotDelete
Delete returns a delete builder for Screenshot.
func (*ScreenshotClient) DeleteOne ¶
func (c *ScreenshotClient) DeleteOne(s *Screenshot) *ScreenshotDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ScreenshotClient) DeleteOneID ¶
func (c *ScreenshotClient) DeleteOneID(id uuid.UUID) *ScreenshotDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ScreenshotClient) Get ¶
func (c *ScreenshotClient) Get(ctx context.Context, id uuid.UUID) (*Screenshot, error)
Get returns a Screenshot entity by its id.
func (*ScreenshotClient) GetX ¶
func (c *ScreenshotClient) GetX(ctx context.Context, id uuid.UUID) *Screenshot
GetX is like Get, but panics if an error occurs.
func (*ScreenshotClient) Hooks ¶
func (c *ScreenshotClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ScreenshotClient) Intercept ¶
func (c *ScreenshotClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `screenshot.Intercept(f(g(h())))`.
func (*ScreenshotClient) Interceptors ¶
func (c *ScreenshotClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ScreenshotClient) Query ¶
func (c *ScreenshotClient) Query() *ScreenshotQuery
Query returns a query builder for Screenshot.
func (*ScreenshotClient) Update ¶
func (c *ScreenshotClient) Update() *ScreenshotUpdate
Update returns an update builder for Screenshot.
func (*ScreenshotClient) UpdateOne ¶
func (c *ScreenshotClient) UpdateOne(s *Screenshot) *ScreenshotUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ScreenshotClient) UpdateOneID ¶
func (c *ScreenshotClient) UpdateOneID(id uuid.UUID) *ScreenshotUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ScreenshotClient) Use ¶
func (c *ScreenshotClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `screenshot.Hooks(f(g(h())))`.
type ScreenshotCreate ¶
type ScreenshotCreate struct {
// contains filtered or unexported fields
}
ScreenshotCreate is the builder for creating a Screenshot entity.
func (*ScreenshotCreate) Exec ¶
func (sc *ScreenshotCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ScreenshotCreate) ExecX ¶
func (sc *ScreenshotCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ScreenshotCreate) Mutation ¶
func (sc *ScreenshotCreate) Mutation() *ScreenshotMutation
Mutation returns the ScreenshotMutation object of the builder.
func (*ScreenshotCreate) Save ¶
func (sc *ScreenshotCreate) Save(ctx context.Context) (*Screenshot, error)
Save creates the Screenshot in the database.
func (*ScreenshotCreate) SaveX ¶
func (sc *ScreenshotCreate) SaveX(ctx context.Context) *Screenshot
SaveX calls Save and panics if Save returns an error.
func (*ScreenshotCreate) SetCreatedAt ¶
func (sc *ScreenshotCreate) SetCreatedAt(t time.Time) *ScreenshotCreate
SetCreatedAt sets the "created_at" field.
func (*ScreenshotCreate) SetID ¶
func (sc *ScreenshotCreate) SetID(u uuid.UUID) *ScreenshotCreate
SetID sets the "id" field.
func (*ScreenshotCreate) SetNillableStoredPath ¶
func (sc *ScreenshotCreate) SetNillableStoredPath(s *string) *ScreenshotCreate
SetNillableStoredPath sets the "stored_path" field if the given value is not nil.
func (*ScreenshotCreate) SetStatus ¶
func (sc *ScreenshotCreate) SetStatus(m models.Status) *ScreenshotCreate
SetStatus sets the "status" field.
func (*ScreenshotCreate) SetStoredPath ¶
func (sc *ScreenshotCreate) SetStoredPath(s string) *ScreenshotCreate
SetStoredPath sets the "stored_path" field.
func (*ScreenshotCreate) SetURL ¶
func (sc *ScreenshotCreate) SetURL(s string) *ScreenshotCreate
SetURL sets the "url" field.
type ScreenshotCreateBulk ¶
type ScreenshotCreateBulk struct {
// contains filtered or unexported fields
}
ScreenshotCreateBulk is the builder for creating many Screenshot entities in bulk.
func (*ScreenshotCreateBulk) Exec ¶
func (scb *ScreenshotCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ScreenshotCreateBulk) ExecX ¶
func (scb *ScreenshotCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ScreenshotCreateBulk) Save ¶
func (scb *ScreenshotCreateBulk) Save(ctx context.Context) ([]*Screenshot, error)
Save creates the Screenshot entities in the database.
func (*ScreenshotCreateBulk) SaveX ¶
func (scb *ScreenshotCreateBulk) SaveX(ctx context.Context) []*Screenshot
SaveX is like Save, but panics if an error occurs.
type ScreenshotDelete ¶
type ScreenshotDelete struct {
// contains filtered or unexported fields
}
ScreenshotDelete is the builder for deleting a Screenshot entity.
func (*ScreenshotDelete) Exec ¶
func (sd *ScreenshotDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ScreenshotDelete) ExecX ¶
func (sd *ScreenshotDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ScreenshotDelete) Where ¶
func (sd *ScreenshotDelete) Where(ps ...predicate.Screenshot) *ScreenshotDelete
Where appends a list predicates to the ScreenshotDelete builder.
type ScreenshotDeleteOne ¶
type ScreenshotDeleteOne struct {
// contains filtered or unexported fields
}
ScreenshotDeleteOne is the builder for deleting a single Screenshot entity.
func (*ScreenshotDeleteOne) Exec ¶
func (sdo *ScreenshotDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ScreenshotDeleteOne) ExecX ¶
func (sdo *ScreenshotDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ScreenshotDeleteOne) Where ¶
func (sdo *ScreenshotDeleteOne) Where(ps ...predicate.Screenshot) *ScreenshotDeleteOne
Where appends a list predicates to the ScreenshotDelete builder.
type ScreenshotGroupBy ¶
type ScreenshotGroupBy struct {
// contains filtered or unexported fields
}
ScreenshotGroupBy is the group-by builder for Screenshot entities.
func (*ScreenshotGroupBy) Aggregate ¶
func (sgb *ScreenshotGroupBy) Aggregate(fns ...AggregateFunc) *ScreenshotGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ScreenshotGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ScreenshotGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ScreenshotGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ScreenshotGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ScreenshotGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ScreenshotGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ScreenshotGroupBy) Scan ¶
func (sgb *ScreenshotGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ScreenshotGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ScreenshotMutation ¶
type ScreenshotMutation struct {
// contains filtered or unexported fields
}
ScreenshotMutation represents an operation that mutates the Screenshot nodes in the graph.
func (*ScreenshotMutation) AddField ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) AddedEdges ¶
func (m *ScreenshotMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ScreenshotMutation) AddedField ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) AddedFields ¶
func (m *ScreenshotMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ScreenshotMutation) AddedIDs ¶
func (m *ScreenshotMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ScreenshotMutation) ClearEdge ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) ClearField ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) ClearStoredPath ¶
func (m *ScreenshotMutation) ClearStoredPath()
ClearStoredPath clears the value of the "stored_path" field.
func (*ScreenshotMutation) ClearedEdges ¶
func (m *ScreenshotMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ScreenshotMutation) ClearedFields ¶
func (m *ScreenshotMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ScreenshotMutation) Client ¶
func (m ScreenshotMutation) 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 (*ScreenshotMutation) CreatedAt ¶
func (m *ScreenshotMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ScreenshotMutation) EdgeCleared ¶
func (m *ScreenshotMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ScreenshotMutation) Field ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) FieldCleared ¶
func (m *ScreenshotMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ScreenshotMutation) Fields ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) ID ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ScreenshotMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Screenshot entity. If the Screenshot object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ScreenshotMutation) 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 (*ScreenshotMutation) OldStatus ¶
OldStatus returns the old "status" field's value of the Screenshot entity. If the Screenshot object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ScreenshotMutation) OldStoredPath ¶
func (m *ScreenshotMutation) OldStoredPath(ctx context.Context) (v *string, err error)
OldStoredPath returns the old "stored_path" field's value of the Screenshot entity. If the Screenshot object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ScreenshotMutation) OldURL ¶
func (m *ScreenshotMutation) OldURL(ctx context.Context) (v string, err error)
OldURL returns the old "url" field's value of the Screenshot entity. If the Screenshot object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ScreenshotMutation) RemovedEdges ¶
func (m *ScreenshotMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ScreenshotMutation) RemovedIDs ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) ResetCreatedAt ¶
func (m *ScreenshotMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ScreenshotMutation) ResetEdge ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) ResetField ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) ResetStatus ¶
func (m *ScreenshotMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*ScreenshotMutation) ResetStoredPath ¶
func (m *ScreenshotMutation) ResetStoredPath()
ResetStoredPath resets all changes to the "stored_path" field.
func (*ScreenshotMutation) ResetURL ¶
func (m *ScreenshotMutation) ResetURL()
ResetURL resets all changes to the "url" field.
func (*ScreenshotMutation) SetCreatedAt ¶
func (m *ScreenshotMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ScreenshotMutation) SetField ¶
func (m *ScreenshotMutation) 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 (*ScreenshotMutation) SetID ¶
func (m *ScreenshotMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Screenshot entities.
func (*ScreenshotMutation) SetOp ¶
func (m *ScreenshotMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ScreenshotMutation) SetStatus ¶
func (m *ScreenshotMutation) SetStatus(value models.Status)
SetStatus sets the "status" field.
func (*ScreenshotMutation) SetStoredPath ¶
func (m *ScreenshotMutation) SetStoredPath(s string)
SetStoredPath sets the "stored_path" field.
func (*ScreenshotMutation) SetURL ¶
func (m *ScreenshotMutation) SetURL(s string)
SetURL sets the "url" field.
func (*ScreenshotMutation) Status ¶
func (m *ScreenshotMutation) Status() (r models.Status, exists bool)
Status returns the value of the "status" field in the mutation.
func (*ScreenshotMutation) StoredPath ¶
func (m *ScreenshotMutation) StoredPath() (r string, exists bool)
StoredPath returns the value of the "stored_path" field in the mutation.
func (*ScreenshotMutation) StoredPathCleared ¶
func (m *ScreenshotMutation) StoredPathCleared() bool
StoredPathCleared returns if the "stored_path" field was cleared in this mutation.
func (ScreenshotMutation) Tx ¶
func (m ScreenshotMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ScreenshotMutation) Type ¶
func (m *ScreenshotMutation) Type() string
Type returns the node type of this mutation (Screenshot).
func (*ScreenshotMutation) URL ¶
func (m *ScreenshotMutation) URL() (r string, exists bool)
URL returns the value of the "url" field in the mutation.
func (*ScreenshotMutation) Where ¶
func (m *ScreenshotMutation) Where(ps ...predicate.Screenshot)
Where appends a list predicates to the ScreenshotMutation builder.
func (*ScreenshotMutation) WhereP ¶
func (m *ScreenshotMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ScreenshotMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ScreenshotQuery ¶
type ScreenshotQuery struct {
// contains filtered or unexported fields
}
ScreenshotQuery is the builder for querying Screenshot entities.
func (*ScreenshotQuery) Aggregate ¶
func (sq *ScreenshotQuery) Aggregate(fns ...AggregateFunc) *ScreenshotSelect
Aggregate returns a ScreenshotSelect configured with the given aggregations.
func (*ScreenshotQuery) All ¶
func (sq *ScreenshotQuery) All(ctx context.Context) ([]*Screenshot, error)
All executes the query and returns a list of Screenshots.
func (*ScreenshotQuery) AllX ¶
func (sq *ScreenshotQuery) AllX(ctx context.Context) []*Screenshot
AllX is like All, but panics if an error occurs.
func (*ScreenshotQuery) Clone ¶
func (sq *ScreenshotQuery) Clone() *ScreenshotQuery
Clone returns a duplicate of the ScreenshotQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ScreenshotQuery) Count ¶
func (sq *ScreenshotQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ScreenshotQuery) CountX ¶
func (sq *ScreenshotQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ScreenshotQuery) Exist ¶
func (sq *ScreenshotQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ScreenshotQuery) ExistX ¶
func (sq *ScreenshotQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ScreenshotQuery) First ¶
func (sq *ScreenshotQuery) First(ctx context.Context) (*Screenshot, error)
First returns the first Screenshot entity from the query. Returns a *NotFoundError when no Screenshot was found.
func (*ScreenshotQuery) FirstID ¶
FirstID returns the first Screenshot ID from the query. Returns a *NotFoundError when no Screenshot ID was found.
func (*ScreenshotQuery) FirstIDX ¶
func (sq *ScreenshotQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*ScreenshotQuery) FirstX ¶
func (sq *ScreenshotQuery) FirstX(ctx context.Context) *Screenshot
FirstX is like First, but panics if an error occurs.
func (*ScreenshotQuery) GroupBy ¶
func (sq *ScreenshotQuery) GroupBy(field string, fields ...string) *ScreenshotGroupBy
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 { Status models.Status `json:"status,omitempty"` Count int `json:"count,omitempty"` } client.Screenshot.Query(). GroupBy(screenshot.FieldStatus). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ScreenshotQuery) IDsX ¶
func (sq *ScreenshotQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*ScreenshotQuery) Limit ¶
func (sq *ScreenshotQuery) Limit(limit int) *ScreenshotQuery
Limit the number of records to be returned by this query.
func (*ScreenshotQuery) Offset ¶
func (sq *ScreenshotQuery) Offset(offset int) *ScreenshotQuery
Offset to start from.
func (*ScreenshotQuery) Only ¶
func (sq *ScreenshotQuery) Only(ctx context.Context) (*Screenshot, error)
Only returns a single Screenshot entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Screenshot entity is found. Returns a *NotFoundError when no Screenshot entities are found.
func (*ScreenshotQuery) OnlyID ¶
OnlyID is like Only, but returns the only Screenshot ID in the query. Returns a *NotSingularError when more than one Screenshot ID is found. Returns a *NotFoundError when no entities are found.
func (*ScreenshotQuery) OnlyIDX ¶
func (sq *ScreenshotQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ScreenshotQuery) OnlyX ¶
func (sq *ScreenshotQuery) OnlyX(ctx context.Context) *Screenshot
OnlyX is like Only, but panics if an error occurs.
func (*ScreenshotQuery) Order ¶
func (sq *ScreenshotQuery) Order(o ...OrderFunc) *ScreenshotQuery
Order specifies how the records should be ordered.
func (*ScreenshotQuery) Select ¶
func (sq *ScreenshotQuery) Select(fields ...string) *ScreenshotSelect
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 { Status models.Status `json:"status,omitempty"` } client.Screenshot.Query(). Select(screenshot.FieldStatus). Scan(ctx, &v)
func (*ScreenshotQuery) Unique ¶
func (sq *ScreenshotQuery) Unique(unique bool) *ScreenshotQuery
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 (*ScreenshotQuery) Where ¶
func (sq *ScreenshotQuery) Where(ps ...predicate.Screenshot) *ScreenshotQuery
Where adds a new predicate for the ScreenshotQuery builder.
type ScreenshotSelect ¶
type ScreenshotSelect struct { *ScreenshotQuery // contains filtered or unexported fields }
ScreenshotSelect is the builder for selecting fields of Screenshot entities.
func (*ScreenshotSelect) Aggregate ¶
func (ss *ScreenshotSelect) Aggregate(fns ...AggregateFunc) *ScreenshotSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ScreenshotSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ScreenshotSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ScreenshotSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ScreenshotSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ScreenshotSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ScreenshotSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ScreenshotSelect) Scan ¶
func (ss *ScreenshotSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ScreenshotSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ScreenshotUpdate ¶
type ScreenshotUpdate struct {
// contains filtered or unexported fields
}
ScreenshotUpdate is the builder for updating Screenshot entities.
func (*ScreenshotUpdate) ClearStoredPath ¶
func (su *ScreenshotUpdate) ClearStoredPath() *ScreenshotUpdate
ClearStoredPath clears the value of the "stored_path" field.
func (*ScreenshotUpdate) Exec ¶
func (su *ScreenshotUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ScreenshotUpdate) ExecX ¶
func (su *ScreenshotUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ScreenshotUpdate) Mutation ¶
func (su *ScreenshotUpdate) Mutation() *ScreenshotMutation
Mutation returns the ScreenshotMutation object of the builder.
func (*ScreenshotUpdate) Save ¶
func (su *ScreenshotUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ScreenshotUpdate) SaveX ¶
func (su *ScreenshotUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ScreenshotUpdate) SetCreatedAt ¶
func (su *ScreenshotUpdate) SetCreatedAt(t time.Time) *ScreenshotUpdate
SetCreatedAt sets the "created_at" field.
func (*ScreenshotUpdate) SetNillableStoredPath ¶
func (su *ScreenshotUpdate) SetNillableStoredPath(s *string) *ScreenshotUpdate
SetNillableStoredPath sets the "stored_path" field if the given value is not nil.
func (*ScreenshotUpdate) SetStatus ¶
func (su *ScreenshotUpdate) SetStatus(m models.Status) *ScreenshotUpdate
SetStatus sets the "status" field.
func (*ScreenshotUpdate) SetStoredPath ¶
func (su *ScreenshotUpdate) SetStoredPath(s string) *ScreenshotUpdate
SetStoredPath sets the "stored_path" field.
func (*ScreenshotUpdate) SetURL ¶
func (su *ScreenshotUpdate) SetURL(s string) *ScreenshotUpdate
SetURL sets the "url" field.
func (*ScreenshotUpdate) Where ¶
func (su *ScreenshotUpdate) Where(ps ...predicate.Screenshot) *ScreenshotUpdate
Where appends a list predicates to the ScreenshotUpdate builder.
type ScreenshotUpdateOne ¶
type ScreenshotUpdateOne struct {
// contains filtered or unexported fields
}
ScreenshotUpdateOne is the builder for updating a single Screenshot entity.
func (*ScreenshotUpdateOne) ClearStoredPath ¶
func (suo *ScreenshotUpdateOne) ClearStoredPath() *ScreenshotUpdateOne
ClearStoredPath clears the value of the "stored_path" field.
func (*ScreenshotUpdateOne) Exec ¶
func (suo *ScreenshotUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ScreenshotUpdateOne) ExecX ¶
func (suo *ScreenshotUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ScreenshotUpdateOne) Mutation ¶
func (suo *ScreenshotUpdateOne) Mutation() *ScreenshotMutation
Mutation returns the ScreenshotMutation object of the builder.
func (*ScreenshotUpdateOne) Save ¶
func (suo *ScreenshotUpdateOne) Save(ctx context.Context) (*Screenshot, error)
Save executes the query and returns the updated Screenshot entity.
func (*ScreenshotUpdateOne) SaveX ¶
func (suo *ScreenshotUpdateOne) SaveX(ctx context.Context) *Screenshot
SaveX is like Save, but panics if an error occurs.
func (*ScreenshotUpdateOne) Select ¶
func (suo *ScreenshotUpdateOne) Select(field string, fields ...string) *ScreenshotUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ScreenshotUpdateOne) SetCreatedAt ¶
func (suo *ScreenshotUpdateOne) SetCreatedAt(t time.Time) *ScreenshotUpdateOne
SetCreatedAt sets the "created_at" field.
func (*ScreenshotUpdateOne) SetNillableStoredPath ¶
func (suo *ScreenshotUpdateOne) SetNillableStoredPath(s *string) *ScreenshotUpdateOne
SetNillableStoredPath sets the "stored_path" field if the given value is not nil.
func (*ScreenshotUpdateOne) SetStatus ¶
func (suo *ScreenshotUpdateOne) SetStatus(m models.Status) *ScreenshotUpdateOne
SetStatus sets the "status" field.
func (*ScreenshotUpdateOne) SetStoredPath ¶
func (suo *ScreenshotUpdateOne) SetStoredPath(s string) *ScreenshotUpdateOne
SetStoredPath sets the "stored_path" field.
func (*ScreenshotUpdateOne) SetURL ¶
func (suo *ScreenshotUpdateOne) SetURL(s string) *ScreenshotUpdateOne
SetURL sets the "url" field.
func (*ScreenshotUpdateOne) Where ¶
func (suo *ScreenshotUpdateOne) Where(ps ...predicate.Screenshot) *ScreenshotUpdateOne
Where appends a list predicates to the ScreenshotUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Screenshot is the client for interacting with the Screenshot builders. Screenshot *ScreenshotClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.