ent

package
v0.0.0-...-ea7e623 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2021 License: Unlicense Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeAnomaly              = "Anomaly"
	TypeDetectionJob         = "DetectionJob"
	TypeDetectionJobInstance = "DetectionJobInstance"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validaton error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector, func(string) bool) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

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 Anomalies

type Anomalies []*Anomaly

Anomalies is a parsable slice of Anomaly.

type Anomaly

type Anomaly struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Value holds the value of the "value" field.
	Value float64 `json:"value,omitempty"`
	// Processed holds the value of the "processed" field.
	Processed bool `json:"processed,omitempty"`
	// PeriodStart holds the value of the "period_start" field.
	PeriodStart time.Time `json:"period_start,omitempty"`
	// PeriodEnd holds the value of the "period_end" field.
	PeriodEnd time.Time `json:"period_end,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AnomalyQuery when eager-loading is set.
	Edges AnomalyEdges `json:"edges"`
	// contains filtered or unexported fields
}

Anomaly is the model entity for the Anomaly schema.

func (*Anomaly) QueryDetectionJobInstance

func (a *Anomaly) QueryDetectionJobInstance() *DetectionJobInstanceQuery

QueryDetectionJobInstance queries the "detection_job_instance" edge of the Anomaly entity.

func (*Anomaly) String

func (a *Anomaly) String() string

String implements the fmt.Stringer.

func (*Anomaly) Unwrap

func (a *Anomaly) Unwrap() *Anomaly

Unwrap unwraps the Anomaly 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 (*Anomaly) Update

func (a *Anomaly) Update() *AnomalyUpdateOne

Update returns a builder for updating this Anomaly. Note that you need to call Anomaly.Unwrap() before calling this method if this Anomaly was returned from a transaction, and the transaction was committed or rolled back.

type AnomalyClient

type AnomalyClient struct {
	// contains filtered or unexported fields
}

AnomalyClient is a client for the Anomaly schema.

func NewAnomalyClient

func NewAnomalyClient(c config) *AnomalyClient

NewAnomalyClient returns a client for the Anomaly from the given config.

func (*AnomalyClient) Create

func (c *AnomalyClient) Create() *AnomalyCreate

Create returns a create builder for Anomaly.

func (*AnomalyClient) CreateBulk

func (c *AnomalyClient) CreateBulk(builders ...*AnomalyCreate) *AnomalyCreateBulk

CreateBulk returns a builder for creating a bulk of Anomaly entities.

func (*AnomalyClient) Delete

func (c *AnomalyClient) Delete() *AnomalyDelete

Delete returns a delete builder for Anomaly.

func (*AnomalyClient) DeleteOne

func (c *AnomalyClient) DeleteOne(a *Anomaly) *AnomalyDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AnomalyClient) DeleteOneID

func (c *AnomalyClient) DeleteOneID(id int) *AnomalyDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AnomalyClient) Get

func (c *AnomalyClient) Get(ctx context.Context, id int) (*Anomaly, error)

Get returns a Anomaly entity by its id.

func (*AnomalyClient) GetX

func (c *AnomalyClient) GetX(ctx context.Context, id int) *Anomaly

GetX is like Get, but panics if an error occurs.

func (*AnomalyClient) Hooks

func (c *AnomalyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*AnomalyClient) Query

func (c *AnomalyClient) Query() *AnomalyQuery

Query returns a query builder for Anomaly.

func (*AnomalyClient) QueryDetectionJobInstance

func (c *AnomalyClient) QueryDetectionJobInstance(a *Anomaly) *DetectionJobInstanceQuery

QueryDetectionJobInstance queries the detection_job_instance edge of a Anomaly.

func (*AnomalyClient) Update

func (c *AnomalyClient) Update() *AnomalyUpdate

Update returns an update builder for Anomaly.

func (*AnomalyClient) UpdateOne

func (c *AnomalyClient) UpdateOne(a *Anomaly) *AnomalyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AnomalyClient) UpdateOneID

func (c *AnomalyClient) UpdateOneID(id int) *AnomalyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AnomalyClient) Use

func (c *AnomalyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `anomaly.Hooks(f(g(h())))`.

type AnomalyCreate

type AnomalyCreate struct {
	// contains filtered or unexported fields
}

AnomalyCreate is the builder for creating a Anomaly entity.

func (*AnomalyCreate) Mutation

func (ac *AnomalyCreate) Mutation() *AnomalyMutation

Mutation returns the AnomalyMutation object of the builder.

func (*AnomalyCreate) Save

func (ac *AnomalyCreate) Save(ctx context.Context) (*Anomaly, error)

Save creates the Anomaly in the database.

func (*AnomalyCreate) SaveX

func (ac *AnomalyCreate) SaveX(ctx context.Context) *Anomaly

SaveX calls Save and panics if Save returns an error.

func (*AnomalyCreate) SetCreateTime

func (ac *AnomalyCreate) SetCreateTime(t time.Time) *AnomalyCreate

SetCreateTime sets the "create_time" field.

func (*AnomalyCreate) SetDetectionJobInstance

func (ac *AnomalyCreate) SetDetectionJobInstance(d *DetectionJobInstance) *AnomalyCreate

SetDetectionJobInstance sets the "detection_job_instance" edge to the DetectionJobInstance entity.

func (*AnomalyCreate) SetDetectionJobInstanceID

func (ac *AnomalyCreate) SetDetectionJobInstanceID(id int) *AnomalyCreate

SetDetectionJobInstanceID sets the "detection_job_instance" edge to the DetectionJobInstance entity by ID.

func (*AnomalyCreate) SetNillableCreateTime

func (ac *AnomalyCreate) SetNillableCreateTime(t *time.Time) *AnomalyCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*AnomalyCreate) SetNillableProcessed

func (ac *AnomalyCreate) SetNillableProcessed(b *bool) *AnomalyCreate

SetNillableProcessed sets the "processed" field if the given value is not nil.

func (*AnomalyCreate) SetNillableUpdateTime

func (ac *AnomalyCreate) SetNillableUpdateTime(t *time.Time) *AnomalyCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*AnomalyCreate) SetPeriodEnd

func (ac *AnomalyCreate) SetPeriodEnd(t time.Time) *AnomalyCreate

SetPeriodEnd sets the "period_end" field.

func (*AnomalyCreate) SetPeriodStart

func (ac *AnomalyCreate) SetPeriodStart(t time.Time) *AnomalyCreate

SetPeriodStart sets the "period_start" field.

func (*AnomalyCreate) SetProcessed

func (ac *AnomalyCreate) SetProcessed(b bool) *AnomalyCreate

SetProcessed sets the "processed" field.

func (*AnomalyCreate) SetType

func (ac *AnomalyCreate) SetType(s string) *AnomalyCreate

SetType sets the "type" field.

func (*AnomalyCreate) SetUpdateTime

func (ac *AnomalyCreate) SetUpdateTime(t time.Time) *AnomalyCreate

SetUpdateTime sets the "update_time" field.

func (*AnomalyCreate) SetValue

func (ac *AnomalyCreate) SetValue(f float64) *AnomalyCreate

SetValue sets the "value" field.

type AnomalyCreateBulk

type AnomalyCreateBulk struct {
	// contains filtered or unexported fields
}

AnomalyCreateBulk is the builder for creating many Anomaly entities in bulk.

func (*AnomalyCreateBulk) Save

func (acb *AnomalyCreateBulk) Save(ctx context.Context) ([]*Anomaly, error)

Save creates the Anomaly entities in the database.

func (*AnomalyCreateBulk) SaveX

func (acb *AnomalyCreateBulk) SaveX(ctx context.Context) []*Anomaly

SaveX is like Save, but panics if an error occurs.

type AnomalyDelete

type AnomalyDelete struct {
	// contains filtered or unexported fields
}

AnomalyDelete is the builder for deleting a Anomaly entity.

func (*AnomalyDelete) Exec

func (ad *AnomalyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*AnomalyDelete) ExecX

func (ad *AnomalyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*AnomalyDelete) Where

func (ad *AnomalyDelete) Where(ps ...predicate.Anomaly) *AnomalyDelete

Where adds a new predicate to the AnomalyDelete builder.

type AnomalyDeleteOne

type AnomalyDeleteOne struct {
	// contains filtered or unexported fields
}

AnomalyDeleteOne is the builder for deleting a single Anomaly entity.

func (*AnomalyDeleteOne) Exec

func (ado *AnomalyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AnomalyDeleteOne) ExecX

func (ado *AnomalyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type AnomalyEdges

type AnomalyEdges struct {
	// DetectionJobInstance holds the value of the detection_job_instance edge.
	DetectionJobInstance *DetectionJobInstance `json:"detection_job_instance,omitempty"`
	// contains filtered or unexported fields
}

AnomalyEdges holds the relations/edges for other nodes in the graph.

func (AnomalyEdges) DetectionJobInstanceOrErr

func (e AnomalyEdges) DetectionJobInstanceOrErr() (*DetectionJobInstance, error)

DetectionJobInstanceOrErr returns the DetectionJobInstance value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type AnomalyGroupBy

type AnomalyGroupBy struct {
	// contains filtered or unexported fields
}

AnomalyGroupBy is the group-by builder for Anomaly entities.

func (*AnomalyGroupBy) Aggregate

func (agb *AnomalyGroupBy) Aggregate(fns ...AggregateFunc) *AnomalyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*AnomalyGroupBy) Bool

func (agb *AnomalyGroupBy) 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 (*AnomalyGroupBy) BoolX

func (agb *AnomalyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AnomalyGroupBy) Bools

func (agb *AnomalyGroupBy) 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 (*AnomalyGroupBy) BoolsX

func (agb *AnomalyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AnomalyGroupBy) Float64

func (agb *AnomalyGroupBy) 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 (*AnomalyGroupBy) Float64X

func (agb *AnomalyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AnomalyGroupBy) Float64s

func (agb *AnomalyGroupBy) 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 (*AnomalyGroupBy) Float64sX

func (agb *AnomalyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AnomalyGroupBy) Int

func (agb *AnomalyGroupBy) 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 (*AnomalyGroupBy) IntX

func (agb *AnomalyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AnomalyGroupBy) Ints

func (agb *AnomalyGroupBy) 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 (*AnomalyGroupBy) IntsX

func (agb *AnomalyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AnomalyGroupBy) Scan

func (agb *AnomalyGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*AnomalyGroupBy) ScanX

func (agb *AnomalyGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*AnomalyGroupBy) String

func (agb *AnomalyGroupBy) 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 (*AnomalyGroupBy) StringX

func (agb *AnomalyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AnomalyGroupBy) Strings

func (agb *AnomalyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*AnomalyGroupBy) StringsX

func (agb *AnomalyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AnomalyMutation

type AnomalyMutation struct {
	// contains filtered or unexported fields
}

AnomalyMutation represents an operation that mutates the Anomaly nodes in the graph.

func (*AnomalyMutation) AddField

func (m *AnomalyMutation) 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 (*AnomalyMutation) AddValue

func (m *AnomalyMutation) AddValue(f float64)

AddValue adds f to the "value" field.

func (*AnomalyMutation) AddedEdges

func (m *AnomalyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*AnomalyMutation) AddedField

func (m *AnomalyMutation) 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 (*AnomalyMutation) AddedFields

func (m *AnomalyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*AnomalyMutation) AddedIDs

func (m *AnomalyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*AnomalyMutation) AddedValue

func (m *AnomalyMutation) AddedValue() (r float64, exists bool)

AddedValue returns the value that was added to the "value" field in this mutation.

func (*AnomalyMutation) ClearDetectionJobInstance

func (m *AnomalyMutation) ClearDetectionJobInstance()

ClearDetectionJobInstance clears the "detection_job_instance" edge to the DetectionJobInstance entity.

func (*AnomalyMutation) ClearEdge

func (m *AnomalyMutation) 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 (*AnomalyMutation) ClearField

func (m *AnomalyMutation) 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 (*AnomalyMutation) ClearedEdges

func (m *AnomalyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*AnomalyMutation) ClearedFields

func (m *AnomalyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (AnomalyMutation) Client

func (m AnomalyMutation) 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 (*AnomalyMutation) CreateTime

func (m *AnomalyMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*AnomalyMutation) DetectionJobInstanceCleared

func (m *AnomalyMutation) DetectionJobInstanceCleared() bool

DetectionJobInstanceCleared returns if the "detection_job_instance" edge to the DetectionJobInstance entity was cleared.

func (*AnomalyMutation) DetectionJobInstanceID

func (m *AnomalyMutation) DetectionJobInstanceID() (id int, exists bool)

DetectionJobInstanceID returns the "detection_job_instance" edge ID in the mutation.

func (*AnomalyMutation) DetectionJobInstanceIDs

func (m *AnomalyMutation) DetectionJobInstanceIDs() (ids []int)

DetectionJobInstanceIDs returns the "detection_job_instance" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DetectionJobInstanceID instead. It exists only for internal usage by the builders.

func (*AnomalyMutation) EdgeCleared

func (m *AnomalyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*AnomalyMutation) Field

func (m *AnomalyMutation) 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 (*AnomalyMutation) FieldCleared

func (m *AnomalyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*AnomalyMutation) Fields

func (m *AnomalyMutation) 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 (*AnomalyMutation) GetType

func (m *AnomalyMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*AnomalyMutation) ID

func (m *AnomalyMutation) 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.

func (*AnomalyMutation) OldCreateTime

func (m *AnomalyMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Anomaly entity. If the Anomaly 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 (*AnomalyMutation) OldField

func (m *AnomalyMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*AnomalyMutation) OldPeriodEnd

func (m *AnomalyMutation) OldPeriodEnd(ctx context.Context) (v time.Time, err error)

OldPeriodEnd returns the old "period_end" field's value of the Anomaly entity. If the Anomaly 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 (*AnomalyMutation) OldPeriodStart

func (m *AnomalyMutation) OldPeriodStart(ctx context.Context) (v time.Time, err error)

OldPeriodStart returns the old "period_start" field's value of the Anomaly entity. If the Anomaly 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 (*AnomalyMutation) OldProcessed

func (m *AnomalyMutation) OldProcessed(ctx context.Context) (v bool, err error)

OldProcessed returns the old "processed" field's value of the Anomaly entity. If the Anomaly 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 (*AnomalyMutation) OldType

func (m *AnomalyMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the Anomaly entity. If the Anomaly 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 (*AnomalyMutation) OldUpdateTime

func (m *AnomalyMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Anomaly entity. If the Anomaly 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 (*AnomalyMutation) OldValue

func (m *AnomalyMutation) OldValue(ctx context.Context) (v float64, err error)

OldValue returns the old "value" field's value of the Anomaly entity. If the Anomaly 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 (*AnomalyMutation) Op

func (m *AnomalyMutation) Op() Op

Op returns the operation name.

func (*AnomalyMutation) PeriodEnd

func (m *AnomalyMutation) PeriodEnd() (r time.Time, exists bool)

PeriodEnd returns the value of the "period_end" field in the mutation.

func (*AnomalyMutation) PeriodStart

func (m *AnomalyMutation) PeriodStart() (r time.Time, exists bool)

PeriodStart returns the value of the "period_start" field in the mutation.

func (*AnomalyMutation) Processed

func (m *AnomalyMutation) Processed() (r bool, exists bool)

Processed returns the value of the "processed" field in the mutation.

func (*AnomalyMutation) RemovedEdges

func (m *AnomalyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*AnomalyMutation) RemovedIDs

func (m *AnomalyMutation) 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 (*AnomalyMutation) ResetCreateTime

func (m *AnomalyMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*AnomalyMutation) ResetDetectionJobInstance

func (m *AnomalyMutation) ResetDetectionJobInstance()

ResetDetectionJobInstance resets all changes to the "detection_job_instance" edge.

func (*AnomalyMutation) ResetEdge

func (m *AnomalyMutation) 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 (*AnomalyMutation) ResetField

func (m *AnomalyMutation) 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 (*AnomalyMutation) ResetPeriodEnd

func (m *AnomalyMutation) ResetPeriodEnd()

ResetPeriodEnd resets all changes to the "period_end" field.

func (*AnomalyMutation) ResetPeriodStart

func (m *AnomalyMutation) ResetPeriodStart()

ResetPeriodStart resets all changes to the "period_start" field.

func (*AnomalyMutation) ResetProcessed

func (m *AnomalyMutation) ResetProcessed()

ResetProcessed resets all changes to the "processed" field.

func (*AnomalyMutation) ResetType

func (m *AnomalyMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*AnomalyMutation) ResetUpdateTime

func (m *AnomalyMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*AnomalyMutation) ResetValue

func (m *AnomalyMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*AnomalyMutation) SetCreateTime

func (m *AnomalyMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*AnomalyMutation) SetDetectionJobInstanceID

func (m *AnomalyMutation) SetDetectionJobInstanceID(id int)

SetDetectionJobInstanceID sets the "detection_job_instance" edge to the DetectionJobInstance entity by id.

func (*AnomalyMutation) SetField

func (m *AnomalyMutation) 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 (*AnomalyMutation) SetPeriodEnd

func (m *AnomalyMutation) SetPeriodEnd(t time.Time)

SetPeriodEnd sets the "period_end" field.

func (*AnomalyMutation) SetPeriodStart

func (m *AnomalyMutation) SetPeriodStart(t time.Time)

SetPeriodStart sets the "period_start" field.

func (*AnomalyMutation) SetProcessed

func (m *AnomalyMutation) SetProcessed(b bool)

SetProcessed sets the "processed" field.

func (*AnomalyMutation) SetType

func (m *AnomalyMutation) SetType(s string)

SetType sets the "type" field.

func (*AnomalyMutation) SetUpdateTime

func (m *AnomalyMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*AnomalyMutation) SetValue

func (m *AnomalyMutation) SetValue(f float64)

SetValue sets the "value" field.

func (AnomalyMutation) Tx

func (m AnomalyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*AnomalyMutation) Type

func (m *AnomalyMutation) Type() string

Type returns the node type of this mutation (Anomaly).

func (*AnomalyMutation) UpdateTime

func (m *AnomalyMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*AnomalyMutation) Value

func (m *AnomalyMutation) Value() (r float64, exists bool)

Value returns the value of the "value" field in the mutation.

type AnomalyQuery

type AnomalyQuery struct {
	// contains filtered or unexported fields
}

AnomalyQuery is the builder for querying Anomaly entities.

func (*AnomalyQuery) All

func (aq *AnomalyQuery) All(ctx context.Context) ([]*Anomaly, error)

All executes the query and returns a list of Anomalies.

func (*AnomalyQuery) AllX

func (aq *AnomalyQuery) AllX(ctx context.Context) []*Anomaly

AllX is like All, but panics if an error occurs.

func (*AnomalyQuery) Clone

func (aq *AnomalyQuery) Clone() *AnomalyQuery

Clone returns a duplicate of the AnomalyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*AnomalyQuery) Count

func (aq *AnomalyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AnomalyQuery) CountX

func (aq *AnomalyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*AnomalyQuery) Exist

func (aq *AnomalyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*AnomalyQuery) ExistX

func (aq *AnomalyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*AnomalyQuery) First

func (aq *AnomalyQuery) First(ctx context.Context) (*Anomaly, error)

First returns the first Anomaly entity from the query. Returns a *NotFoundError when no Anomaly was found.

func (*AnomalyQuery) FirstID

func (aq *AnomalyQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Anomaly ID from the query. Returns a *NotFoundError when no Anomaly ID was found.

func (*AnomalyQuery) FirstIDX

func (aq *AnomalyQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*AnomalyQuery) FirstX

func (aq *AnomalyQuery) FirstX(ctx context.Context) *Anomaly

FirstX is like First, but panics if an error occurs.

func (*AnomalyQuery) GroupBy

func (aq *AnomalyQuery) GroupBy(field string, fields ...string) *AnomalyGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Anomaly.Query().
	GroupBy(anomaly.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AnomalyQuery) IDs

func (aq *AnomalyQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Anomaly IDs.

func (*AnomalyQuery) IDsX

func (aq *AnomalyQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*AnomalyQuery) Limit

func (aq *AnomalyQuery) Limit(limit int) *AnomalyQuery

Limit adds a limit step to the query.

func (*AnomalyQuery) Offset

func (aq *AnomalyQuery) Offset(offset int) *AnomalyQuery

Offset adds an offset step to the query.

func (*AnomalyQuery) Only

func (aq *AnomalyQuery) Only(ctx context.Context) (*Anomaly, error)

Only returns a single Anomaly entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Anomaly entity is not found. Returns a *NotFoundError when no Anomaly entities are found.

func (*AnomalyQuery) OnlyID

func (aq *AnomalyQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Anomaly ID in the query. Returns a *NotSingularError when exactly one Anomaly ID is not found. Returns a *NotFoundError when no entities are found.

func (*AnomalyQuery) OnlyIDX

func (aq *AnomalyQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*AnomalyQuery) OnlyX

func (aq *AnomalyQuery) OnlyX(ctx context.Context) *Anomaly

OnlyX is like Only, but panics if an error occurs.

func (*AnomalyQuery) Order

func (aq *AnomalyQuery) Order(o ...OrderFunc) *AnomalyQuery

Order adds an order step to the query.

func (*AnomalyQuery) QueryDetectionJobInstance

func (aq *AnomalyQuery) QueryDetectionJobInstance() *DetectionJobInstanceQuery

QueryDetectionJobInstance chains the current query on the "detection_job_instance" edge.

func (*AnomalyQuery) Select

func (aq *AnomalyQuery) Select(field string, fields ...string) *AnomalySelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Anomaly.Query().
	Select(anomaly.FieldCreateTime).
	Scan(ctx, &v)

func (*AnomalyQuery) Where

func (aq *AnomalyQuery) Where(ps ...predicate.Anomaly) *AnomalyQuery

Where adds a new predicate for the AnomalyQuery builder.

func (*AnomalyQuery) WithDetectionJobInstance

func (aq *AnomalyQuery) WithDetectionJobInstance(opts ...func(*DetectionJobInstanceQuery)) *AnomalyQuery

WithDetectionJobInstance tells the query-builder to eager-load the nodes that are connected to the "detection_job_instance" edge. The optional arguments are used to configure the query builder of the edge.

type AnomalySelect

type AnomalySelect struct {
	*AnomalyQuery
	// contains filtered or unexported fields
}

AnomalySelect is the builder for selecting fields of Anomaly entities.

func (*AnomalySelect) Bool

func (as *AnomalySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) BoolX

func (as *AnomalySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AnomalySelect) Bools

func (as *AnomalySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) BoolsX

func (as *AnomalySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AnomalySelect) Float64

func (as *AnomalySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) Float64X

func (as *AnomalySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AnomalySelect) Float64s

func (as *AnomalySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) Float64sX

func (as *AnomalySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AnomalySelect) Int

func (as *AnomalySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) IntX

func (as *AnomalySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AnomalySelect) Ints

func (as *AnomalySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) IntsX

func (as *AnomalySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AnomalySelect) Scan

func (as *AnomalySelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*AnomalySelect) ScanX

func (as *AnomalySelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*AnomalySelect) String

func (as *AnomalySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) StringX

func (as *AnomalySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AnomalySelect) Strings

func (as *AnomalySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AnomalySelect) StringsX

func (as *AnomalySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AnomalyUpdate

type AnomalyUpdate struct {
	// contains filtered or unexported fields
}

AnomalyUpdate is the builder for updating Anomaly entities.

func (*AnomalyUpdate) AddValue

func (au *AnomalyUpdate) AddValue(f float64) *AnomalyUpdate

AddValue adds f to the "value" field.

func (*AnomalyUpdate) ClearDetectionJobInstance

func (au *AnomalyUpdate) ClearDetectionJobInstance() *AnomalyUpdate

ClearDetectionJobInstance clears the "detection_job_instance" edge to the DetectionJobInstance entity.

func (*AnomalyUpdate) Exec

func (au *AnomalyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AnomalyUpdate) ExecX

func (au *AnomalyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AnomalyUpdate) Mutation

func (au *AnomalyUpdate) Mutation() *AnomalyMutation

Mutation returns the AnomalyMutation object of the builder.

func (*AnomalyUpdate) Save

func (au *AnomalyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*AnomalyUpdate) SaveX

func (au *AnomalyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*AnomalyUpdate) SetDetectionJobInstance

func (au *AnomalyUpdate) SetDetectionJobInstance(d *DetectionJobInstance) *AnomalyUpdate

SetDetectionJobInstance sets the "detection_job_instance" edge to the DetectionJobInstance entity.

func (*AnomalyUpdate) SetDetectionJobInstanceID

func (au *AnomalyUpdate) SetDetectionJobInstanceID(id int) *AnomalyUpdate

SetDetectionJobInstanceID sets the "detection_job_instance" edge to the DetectionJobInstance entity by ID.

func (*AnomalyUpdate) SetNillableProcessed

func (au *AnomalyUpdate) SetNillableProcessed(b *bool) *AnomalyUpdate

SetNillableProcessed sets the "processed" field if the given value is not nil.

func (*AnomalyUpdate) SetPeriodEnd

func (au *AnomalyUpdate) SetPeriodEnd(t time.Time) *AnomalyUpdate

SetPeriodEnd sets the "period_end" field.

func (*AnomalyUpdate) SetPeriodStart

func (au *AnomalyUpdate) SetPeriodStart(t time.Time) *AnomalyUpdate

SetPeriodStart sets the "period_start" field.

func (*AnomalyUpdate) SetProcessed

func (au *AnomalyUpdate) SetProcessed(b bool) *AnomalyUpdate

SetProcessed sets the "processed" field.

func (*AnomalyUpdate) SetType

func (au *AnomalyUpdate) SetType(s string) *AnomalyUpdate

SetType sets the "type" field.

func (*AnomalyUpdate) SetValue

func (au *AnomalyUpdate) SetValue(f float64) *AnomalyUpdate

SetValue sets the "value" field.

func (*AnomalyUpdate) Where

func (au *AnomalyUpdate) Where(ps ...predicate.Anomaly) *AnomalyUpdate

Where adds a new predicate for the AnomalyUpdate builder.

type AnomalyUpdateOne

type AnomalyUpdateOne struct {
	// contains filtered or unexported fields
}

AnomalyUpdateOne is the builder for updating a single Anomaly entity.

func (*AnomalyUpdateOne) AddValue

func (auo *AnomalyUpdateOne) AddValue(f float64) *AnomalyUpdateOne

AddValue adds f to the "value" field.

func (*AnomalyUpdateOne) ClearDetectionJobInstance

func (auo *AnomalyUpdateOne) ClearDetectionJobInstance() *AnomalyUpdateOne

ClearDetectionJobInstance clears the "detection_job_instance" edge to the DetectionJobInstance entity.

func (*AnomalyUpdateOne) Exec

func (auo *AnomalyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AnomalyUpdateOne) ExecX

func (auo *AnomalyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AnomalyUpdateOne) Mutation

func (auo *AnomalyUpdateOne) Mutation() *AnomalyMutation

Mutation returns the AnomalyMutation object of the builder.

func (*AnomalyUpdateOne) Save

func (auo *AnomalyUpdateOne) Save(ctx context.Context) (*Anomaly, error)

Save executes the query and returns the updated Anomaly entity.

func (*AnomalyUpdateOne) SaveX

func (auo *AnomalyUpdateOne) SaveX(ctx context.Context) *Anomaly

SaveX is like Save, but panics if an error occurs.

func (*AnomalyUpdateOne) SetDetectionJobInstance

func (auo *AnomalyUpdateOne) SetDetectionJobInstance(d *DetectionJobInstance) *AnomalyUpdateOne

SetDetectionJobInstance sets the "detection_job_instance" edge to the DetectionJobInstance entity.

func (*AnomalyUpdateOne) SetDetectionJobInstanceID

func (auo *AnomalyUpdateOne) SetDetectionJobInstanceID(id int) *AnomalyUpdateOne

SetDetectionJobInstanceID sets the "detection_job_instance" edge to the DetectionJobInstance entity by ID.

func (*AnomalyUpdateOne) SetNillableProcessed

func (auo *AnomalyUpdateOne) SetNillableProcessed(b *bool) *AnomalyUpdateOne

SetNillableProcessed sets the "processed" field if the given value is not nil.

func (*AnomalyUpdateOne) SetPeriodEnd

func (auo *AnomalyUpdateOne) SetPeriodEnd(t time.Time) *AnomalyUpdateOne

SetPeriodEnd sets the "period_end" field.

func (*AnomalyUpdateOne) SetPeriodStart

func (auo *AnomalyUpdateOne) SetPeriodStart(t time.Time) *AnomalyUpdateOne

SetPeriodStart sets the "period_start" field.

func (*AnomalyUpdateOne) SetProcessed

func (auo *AnomalyUpdateOne) SetProcessed(b bool) *AnomalyUpdateOne

SetProcessed sets the "processed" field.

func (*AnomalyUpdateOne) SetType

func (auo *AnomalyUpdateOne) SetType(s string) *AnomalyUpdateOne

SetType sets the "type" field.

func (*AnomalyUpdateOne) SetValue

func (auo *AnomalyUpdateOne) SetValue(f float64) *AnomalyUpdateOne

SetValue sets the "value" field.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Anomaly is the client for interacting with the Anomaly builders.
	Anomaly *AnomalyClient
	// DetectionJob is the client for interacting with the DetectionJob builders.
	DetectionJob *DetectionJobClient
	// DetectionJobInstance is the client for interacting with the DetectionJobInstance builders.
	DetectionJobInstance *DetectionJobInstanceClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

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) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Anomaly.
	Query().
	Count(ctx)

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

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.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Committer method.

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 DetectionJob

type DetectionJob struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Schedule holds the value of the "schedule" field.
	Schedule *string `json:"schedule,omitempty"`
	// Method holds the value of the "method" field.
	Method string `json:"method,omitempty"`
	// SiteID holds the value of the "site_id" field.
	SiteID string `json:"site_id,omitempty"`
	// Metric holds the value of the "metric" field.
	Metric string `json:"metric,omitempty"`
	// Attribute holds the value of the "attribute" field.
	Attribute string `json:"attribute,omitempty"`
	// TimeAgo holds the value of the "time_ago" field.
	TimeAgo string `json:"time_ago,omitempty"`
	// TimeStep holds the value of the "time_step" field.
	TimeStep string `json:"time_step,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DetectionJobQuery when eager-loading is set.
	Edges DetectionJobEdges `json:"edges"`
	// contains filtered or unexported fields
}

