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 MatrixAttack
- type MatrixAttackClient
- func (c *MatrixAttackClient) Create() *MatrixAttackCreate
- func (c *MatrixAttackClient) CreateBulk(builders ...*MatrixAttackCreate) *MatrixAttackCreateBulk
- func (c *MatrixAttackClient) Delete() *MatrixAttackDelete
- func (c *MatrixAttackClient) DeleteOne(ma *MatrixAttack) *MatrixAttackDeleteOne
- func (c *MatrixAttackClient) DeleteOneID(id int) *MatrixAttackDeleteOne
- func (c *MatrixAttackClient) Get(ctx context.Context, id int) (*MatrixAttack, error)
- func (c *MatrixAttackClient) GetX(ctx context.Context, id int) *MatrixAttack
- func (c *MatrixAttackClient) Hooks() []Hook
- func (c *MatrixAttackClient) Query() *MatrixAttackQuery
- func (c *MatrixAttackClient) Update() *MatrixAttackUpdate
- func (c *MatrixAttackClient) UpdateOne(ma *MatrixAttack) *MatrixAttackUpdateOne
- func (c *MatrixAttackClient) UpdateOneID(id int) *MatrixAttackUpdateOne
- func (c *MatrixAttackClient) Use(hooks ...Hook)
- type MatrixAttackCreate
- func (mac *MatrixAttackCreate) Exec(ctx context.Context) error
- func (mac *MatrixAttackCreate) ExecX(ctx context.Context)
- func (mac *MatrixAttackCreate) Mutation() *MatrixAttackMutation
- func (mac *MatrixAttackCreate) Save(ctx context.Context) (*MatrixAttack, error)
- func (mac *MatrixAttackCreate) SaveX(ctx context.Context) *MatrixAttack
- func (mac *MatrixAttackCreate) SetCreateDate(t time.Time) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetIdMatrix(s string) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetModifyDate(t time.Time) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetNameMatrix(s string) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetNillableCreateDate(t *time.Time) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetNillableModifyDate(t *time.Time) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetNillableNameMatrix(s *string) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetNillableVendorName(s *string) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetNillableVersionMatrix(s *string) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetVendorName(s string) *MatrixAttackCreate
- func (mac *MatrixAttackCreate) SetVersionMatrix(s string) *MatrixAttackCreate
- type MatrixAttackCreateBulk
- type MatrixAttackDelete
- type MatrixAttackDeleteOne
- type MatrixAttackGroupBy
- func (magb *MatrixAttackGroupBy) Aggregate(fns ...AggregateFunc) *MatrixAttackGroupBy
- func (magb *MatrixAttackGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (magb *MatrixAttackGroupBy) BoolX(ctx context.Context) bool
- func (magb *MatrixAttackGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (magb *MatrixAttackGroupBy) BoolsX(ctx context.Context) []bool
- func (magb *MatrixAttackGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (magb *MatrixAttackGroupBy) Float64X(ctx context.Context) float64
- func (magb *MatrixAttackGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (magb *MatrixAttackGroupBy) Float64sX(ctx context.Context) []float64
- func (magb *MatrixAttackGroupBy) Int(ctx context.Context) (_ int, err error)
- func (magb *MatrixAttackGroupBy) IntX(ctx context.Context) int
- func (magb *MatrixAttackGroupBy) Ints(ctx context.Context) ([]int, error)
- func (magb *MatrixAttackGroupBy) IntsX(ctx context.Context) []int
- func (magb *MatrixAttackGroupBy) Scan(ctx context.Context, v interface{}) error
- func (magb *MatrixAttackGroupBy) ScanX(ctx context.Context, v interface{})
- func (magb *MatrixAttackGroupBy) String(ctx context.Context) (_ string, err error)
- func (magb *MatrixAttackGroupBy) StringX(ctx context.Context) string
- func (magb *MatrixAttackGroupBy) Strings(ctx context.Context) ([]string, error)
- func (magb *MatrixAttackGroupBy) StringsX(ctx context.Context) []string
- type MatrixAttackMutation
- func (m *MatrixAttackMutation) AddField(name string, value ent.Value) error
- func (m *MatrixAttackMutation) AddedEdges() []string
- func (m *MatrixAttackMutation) AddedField(name string) (ent.Value, bool)
- func (m *MatrixAttackMutation) AddedFields() []string
- func (m *MatrixAttackMutation) AddedIDs(name string) []ent.Value
- func (m *MatrixAttackMutation) ClearEdge(name string) error
- func (m *MatrixAttackMutation) ClearField(name string) error
- func (m *MatrixAttackMutation) ClearedEdges() []string
- func (m *MatrixAttackMutation) ClearedFields() []string
- func (m MatrixAttackMutation) Client() *Client
- func (m *MatrixAttackMutation) CreateDate() (r time.Time, exists bool)
- func (m *MatrixAttackMutation) EdgeCleared(name string) bool
- func (m *MatrixAttackMutation) Field(name string) (ent.Value, bool)
- func (m *MatrixAttackMutation) FieldCleared(name string) bool
- func (m *MatrixAttackMutation) Fields() []string
- func (m *MatrixAttackMutation) ID() (id int, exists bool)
- func (m *MatrixAttackMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MatrixAttackMutation) IdMatrix() (r string, exists bool)
- func (m *MatrixAttackMutation) ModifyDate() (r time.Time, exists bool)
- func (m *MatrixAttackMutation) NameMatrix() (r string, exists bool)
- func (m *MatrixAttackMutation) OldCreateDate(ctx context.Context) (v time.Time, err error)
- func (m *MatrixAttackMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MatrixAttackMutation) OldIdMatrix(ctx context.Context) (v string, err error)
- func (m *MatrixAttackMutation) OldModifyDate(ctx context.Context) (v time.Time, err error)
- func (m *MatrixAttackMutation) OldNameMatrix(ctx context.Context) (v string, err error)
- func (m *MatrixAttackMutation) OldVendorName(ctx context.Context) (v string, err error)
- func (m *MatrixAttackMutation) OldVersionMatrix(ctx context.Context) (v string, err error)
- func (m *MatrixAttackMutation) Op() Op
- func (m *MatrixAttackMutation) RemovedEdges() []string
- func (m *MatrixAttackMutation) RemovedIDs(name string) []ent.Value
- func (m *MatrixAttackMutation) ResetCreateDate()
- func (m *MatrixAttackMutation) ResetEdge(name string) error
- func (m *MatrixAttackMutation) ResetField(name string) error
- func (m *MatrixAttackMutation) ResetIdMatrix()
- func (m *MatrixAttackMutation) ResetModifyDate()
- func (m *MatrixAttackMutation) ResetNameMatrix()
- func (m *MatrixAttackMutation) ResetVendorName()
- func (m *MatrixAttackMutation) ResetVersionMatrix()
- func (m *MatrixAttackMutation) SetCreateDate(t time.Time)
- func (m *MatrixAttackMutation) SetField(name string, value ent.Value) error
- func (m *MatrixAttackMutation) SetIdMatrix(s string)
- func (m *MatrixAttackMutation) SetModifyDate(t time.Time)
- func (m *MatrixAttackMutation) SetNameMatrix(s string)
- func (m *MatrixAttackMutation) SetVendorName(s string)
- func (m *MatrixAttackMutation) SetVersionMatrix(s string)
- func (m MatrixAttackMutation) Tx() (*Tx, error)
- func (m *MatrixAttackMutation) Type() string
- func (m *MatrixAttackMutation) VendorName() (r string, exists bool)
- func (m *MatrixAttackMutation) VersionMatrix() (r string, exists bool)
- func (m *MatrixAttackMutation) Where(ps ...predicate.MatrixAttack)
- type MatrixAttackQuery
- func (maq *MatrixAttackQuery) All(ctx context.Context) ([]*MatrixAttack, error)
- func (maq *MatrixAttackQuery) AllX(ctx context.Context) []*MatrixAttack
- func (maq *MatrixAttackQuery) Clone() *MatrixAttackQuery
- func (maq *MatrixAttackQuery) Count(ctx context.Context) (int, error)
- func (maq *MatrixAttackQuery) CountX(ctx context.Context) int
- func (maq *MatrixAttackQuery) Exist(ctx context.Context) (bool, error)
- func (maq *MatrixAttackQuery) ExistX(ctx context.Context) bool
- func (maq *MatrixAttackQuery) First(ctx context.Context) (*MatrixAttack, error)
- func (maq *MatrixAttackQuery) FirstID(ctx context.Context) (id int, err error)
- func (maq *MatrixAttackQuery) FirstIDX(ctx context.Context) int
- func (maq *MatrixAttackQuery) FirstX(ctx context.Context) *MatrixAttack
- func (maq *MatrixAttackQuery) GroupBy(field string, fields ...string) *MatrixAttackGroupBy
- func (maq *MatrixAttackQuery) IDs(ctx context.Context) ([]int, error)
- func (maq *MatrixAttackQuery) IDsX(ctx context.Context) []int
- func (maq *MatrixAttackQuery) Limit(limit int) *MatrixAttackQuery
- func (maq *MatrixAttackQuery) Offset(offset int) *MatrixAttackQuery
- func (maq *MatrixAttackQuery) Only(ctx context.Context) (*MatrixAttack, error)
- func (maq *MatrixAttackQuery) OnlyID(ctx context.Context) (id int, err error)
- func (maq *MatrixAttackQuery) OnlyIDX(ctx context.Context) int
- func (maq *MatrixAttackQuery) OnlyX(ctx context.Context) *MatrixAttack
- func (maq *MatrixAttackQuery) Order(o ...OrderFunc) *MatrixAttackQuery
- func (maq *MatrixAttackQuery) Select(fields ...string) *MatrixAttackSelect
- func (maq *MatrixAttackQuery) Unique(unique bool) *MatrixAttackQuery
- func (maq *MatrixAttackQuery) Where(ps ...predicate.MatrixAttack) *MatrixAttackQuery
- type MatrixAttackSelect
- func (mas *MatrixAttackSelect) Bool(ctx context.Context) (_ bool, err error)
- func (mas *MatrixAttackSelect) BoolX(ctx context.Context) bool
- func (mas *MatrixAttackSelect) Bools(ctx context.Context) ([]bool, error)
- func (mas *MatrixAttackSelect) BoolsX(ctx context.Context) []bool
- func (mas *MatrixAttackSelect) Float64(ctx context.Context) (_ float64, err error)
- func (mas *MatrixAttackSelect) Float64X(ctx context.Context) float64
- func (mas *MatrixAttackSelect) Float64s(ctx context.Context) ([]float64, error)
- func (mas *MatrixAttackSelect) Float64sX(ctx context.Context) []float64
- func (mas *MatrixAttackSelect) Int(ctx context.Context) (_ int, err error)
- func (mas *MatrixAttackSelect) IntX(ctx context.Context) int
- func (mas *MatrixAttackSelect) Ints(ctx context.Context) ([]int, error)
- func (mas *MatrixAttackSelect) IntsX(ctx context.Context) []int
- func (mas *MatrixAttackSelect) Scan(ctx context.Context, v interface{}) error
- func (mas *MatrixAttackSelect) ScanX(ctx context.Context, v interface{})
- func (mas *MatrixAttackSelect) String(ctx context.Context) (_ string, err error)
- func (mas *MatrixAttackSelect) StringX(ctx context.Context) string
- func (mas *MatrixAttackSelect) Strings(ctx context.Context) ([]string, error)
- func (mas *MatrixAttackSelect) StringsX(ctx context.Context) []string
- type MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) Exec(ctx context.Context) error
- func (mau *MatrixAttackUpdate) ExecX(ctx context.Context)
- func (mau *MatrixAttackUpdate) Mutation() *MatrixAttackMutation
- func (mau *MatrixAttackUpdate) Save(ctx context.Context) (int, error)
- func (mau *MatrixAttackUpdate) SaveX(ctx context.Context) int
- func (mau *MatrixAttackUpdate) SetCreateDate(t time.Time) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetIdMatrix(s string) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetModifyDate(t time.Time) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetNameMatrix(s string) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetNillableCreateDate(t *time.Time) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetNillableModifyDate(t *time.Time) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetNillableNameMatrix(s *string) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetNillableVendorName(s *string) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetNillableVersionMatrix(s *string) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetVendorName(s string) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) SetVersionMatrix(s string) *MatrixAttackUpdate
- func (mau *MatrixAttackUpdate) Where(ps ...predicate.MatrixAttack) *MatrixAttackUpdate
- type MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) Exec(ctx context.Context) error
- func (mauo *MatrixAttackUpdateOne) ExecX(ctx context.Context)
- func (mauo *MatrixAttackUpdateOne) Mutation() *MatrixAttackMutation
- func (mauo *MatrixAttackUpdateOne) Save(ctx context.Context) (*MatrixAttack, error)
- func (mauo *MatrixAttackUpdateOne) SaveX(ctx context.Context) *MatrixAttack
- func (mauo *MatrixAttackUpdateOne) Select(field string, fields ...string) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetCreateDate(t time.Time) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetIdMatrix(s string) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetModifyDate(t time.Time) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetNameMatrix(s string) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetNillableCreateDate(t *time.Time) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetNillableModifyDate(t *time.Time) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetNillableNameMatrix(s *string) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetNillableVendorName(s *string) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetNillableVersionMatrix(s *string) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetVendorName(s string) *MatrixAttackUpdateOne
- func (mauo *MatrixAttackUpdateOne) SetVersionMatrix(s string) *MatrixAttackUpdateOne
- type MatrixAttacks
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeMatrixAttack = "MatrixAttack" )
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 // MatrixAttack is the client for interacting with the MatrixAttack builders. MatrixAttack *MatrixAttackClient // 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(). MatrixAttack. 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 MatrixAttack ¶
type MatrixAttack struct { // ID of the ent. ID int `json:"id,omitempty"` // IdMatrix holds the value of the "IdMatrix" field. IdMatrix string `json:"IdMatrix,omitempty"` // VendorName holds the value of the "VendorName" field. VendorName string `json:"VendorName,omitempty"` // NameMatrix holds the value of the "NameMatrix" field. NameMatrix string `json:"NameMatrix,omitempty"` // VersionMatrix holds the value of the "VersionMatrix" field. VersionMatrix string `json:"VersionMatrix,omitempty"` // CreateDate holds the value of the "CreateDate" field. CreateDate time.Time `json:"CreateDate,omitempty"` // ModifyDate holds the value of the "ModifyDate" field. ModifyDate time.Time `json:"ModifyDate,omitempty"` // contains filtered or unexported fields }
MatrixAttack is the model entity for the MatrixAttack schema.
func (*MatrixAttack) String ¶
func (ma *MatrixAttack) String() string
String implements the fmt.Stringer.
func (*MatrixAttack) Unwrap ¶
func (ma *MatrixAttack) Unwrap() *MatrixAttack
Unwrap unwraps the MatrixAttack 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 (*MatrixAttack) Update ¶
func (ma *MatrixAttack) Update() *MatrixAttackUpdateOne
Update returns a builder for updating this MatrixAttack. Note that you need to call MatrixAttack.Unwrap() before calling this method if this MatrixAttack was returned from a transaction, and the transaction was committed or rolled back.
type MatrixAttackClient ¶
type MatrixAttackClient struct {
// contains filtered or unexported fields
}
MatrixAttackClient is a client for the MatrixAttack schema.
func NewMatrixAttackClient ¶
func NewMatrixAttackClient(c config) *MatrixAttackClient
NewMatrixAttackClient returns a client for the MatrixAttack from the given config.
func (*MatrixAttackClient) Create ¶
func (c *MatrixAttackClient) Create() *MatrixAttackCreate
Create returns a create builder for MatrixAttack.
func (*MatrixAttackClient) CreateBulk ¶
func (c *MatrixAttackClient) CreateBulk(builders ...*MatrixAttackCreate) *MatrixAttackCreateBulk
CreateBulk returns a builder for creating a bulk of MatrixAttack entities.
func (*MatrixAttackClient) Delete ¶
func (c *MatrixAttackClient) Delete() *MatrixAttackDelete
Delete returns a delete builder for MatrixAttack.
func (*MatrixAttackClient) DeleteOne ¶
func (c *MatrixAttackClient) DeleteOne(ma *MatrixAttack) *MatrixAttackDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*MatrixAttackClient) DeleteOneID ¶
func (c *MatrixAttackClient) DeleteOneID(id int) *MatrixAttackDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*MatrixAttackClient) Get ¶
func (c *MatrixAttackClient) Get(ctx context.Context, id int) (*MatrixAttack, error)
Get returns a MatrixAttack entity by its id.
func (*MatrixAttackClient) GetX ¶
func (c *MatrixAttackClient) GetX(ctx context.Context, id int) *MatrixAttack
GetX is like Get, but panics if an error occurs.
func (*MatrixAttackClient) Hooks ¶
func (c *MatrixAttackClient) Hooks() []Hook
Hooks returns the client hooks.
func (*MatrixAttackClient) Query ¶
func (c *MatrixAttackClient) Query() *MatrixAttackQuery
Query returns a query builder for MatrixAttack.
func (*MatrixAttackClient) Update ¶
func (c *MatrixAttackClient) Update() *MatrixAttackUpdate
Update returns an update builder for MatrixAttack.
func (*MatrixAttackClient) UpdateOne ¶
func (c *MatrixAttackClient) UpdateOne(ma *MatrixAttack) *MatrixAttackUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MatrixAttackClient) UpdateOneID ¶
func (c *MatrixAttackClient) UpdateOneID(id int) *MatrixAttackUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MatrixAttackClient) Use ¶
func (c *MatrixAttackClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `matrixattack.Hooks(f(g(h())))`.
type MatrixAttackCreate ¶
type MatrixAttackCreate struct {
// contains filtered or unexported fields
}
MatrixAttackCreate is the builder for creating a MatrixAttack entity.
func (*MatrixAttackCreate) Exec ¶
func (mac *MatrixAttackCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MatrixAttackCreate) ExecX ¶
func (mac *MatrixAttackCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MatrixAttackCreate) Mutation ¶
func (mac *MatrixAttackCreate) Mutation() *MatrixAttackMutation
Mutation returns the MatrixAttackMutation object of the builder.
func (*MatrixAttackCreate) Save ¶
func (mac *MatrixAttackCreate) Save(ctx context.Context) (*MatrixAttack, error)
Save creates the MatrixAttack in the database.
func (*MatrixAttackCreate) SaveX ¶
func (mac *MatrixAttackCreate) SaveX(ctx context.Context) *MatrixAttack
SaveX calls Save and panics if Save returns an error.
func (*MatrixAttackCreate) SetCreateDate ¶
func (mac *MatrixAttackCreate) SetCreateDate(t time.Time) *MatrixAttackCreate
SetCreateDate sets the "CreateDate" field.
func (*MatrixAttackCreate) SetIdMatrix ¶
func (mac *MatrixAttackCreate) SetIdMatrix(s string) *MatrixAttackCreate
SetIdMatrix sets the "IdMatrix" field.
func (*MatrixAttackCreate) SetModifyDate ¶
func (mac *MatrixAttackCreate) SetModifyDate(t time.Time) *MatrixAttackCreate
SetModifyDate sets the "ModifyDate" field.
func (*MatrixAttackCreate) SetNameMatrix ¶
func (mac *MatrixAttackCreate) SetNameMatrix(s string) *MatrixAttackCreate
SetNameMatrix sets the "NameMatrix" field.
func (*MatrixAttackCreate) SetNillableCreateDate ¶
func (mac *MatrixAttackCreate) SetNillableCreateDate(t *time.Time) *MatrixAttackCreate
SetNillableCreateDate sets the "CreateDate" field if the given value is not nil.
func (*MatrixAttackCreate) SetNillableModifyDate ¶
func (mac *MatrixAttackCreate) SetNillableModifyDate(t *time.Time) *MatrixAttackCreate
SetNillableModifyDate sets the "ModifyDate" field if the given value is not nil.
func (*MatrixAttackCreate) SetNillableNameMatrix ¶
func (mac *MatrixAttackCreate) SetNillableNameMatrix(s *string) *MatrixAttackCreate
SetNillableNameMatrix sets the "NameMatrix" field if the given value is not nil.
func (*MatrixAttackCreate) SetNillableVendorName ¶
func (mac *MatrixAttackCreate) SetNillableVendorName(s *string) *MatrixAttackCreate
SetNillableVendorName sets the "VendorName" field if the given value is not nil.
func (*MatrixAttackCreate) SetNillableVersionMatrix ¶
func (mac *MatrixAttackCreate) SetNillableVersionMatrix(s *string) *MatrixAttackCreate
SetNillableVersionMatrix sets the "VersionMatrix" field if the given value is not nil.
func (*MatrixAttackCreate) SetVendorName ¶
func (mac *MatrixAttackCreate) SetVendorName(s string) *MatrixAttackCreate
SetVendorName sets the "VendorName" field.
func (*MatrixAttackCreate) SetVersionMatrix ¶
func (mac *MatrixAttackCreate) SetVersionMatrix(s string) *MatrixAttackCreate
SetVersionMatrix sets the "VersionMatrix" field.
type MatrixAttackCreateBulk ¶
type MatrixAttackCreateBulk struct {
// contains filtered or unexported fields
}
MatrixAttackCreateBulk is the builder for creating many MatrixAttack entities in bulk.
func (*MatrixAttackCreateBulk) Exec ¶
func (macb *MatrixAttackCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MatrixAttackCreateBulk) ExecX ¶
func (macb *MatrixAttackCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MatrixAttackCreateBulk) Save ¶
func (macb *MatrixAttackCreateBulk) Save(ctx context.Context) ([]*MatrixAttack, error)
Save creates the MatrixAttack entities in the database.
func (*MatrixAttackCreateBulk) SaveX ¶
func (macb *MatrixAttackCreateBulk) SaveX(ctx context.Context) []*MatrixAttack
SaveX is like Save, but panics if an error occurs.
type MatrixAttackDelete ¶
type MatrixAttackDelete struct {
// contains filtered or unexported fields
}
MatrixAttackDelete is the builder for deleting a MatrixAttack entity.
func (*MatrixAttackDelete) Exec ¶
func (mad *MatrixAttackDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MatrixAttackDelete) ExecX ¶
func (mad *MatrixAttackDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MatrixAttackDelete) Where ¶
func (mad *MatrixAttackDelete) Where(ps ...predicate.MatrixAttack) *MatrixAttackDelete
Where appends a list predicates to the MatrixAttackDelete builder.
type MatrixAttackDeleteOne ¶
type MatrixAttackDeleteOne struct {
// contains filtered or unexported fields
}
MatrixAttackDeleteOne is the builder for deleting a single MatrixAttack entity.
func (*MatrixAttackDeleteOne) Exec ¶
func (mado *MatrixAttackDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MatrixAttackDeleteOne) ExecX ¶
func (mado *MatrixAttackDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MatrixAttackGroupBy ¶
type MatrixAttackGroupBy struct {
// contains filtered or unexported fields
}
MatrixAttackGroupBy is the group-by builder for MatrixAttack entities.
func (*MatrixAttackGroupBy) Aggregate ¶
func (magb *MatrixAttackGroupBy) Aggregate(fns ...AggregateFunc) *MatrixAttackGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MatrixAttackGroupBy) Bool ¶
func (magb *MatrixAttackGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*MatrixAttackGroupBy) BoolX ¶
func (magb *MatrixAttackGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*MatrixAttackGroupBy) Bools ¶
func (magb *MatrixAttackGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*MatrixAttackGroupBy) BoolsX ¶
func (magb *MatrixAttackGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*MatrixAttackGroupBy) Float64 ¶
func (magb *MatrixAttackGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*MatrixAttackGroupBy) Float64X ¶
func (magb *MatrixAttackGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*MatrixAttackGroupBy) Float64s ¶
func (magb *MatrixAttackGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*MatrixAttackGroupBy) Float64sX ¶
func (magb *MatrixAttackGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*MatrixAttackGroupBy) Int ¶
func (magb *MatrixAttackGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*MatrixAttackGroupBy) IntX ¶
func (magb *MatrixAttackGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*MatrixAttackGroupBy) Ints ¶
func (magb *MatrixAttackGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*MatrixAttackGroupBy) IntsX ¶
func (magb *MatrixAttackGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*MatrixAttackGroupBy) Scan ¶
func (magb *MatrixAttackGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*MatrixAttackGroupBy) ScanX ¶
func (magb *MatrixAttackGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*MatrixAttackGroupBy) String ¶
func (magb *MatrixAttackGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*MatrixAttackGroupBy) StringX ¶
func (magb *MatrixAttackGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type MatrixAttackMutation ¶
type MatrixAttackMutation struct {
// contains filtered or unexported fields
}
MatrixAttackMutation represents an operation that mutates the MatrixAttack nodes in the graph.
func (*MatrixAttackMutation) AddField ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) AddedEdges ¶
func (m *MatrixAttackMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MatrixAttackMutation) AddedField ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) AddedFields ¶
func (m *MatrixAttackMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MatrixAttackMutation) AddedIDs ¶
func (m *MatrixAttackMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MatrixAttackMutation) ClearEdge ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) ClearField ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) ClearedEdges ¶
func (m *MatrixAttackMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MatrixAttackMutation) ClearedFields ¶
func (m *MatrixAttackMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MatrixAttackMutation) Client ¶
func (m MatrixAttackMutation) 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 (*MatrixAttackMutation) CreateDate ¶
func (m *MatrixAttackMutation) CreateDate() (r time.Time, exists bool)
CreateDate returns the value of the "CreateDate" field in the mutation.
func (*MatrixAttackMutation) EdgeCleared ¶
func (m *MatrixAttackMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MatrixAttackMutation) Field ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) FieldCleared ¶
func (m *MatrixAttackMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MatrixAttackMutation) Fields ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) ID ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) IDs ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) IdMatrix ¶
func (m *MatrixAttackMutation) IdMatrix() (r string, exists bool)
IdMatrix returns the value of the "IdMatrix" field in the mutation.
func (*MatrixAttackMutation) ModifyDate ¶
func (m *MatrixAttackMutation) ModifyDate() (r time.Time, exists bool)
ModifyDate returns the value of the "ModifyDate" field in the mutation.
func (*MatrixAttackMutation) NameMatrix ¶
func (m *MatrixAttackMutation) NameMatrix() (r string, exists bool)
NameMatrix returns the value of the "NameMatrix" field in the mutation.
func (*MatrixAttackMutation) OldCreateDate ¶
OldCreateDate returns the old "CreateDate" field's value of the MatrixAttack entity. If the MatrixAttack 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 (*MatrixAttackMutation) 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 (*MatrixAttackMutation) OldIdMatrix ¶
func (m *MatrixAttackMutation) OldIdMatrix(ctx context.Context) (v string, err error)
OldIdMatrix returns the old "IdMatrix" field's value of the MatrixAttack entity. If the MatrixAttack 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 (*MatrixAttackMutation) OldModifyDate ¶
OldModifyDate returns the old "ModifyDate" field's value of the MatrixAttack entity. If the MatrixAttack 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 (*MatrixAttackMutation) OldNameMatrix ¶
func (m *MatrixAttackMutation) OldNameMatrix(ctx context.Context) (v string, err error)
OldNameMatrix returns the old "NameMatrix" field's value of the MatrixAttack entity. If the MatrixAttack 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 (*MatrixAttackMutation) OldVendorName ¶
func (m *MatrixAttackMutation) OldVendorName(ctx context.Context) (v string, err error)
OldVendorName returns the old "VendorName" field's value of the MatrixAttack entity. If the MatrixAttack 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 (*MatrixAttackMutation) OldVersionMatrix ¶
func (m *MatrixAttackMutation) OldVersionMatrix(ctx context.Context) (v string, err error)
OldVersionMatrix returns the old "VersionMatrix" field's value of the MatrixAttack entity. If the MatrixAttack 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 (*MatrixAttackMutation) Op ¶
func (m *MatrixAttackMutation) Op() Op
Op returns the operation name.
func (*MatrixAttackMutation) RemovedEdges ¶
func (m *MatrixAttackMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MatrixAttackMutation) RemovedIDs ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) ResetCreateDate ¶
func (m *MatrixAttackMutation) ResetCreateDate()
ResetCreateDate resets all changes to the "CreateDate" field.
func (*MatrixAttackMutation) ResetEdge ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) ResetField ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) ResetIdMatrix ¶
func (m *MatrixAttackMutation) ResetIdMatrix()
ResetIdMatrix resets all changes to the "IdMatrix" field.
func (*MatrixAttackMutation) ResetModifyDate ¶
func (m *MatrixAttackMutation) ResetModifyDate()
ResetModifyDate resets all changes to the "ModifyDate" field.
func (*MatrixAttackMutation) ResetNameMatrix ¶
func (m *MatrixAttackMutation) ResetNameMatrix()
ResetNameMatrix resets all changes to the "NameMatrix" field.
func (*MatrixAttackMutation) ResetVendorName ¶
func (m *MatrixAttackMutation) ResetVendorName()
ResetVendorName resets all changes to the "VendorName" field.
func (*MatrixAttackMutation) ResetVersionMatrix ¶
func (m *MatrixAttackMutation) ResetVersionMatrix()
ResetVersionMatrix resets all changes to the "VersionMatrix" field.
func (*MatrixAttackMutation) SetCreateDate ¶
func (m *MatrixAttackMutation) SetCreateDate(t time.Time)
SetCreateDate sets the "CreateDate" field.
func (*MatrixAttackMutation) SetField ¶
func (m *MatrixAttackMutation) 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 (*MatrixAttackMutation) SetIdMatrix ¶
func (m *MatrixAttackMutation) SetIdMatrix(s string)
SetIdMatrix sets the "IdMatrix" field.
func (*MatrixAttackMutation) SetModifyDate ¶
func (m *MatrixAttackMutation) SetModifyDate(t time.Time)
SetModifyDate sets the "ModifyDate" field.
func (*MatrixAttackMutation) SetNameMatrix ¶
func (m *MatrixAttackMutation) SetNameMatrix(s string)
SetNameMatrix sets the "NameMatrix" field.
func (*MatrixAttackMutation) SetVendorName ¶
func (m *MatrixAttackMutation) SetVendorName(s string)
SetVendorName sets the "VendorName" field.
func (*MatrixAttackMutation) SetVersionMatrix ¶
func (m *MatrixAttackMutation) SetVersionMatrix(s string)
SetVersionMatrix sets the "VersionMatrix" field.
func (MatrixAttackMutation) Tx ¶
func (m MatrixAttackMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MatrixAttackMutation) Type ¶
func (m *MatrixAttackMutation) Type() string
Type returns the node type of this mutation (MatrixAttack).
func (*MatrixAttackMutation) VendorName ¶
func (m *MatrixAttackMutation) VendorName() (r string, exists bool)
VendorName returns the value of the "VendorName" field in the mutation.
func (*MatrixAttackMutation) VersionMatrix ¶
func (m *MatrixAttackMutation) VersionMatrix() (r string, exists bool)
VersionMatrix returns the value of the "VersionMatrix" field in the mutation.
func (*MatrixAttackMutation) Where ¶
func (m *MatrixAttackMutation) Where(ps ...predicate.MatrixAttack)
Where appends a list predicates to the MatrixAttackMutation builder.
type MatrixAttackQuery ¶
type MatrixAttackQuery struct {
// contains filtered or unexported fields
}
MatrixAttackQuery is the builder for querying MatrixAttack entities.
func (*MatrixAttackQuery) All ¶
func (maq *MatrixAttackQuery) All(ctx context.Context) ([]*MatrixAttack, error)
All executes the query and returns a list of MatrixAttacks.
func (*MatrixAttackQuery) AllX ¶
func (maq *MatrixAttackQuery) AllX(ctx context.Context) []*MatrixAttack
AllX is like All, but panics if an error occurs.
func (*MatrixAttackQuery) Clone ¶
func (maq *MatrixAttackQuery) Clone() *MatrixAttackQuery
Clone returns a duplicate of the MatrixAttackQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MatrixAttackQuery) Count ¶
func (maq *MatrixAttackQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MatrixAttackQuery) CountX ¶
func (maq *MatrixAttackQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MatrixAttackQuery) Exist ¶
func (maq *MatrixAttackQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MatrixAttackQuery) ExistX ¶
func (maq *MatrixAttackQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MatrixAttackQuery) First ¶
func (maq *MatrixAttackQuery) First(ctx context.Context) (*MatrixAttack, error)
First returns the first MatrixAttack entity from the query. Returns a *NotFoundError when no MatrixAttack was found.
func (*MatrixAttackQuery) FirstID ¶
func (maq *MatrixAttackQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first MatrixAttack ID from the query. Returns a *NotFoundError when no MatrixAttack ID was found.
func (*MatrixAttackQuery) FirstIDX ¶
func (maq *MatrixAttackQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*MatrixAttackQuery) FirstX ¶
func (maq *MatrixAttackQuery) FirstX(ctx context.Context) *MatrixAttack
FirstX is like First, but panics if an error occurs.
func (*MatrixAttackQuery) GroupBy ¶
func (maq *MatrixAttackQuery) GroupBy(field string, fields ...string) *MatrixAttackGroupBy
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 { IdMatrix string `json:"IdMatrix,omitempty"` Count int `json:"count,omitempty"` } client.MatrixAttack.Query(). GroupBy(matrixattack.FieldIdMatrix). Aggregate(ent.Count()). Scan(ctx, &v)
func (*MatrixAttackQuery) IDs ¶
func (maq *MatrixAttackQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of MatrixAttack IDs.
func (*MatrixAttackQuery) IDsX ¶
func (maq *MatrixAttackQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*MatrixAttackQuery) Limit ¶
func (maq *MatrixAttackQuery) Limit(limit int) *MatrixAttackQuery
Limit adds a limit step to the query.
func (*MatrixAttackQuery) Offset ¶
func (maq *MatrixAttackQuery) Offset(offset int) *MatrixAttackQuery
Offset adds an offset step to the query.
func (*MatrixAttackQuery) Only ¶
func (maq *MatrixAttackQuery) Only(ctx context.Context) (*MatrixAttack, error)
Only returns a single MatrixAttack entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one MatrixAttack entity is not found. Returns a *NotFoundError when no MatrixAttack entities are found.
func (*MatrixAttackQuery) OnlyID ¶
func (maq *MatrixAttackQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only MatrixAttack ID in the query. Returns a *NotSingularError when exactly one MatrixAttack ID is not found. Returns a *NotFoundError when no entities are found.
func (*MatrixAttackQuery) OnlyIDX ¶
func (maq *MatrixAttackQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MatrixAttackQuery) OnlyX ¶
func (maq *MatrixAttackQuery) OnlyX(ctx context.Context) *MatrixAttack
OnlyX is like Only, but panics if an error occurs.
func (*MatrixAttackQuery) Order ¶
func (maq *MatrixAttackQuery) Order(o ...OrderFunc) *MatrixAttackQuery
Order adds an order step to the query.
func (*MatrixAttackQuery) Select ¶
func (maq *MatrixAttackQuery) Select(fields ...string) *MatrixAttackSelect
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 { IdMatrix string `json:"IdMatrix,omitempty"` } client.MatrixAttack.Query(). Select(matrixattack.FieldIdMatrix). Scan(ctx, &v)
func (*MatrixAttackQuery) Unique ¶
func (maq *MatrixAttackQuery) Unique(unique bool) *MatrixAttackQuery
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 (*MatrixAttackQuery) Where ¶
func (maq *MatrixAttackQuery) Where(ps ...predicate.MatrixAttack) *MatrixAttackQuery
Where adds a new predicate for the MatrixAttackQuery builder.
type MatrixAttackSelect ¶
type MatrixAttackSelect struct { *MatrixAttackQuery // contains filtered or unexported fields }
MatrixAttackSelect is the builder for selecting fields of MatrixAttack entities.
func (*MatrixAttackSelect) Bool ¶
func (mas *MatrixAttackSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MatrixAttackSelect) BoolX ¶
func (mas *MatrixAttackSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*MatrixAttackSelect) Bools ¶
func (mas *MatrixAttackSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MatrixAttackSelect) BoolsX ¶
func (mas *MatrixAttackSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*MatrixAttackSelect) Float64 ¶
func (mas *MatrixAttackSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MatrixAttackSelect) Float64X ¶
func (mas *MatrixAttackSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*MatrixAttackSelect) Float64s ¶
func (mas *MatrixAttackSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MatrixAttackSelect) Float64sX ¶
func (mas *MatrixAttackSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*MatrixAttackSelect) Int ¶
func (mas *MatrixAttackSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MatrixAttackSelect) IntX ¶
func (mas *MatrixAttackSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*MatrixAttackSelect) Ints ¶
func (mas *MatrixAttackSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MatrixAttackSelect) IntsX ¶
func (mas *MatrixAttackSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*MatrixAttackSelect) Scan ¶
func (mas *MatrixAttackSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*MatrixAttackSelect) ScanX ¶
func (mas *MatrixAttackSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*MatrixAttackSelect) String ¶
func (mas *MatrixAttackSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*MatrixAttackSelect) StringX ¶
func (mas *MatrixAttackSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type MatrixAttackUpdate ¶
type MatrixAttackUpdate struct {
// contains filtered or unexported fields
}
MatrixAttackUpdate is the builder for updating MatrixAttack entities.
func (*MatrixAttackUpdate) Exec ¶
func (mau *MatrixAttackUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MatrixAttackUpdate) ExecX ¶
func (mau *MatrixAttackUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MatrixAttackUpdate) Mutation ¶
func (mau *MatrixAttackUpdate) Mutation() *MatrixAttackMutation
Mutation returns the MatrixAttackMutation object of the builder.
func (*MatrixAttackUpdate) Save ¶
func (mau *MatrixAttackUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MatrixAttackUpdate) SaveX ¶
func (mau *MatrixAttackUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MatrixAttackUpdate) SetCreateDate ¶
func (mau *MatrixAttackUpdate) SetCreateDate(t time.Time) *MatrixAttackUpdate
SetCreateDate sets the "CreateDate" field.
func (*MatrixAttackUpdate) SetIdMatrix ¶
func (mau *MatrixAttackUpdate) SetIdMatrix(s string) *MatrixAttackUpdate
SetIdMatrix sets the "IdMatrix" field.
func (*MatrixAttackUpdate) SetModifyDate ¶
func (mau *MatrixAttackUpdate) SetModifyDate(t time.Time) *MatrixAttackUpdate
SetModifyDate sets the "ModifyDate" field.
func (*MatrixAttackUpdate) SetNameMatrix ¶
func (mau *MatrixAttackUpdate) SetNameMatrix(s string) *MatrixAttackUpdate
SetNameMatrix sets the "NameMatrix" field.
func (*MatrixAttackUpdate) SetNillableCreateDate ¶
func (mau *MatrixAttackUpdate) SetNillableCreateDate(t *time.Time) *MatrixAttackUpdate
SetNillableCreateDate sets the "CreateDate" field if the given value is not nil.
func (*MatrixAttackUpdate) SetNillableModifyDate ¶
func (mau *MatrixAttackUpdate) SetNillableModifyDate(t *time.Time) *MatrixAttackUpdate
SetNillableModifyDate sets the "ModifyDate" field if the given value is not nil.
func (*MatrixAttackUpdate) SetNillableNameMatrix ¶
func (mau *MatrixAttackUpdate) SetNillableNameMatrix(s *string) *MatrixAttackUpdate
SetNillableNameMatrix sets the "NameMatrix" field if the given value is not nil.
func (*MatrixAttackUpdate) SetNillableVendorName ¶
func (mau *MatrixAttackUpdate) SetNillableVendorName(s *string) *MatrixAttackUpdate
SetNillableVendorName sets the "VendorName" field if the given value is not nil.
func (*MatrixAttackUpdate) SetNillableVersionMatrix ¶
func (mau *MatrixAttackUpdate) SetNillableVersionMatrix(s *string) *MatrixAttackUpdate
SetNillableVersionMatrix sets the "VersionMatrix" field if the given value is not nil.
func (*MatrixAttackUpdate) SetVendorName ¶
func (mau *MatrixAttackUpdate) SetVendorName(s string) *MatrixAttackUpdate
SetVendorName sets the "VendorName" field.
func (*MatrixAttackUpdate) SetVersionMatrix ¶
func (mau *MatrixAttackUpdate) SetVersionMatrix(s string) *MatrixAttackUpdate
SetVersionMatrix sets the "VersionMatrix" field.
func (*MatrixAttackUpdate) Where ¶
func (mau *MatrixAttackUpdate) Where(ps ...predicate.MatrixAttack) *MatrixAttackUpdate
Where appends a list predicates to the MatrixAttackUpdate builder.
type MatrixAttackUpdateOne ¶
type MatrixAttackUpdateOne struct {
// contains filtered or unexported fields
}
MatrixAttackUpdateOne is the builder for updating a single MatrixAttack entity.
func (*MatrixAttackUpdateOne) Exec ¶
func (mauo *MatrixAttackUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MatrixAttackUpdateOne) ExecX ¶
func (mauo *MatrixAttackUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MatrixAttackUpdateOne) Mutation ¶
func (mauo *MatrixAttackUpdateOne) Mutation() *MatrixAttackMutation
Mutation returns the MatrixAttackMutation object of the builder.
func (*MatrixAttackUpdateOne) Save ¶
func (mauo *MatrixAttackUpdateOne) Save(ctx context.Context) (*MatrixAttack, error)
Save executes the query and returns the updated MatrixAttack entity.
func (*MatrixAttackUpdateOne) SaveX ¶
func (mauo *MatrixAttackUpdateOne) SaveX(ctx context.Context) *MatrixAttack
SaveX is like Save, but panics if an error occurs.
func (*MatrixAttackUpdateOne) Select ¶
func (mauo *MatrixAttackUpdateOne) Select(field string, fields ...string) *MatrixAttackUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MatrixAttackUpdateOne) SetCreateDate ¶
func (mauo *MatrixAttackUpdateOne) SetCreateDate(t time.Time) *MatrixAttackUpdateOne
SetCreateDate sets the "CreateDate" field.
func (*MatrixAttackUpdateOne) SetIdMatrix ¶
func (mauo *MatrixAttackUpdateOne) SetIdMatrix(s string) *MatrixAttackUpdateOne
SetIdMatrix sets the "IdMatrix" field.
func (*MatrixAttackUpdateOne) SetModifyDate ¶
func (mauo *MatrixAttackUpdateOne) SetModifyDate(t time.Time) *MatrixAttackUpdateOne
SetModifyDate sets the "ModifyDate" field.
func (*MatrixAttackUpdateOne) SetNameMatrix ¶
func (mauo *MatrixAttackUpdateOne) SetNameMatrix(s string) *MatrixAttackUpdateOne
SetNameMatrix sets the "NameMatrix" field.
func (*MatrixAttackUpdateOne) SetNillableCreateDate ¶
func (mauo *MatrixAttackUpdateOne) SetNillableCreateDate(t *time.Time) *MatrixAttackUpdateOne
SetNillableCreateDate sets the "CreateDate" field if the given value is not nil.
func (*MatrixAttackUpdateOne) SetNillableModifyDate ¶
func (mauo *MatrixAttackUpdateOne) SetNillableModifyDate(t *time.Time) *MatrixAttackUpdateOne
SetNillableModifyDate sets the "ModifyDate" field if the given value is not nil.
func (*MatrixAttackUpdateOne) SetNillableNameMatrix ¶
func (mauo *MatrixAttackUpdateOne) SetNillableNameMatrix(s *string) *MatrixAttackUpdateOne
SetNillableNameMatrix sets the "NameMatrix" field if the given value is not nil.
func (*MatrixAttackUpdateOne) SetNillableVendorName ¶
func (mauo *MatrixAttackUpdateOne) SetNillableVendorName(s *string) *MatrixAttackUpdateOne
SetNillableVendorName sets the "VendorName" field if the given value is not nil.
func (*MatrixAttackUpdateOne) SetNillableVersionMatrix ¶
func (mauo *MatrixAttackUpdateOne) SetNillableVersionMatrix(s *string) *MatrixAttackUpdateOne
SetNillableVersionMatrix sets the "VersionMatrix" field if the given value is not nil.
func (*MatrixAttackUpdateOne) SetVendorName ¶
func (mauo *MatrixAttackUpdateOne) SetVendorName(s string) *MatrixAttackUpdateOne
SetVendorName sets the "VendorName" field.
func (*MatrixAttackUpdateOne) SetVersionMatrix ¶
func (mauo *MatrixAttackUpdateOne) SetVersionMatrix(s string) *MatrixAttackUpdateOne
SetVersionMatrix sets the "VersionMatrix" field.
type MatrixAttacks ¶
type MatrixAttacks []*MatrixAttack
MatrixAttacks is a parsable slice of MatrixAttack.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(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 { // MatrixAttack is the client for interacting with the MatrixAttack builders. MatrixAttack *MatrixAttackClient // 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.