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
- 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 RequestLog
- type RequestLogClient
- func (c *RequestLogClient) Create() *RequestLogCreate
- func (c *RequestLogClient) CreateBulk(builders ...*RequestLogCreate) *RequestLogCreateBulk
- func (c *RequestLogClient) Delete() *RequestLogDelete
- func (c *RequestLogClient) DeleteOne(rl *RequestLog) *RequestLogDeleteOne
- func (c *RequestLogClient) DeleteOneID(id int) *RequestLogDeleteOne
- func (c *RequestLogClient) Get(ctx context.Context, id int) (*RequestLog, error)
- func (c *RequestLogClient) GetX(ctx context.Context, id int) *RequestLog
- func (c *RequestLogClient) Hooks() []Hook
- func (c *RequestLogClient) Query() *RequestLogQuery
- func (c *RequestLogClient) Update() *RequestLogUpdate
- func (c *RequestLogClient) UpdateOne(rl *RequestLog) *RequestLogUpdateOne
- func (c *RequestLogClient) UpdateOneID(id int) *RequestLogUpdateOne
- func (c *RequestLogClient) Use(hooks ...Hook)
- type RequestLogCreate
- func (rlc *RequestLogCreate) Exec(ctx context.Context) error
- func (rlc *RequestLogCreate) ExecX(ctx context.Context)
- func (rlc *RequestLogCreate) Mutation() *RequestLogMutation
- func (rlc *RequestLogCreate) Save(ctx context.Context) (*RequestLog, error)
- func (rlc *RequestLogCreate) SaveX(ctx context.Context) *RequestLog
- func (rlc *RequestLogCreate) SetBody(b []byte) *RequestLogCreate
- func (rlc *RequestLogCreate) SetFlag(s string) *RequestLogCreate
- func (rlc *RequestLogCreate) SetHeaders(s string) *RequestLogCreate
- func (rlc *RequestLogCreate) SetNillableFlag(s *string) *RequestLogCreate
- func (rlc *RequestLogCreate) SetTime(t time.Time) *RequestLogCreate
- type RequestLogCreateBulk
- type RequestLogDelete
- type RequestLogDeleteOne
- type RequestLogGroupBy
- func (rlgb *RequestLogGroupBy) Aggregate(fns ...AggregateFunc) *RequestLogGroupBy
- func (s *RequestLogGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RequestLogGroupBy) BoolX(ctx context.Context) bool
- func (s *RequestLogGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RequestLogGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RequestLogGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RequestLogGroupBy) Float64X(ctx context.Context) float64
- func (s *RequestLogGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RequestLogGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RequestLogGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RequestLogGroupBy) IntX(ctx context.Context) int
- func (s *RequestLogGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RequestLogGroupBy) IntsX(ctx context.Context) []int
- func (rlgb *RequestLogGroupBy) Scan(ctx context.Context, v any) error
- func (s *RequestLogGroupBy) ScanX(ctx context.Context, v any)
- func (s *RequestLogGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RequestLogGroupBy) StringX(ctx context.Context) string
- func (s *RequestLogGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RequestLogGroupBy) StringsX(ctx context.Context) []string
- type RequestLogMutation
- func (m *RequestLogMutation) AddField(name string, value ent.Value) error
- func (m *RequestLogMutation) AddedEdges() []string
- func (m *RequestLogMutation) AddedField(name string) (ent.Value, bool)
- func (m *RequestLogMutation) AddedFields() []string
- func (m *RequestLogMutation) AddedIDs(name string) []ent.Value
- func (m *RequestLogMutation) Body() (r []byte, exists bool)
- func (m *RequestLogMutation) BodyCleared() bool
- func (m *RequestLogMutation) ClearBody()
- func (m *RequestLogMutation) ClearEdge(name string) error
- func (m *RequestLogMutation) ClearField(name string) error
- func (m *RequestLogMutation) ClearedEdges() []string
- func (m *RequestLogMutation) ClearedFields() []string
- func (m RequestLogMutation) Client() *Client
- func (m *RequestLogMutation) EdgeCleared(name string) bool
- func (m *RequestLogMutation) Field(name string) (ent.Value, bool)
- func (m *RequestLogMutation) FieldCleared(name string) bool
- func (m *RequestLogMutation) Fields() []string
- func (m *RequestLogMutation) Flag() (r string, exists bool)
- func (m *RequestLogMutation) Headers() (r string, exists bool)
- func (m *RequestLogMutation) ID() (id int, exists bool)
- func (m *RequestLogMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RequestLogMutation) OldBody(ctx context.Context) (v []byte, err error)
- func (m *RequestLogMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RequestLogMutation) OldFlag(ctx context.Context) (v string, err error)
- func (m *RequestLogMutation) OldHeaders(ctx context.Context) (v string, err error)
- func (m *RequestLogMutation) OldTime(ctx context.Context) (v time.Time, err error)
- func (m *RequestLogMutation) Op() Op
- func (m *RequestLogMutation) RemovedEdges() []string
- func (m *RequestLogMutation) RemovedIDs(name string) []ent.Value
- func (m *RequestLogMutation) ResetBody()
- func (m *RequestLogMutation) ResetEdge(name string) error
- func (m *RequestLogMutation) ResetField(name string) error
- func (m *RequestLogMutation) ResetFlag()
- func (m *RequestLogMutation) ResetHeaders()
- func (m *RequestLogMutation) ResetTime()
- func (m *RequestLogMutation) SetBody(b []byte)
- func (m *RequestLogMutation) SetField(name string, value ent.Value) error
- func (m *RequestLogMutation) SetFlag(s string)
- func (m *RequestLogMutation) SetHeaders(s string)
- func (m *RequestLogMutation) SetTime(t time.Time)
- func (m *RequestLogMutation) Time() (r time.Time, exists bool)
- func (m RequestLogMutation) Tx() (*Tx, error)
- func (m *RequestLogMutation) Type() string
- func (m *RequestLogMutation) Where(ps ...predicate.RequestLog)
- type RequestLogQuery
- func (rlq *RequestLogQuery) Aggregate(fns ...AggregateFunc) *RequestLogSelect
- func (rlq *RequestLogQuery) All(ctx context.Context) ([]*RequestLog, error)
- func (rlq *RequestLogQuery) AllX(ctx context.Context) []*RequestLog
- func (rlq *RequestLogQuery) Clone() *RequestLogQuery
- func (rlq *RequestLogQuery) Count(ctx context.Context) (int, error)
- func (rlq *RequestLogQuery) CountX(ctx context.Context) int
- func (rlq *RequestLogQuery) Exist(ctx context.Context) (bool, error)
- func (rlq *RequestLogQuery) ExistX(ctx context.Context) bool
- func (rlq *RequestLogQuery) First(ctx context.Context) (*RequestLog, error)
- func (rlq *RequestLogQuery) FirstID(ctx context.Context) (id int, err error)
- func (rlq *RequestLogQuery) FirstIDX(ctx context.Context) int
- func (rlq *RequestLogQuery) FirstX(ctx context.Context) *RequestLog
- func (rlq *RequestLogQuery) GroupBy(field string, fields ...string) *RequestLogGroupBy
- func (rlq *RequestLogQuery) IDs(ctx context.Context) ([]int, error)
- func (rlq *RequestLogQuery) IDsX(ctx context.Context) []int
- func (rlq *RequestLogQuery) Limit(limit int) *RequestLogQuery
- func (rlq *RequestLogQuery) Offset(offset int) *RequestLogQuery
- func (rlq *RequestLogQuery) Only(ctx context.Context) (*RequestLog, error)
- func (rlq *RequestLogQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rlq *RequestLogQuery) OnlyIDX(ctx context.Context) int
- func (rlq *RequestLogQuery) OnlyX(ctx context.Context) *RequestLog
- func (rlq *RequestLogQuery) Order(o ...OrderFunc) *RequestLogQuery
- func (rlq *RequestLogQuery) Select(fields ...string) *RequestLogSelect
- func (rlq *RequestLogQuery) Unique(unique bool) *RequestLogQuery
- func (rlq *RequestLogQuery) Where(ps ...predicate.RequestLog) *RequestLogQuery
- type RequestLogSelect
- func (rls *RequestLogSelect) Aggregate(fns ...AggregateFunc) *RequestLogSelect
- func (s *RequestLogSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RequestLogSelect) BoolX(ctx context.Context) bool
- func (s *RequestLogSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RequestLogSelect) BoolsX(ctx context.Context) []bool
- func (s *RequestLogSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RequestLogSelect) Float64X(ctx context.Context) float64
- func (s *RequestLogSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RequestLogSelect) Float64sX(ctx context.Context) []float64
- func (s *RequestLogSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RequestLogSelect) IntX(ctx context.Context) int
- func (s *RequestLogSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RequestLogSelect) IntsX(ctx context.Context) []int
- func (rls *RequestLogSelect) Scan(ctx context.Context, v any) error
- func (s *RequestLogSelect) ScanX(ctx context.Context, v any)
- func (s *RequestLogSelect) String(ctx context.Context) (_ string, err error)
- func (s *RequestLogSelect) StringX(ctx context.Context) string
- func (s *RequestLogSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RequestLogSelect) StringsX(ctx context.Context) []string
- type RequestLogUpdate
- func (rlu *RequestLogUpdate) ClearBody() *RequestLogUpdate
- func (rlu *RequestLogUpdate) Exec(ctx context.Context) error
- func (rlu *RequestLogUpdate) ExecX(ctx context.Context)
- func (rlu *RequestLogUpdate) Mutation() *RequestLogMutation
- func (rlu *RequestLogUpdate) Save(ctx context.Context) (int, error)
- func (rlu *RequestLogUpdate) SaveX(ctx context.Context) int
- func (rlu *RequestLogUpdate) SetBody(b []byte) *RequestLogUpdate
- func (rlu *RequestLogUpdate) SetFlag(s string) *RequestLogUpdate
- func (rlu *RequestLogUpdate) SetHeaders(s string) *RequestLogUpdate
- func (rlu *RequestLogUpdate) SetNillableFlag(s *string) *RequestLogUpdate
- func (rlu *RequestLogUpdate) SetTime(t time.Time) *RequestLogUpdate
- func (rlu *RequestLogUpdate) Where(ps ...predicate.RequestLog) *RequestLogUpdate
- type RequestLogUpdateOne
- func (rluo *RequestLogUpdateOne) ClearBody() *RequestLogUpdateOne
- func (rluo *RequestLogUpdateOne) Exec(ctx context.Context) error
- func (rluo *RequestLogUpdateOne) ExecX(ctx context.Context)
- func (rluo *RequestLogUpdateOne) Mutation() *RequestLogMutation
- func (rluo *RequestLogUpdateOne) Save(ctx context.Context) (*RequestLog, error)
- func (rluo *RequestLogUpdateOne) SaveX(ctx context.Context) *RequestLog
- func (rluo *RequestLogUpdateOne) Select(field string, fields ...string) *RequestLogUpdateOne
- func (rluo *RequestLogUpdateOne) SetBody(b []byte) *RequestLogUpdateOne
- func (rluo *RequestLogUpdateOne) SetFlag(s string) *RequestLogUpdateOne
- func (rluo *RequestLogUpdateOne) SetHeaders(s string) *RequestLogUpdateOne
- func (rluo *RequestLogUpdateOne) SetNillableFlag(s *string) *RequestLogUpdateOne
- func (rluo *RequestLogUpdateOne) SetTime(t time.Time) *RequestLogUpdateOne
- type RequestLogs
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- 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. TypeRequestLog = "RequestLog" )
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 // RequestLog is the client for interacting with the RequestLog builders. RequestLog *RequestLogClient // 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(). RequestLog. 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(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 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 RequestLog ¶
type RequestLog struct { // ID of the ent. ID int `json:"id,omitempty"` // Time holds the value of the "time" field. Time time.Time `json:"time,omitempty"` // Headers holds the value of the "headers" field. Headers string `json:"headers,omitempty"` // Body holds the value of the "body" field. Body []byte `json:"body,omitempty"` // Flag holds the value of the "flag" field. Flag string `json:"flag,omitempty"` // contains filtered or unexported fields }
RequestLog is the model entity for the RequestLog schema.
func (*RequestLog) String ¶
func (rl *RequestLog) String() string
String implements the fmt.Stringer.
func (*RequestLog) Unwrap ¶
func (rl *RequestLog) Unwrap() *RequestLog
Unwrap unwraps the RequestLog 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 (*RequestLog) Update ¶
func (rl *RequestLog) Update() *RequestLogUpdateOne
Update returns a builder for updating this RequestLog. Note that you need to call RequestLog.Unwrap() before calling this method if this RequestLog was returned from a transaction, and the transaction was committed or rolled back.
type RequestLogClient ¶
type RequestLogClient struct {
// contains filtered or unexported fields
}
RequestLogClient is a client for the RequestLog schema.
func NewRequestLogClient ¶
func NewRequestLogClient(c config) *RequestLogClient
NewRequestLogClient returns a client for the RequestLog from the given config.
func (*RequestLogClient) Create ¶
func (c *RequestLogClient) Create() *RequestLogCreate
Create returns a builder for creating a RequestLog entity.
func (*RequestLogClient) CreateBulk ¶
func (c *RequestLogClient) CreateBulk(builders ...*RequestLogCreate) *RequestLogCreateBulk
CreateBulk returns a builder for creating a bulk of RequestLog entities.
func (*RequestLogClient) Delete ¶
func (c *RequestLogClient) Delete() *RequestLogDelete
Delete returns a delete builder for RequestLog.
func (*RequestLogClient) DeleteOne ¶
func (c *RequestLogClient) DeleteOne(rl *RequestLog) *RequestLogDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RequestLogClient) DeleteOneID ¶
func (c *RequestLogClient) DeleteOneID(id int) *RequestLogDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RequestLogClient) Get ¶
func (c *RequestLogClient) Get(ctx context.Context, id int) (*RequestLog, error)
Get returns a RequestLog entity by its id.
func (*RequestLogClient) GetX ¶
func (c *RequestLogClient) GetX(ctx context.Context, id int) *RequestLog
GetX is like Get, but panics if an error occurs.
func (*RequestLogClient) Hooks ¶
func (c *RequestLogClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RequestLogClient) Query ¶
func (c *RequestLogClient) Query() *RequestLogQuery
Query returns a query builder for RequestLog.
func (*RequestLogClient) Update ¶
func (c *RequestLogClient) Update() *RequestLogUpdate
Update returns an update builder for RequestLog.
func (*RequestLogClient) UpdateOne ¶
func (c *RequestLogClient) UpdateOne(rl *RequestLog) *RequestLogUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RequestLogClient) UpdateOneID ¶
func (c *RequestLogClient) UpdateOneID(id int) *RequestLogUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RequestLogClient) Use ¶
func (c *RequestLogClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `requestlog.Hooks(f(g(h())))`.
type RequestLogCreate ¶
type RequestLogCreate struct {
// contains filtered or unexported fields
}
RequestLogCreate is the builder for creating a RequestLog entity.
func (*RequestLogCreate) Exec ¶
func (rlc *RequestLogCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RequestLogCreate) ExecX ¶
func (rlc *RequestLogCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RequestLogCreate) Mutation ¶
func (rlc *RequestLogCreate) Mutation() *RequestLogMutation
Mutation returns the RequestLogMutation object of the builder.
func (*RequestLogCreate) Save ¶
func (rlc *RequestLogCreate) Save(ctx context.Context) (*RequestLog, error)
Save creates the RequestLog in the database.
func (*RequestLogCreate) SaveX ¶
func (rlc *RequestLogCreate) SaveX(ctx context.Context) *RequestLog
SaveX calls Save and panics if Save returns an error.
func (*RequestLogCreate) SetBody ¶
func (rlc *RequestLogCreate) SetBody(b []byte) *RequestLogCreate
SetBody sets the "body" field.
func (*RequestLogCreate) SetFlag ¶
func (rlc *RequestLogCreate) SetFlag(s string) *RequestLogCreate
SetFlag sets the "flag" field.
func (*RequestLogCreate) SetHeaders ¶
func (rlc *RequestLogCreate) SetHeaders(s string) *RequestLogCreate
SetHeaders sets the "headers" field.
func (*RequestLogCreate) SetNillableFlag ¶
func (rlc *RequestLogCreate) SetNillableFlag(s *string) *RequestLogCreate
SetNillableFlag sets the "flag" field if the given value is not nil.
func (*RequestLogCreate) SetTime ¶
func (rlc *RequestLogCreate) SetTime(t time.Time) *RequestLogCreate
SetTime sets the "time" field.
type RequestLogCreateBulk ¶
type RequestLogCreateBulk struct {
// contains filtered or unexported fields
}
RequestLogCreateBulk is the builder for creating many RequestLog entities in bulk.
func (*RequestLogCreateBulk) Exec ¶
func (rlcb *RequestLogCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RequestLogCreateBulk) ExecX ¶
func (rlcb *RequestLogCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RequestLogCreateBulk) Save ¶
func (rlcb *RequestLogCreateBulk) Save(ctx context.Context) ([]*RequestLog, error)
Save creates the RequestLog entities in the database.
func (*RequestLogCreateBulk) SaveX ¶
func (rlcb *RequestLogCreateBulk) SaveX(ctx context.Context) []*RequestLog
SaveX is like Save, but panics if an error occurs.
type RequestLogDelete ¶
type RequestLogDelete struct {
// contains filtered or unexported fields
}
RequestLogDelete is the builder for deleting a RequestLog entity.
func (*RequestLogDelete) Exec ¶
func (rld *RequestLogDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RequestLogDelete) ExecX ¶
func (rld *RequestLogDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RequestLogDelete) Where ¶
func (rld *RequestLogDelete) Where(ps ...predicate.RequestLog) *RequestLogDelete
Where appends a list predicates to the RequestLogDelete builder.
type RequestLogDeleteOne ¶
type RequestLogDeleteOne struct {
// contains filtered or unexported fields
}
RequestLogDeleteOne is the builder for deleting a single RequestLog entity.
func (*RequestLogDeleteOne) Exec ¶
func (rldo *RequestLogDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RequestLogDeleteOne) ExecX ¶
func (rldo *RequestLogDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RequestLogGroupBy ¶
type RequestLogGroupBy struct {
// contains filtered or unexported fields
}
RequestLogGroupBy is the group-by builder for RequestLog entities.
func (*RequestLogGroupBy) Aggregate ¶
func (rlgb *RequestLogGroupBy) Aggregate(fns ...AggregateFunc) *RequestLogGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RequestLogGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RequestLogGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RequestLogGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RequestLogGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RequestLogGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RequestLogGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RequestLogGroupBy) Scan ¶
func (rlgb *RequestLogGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*RequestLogGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RequestLogMutation ¶
type RequestLogMutation struct {
// contains filtered or unexported fields
}
RequestLogMutation represents an operation that mutates the RequestLog nodes in the graph.
func (*RequestLogMutation) AddField ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) AddedEdges ¶
func (m *RequestLogMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RequestLogMutation) AddedField ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) AddedFields ¶
func (m *RequestLogMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RequestLogMutation) AddedIDs ¶
func (m *RequestLogMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RequestLogMutation) Body ¶
func (m *RequestLogMutation) Body() (r []byte, exists bool)
Body returns the value of the "body" field in the mutation.
func (*RequestLogMutation) BodyCleared ¶
func (m *RequestLogMutation) BodyCleared() bool
BodyCleared returns if the "body" field was cleared in this mutation.
func (*RequestLogMutation) ClearBody ¶
func (m *RequestLogMutation) ClearBody()
ClearBody clears the value of the "body" field.
func (*RequestLogMutation) ClearEdge ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) ClearField ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) ClearedEdges ¶
func (m *RequestLogMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RequestLogMutation) ClearedFields ¶
func (m *RequestLogMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RequestLogMutation) Client ¶
func (m RequestLogMutation) 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 (*RequestLogMutation) EdgeCleared ¶
func (m *RequestLogMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RequestLogMutation) Field ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) FieldCleared ¶
func (m *RequestLogMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RequestLogMutation) Fields ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) Flag ¶
func (m *RequestLogMutation) Flag() (r string, exists bool)
Flag returns the value of the "flag" field in the mutation.
func (*RequestLogMutation) Headers ¶
func (m *RequestLogMutation) Headers() (r string, exists bool)
Headers returns the value of the "headers" field in the mutation.
func (*RequestLogMutation) ID ¶
func (m *RequestLogMutation) ID() (id int, 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 (*RequestLogMutation) IDs ¶
func (m *RequestLogMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*RequestLogMutation) OldBody ¶
func (m *RequestLogMutation) OldBody(ctx context.Context) (v []byte, err error)
OldBody returns the old "body" field's value of the RequestLog entity. If the RequestLog 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 (*RequestLogMutation) 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 (*RequestLogMutation) OldFlag ¶
func (m *RequestLogMutation) OldFlag(ctx context.Context) (v string, err error)
OldFlag returns the old "flag" field's value of the RequestLog entity. If the RequestLog 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 (*RequestLogMutation) OldHeaders ¶
func (m *RequestLogMutation) OldHeaders(ctx context.Context) (v string, err error)
OldHeaders returns the old "headers" field's value of the RequestLog entity. If the RequestLog 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 (*RequestLogMutation) OldTime ¶
OldTime returns the old "time" field's value of the RequestLog entity. If the RequestLog 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 (*RequestLogMutation) RemovedEdges ¶
func (m *RequestLogMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RequestLogMutation) RemovedIDs ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) ResetBody ¶
func (m *RequestLogMutation) ResetBody()
ResetBody resets all changes to the "body" field.
func (*RequestLogMutation) ResetEdge ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) ResetField ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) ResetFlag ¶
func (m *RequestLogMutation) ResetFlag()
ResetFlag resets all changes to the "flag" field.
func (*RequestLogMutation) ResetHeaders ¶
func (m *RequestLogMutation) ResetHeaders()
ResetHeaders resets all changes to the "headers" field.
func (*RequestLogMutation) ResetTime ¶
func (m *RequestLogMutation) ResetTime()
ResetTime resets all changes to the "time" field.
func (*RequestLogMutation) SetBody ¶
func (m *RequestLogMutation) SetBody(b []byte)
SetBody sets the "body" field.
func (*RequestLogMutation) SetField ¶
func (m *RequestLogMutation) 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 (*RequestLogMutation) SetFlag ¶
func (m *RequestLogMutation) SetFlag(s string)
SetFlag sets the "flag" field.
func (*RequestLogMutation) SetHeaders ¶
func (m *RequestLogMutation) SetHeaders(s string)
SetHeaders sets the "headers" field.
func (*RequestLogMutation) SetTime ¶
func (m *RequestLogMutation) SetTime(t time.Time)
SetTime sets the "time" field.
func (*RequestLogMutation) Time ¶
func (m *RequestLogMutation) Time() (r time.Time, exists bool)
Time returns the value of the "time" field in the mutation.
func (RequestLogMutation) Tx ¶
func (m RequestLogMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RequestLogMutation) Type ¶
func (m *RequestLogMutation) Type() string
Type returns the node type of this mutation (RequestLog).
func (*RequestLogMutation) Where ¶
func (m *RequestLogMutation) Where(ps ...predicate.RequestLog)
Where appends a list predicates to the RequestLogMutation builder.
type RequestLogQuery ¶
type RequestLogQuery struct {
// contains filtered or unexported fields
}
RequestLogQuery is the builder for querying RequestLog entities.
func (*RequestLogQuery) Aggregate ¶
func (rlq *RequestLogQuery) Aggregate(fns ...AggregateFunc) *RequestLogSelect
Aggregate returns a RequestLogSelect configured with the given aggregations.
func (*RequestLogQuery) All ¶
func (rlq *RequestLogQuery) All(ctx context.Context) ([]*RequestLog, error)
All executes the query and returns a list of RequestLogs.
func (*RequestLogQuery) AllX ¶
func (rlq *RequestLogQuery) AllX(ctx context.Context) []*RequestLog
AllX is like All, but panics if an error occurs.
func (*RequestLogQuery) Clone ¶
func (rlq *RequestLogQuery) Clone() *RequestLogQuery
Clone returns a duplicate of the RequestLogQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RequestLogQuery) Count ¶
func (rlq *RequestLogQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RequestLogQuery) CountX ¶
func (rlq *RequestLogQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RequestLogQuery) Exist ¶
func (rlq *RequestLogQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RequestLogQuery) ExistX ¶
func (rlq *RequestLogQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RequestLogQuery) First ¶
func (rlq *RequestLogQuery) First(ctx context.Context) (*RequestLog, error)
First returns the first RequestLog entity from the query. Returns a *NotFoundError when no RequestLog was found.
func (*RequestLogQuery) FirstID ¶
func (rlq *RequestLogQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first RequestLog ID from the query. Returns a *NotFoundError when no RequestLog ID was found.
func (*RequestLogQuery) FirstIDX ¶
func (rlq *RequestLogQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RequestLogQuery) FirstX ¶
func (rlq *RequestLogQuery) FirstX(ctx context.Context) *RequestLog
FirstX is like First, but panics if an error occurs.
func (*RequestLogQuery) GroupBy ¶
func (rlq *RequestLogQuery) GroupBy(field string, fields ...string) *RequestLogGroupBy
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 { Time time.Time `json:"time,omitempty"` Count int `json:"count,omitempty"` } client.RequestLog.Query(). GroupBy(requestlog.FieldTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RequestLogQuery) IDs ¶
func (rlq *RequestLogQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of RequestLog IDs.
func (*RequestLogQuery) IDsX ¶
func (rlq *RequestLogQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RequestLogQuery) Limit ¶
func (rlq *RequestLogQuery) Limit(limit int) *RequestLogQuery
Limit adds a limit step to the query.
func (*RequestLogQuery) Offset ¶
func (rlq *RequestLogQuery) Offset(offset int) *RequestLogQuery
Offset adds an offset step to the query.
func (*RequestLogQuery) Only ¶
func (rlq *RequestLogQuery) Only(ctx context.Context) (*RequestLog, error)
Only returns a single RequestLog entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RequestLog entity is found. Returns a *NotFoundError when no RequestLog entities are found.
func (*RequestLogQuery) OnlyID ¶
func (rlq *RequestLogQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only RequestLog ID in the query. Returns a *NotSingularError when more than one RequestLog ID is found. Returns a *NotFoundError when no entities are found.
func (*RequestLogQuery) OnlyIDX ¶
func (rlq *RequestLogQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RequestLogQuery) OnlyX ¶
func (rlq *RequestLogQuery) OnlyX(ctx context.Context) *RequestLog
OnlyX is like Only, but panics if an error occurs.
func (*RequestLogQuery) Order ¶
func (rlq *RequestLogQuery) Order(o ...OrderFunc) *RequestLogQuery
Order adds an order step to the query.
func (*RequestLogQuery) Select ¶
func (rlq *RequestLogQuery) Select(fields ...string) *RequestLogSelect
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 { Time time.Time `json:"time,omitempty"` } client.RequestLog.Query(). Select(requestlog.FieldTime). Scan(ctx, &v)
func (*RequestLogQuery) Unique ¶
func (rlq *RequestLogQuery) Unique(unique bool) *RequestLogQuery
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 (*RequestLogQuery) Where ¶
func (rlq *RequestLogQuery) Where(ps ...predicate.RequestLog) *RequestLogQuery
Where adds a new predicate for the RequestLogQuery builder.
type RequestLogSelect ¶
type RequestLogSelect struct { *RequestLogQuery // contains filtered or unexported fields }
RequestLogSelect is the builder for selecting fields of RequestLog entities.
func (*RequestLogSelect) Aggregate ¶
func (rls *RequestLogSelect) Aggregate(fns ...AggregateFunc) *RequestLogSelect
Aggregate adds the given aggregation functions to the selector query.
func (*RequestLogSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RequestLogSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RequestLogSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RequestLogSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RequestLogSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RequestLogSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RequestLogSelect) Scan ¶
func (rls *RequestLogSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RequestLogSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RequestLogUpdate ¶
type RequestLogUpdate struct {
// contains filtered or unexported fields
}
RequestLogUpdate is the builder for updating RequestLog entities.
func (*RequestLogUpdate) ClearBody ¶
func (rlu *RequestLogUpdate) ClearBody() *RequestLogUpdate
ClearBody clears the value of the "body" field.
func (*RequestLogUpdate) Exec ¶
func (rlu *RequestLogUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RequestLogUpdate) ExecX ¶
func (rlu *RequestLogUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RequestLogUpdate) Mutation ¶
func (rlu *RequestLogUpdate) Mutation() *RequestLogMutation
Mutation returns the RequestLogMutation object of the builder.
func (*RequestLogUpdate) Save ¶
func (rlu *RequestLogUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RequestLogUpdate) SaveX ¶
func (rlu *RequestLogUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RequestLogUpdate) SetBody ¶
func (rlu *RequestLogUpdate) SetBody(b []byte) *RequestLogUpdate
SetBody sets the "body" field.
func (*RequestLogUpdate) SetFlag ¶
func (rlu *RequestLogUpdate) SetFlag(s string) *RequestLogUpdate
SetFlag sets the "flag" field.
func (*RequestLogUpdate) SetHeaders ¶
func (rlu *RequestLogUpdate) SetHeaders(s string) *RequestLogUpdate
SetHeaders sets the "headers" field.
func (*RequestLogUpdate) SetNillableFlag ¶
func (rlu *RequestLogUpdate) SetNillableFlag(s *string) *RequestLogUpdate
SetNillableFlag sets the "flag" field if the given value is not nil.
func (*RequestLogUpdate) SetTime ¶
func (rlu *RequestLogUpdate) SetTime(t time.Time) *RequestLogUpdate
SetTime sets the "time" field.
func (*RequestLogUpdate) Where ¶
func (rlu *RequestLogUpdate) Where(ps ...predicate.RequestLog) *RequestLogUpdate
Where appends a list predicates to the RequestLogUpdate builder.
type RequestLogUpdateOne ¶
type RequestLogUpdateOne struct {
// contains filtered or unexported fields
}
RequestLogUpdateOne is the builder for updating a single RequestLog entity.
func (*RequestLogUpdateOne) ClearBody ¶
func (rluo *RequestLogUpdateOne) ClearBody() *RequestLogUpdateOne
ClearBody clears the value of the "body" field.
func (*RequestLogUpdateOne) Exec ¶
func (rluo *RequestLogUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RequestLogUpdateOne) ExecX ¶
func (rluo *RequestLogUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RequestLogUpdateOne) Mutation ¶
func (rluo *RequestLogUpdateOne) Mutation() *RequestLogMutation
Mutation returns the RequestLogMutation object of the builder.
func (*RequestLogUpdateOne) Save ¶
func (rluo *RequestLogUpdateOne) Save(ctx context.Context) (*RequestLog, error)
Save executes the query and returns the updated RequestLog entity.
func (*RequestLogUpdateOne) SaveX ¶
func (rluo *RequestLogUpdateOne) SaveX(ctx context.Context) *RequestLog
SaveX is like Save, but panics if an error occurs.
func (*RequestLogUpdateOne) Select ¶
func (rluo *RequestLogUpdateOne) Select(field string, fields ...string) *RequestLogUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RequestLogUpdateOne) SetBody ¶
func (rluo *RequestLogUpdateOne) SetBody(b []byte) *RequestLogUpdateOne
SetBody sets the "body" field.
func (*RequestLogUpdateOne) SetFlag ¶
func (rluo *RequestLogUpdateOne) SetFlag(s string) *RequestLogUpdateOne
SetFlag sets the "flag" field.
func (*RequestLogUpdateOne) SetHeaders ¶
func (rluo *RequestLogUpdateOne) SetHeaders(s string) *RequestLogUpdateOne
SetHeaders sets the "headers" field.
func (*RequestLogUpdateOne) SetNillableFlag ¶
func (rluo *RequestLogUpdateOne) SetNillableFlag(s *string) *RequestLogUpdateOne
SetNillableFlag sets the "flag" field if the given value is not nil.
func (*RequestLogUpdateOne) SetTime ¶
func (rluo *RequestLogUpdateOne) SetTime(t time.Time) *RequestLogUpdateOne
SetTime sets the "time" field.
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 Tx ¶
type Tx struct { // RequestLog is the client for interacting with the RequestLog builders. RequestLog *RequestLogClient // 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.