DetectionJob is the model entity for the DetectionJob schema.

func (*DetectionJob) QueryInstance

func (dj *DetectionJob) QueryInstance() *DetectionJobInstanceQuery

QueryInstance queries the "instance" edge of the DetectionJob entity.

func (*DetectionJob) String

func (dj *DetectionJob) String() string

String implements the fmt.Stringer.

func (*DetectionJob) Unwrap

func (dj *DetectionJob) Unwrap() *DetectionJob

Unwrap unwraps the DetectionJob 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 (*DetectionJob) Update

func (dj *DetectionJob) Update() *DetectionJobUpdateOne

Update returns a builder for updating this DetectionJob. Note that you need to call DetectionJob.Unwrap() before calling this method if this DetectionJob was returned from a transaction, and the transaction was committed or rolled back.

type DetectionJobClient

type DetectionJobClient struct {
	// contains filtered or unexported fields
}

DetectionJobClient is a client for the DetectionJob schema.

func NewDetectionJobClient

func NewDetectionJobClient(c config) *DetectionJobClient

NewDetectionJobClient returns a client for the DetectionJob from the given config.

func (*DetectionJobClient) Create

Create returns a create builder for DetectionJob.

func (*DetectionJobClient) CreateBulk

func (c *DetectionJobClient) CreateBulk(builders ...*DetectionJobCreate) *DetectionJobCreateBulk

CreateBulk returns a builder for creating a bulk of DetectionJob entities.

func (*DetectionJobClient) Delete

Delete returns a delete builder for DetectionJob.

func (*DetectionJobClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DetectionJobClient) DeleteOneID

func (c *DetectionJobClient) DeleteOneID(id int) *DetectionJobDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DetectionJobClient) Get

Get returns a DetectionJob entity by its id.

func (*DetectionJobClient) GetX

GetX is like Get, but panics if an error occurs.

func (*DetectionJobClient) Hooks

func (c *DetectionJobClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DetectionJobClient) Query

Query returns a query builder for DetectionJob.

func (*DetectionJobClient) QueryInstance

QueryInstance queries the instance edge of a DetectionJob.

func (*DetectionJobClient) Update

Update returns an update builder for DetectionJob.

func (*DetectionJobClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DetectionJobClient) UpdateOneID

func (c *DetectionJobClient) UpdateOneID(id int) *DetectionJobUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DetectionJobClient) Use

func (c *DetectionJobClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `detectionjob.Hooks(f(g(h())))`.

type DetectionJobCreate

type DetectionJobCreate struct {
	// contains filtered or unexported fields
}

DetectionJobCreate is the builder for creating a DetectionJob entity.

func (*DetectionJobCreate) AddInstance

AddInstance adds the "instance" edges to the DetectionJobInstance entity.

func (*DetectionJobCreate) AddInstanceIDs

func (djc *DetectionJobCreate) AddInstanceIDs(ids ...int) *DetectionJobCreate

AddInstanceIDs adds the "instance" edge to the DetectionJobInstance entity by IDs.

func (*DetectionJobCreate) Mutation

func (djc *DetectionJobCreate) Mutation() *DetectionJobMutation

Mutation returns the DetectionJobMutation object of the builder.

func (*DetectionJobCreate) Save

Save creates the DetectionJob in the database.

func (*DetectionJobCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DetectionJobCreate) SetAttribute

func (djc *DetectionJobCreate) SetAttribute(s string) *DetectionJobCreate

SetAttribute sets the "attribute" field.

func (*DetectionJobCreate) SetCreateTime

func (djc *DetectionJobCreate) SetCreateTime(t time.Time) *DetectionJobCreate

SetCreateTime sets the "create_time" field.

func (*DetectionJobCreate) SetDescription

func (djc *DetectionJobCreate) SetDescription(s string) *DetectionJobCreate

SetDescription sets the "description" field.

func (*DetectionJobCreate) SetMethod

func (djc *DetectionJobCreate) SetMethod(s string) *DetectionJobCreate

SetMethod sets the "method" field.

func (*DetectionJobCreate) SetMetric

func (djc *DetectionJobCreate) SetMetric(s string) *DetectionJobCreate

SetMetric sets the "metric" field.

func (*DetectionJobCreate) SetNillableCreateTime

func (djc *DetectionJobCreate) SetNillableCreateTime(t *time.Time) *DetectionJobCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*DetectionJobCreate) SetNillableDescription

func (djc *DetectionJobCreate) SetNillableDescription(s *string) *DetectionJobCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DetectionJobCreate) SetNillableSchedule

func (djc *DetectionJobCreate) SetNillableSchedule(s *string) *DetectionJobCreate

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*DetectionJobCreate) SetNillableUpdateTime

func (djc *DetectionJobCreate) SetNillableUpdateTime(t *time.Time) *DetectionJobCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*DetectionJobCreate) SetSchedule

func (djc *DetectionJobCreate) SetSchedule(s string) *DetectionJobCreate

SetSchedule sets the "schedule" field.

func (*DetectionJobCreate) SetSiteID

func (djc *DetectionJobCreate) SetSiteID(s string) *DetectionJobCreate

SetSiteID sets the "site_id" field.

func (*DetectionJobCreate) SetTimeAgo

func (djc *DetectionJobCreate) SetTimeAgo(s string) *DetectionJobCreate

SetTimeAgo sets the "time_ago" field.

func (*DetectionJobCreate) SetTimeStep

func (djc *DetectionJobCreate) SetTimeStep(s string) *DetectionJobCreate

SetTimeStep sets the "time_step" field.

func (*DetectionJobCreate) SetUpdateTime

func (djc *DetectionJobCreate) SetUpdateTime(t time.Time) *DetectionJobCreate

SetUpdateTime sets the "update_time" field.

type DetectionJobCreateBulk

type DetectionJobCreateBulk struct {
	// contains filtered or unexported fields
}

DetectionJobCreateBulk is the builder for creating many DetectionJob entities in bulk.

func (*DetectionJobCreateBulk) Save

Save creates the DetectionJob entities in the database.

func (*DetectionJobCreateBulk) SaveX

func (djcb *DetectionJobCreateBulk) SaveX(ctx context.Context) []*DetectionJob

SaveX is like Save, but panics if an error occurs.

type DetectionJobDelete

type DetectionJobDelete struct {
	// contains filtered or unexported fields
}

DetectionJobDelete is the builder for deleting a DetectionJob entity.

func (*DetectionJobDelete) Exec

func (djd *DetectionJobDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DetectionJobDelete) ExecX

func (djd *DetectionJobDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DetectionJobDelete) Where

Where adds a new predicate to the DetectionJobDelete builder.

type DetectionJobDeleteOne

type DetectionJobDeleteOne struct {
	// contains filtered or unexported fields
}

DetectionJobDeleteOne is the builder for deleting a single DetectionJob entity.

func (*DetectionJobDeleteOne) Exec

func (djdo *DetectionJobDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DetectionJobDeleteOne) ExecX

func (djdo *DetectionJobDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type DetectionJobEdges

type DetectionJobEdges struct {
	// Instance holds the value of the instance edge.
	Instance []*DetectionJobInstance `json:"instance,omitempty"`
	// contains filtered or unexported fields
}

DetectionJobEdges holds the relations/edges for other nodes in the graph.

func (DetectionJobEdges) InstanceOrErr

func (e DetectionJobEdges) InstanceOrErr() ([]*DetectionJobInstance, error)

InstanceOrErr returns the Instance value or an error if the edge was not loaded in eager-loading.

type DetectionJobGroupBy

type DetectionJobGroupBy struct {
	// contains filtered or unexported fields
}

DetectionJobGroupBy is the group-by builder for DetectionJob entities.

func (*DetectionJobGroupBy) Aggregate

func (djgb *DetectionJobGroupBy) Aggregate(fns ...AggregateFunc) *DetectionJobGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DetectionJobGroupBy) Bool

func (djgb *DetectionJobGroupBy) 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 (*DetectionJobGroupBy) BoolX

func (djgb *DetectionJobGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DetectionJobGroupBy) Bools

func (djgb *DetectionJobGroupBy) 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 (*DetectionJobGroupBy) BoolsX

func (djgb *DetectionJobGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DetectionJobGroupBy) Float64

func (djgb *DetectionJobGroupBy) 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 (*DetectionJobGroupBy) Float64X

func (djgb *DetectionJobGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DetectionJobGroupBy) Float64s

func (djgb *DetectionJobGroupBy) 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 (*DetectionJobGroupBy) Float64sX

func (djgb *DetectionJobGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DetectionJobGroupBy) Int

func (djgb *DetectionJobGroupBy) 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 (*DetectionJobGroupBy) IntX

func (djgb *DetectionJobGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DetectionJobGroupBy) Ints

func (djgb *DetectionJobGroupBy) 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 (*DetectionJobGroupBy) IntsX

func (djgb *DetectionJobGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DetectionJobGroupBy) Scan

func (djgb *DetectionJobGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*DetectionJobGroupBy) ScanX

func (djgb *DetectionJobGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*DetectionJobGroupBy) String

func (djgb *DetectionJobGroupBy) 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 (*DetectionJobGroupBy) StringX

func (djgb *DetectionJobGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DetectionJobGroupBy) Strings

func (djgb *DetectionJobGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*DetectionJobGroupBy) StringsX

func (djgb *DetectionJobGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DetectionJobInstance

type DetectionJobInstance struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt *time.Time `json:"started_at,omitempty"`
	// FinishedAt holds the value of the "finished_at" field.
	FinishedAt *time.Time `json:"finished_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DetectionJobInstanceQuery when eager-loading is set.
	Edges DetectionJobInstanceEdges `json:"edges"`
	// contains filtered or unexported fields
}

DetectionJobInstance is the model entity for the DetectionJobInstance schema.

func (*DetectionJobInstance) QueryAnomalies

func (dji *DetectionJobInstance) QueryAnomalies() *AnomalyQuery

QueryAnomalies queries the "anomalies" edge of the DetectionJobInstance entity.

func (*DetectionJobInstance) QueryDetectionJob

func (dji *DetectionJobInstance) QueryDetectionJob() *DetectionJobQuery

QueryDetectionJob queries the "detection_job" edge of the DetectionJobInstance entity.

func (*DetectionJobInstance) String

func (dji *DetectionJobInstance) String() string

String implements the fmt.Stringer.

func (*DetectionJobInstance) Unwrap

Unwrap unwraps the DetectionJobInstance 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 (*DetectionJobInstance) Update

Update returns a builder for updating this DetectionJobInstance. Note that you need to call DetectionJobInstance.Unwrap() before calling this method if this DetectionJobInstance was returned from a transaction, and the transaction was committed or rolled back.

type DetectionJobInstanceClient

type DetectionJobInstanceClient struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceClient is a client for the DetectionJobInstance schema.

func NewDetectionJobInstanceClient

func NewDetectionJobInstanceClient(c config) *DetectionJobInstanceClient

NewDetectionJobInstanceClient returns a client for the DetectionJobInstance from the given config.

func (*DetectionJobInstanceClient) Create

Create returns a create builder for DetectionJobInstance.

func (*DetectionJobInstanceClient) CreateBulk

CreateBulk returns a builder for creating a bulk of DetectionJobInstance entities.

func (*DetectionJobInstanceClient) Delete

Delete returns a delete builder for DetectionJobInstance.

func (*DetectionJobInstanceClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DetectionJobInstanceClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*DetectionJobInstanceClient) Get

Get returns a DetectionJobInstance entity by its id.

func (*DetectionJobInstanceClient) GetX

GetX is like Get, but panics if an error occurs.

func (*DetectionJobInstanceClient) Hooks

func (c *DetectionJobInstanceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DetectionJobInstanceClient) Query

Query returns a query builder for DetectionJobInstance.

func (*DetectionJobInstanceClient) QueryAnomalies

QueryAnomalies queries the anomalies edge of a DetectionJobInstance.

func (*DetectionJobInstanceClient) QueryDetectionJob

QueryDetectionJob queries the detection_job edge of a DetectionJobInstance.

func (*DetectionJobInstanceClient) Update

Update returns an update builder for DetectionJobInstance.

func (*DetectionJobInstanceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DetectionJobInstanceClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DetectionJobInstanceClient) Use

func (c *DetectionJobInstanceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `detectionjobinstance.Hooks(f(g(h())))`.

type DetectionJobInstanceCreate

type DetectionJobInstanceCreate struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceCreate is the builder for creating a DetectionJobInstance entity.

func (*DetectionJobInstanceCreate) AddAnomalies

AddAnomalies adds the "anomalies" edges to the Anomaly entity.

func (*DetectionJobInstanceCreate) AddAnomalyIDs

func (djic *DetectionJobInstanceCreate) AddAnomalyIDs(ids ...int) *DetectionJobInstanceCreate

AddAnomalyIDs adds the "anomalies" edge to the Anomaly entity by IDs.

func (*DetectionJobInstanceCreate) Mutation

Mutation returns the DetectionJobInstanceMutation object of the builder.

func (*DetectionJobInstanceCreate) Save

Save creates the DetectionJobInstance in the database.

func (*DetectionJobInstanceCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DetectionJobInstanceCreate) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*DetectionJobInstanceCreate) SetDetectionJob

SetDetectionJob sets the "detection_job" edge to the DetectionJob entity.

func (*DetectionJobInstanceCreate) SetDetectionJobID

func (djic *DetectionJobInstanceCreate) SetDetectionJobID(id int) *DetectionJobInstanceCreate

SetDetectionJobID sets the "detection_job" edge to the DetectionJob entity by ID.

func (*DetectionJobInstanceCreate) SetFinishedAt

SetFinishedAt sets the "finished_at" field.

func (*DetectionJobInstanceCreate) SetNillableCreateTime

func (djic *DetectionJobInstanceCreate) SetNillableCreateTime(t *time.Time) *DetectionJobInstanceCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*DetectionJobInstanceCreate) SetNillableFinishedAt

func (djic *DetectionJobInstanceCreate) SetNillableFinishedAt(t *time.Time) *DetectionJobInstanceCreate

SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.

func (*DetectionJobInstanceCreate) SetNillableStartedAt

func (djic *DetectionJobInstanceCreate) SetNillableStartedAt(t *time.Time) *DetectionJobInstanceCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*DetectionJobInstanceCreate) SetNillableUpdateTime

func (djic *DetectionJobInstanceCreate) SetNillableUpdateTime(t *time.Time) *DetectionJobInstanceCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*DetectionJobInstanceCreate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*DetectionJobInstanceCreate) SetUpdateTime

SetUpdateTime sets the "update_time" field.

type DetectionJobInstanceCreateBulk

type DetectionJobInstanceCreateBulk struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceCreateBulk is the builder for creating many DetectionJobInstance entities in bulk.

func (*DetectionJobInstanceCreateBulk) Save

Save creates the DetectionJobInstance entities in the database.

func (*DetectionJobInstanceCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type DetectionJobInstanceDelete

type DetectionJobInstanceDelete struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceDelete is the builder for deleting a DetectionJobInstance entity.

func (*DetectionJobInstanceDelete) Exec

func (djid *DetectionJobInstanceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DetectionJobInstanceDelete) ExecX

func (djid *DetectionJobInstanceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DetectionJobInstanceDelete) Where

Where adds a new predicate to the DetectionJobInstanceDelete builder.

type DetectionJobInstanceDeleteOne

type DetectionJobInstanceDeleteOne struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceDeleteOne is the builder for deleting a single DetectionJobInstance entity.

func (*DetectionJobInstanceDeleteOne) Exec

Exec executes the deletion query.

func (*DetectionJobInstanceDeleteOne) ExecX

func (djido *DetectionJobInstanceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type DetectionJobInstanceEdges

type DetectionJobInstanceEdges struct {
	// Anomalies holds the value of the anomalies edge.
	Anomalies []*Anomaly `json:"anomalies,omitempty"`
	// DetectionJob holds the value of the detection_job edge.
	DetectionJob *DetectionJob `json:"detection_job,omitempty"`
	// contains filtered or unexported fields
}

DetectionJobInstanceEdges holds the relations/edges for other nodes in the graph.

func (DetectionJobInstanceEdges) AnomaliesOrErr

func (e DetectionJobInstanceEdges) AnomaliesOrErr() ([]*Anomaly, error)

AnomaliesOrErr returns the Anomalies value or an error if the edge was not loaded in eager-loading.

func (DetectionJobInstanceEdges) DetectionJobOrErr

func (e DetectionJobInstanceEdges) DetectionJobOrErr() (*DetectionJob, error)

DetectionJobOrErr returns the DetectionJob value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type DetectionJobInstanceGroupBy

type DetectionJobInstanceGroupBy struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceGroupBy is the group-by builder for DetectionJobInstance entities.

func (*DetectionJobInstanceGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*DetectionJobInstanceGroupBy) Bool

func (djigb *DetectionJobInstanceGroupBy) 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 (*DetectionJobInstanceGroupBy) BoolX

func (djigb *DetectionJobInstanceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) Bools

func (djigb *DetectionJobInstanceGroupBy) 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 (*DetectionJobInstanceGroupBy) BoolsX

func (djigb *DetectionJobInstanceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) Float64

func (djigb *DetectionJobInstanceGroupBy) 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 (*DetectionJobInstanceGroupBy) Float64X

func (djigb *DetectionJobInstanceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) Float64s

func (djigb *DetectionJobInstanceGroupBy) 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 (*DetectionJobInstanceGroupBy) Float64sX

func (djigb *DetectionJobInstanceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) Int

func (djigb *DetectionJobInstanceGroupBy) 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 (*DetectionJobInstanceGroupBy) IntX

IntX is like Int, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) Ints

func (djigb *DetectionJobInstanceGroupBy) 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 (*DetectionJobInstanceGroupBy) IntsX

func (djigb *DetectionJobInstanceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) Scan

func (djigb *DetectionJobInstanceGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*DetectionJobInstanceGroupBy) ScanX

func (djigb *DetectionJobInstanceGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) String

func (djigb *DetectionJobInstanceGroupBy) 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 (*DetectionJobInstanceGroupBy) StringX

func (djigb *DetectionJobInstanceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DetectionJobInstanceGroupBy) Strings

func (djigb *DetectionJobInstanceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*DetectionJobInstanceGroupBy) StringsX

func (djigb *DetectionJobInstanceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DetectionJobInstanceMutation

type DetectionJobInstanceMutation struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceMutation represents an operation that mutates the DetectionJobInstance nodes in the graph.

func (*DetectionJobInstanceMutation) AddAnomalyIDs

func (m *DetectionJobInstanceMutation) AddAnomalyIDs(ids ...int)

AddAnomalyIDs adds the "anomalies" edge to the Anomaly entity by ids.

func (*DetectionJobInstanceMutation) AddField

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) AddedEdges

func (m *DetectionJobInstanceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DetectionJobInstanceMutation) AddedField

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) AddedFields

func (m *DetectionJobInstanceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DetectionJobInstanceMutation) AddedIDs

func (m *DetectionJobInstanceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DetectionJobInstanceMutation) AnomaliesCleared

func (m *DetectionJobInstanceMutation) AnomaliesCleared() bool

AnomaliesCleared returns if the "anomalies" edge to the Anomaly entity was cleared.

func (*DetectionJobInstanceMutation) AnomaliesIDs

func (m *DetectionJobInstanceMutation) AnomaliesIDs() (ids []int)

AnomaliesIDs returns the "anomalies" edge IDs in the mutation.

func (*DetectionJobInstanceMutation) ClearAnomalies

func (m *DetectionJobInstanceMutation) ClearAnomalies()

ClearAnomalies clears the "anomalies" edge to the Anomaly entity.

func (*DetectionJobInstanceMutation) ClearDetectionJob

func (m *DetectionJobInstanceMutation) ClearDetectionJob()

ClearDetectionJob clears the "detection_job" edge to the DetectionJob entity.

func (*DetectionJobInstanceMutation) ClearEdge

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) ClearField

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) ClearFinishedAt

func (m *DetectionJobInstanceMutation) ClearFinishedAt()

ClearFinishedAt clears the value of the "finished_at" field.

func (*DetectionJobInstanceMutation) ClearStartedAt

func (m *DetectionJobInstanceMutation) ClearStartedAt()

ClearStartedAt clears the value of the "started_at" field.

func (*DetectionJobInstanceMutation) ClearedEdges

func (m *DetectionJobInstanceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DetectionJobInstanceMutation) ClearedFields

func (m *DetectionJobInstanceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) CreateTime

func (m *DetectionJobInstanceMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DetectionJobInstanceMutation) DetectionJobCleared

func (m *DetectionJobInstanceMutation) DetectionJobCleared() bool

DetectionJobCleared returns if the "detection_job" edge to the DetectionJob entity was cleared.

func (*DetectionJobInstanceMutation) DetectionJobID

func (m *DetectionJobInstanceMutation) DetectionJobID() (id int, exists bool)

DetectionJobID returns the "detection_job" edge ID in the mutation.

func (*DetectionJobInstanceMutation) DetectionJobIDs

func (m *DetectionJobInstanceMutation) DetectionJobIDs() (ids []int)

DetectionJobIDs returns the "detection_job" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DetectionJobID instead. It exists only for internal usage by the builders.

func (*DetectionJobInstanceMutation) EdgeCleared

func (m *DetectionJobInstanceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DetectionJobInstanceMutation) Field

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) FieldCleared

func (m *DetectionJobInstanceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DetectionJobInstanceMutation) Fields

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) FinishedAt

func (m *DetectionJobInstanceMutation) FinishedAt() (r time.Time, exists bool)

FinishedAt returns the value of the "finished_at" field in the mutation.

func (*DetectionJobInstanceMutation) FinishedAtCleared

func (m *DetectionJobInstanceMutation) FinishedAtCleared() bool

FinishedAtCleared returns if the "finished_at" field was cleared in this mutation.

func (*DetectionJobInstanceMutation) ID

func (m *DetectionJobInstanceMutation) 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.

func (*DetectionJobInstanceMutation) OldCreateTime

func (m *DetectionJobInstanceMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DetectionJobInstance entity. If the DetectionJobInstance 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 (*DetectionJobInstanceMutation) OldField

func (m *DetectionJobInstanceMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*DetectionJobInstanceMutation) OldFinishedAt

func (m *DetectionJobInstanceMutation) OldFinishedAt(ctx context.Context) (v *time.Time, err error)

OldFinishedAt returns the old "finished_at" field's value of the DetectionJobInstance entity. If the DetectionJobInstance 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 (*DetectionJobInstanceMutation) OldStartedAt

func (m *DetectionJobInstanceMutation) OldStartedAt(ctx context.Context) (v *time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the DetectionJobInstance entity. If the DetectionJobInstance 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 (*DetectionJobInstanceMutation) OldUpdateTime

func (m *DetectionJobInstanceMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the DetectionJobInstance entity. If the DetectionJobInstance 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 (*DetectionJobInstanceMutation) Op

Op returns the operation name.

func (*DetectionJobInstanceMutation) RemoveAnomalyIDs

func (m *DetectionJobInstanceMutation) RemoveAnomalyIDs(ids ...int)

RemoveAnomalyIDs removes the "anomalies" edge to the Anomaly entity by IDs.

func (*DetectionJobInstanceMutation) RemovedAnomaliesIDs

func (m *DetectionJobInstanceMutation) RemovedAnomaliesIDs() (ids []int)

RemovedAnomalies returns the removed IDs of the "anomalies" edge to the Anomaly entity.

func (*DetectionJobInstanceMutation) RemovedEdges

func (m *DetectionJobInstanceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DetectionJobInstanceMutation) RemovedIDs

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) ResetAnomalies

func (m *DetectionJobInstanceMutation) ResetAnomalies()

ResetAnomalies resets all changes to the "anomalies" edge.

func (*DetectionJobInstanceMutation) ResetCreateTime

func (m *DetectionJobInstanceMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DetectionJobInstanceMutation) ResetDetectionJob

func (m *DetectionJobInstanceMutation) ResetDetectionJob()

ResetDetectionJob resets all changes to the "detection_job" edge.

func (*DetectionJobInstanceMutation) ResetEdge

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) ResetField

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) ResetFinishedAt

func (m *DetectionJobInstanceMutation) ResetFinishedAt()

ResetFinishedAt resets all changes to the "finished_at" field.

func (*DetectionJobInstanceMutation) ResetStartedAt

func (m *DetectionJobInstanceMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*DetectionJobInstanceMutation) ResetUpdateTime

func (m *DetectionJobInstanceMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*DetectionJobInstanceMutation) SetCreateTime

func (m *DetectionJobInstanceMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DetectionJobInstanceMutation) SetDetectionJobID

func (m *DetectionJobInstanceMutation) SetDetectionJobID(id int)

SetDetectionJobID sets the "detection_job" edge to the DetectionJob entity by id.

func (*DetectionJobInstanceMutation) SetField

func (m *DetectionJobInstanceMutation) 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 (*DetectionJobInstanceMutation) SetFinishedAt

func (m *DetectionJobInstanceMutation) SetFinishedAt(t time.Time)

SetFinishedAt sets the "finished_at" field.

func (*DetectionJobInstanceMutation) SetStartedAt

func (m *DetectionJobInstanceMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*DetectionJobInstanceMutation) SetUpdateTime

func (m *DetectionJobInstanceMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*DetectionJobInstanceMutation) StartedAt

func (m *DetectionJobInstanceMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*DetectionJobInstanceMutation) StartedAtCleared

func (m *DetectionJobInstanceMutation) StartedAtCleared() bool

StartedAtCleared returns if the "started_at" field was cleared in this mutation.

func (DetectionJobInstanceMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DetectionJobInstanceMutation) Type

Type returns the node type of this mutation (DetectionJobInstance).

func (*DetectionJobInstanceMutation) UpdateTime

func (m *DetectionJobInstanceMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

type DetectionJobInstanceQuery

type DetectionJobInstanceQuery struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceQuery is the builder for querying DetectionJobInstance entities.

func (*DetectionJobInstanceQuery) All

All executes the query and returns a list of DetectionJobInstances.

func (*DetectionJobInstanceQuery) AllX

AllX is like All, but panics if an error occurs.

func (*DetectionJobInstanceQuery) Clone

Clone returns a duplicate of the DetectionJobInstanceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DetectionJobInstanceQuery) Count

func (djiq *DetectionJobInstanceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DetectionJobInstanceQuery) CountX

func (djiq *DetectionJobInstanceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DetectionJobInstanceQuery) Exist

func (djiq *DetectionJobInstanceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DetectionJobInstanceQuery) ExistX

func (djiq *DetectionJobInstanceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DetectionJobInstanceQuery) First

First returns the first DetectionJobInstance entity from the query. Returns a *NotFoundError when no DetectionJobInstance was found.

func (*DetectionJobInstanceQuery) FirstID

func (djiq *DetectionJobInstanceQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first DetectionJobInstance ID from the query. Returns a *NotFoundError when no DetectionJobInstance ID was found.

func (*DetectionJobInstanceQuery) FirstIDX

func (djiq *DetectionJobInstanceQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*DetectionJobInstanceQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*DetectionJobInstanceQuery) GroupBy

func (djiq *DetectionJobInstanceQuery) GroupBy(field string, fields ...string) *DetectionJobInstanceGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DetectionJobInstance.Query().
	GroupBy(detectionjobinstance.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DetectionJobInstanceQuery) IDs

func (djiq *DetectionJobInstanceQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of DetectionJobInstance IDs.

func (*DetectionJobInstanceQuery) IDsX

func (djiq *DetectionJobInstanceQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*DetectionJobInstanceQuery) Limit

Limit adds a limit step to the query.

func (*DetectionJobInstanceQuery) Offset

Offset adds an offset step to the query.

func (*DetectionJobInstanceQuery) Only

Only returns a single DetectionJobInstance entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one DetectionJobInstance entity is not found. Returns a *NotFoundError when no DetectionJobInstance entities are found.

func (*DetectionJobInstanceQuery) OnlyID

func (djiq *DetectionJobInstanceQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only DetectionJobInstance ID in the query. Returns a *NotSingularError when exactly one DetectionJobInstance ID is not found. Returns a *NotFoundError when no entities are found.

func (*DetectionJobInstanceQuery) OnlyIDX

func (djiq *DetectionJobInstanceQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DetectionJobInstanceQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*DetectionJobInstanceQuery) Order

Order adds an order step to the query.

func (*DetectionJobInstanceQuery) QueryAnomalies

func (djiq *DetectionJobInstanceQuery) QueryAnomalies() *AnomalyQuery

QueryAnomalies chains the current query on the "anomalies" edge.

func (*DetectionJobInstanceQuery) QueryDetectionJob

func (djiq *DetectionJobInstanceQuery) QueryDetectionJob() *DetectionJobQuery

QueryDetectionJob chains the current query on the "detection_job" edge.

func (*DetectionJobInstanceQuery) Select

func (djiq *DetectionJobInstanceQuery) Select(field string, fields ...string) *DetectionJobInstanceSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.DetectionJobInstance.Query().
	Select(detectionjobinstance.FieldCreateTime).
	Scan(ctx, &v)

func (*DetectionJobInstanceQuery) Where

Where adds a new predicate for the DetectionJobInstanceQuery builder.

func (*DetectionJobInstanceQuery) WithAnomalies

func (djiq *DetectionJobInstanceQuery) WithAnomalies(opts ...func(*AnomalyQuery)) *DetectionJobInstanceQuery

WithAnomalies tells the query-builder to eager-load the nodes that are connected to the "anomalies" edge. The optional arguments are used to configure the query builder of the edge.

func (*DetectionJobInstanceQuery) WithDetectionJob

func (djiq *DetectionJobInstanceQuery) WithDetectionJob(opts ...func(*DetectionJobQuery)) *DetectionJobInstanceQuery

WithDetectionJob tells the query-builder to eager-load the nodes that are connected to the "detection_job" edge. The optional arguments are used to configure the query builder of the edge.

type DetectionJobInstanceSelect

type DetectionJobInstanceSelect struct {
	*DetectionJobInstanceQuery
	// contains filtered or unexported fields
}

DetectionJobInstanceSelect is the builder for selecting fields of DetectionJobInstance entities.

func (*DetectionJobInstanceSelect) Bool

func (djis *DetectionJobInstanceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) BoolX

BoolX is like Bool, but panics if an error occurs.

func (*DetectionJobInstanceSelect) Bools

func (djis *DetectionJobInstanceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) BoolsX

func (djis *DetectionJobInstanceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DetectionJobInstanceSelect) Float64

func (djis *DetectionJobInstanceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) Float64X

func (djis *DetectionJobInstanceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DetectionJobInstanceSelect) Float64s

func (djis *DetectionJobInstanceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) Float64sX

func (djis *DetectionJobInstanceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DetectionJobInstanceSelect) Int

func (djis *DetectionJobInstanceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) IntX

IntX is like Int, but panics if an error occurs.

func (*DetectionJobInstanceSelect) Ints

func (djis *DetectionJobInstanceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) IntsX

func (djis *DetectionJobInstanceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DetectionJobInstanceSelect) Scan

func (djis *DetectionJobInstanceSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*DetectionJobInstanceSelect) ScanX

func (djis *DetectionJobInstanceSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*DetectionJobInstanceSelect) String

func (djis *DetectionJobInstanceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) StringX

func (djis *DetectionJobInstanceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DetectionJobInstanceSelect) Strings

func (djis *DetectionJobInstanceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DetectionJobInstanceSelect) StringsX

func (djis *DetectionJobInstanceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DetectionJobInstanceUpdate

type DetectionJobInstanceUpdate struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceUpdate is the builder for updating DetectionJobInstance entities.

func (*DetectionJobInstanceUpdate) AddAnomalies

AddAnomalies adds the "anomalies" edges to the Anomaly entity.

func (*DetectionJobInstanceUpdate) AddAnomalyIDs

func (djiu *DetectionJobInstanceUpdate) AddAnomalyIDs(ids ...int) *DetectionJobInstanceUpdate

AddAnomalyIDs adds the "anomalies" edge to the Anomaly entity by IDs.

func (*DetectionJobInstanceUpdate) ClearAnomalies

ClearAnomalies clears all "anomalies" edges to the Anomaly entity.

func (*DetectionJobInstanceUpdate) ClearDetectionJob

func (djiu *DetectionJobInstanceUpdate) ClearDetectionJob() *DetectionJobInstanceUpdate

ClearDetectionJob clears the "detection_job" edge to the DetectionJob entity.

func (*DetectionJobInstanceUpdate) ClearFinishedAt

func (djiu *DetectionJobInstanceUpdate) ClearFinishedAt() *DetectionJobInstanceUpdate

ClearFinishedAt clears the value of the "finished_at" field.

func (*DetectionJobInstanceUpdate) ClearStartedAt

ClearStartedAt clears the value of the "started_at" field.

func (*DetectionJobInstanceUpdate) Exec

Exec executes the query.

func (*DetectionJobInstanceUpdate) ExecX

func (djiu *DetectionJobInstanceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DetectionJobInstanceUpdate) Mutation

Mutation returns the DetectionJobInstanceMutation object of the builder.

func (*DetectionJobInstanceUpdate) RemoveAnomalies

func (djiu *DetectionJobInstanceUpdate) RemoveAnomalies(a ...*Anomaly) *DetectionJobInstanceUpdate

RemoveAnomalies removes "anomalies" edges to Anomaly entities.

func (*DetectionJobInstanceUpdate) RemoveAnomalyIDs

func (djiu *DetectionJobInstanceUpdate) RemoveAnomalyIDs(ids ...int) *DetectionJobInstanceUpdate

RemoveAnomalyIDs removes the "anomalies" edge to Anomaly entities by IDs.

func (*DetectionJobInstanceUpdate) Save

func (djiu *DetectionJobInstanceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DetectionJobInstanceUpdate) SaveX

func (djiu *DetectionJobInstanceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DetectionJobInstanceUpdate) SetDetectionJob

SetDetectionJob sets the "detection_job" edge to the DetectionJob entity.

func (*DetectionJobInstanceUpdate) SetDetectionJobID

func (djiu *DetectionJobInstanceUpdate) SetDetectionJobID(id int) *DetectionJobInstanceUpdate

SetDetectionJobID sets the "detection_job" edge to the DetectionJob entity by ID.

func (*DetectionJobInstanceUpdate) SetFinishedAt

SetFinishedAt sets the "finished_at" field.

func (*DetectionJobInstanceUpdate) SetNillableFinishedAt

func (djiu *DetectionJobInstanceUpdate) SetNillableFinishedAt(t *time.Time) *DetectionJobInstanceUpdate

SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.

func (*DetectionJobInstanceUpdate) SetNillableStartedAt

func (djiu *DetectionJobInstanceUpdate) SetNillableStartedAt(t *time.Time) *DetectionJobInstanceUpdate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*DetectionJobInstanceUpdate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*DetectionJobInstanceUpdate) Where

Where adds a new predicate for the DetectionJobInstanceUpdate builder.

type DetectionJobInstanceUpdateOne

type DetectionJobInstanceUpdateOne struct {
	// contains filtered or unexported fields
}

DetectionJobInstanceUpdateOne is the builder for updating a single DetectionJobInstance entity.

func (*DetectionJobInstanceUpdateOne) AddAnomalies

AddAnomalies adds the "anomalies" edges to the Anomaly entity.

func (*DetectionJobInstanceUpdateOne) AddAnomalyIDs

func (djiuo *DetectionJobInstanceUpdateOne) AddAnomalyIDs(ids ...int) *DetectionJobInstanceUpdateOne

AddAnomalyIDs adds the "anomalies" edge to the Anomaly entity by IDs.

func (*DetectionJobInstanceUpdateOne) ClearAnomalies

ClearAnomalies clears all "anomalies" edges to the Anomaly entity.

func (*DetectionJobInstanceUpdateOne) ClearDetectionJob

ClearDetectionJob clears the "detection_job" edge to the DetectionJob entity.

func (*DetectionJobInstanceUpdateOne) ClearFinishedAt

ClearFinishedAt clears the value of the "finished_at" field.

func (*DetectionJobInstanceUpdateOne) ClearStartedAt

ClearStartedAt clears the value of the "started_at" field.

func (*DetectionJobInstanceUpdateOne) Exec

Exec executes the query on the entity.

func (*DetectionJobInstanceUpdateOne) ExecX

func (djiuo *DetectionJobInstanceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DetectionJobInstanceUpdateOne) Mutation

Mutation returns the DetectionJobInstanceMutation object of the builder.

func (*DetectionJobInstanceUpdateOne) RemoveAnomalies

RemoveAnomalies removes "anomalies" edges to Anomaly entities.

func (*DetectionJobInstanceUpdateOne) RemoveAnomalyIDs

func (djiuo *DetectionJobInstanceUpdateOne) RemoveAnomalyIDs(ids ...int) *DetectionJobInstanceUpdateOne

RemoveAnomalyIDs removes the "anomalies" edge to Anomaly entities by IDs.

func (*DetectionJobInstanceUpdateOne) Save

Save executes the query and returns the updated DetectionJobInstance entity.

func (*DetectionJobInstanceUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*DetectionJobInstanceUpdateOne) SetDetectionJob

SetDetectionJob sets the "detection_job" edge to the DetectionJob entity.

func (*DetectionJobInstanceUpdateOne) SetDetectionJobID

func (djiuo *DetectionJobInstanceUpdateOne) SetDetectionJobID(id int) *DetectionJobInstanceUpdateOne

SetDetectionJobID sets the "detection_job" edge to the DetectionJob entity by ID.

func (*DetectionJobInstanceUpdateOne) SetFinishedAt

SetFinishedAt sets the "finished_at" field.

func (*DetectionJobInstanceUpdateOne) SetNillableFinishedAt

func (djiuo *DetectionJobInstanceUpdateOne) SetNillableFinishedAt(t *time.Time) *DetectionJobInstanceUpdateOne

SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.

func (*DetectionJobInstanceUpdateOne) SetNillableStartedAt

func (djiuo *DetectionJobInstanceUpdateOne) SetNillableStartedAt(t *time.Time) *DetectionJobInstanceUpdateOne

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*DetectionJobInstanceUpdateOne) SetStartedAt

SetStartedAt sets the "started_at" field.

type DetectionJobInstances

type DetectionJobInstances []*DetectionJobInstance

DetectionJobInstances is a parsable slice of DetectionJobInstance.

type DetectionJobMutation

type DetectionJobMutation struct {
	// contains filtered or unexported fields
}

DetectionJobMutation represents an operation that mutates the DetectionJob nodes in the graph.

func (*DetectionJobMutation) AddField

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) AddInstanceIDs

func (m *DetectionJobMutation) AddInstanceIDs(ids ...int)

AddInstanceIDs adds the "instance" edge to the DetectionJobInstance entity by ids.

func (*DetectionJobMutation) AddedEdges

func (m *DetectionJobMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DetectionJobMutation) AddedField

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) AddedFields

func (m *DetectionJobMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DetectionJobMutation) AddedIDs

func (m *DetectionJobMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DetectionJobMutation) Attribute

func (m *DetectionJobMutation) Attribute() (r string, exists bool)

Attribute returns the value of the "attribute" field in the mutation.

func (*DetectionJobMutation) ClearDescription

func (m *DetectionJobMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*DetectionJobMutation) ClearEdge

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) ClearField

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) ClearInstance

func (m *DetectionJobMutation) ClearInstance()

ClearInstance clears the "instance" edge to the DetectionJobInstance entity.

func (*DetectionJobMutation) ClearSchedule

func (m *DetectionJobMutation) ClearSchedule()

ClearSchedule clears the value of the "schedule" field.

func (*DetectionJobMutation) ClearedEdges

func (m *DetectionJobMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DetectionJobMutation) ClearedFields

func (m *DetectionJobMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DetectionJobMutation) Client

func (m DetectionJobMutation) 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 (*DetectionJobMutation) CreateTime

func (m *DetectionJobMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DetectionJobMutation) Description

func (m *DetectionJobMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*DetectionJobMutation) DescriptionCleared

func (m *DetectionJobMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*DetectionJobMutation) EdgeCleared

func (m *DetectionJobMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DetectionJobMutation) Field

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) FieldCleared

func (m *DetectionJobMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DetectionJobMutation) Fields

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) ID

func (m *DetectionJobMutation) 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.

func (*DetectionJobMutation) InstanceCleared

func (m *DetectionJobMutation) InstanceCleared() bool

InstanceCleared returns if the "instance" edge to the DetectionJobInstance entity was cleared.

func (*DetectionJobMutation) InstanceIDs

func (m *DetectionJobMutation) InstanceIDs() (ids []int)

InstanceIDs returns the "instance" edge IDs in the mutation.

func (*DetectionJobMutation) Method

func (m *DetectionJobMutation) Method() (r string, exists bool)

Method returns the value of the "method" field in the mutation.

func (*DetectionJobMutation) Metric

func (m *DetectionJobMutation) Metric() (r string, exists bool)

Metric returns the value of the "metric" field in the mutation.

func (*DetectionJobMutation) OldAttribute

func (m *DetectionJobMutation) OldAttribute(ctx context.Context) (v string, err error)

OldAttribute returns the old "attribute" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldCreateTime

func (m *DetectionJobMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldDescription

func (m *DetectionJobMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldField

func (m *DetectionJobMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*DetectionJobMutation) OldMethod

func (m *DetectionJobMutation) OldMethod(ctx context.Context) (v string, err error)

OldMethod returns the old "method" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldMetric

func (m *DetectionJobMutation) OldMetric(ctx context.Context) (v string, err error)

OldMetric returns the old "metric" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldSchedule

func (m *DetectionJobMutation) OldSchedule(ctx context.Context) (v *string, err error)

OldSchedule returns the old "schedule" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldSiteID

func (m *DetectionJobMutation) OldSiteID(ctx context.Context) (v string, err error)

OldSiteID returns the old "site_id" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldTimeAgo

func (m *DetectionJobMutation) OldTimeAgo(ctx context.Context) (v string, err error)

OldTimeAgo returns the old "time_ago" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldTimeStep

func (m *DetectionJobMutation) OldTimeStep(ctx context.Context) (v string, err error)

OldTimeStep returns the old "time_step" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) OldUpdateTime

func (m *DetectionJobMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the DetectionJob entity. If the DetectionJob 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 (*DetectionJobMutation) Op

func (m *DetectionJobMutation) Op() Op

Op returns the operation name.

func (*DetectionJobMutation) RemoveInstanceIDs

func (m *DetectionJobMutation) RemoveInstanceIDs(ids ...int)

RemoveInstanceIDs removes the "instance" edge to the DetectionJobInstance entity by IDs.

func (*DetectionJobMutation) RemovedEdges

func (m *DetectionJobMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DetectionJobMutation) RemovedIDs

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) RemovedInstanceIDs

func (m *DetectionJobMutation) RemovedInstanceIDs() (ids []int)

RemovedInstance returns the removed IDs of the "instance" edge to the DetectionJobInstance entity.

func (*DetectionJobMutation) ResetAttribute

func (m *DetectionJobMutation) ResetAttribute()

ResetAttribute resets all changes to the "attribute" field.

func (*DetectionJobMutation) ResetCreateTime

func (m *DetectionJobMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DetectionJobMutation) ResetDescription

func (m *DetectionJobMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*DetectionJobMutation) ResetEdge

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) ResetField

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) ResetInstance

func (m *DetectionJobMutation) ResetInstance()

ResetInstance resets all changes to the "instance" edge.

func (*DetectionJobMutation) ResetMethod

func (m *DetectionJobMutation) ResetMethod()

ResetMethod resets all changes to the "method" field.

func (*DetectionJobMutation) ResetMetric

func (m *DetectionJobMutation) ResetMetric()

ResetMetric resets all changes to the "metric" field.

func (*DetectionJobMutation) ResetSchedule

func (m *DetectionJobMutation) ResetSchedule()

ResetSchedule resets all changes to the "schedule" field.

func (*DetectionJobMutation) ResetSiteID

func (m *DetectionJobMutation) ResetSiteID()

ResetSiteID resets all changes to the "site_id" field.

func (*DetectionJobMutation) ResetTimeAgo

func (m *DetectionJobMutation) ResetTimeAgo()

ResetTimeAgo resets all changes to the "time_ago" field.

func (*DetectionJobMutation) ResetTimeStep

func (m *DetectionJobMutation) ResetTimeStep()

ResetTimeStep resets all changes to the "time_step" field.

func (*DetectionJobMutation) ResetUpdateTime

func (m *DetectionJobMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*DetectionJobMutation) Schedule

func (m *DetectionJobMutation) Schedule() (r string, exists bool)

Schedule returns the value of the "schedule" field in the mutation.

func (*DetectionJobMutation) ScheduleCleared

func (m *DetectionJobMutation) ScheduleCleared() bool

ScheduleCleared returns if the "schedule" field was cleared in this mutation.

func (*DetectionJobMutation) SetAttribute

func (m *DetectionJobMutation) SetAttribute(s string)

SetAttribute sets the "attribute" field.

func (*DetectionJobMutation) SetCreateTime

func (m *DetectionJobMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DetectionJobMutation) SetDescription

func (m *DetectionJobMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*DetectionJobMutation) SetField

func (m *DetectionJobMutation) 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 (*DetectionJobMutation) SetMethod

func (m *DetectionJobMutation) SetMethod(s string)

SetMethod sets the "method" field.

func (*DetectionJobMutation) SetMetric

func (m *DetectionJobMutation) SetMetric(s string)

SetMetric sets the "metric" field.

func (*DetectionJobMutation) SetSchedule

func (m *DetectionJobMutation) SetSchedule(s string)

SetSchedule sets the "schedule" field.

func (*DetectionJobMutation) SetSiteID

func (m *DetectionJobMutation) SetSiteID(s string)

SetSiteID sets the "site_id" field.

func (*DetectionJobMutation) SetTimeAgo

func (m *DetectionJobMutation) SetTimeAgo(s string)

SetTimeAgo sets the "time_ago" field.

func (*DetectionJobMutation) SetTimeStep

func (m *DetectionJobMutation) SetTimeStep(s string)

SetTimeStep sets the "time_step" field.

func (*DetectionJobMutation) SetUpdateTime

func (m *DetectionJobMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*DetectionJobMutation) SiteID

func (m *DetectionJobMutation) SiteID() (r string, exists bool)

SiteID returns the value of the "site_id" field in the mutation.

func (*DetectionJobMutation) TimeAgo

func (m *DetectionJobMutation) TimeAgo() (r string, exists bool)

TimeAgo returns the value of the "time_ago" field in the mutation.

func (*DetectionJobMutation) TimeStep

func (m *DetectionJobMutation) TimeStep() (r string, exists bool)

TimeStep returns the value of the "time_step" field in the mutation.

func (DetectionJobMutation) Tx

func (m DetectionJobMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DetectionJobMutation) Type

func (m *DetectionJobMutation) Type() string

Type returns the node type of this mutation (DetectionJob).

func (*DetectionJobMutation) UpdateTime

func (m *DetectionJobMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

type DetectionJobQuery

type DetectionJobQuery struct {
	// contains filtered or unexported fields
}

DetectionJobQuery is the builder for querying DetectionJob entities.

func (*DetectionJobQuery) All

func (djq *DetectionJobQuery) All(ctx context.Context) ([]*DetectionJob, error)

All executes the query and returns a list of DetectionJobs.

func (*DetectionJobQuery) AllX

func (djq *DetectionJobQuery) AllX(ctx context.Context) []*DetectionJob

AllX is like All, but panics if an error occurs.

func (*DetectionJobQuery) Clone

func (djq *DetectionJobQuery) Clone() *DetectionJobQuery

Clone returns a duplicate of the DetectionJobQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DetectionJobQuery) Count

func (djq *DetectionJobQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DetectionJobQuery) CountX

func (djq *DetectionJobQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DetectionJobQuery) Exist

func (djq *DetectionJobQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DetectionJobQuery) ExistX

func (djq *DetectionJobQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DetectionJobQuery) First

func (djq *DetectionJobQuery) First(ctx context.Context) (*DetectionJob, error)

First returns the first DetectionJob entity from the query. Returns a *NotFoundError when no DetectionJob was found.

func (*DetectionJobQuery) FirstID

func (djq *DetectionJobQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first DetectionJob ID from the query. Returns a *NotFoundError when no DetectionJob ID was found.

func (*DetectionJobQuery) FirstIDX

func (djq *DetectionJobQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*DetectionJobQuery) FirstX

func (djq *DetectionJobQuery) FirstX(ctx context.Context) *DetectionJob

FirstX is like First, but panics if an error occurs.

func (*DetectionJobQuery) GroupBy

func (djq *DetectionJobQuery) GroupBy(field string, fields ...string) *DetectionJobGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DetectionJob.Query().
	GroupBy(detectionjob.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DetectionJobQuery) IDs

func (djq *DetectionJobQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of DetectionJob IDs.

func (*DetectionJobQuery) IDsX

func (djq *DetectionJobQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*DetectionJobQuery) Limit

func (djq *DetectionJobQuery) Limit(limit int) *DetectionJobQuery

Limit adds a limit step to the query.

func (*DetectionJobQuery) Offset

func (djq *DetectionJobQuery) Offset(offset int) *DetectionJobQuery

Offset adds an offset step to the query.

func (*DetectionJobQuery) Only

func (djq *DetectionJobQuery) Only(ctx context.Context) (*DetectionJob, error)

Only returns a single DetectionJob entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one DetectionJob entity is not found. Returns a *NotFoundError when no DetectionJob entities are found.

func (*DetectionJobQuery) OnlyID

func (djq *DetectionJobQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only DetectionJob ID in the query. Returns a *NotSingularError when exactly one DetectionJob ID is not found. Returns a *NotFoundError when no entities are found.

func (*DetectionJobQuery) OnlyIDX

func (djq *DetectionJobQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DetectionJobQuery) OnlyX

func (djq *DetectionJobQuery) OnlyX(ctx context.Context) *DetectionJob

OnlyX is like Only, but panics if an error occurs.

func (*DetectionJobQuery) Order

func (djq *DetectionJobQuery) Order(o ...OrderFunc) *DetectionJobQuery

Order adds an order step to the query.

func (*DetectionJobQuery) QueryInstance

func (djq *DetectionJobQuery) QueryInstance() *DetectionJobInstanceQuery

QueryInstance chains the current query on the "instance" edge.

func (*DetectionJobQuery) Select

func (djq *DetectionJobQuery) Select(field string, fields ...string) *DetectionJobSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.DetectionJob.Query().
	Select(detectionjob.FieldCreateTime).
	Scan(ctx, &v)

func (*DetectionJobQuery) Where

Where adds a new predicate for the DetectionJobQuery builder.

func (*DetectionJobQuery) WithInstance

func (djq *DetectionJobQuery) WithInstance(opts ...func(*DetectionJobInstanceQuery)) *DetectionJobQuery

WithInstance tells the query-builder to eager-load the nodes that are connected to the "instance" edge. The optional arguments are used to configure the query builder of the edge.

type DetectionJobSelect

type DetectionJobSelect struct {
	*DetectionJobQuery
	// contains filtered or unexported fields
}

DetectionJobSelect is the builder for selecting fields of DetectionJob entities.

func (*DetectionJobSelect) Bool

func (djs *DetectionJobSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) BoolX

func (djs *DetectionJobSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DetectionJobSelect) Bools

func (djs *DetectionJobSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) BoolsX

func (djs *DetectionJobSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DetectionJobSelect) Float64

func (djs *DetectionJobSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) Float64X

func (djs *DetectionJobSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DetectionJobSelect) Float64s

func (djs *DetectionJobSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) Float64sX

func (djs *DetectionJobSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DetectionJobSelect) Int

func (djs *DetectionJobSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) IntX

func (djs *DetectionJobSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DetectionJobSelect) Ints

func (djs *DetectionJobSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) IntsX

func (djs *DetectionJobSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DetectionJobSelect) Scan

func (djs *DetectionJobSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*DetectionJobSelect) ScanX

func (djs *DetectionJobSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*DetectionJobSelect) String

func (djs *DetectionJobSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) StringX

func (djs *DetectionJobSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DetectionJobSelect) Strings

func (djs *DetectionJobSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DetectionJobSelect) StringsX

func (djs *DetectionJobSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DetectionJobUpdate

type DetectionJobUpdate struct {
	// contains filtered or unexported fields
}

DetectionJobUpdate is the builder for updating DetectionJob entities.

func (*DetectionJobUpdate) AddInstance

AddInstance adds the "instance" edges to the DetectionJobInstance entity.

func (*DetectionJobUpdate) AddInstanceIDs

func (dju *DetectionJobUpdate) AddInstanceIDs(ids ...int) *DetectionJobUpdate

AddInstanceIDs adds the "instance" edge to the DetectionJobInstance entity by IDs.

func (*DetectionJobUpdate) ClearDescription

func (dju *DetectionJobUpdate) ClearDescription() *DetectionJobUpdate

ClearDescription clears the value of the "description" field.

func (*DetectionJobUpdate) ClearInstance

func (dju *DetectionJobUpdate) ClearInstance() *DetectionJobUpdate

ClearInstance clears all "instance" edges to the DetectionJobInstance entity.

func (*DetectionJobUpdate) ClearSchedule

func (dju *DetectionJobUpdate) ClearSchedule() *DetectionJobUpdate

ClearSchedule clears the value of the "schedule" field.

func (*DetectionJobUpdate) Exec

func (dju *DetectionJobUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DetectionJobUpdate) ExecX

func (dju *DetectionJobUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DetectionJobUpdate) Mutation

func (dju *DetectionJobUpdate) Mutation() *DetectionJobMutation

Mutation returns the DetectionJobMutation object of the builder.

func (*DetectionJobUpdate) RemoveInstance

func (dju *DetectionJobUpdate) RemoveInstance(d ...*DetectionJobInstance) *DetectionJobUpdate

RemoveInstance removes "instance" edges to DetectionJobInstance entities.

func (*DetectionJobUpdate) RemoveInstanceIDs

func (dju *DetectionJobUpdate) RemoveInstanceIDs(ids ...int) *DetectionJobUpdate

RemoveInstanceIDs removes the "instance" edge to DetectionJobInstance entities by IDs.

func (*DetectionJobUpdate) Save

func (dju *DetectionJobUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DetectionJobUpdate) SaveX

func (dju *DetectionJobUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DetectionJobUpdate) SetAttribute

func (dju *DetectionJobUpdate) SetAttribute(s string) *DetectionJobUpdate

SetAttribute sets the "attribute" field.

func (*DetectionJobUpdate) SetDescription

func (dju *DetectionJobUpdate) SetDescription(s string) *DetectionJobUpdate

SetDescription sets the "description" field.

func (*DetectionJobUpdate) SetMethod

func (dju *DetectionJobUpdate) SetMethod(s string) *DetectionJobUpdate

SetMethod sets the "method" field.

func (*DetectionJobUpdate) SetMetric

func (dju *DetectionJobUpdate) SetMetric(s string) *DetectionJobUpdate

SetMetric sets the "metric" field.

func (*DetectionJobUpdate) SetNillableDescription

func (dju *DetectionJobUpdate) SetNillableDescription(s *string) *DetectionJobUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DetectionJobUpdate) SetNillableSchedule

func (dju *DetectionJobUpdate) SetNillableSchedule(s *string) *DetectionJobUpdate

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*DetectionJobUpdate) SetSchedule

func (dju *DetectionJobUpdate) SetSchedule(s string) *DetectionJobUpdate

SetSchedule sets the "schedule" field.

func (*DetectionJobUpdate) SetSiteID

func (dju *DetectionJobUpdate) SetSiteID(s string) *DetectionJobUpdate

SetSiteID sets the "site_id" field.

func (*DetectionJobUpdate) SetTimeAgo

func (dju *DetectionJobUpdate) SetTimeAgo(s string) *DetectionJobUpdate

SetTimeAgo sets the "time_ago" field.

func (*DetectionJobUpdate) SetTimeStep

func (dju *DetectionJobUpdate) SetTimeStep(s string) *DetectionJobUpdate

SetTimeStep sets the "time_step" field.

func (*DetectionJobUpdate) Where

Where adds a new predicate for the DetectionJobUpdate builder.

type DetectionJobUpdateOne

type DetectionJobUpdateOne struct {
	// contains filtered or unexported fields
}

DetectionJobUpdateOne is the builder for updating a single DetectionJob entity.

func (*DetectionJobUpdateOne) AddInstance

AddInstance adds the "instance" edges to the DetectionJobInstance entity.

func (*DetectionJobUpdateOne) AddInstanceIDs

func (djuo *DetectionJobUpdateOne) AddInstanceIDs(ids ...int) *DetectionJobUpdateOne

AddInstanceIDs adds the "instance" edge to the DetectionJobInstance entity by IDs.

func (*DetectionJobUpdateOne) ClearDescription

func (djuo *DetectionJobUpdateOne) ClearDescription() *DetectionJobUpdateOne

ClearDescription clears the value of the "description" field.

func (*DetectionJobUpdateOne) ClearInstance

func (djuo *DetectionJobUpdateOne) ClearInstance() *DetectionJobUpdateOne

ClearInstance clears all "instance" edges to the DetectionJobInstance entity.

func (*DetectionJobUpdateOne) ClearSchedule

func (djuo *DetectionJobUpdateOne) ClearSchedule() *DetectionJobUpdateOne

ClearSchedule clears the value of the "schedule" field.

func (*DetectionJobUpdateOne) Exec

func (djuo *DetectionJobUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DetectionJobUpdateOne) ExecX

func (djuo *DetectionJobUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DetectionJobUpdateOne) Mutation

func (djuo *DetectionJobUpdateOne) Mutation() *DetectionJobMutation

Mutation returns the DetectionJobMutation object of the builder.

func (*DetectionJobUpdateOne) RemoveInstance

RemoveInstance removes "instance" edges to DetectionJobInstance entities.

func (*DetectionJobUpdateOne) RemoveInstanceIDs

func (djuo *DetectionJobUpdateOne) RemoveInstanceIDs(ids ...int) *DetectionJobUpdateOne

RemoveInstanceIDs removes the "instance" edge to DetectionJobInstance entities by IDs.

func (*DetectionJobUpdateOne) Save

Save executes the query and returns the updated DetectionJob entity.

func (*DetectionJobUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*DetectionJobUpdateOne) SetAttribute

func (djuo *DetectionJobUpdateOne) SetAttribute(s string) *DetectionJobUpdateOne

SetAttribute sets the "attribute" field.

func (*DetectionJobUpdateOne) SetDescription

func (djuo *DetectionJobUpdateOne) SetDescription(s string) *DetectionJobUpdateOne

SetDescription sets the "description" field.

func (*DetectionJobUpdateOne) SetMethod

SetMethod sets the "method" field.

func (*DetectionJobUpdateOne) SetMetric

SetMetric sets the "metric" field.

func (*DetectionJobUpdateOne) SetNillableDescription

func (djuo *DetectionJobUpdateOne) SetNillableDescription(s *string) *DetectionJobUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DetectionJobUpdateOne) SetNillableSchedule

func (djuo *DetectionJobUpdateOne) SetNillableSchedule(s *string) *DetectionJobUpdateOne

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*DetectionJobUpdateOne) SetSchedule

func (djuo *DetectionJobUpdateOne) SetSchedule(s string) *DetectionJobUpdateOne

SetSchedule sets the "schedule" field.

func (*DetectionJobUpdateOne) SetSiteID

SetSiteID sets the "site_id" field.

func (*DetectionJobUpdateOne) SetTimeAgo

func (djuo *DetectionJobUpdateOne) SetTimeAgo(s string) *DetectionJobUpdateOne

SetTimeAgo sets the "time_ago" field.

func (*DetectionJobUpdateOne) SetTimeStep

func (djuo *DetectionJobUpdateOne) SetTimeStep(s string) *DetectionJobUpdateOne

SetTimeStep sets the "time_step" field.

type DetectionJobs

type DetectionJobs []*DetectionJob

DetectionJobs is a parsable slice of DetectionJob.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

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 Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector, func(string) bool)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

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.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Tx

type Tx struct {

	// Anomaly is the client for interacting with the Anomaly builders.
	Anomaly *AnomalyClient
	// DetectionJob is the client for interacting with the DetectionJob builders.
	DetectionJob *DetectionJobClient
	// DetectionJobInstance is the client for interacting with the DetectionJobInstance builders.
	DetectionJobInstance *DetectionJobInstanceClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL