ent

package
v1.4.4-rc3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 23 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.
	TypeAlert    = "Alert"
	TypeBouncer  = "Bouncer"
	TypeDecision = "Decision"
	TypeEvent    = "Event"
	TypeMachine  = "Machine"
	TypeMeta     = "Meta"
)

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 validation 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) 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 Alert

type Alert struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// Scenario holds the value of the "scenario" field.
	Scenario string `json:"scenario,omitempty"`
	// BucketId holds the value of the "bucketId" field.
	BucketId string `json:"bucketId,omitempty"`
	// Message holds the value of the "message" field.
	Message string `json:"message,omitempty"`
	// EventsCount holds the value of the "eventsCount" field.
	EventsCount int32 `json:"eventsCount,omitempty"`
	// StartedAt holds the value of the "startedAt" field.
	StartedAt time.Time `json:"startedAt,omitempty"`
	// StoppedAt holds the value of the "stoppedAt" field.
	StoppedAt time.Time `json:"stoppedAt,omitempty"`
	// SourceIp holds the value of the "sourceIp" field.
	SourceIp string `json:"sourceIp,omitempty"`
	// SourceRange holds the value of the "sourceRange" field.
	SourceRange string `json:"sourceRange,omitempty"`
	// SourceAsNumber holds the value of the "sourceAsNumber" field.
	SourceAsNumber string `json:"sourceAsNumber,omitempty"`
	// SourceAsName holds the value of the "sourceAsName" field.
	SourceAsName string `json:"sourceAsName,omitempty"`
	// SourceCountry holds the value of the "sourceCountry" field.
	SourceCountry string `json:"sourceCountry,omitempty"`
	// SourceLatitude holds the value of the "sourceLatitude" field.
	SourceLatitude float32 `json:"sourceLatitude,omitempty"`
	// SourceLongitude holds the value of the "sourceLongitude" field.
	SourceLongitude float32 `json:"sourceLongitude,omitempty"`
	// SourceScope holds the value of the "sourceScope" field.
	SourceScope string `json:"sourceScope,omitempty"`
	// SourceValue holds the value of the "sourceValue" field.
	SourceValue string `json:"sourceValue,omitempty"`
	// Capacity holds the value of the "capacity" field.
	Capacity int32 `json:"capacity,omitempty"`
	// LeakSpeed holds the value of the "leakSpeed" field.
	LeakSpeed string `json:"leakSpeed,omitempty"`
	// ScenarioVersion holds the value of the "scenarioVersion" field.
	ScenarioVersion string `json:"scenarioVersion,omitempty"`
	// ScenarioHash holds the value of the "scenarioHash" field.
	ScenarioHash string `json:"scenarioHash,omitempty"`
	// Simulated holds the value of the "simulated" field.
	Simulated bool `json:"simulated,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AlertQuery when eager-loading is set.
	Edges AlertEdges `json:"edges"`
	// contains filtered or unexported fields
}

Alert is the model entity for the Alert schema.

func (*Alert) QueryDecisions

func (a *Alert) QueryDecisions() *DecisionQuery

QueryDecisions queries the "decisions" edge of the Alert entity.

func (*Alert) QueryEvents

func (a *Alert) QueryEvents() *EventQuery

QueryEvents queries the "events" edge of the Alert entity.

func (*Alert) QueryMetas

func (a *Alert) QueryMetas() *MetaQuery

QueryMetas queries the "metas" edge of the Alert entity.

func (*Alert) QueryOwner

func (a *Alert) QueryOwner() *MachineQuery

QueryOwner queries the "owner" edge of the Alert entity.

func (*Alert) String

func (a *Alert) String() string

String implements the fmt.Stringer.

func (*Alert) Unwrap

func (a *Alert) Unwrap() *Alert

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

func (a *Alert) Update() *AlertUpdateOne

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

type AlertClient

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

AlertClient is a client for the Alert schema.

func NewAlertClient

func NewAlertClient(c config) *AlertClient

NewAlertClient returns a client for the Alert from the given config.

func (*AlertClient) Create

func (c *AlertClient) Create() *AlertCreate

Create returns a builder for creating a Alert entity.

func (*AlertClient) CreateBulk

func (c *AlertClient) CreateBulk(builders ...*AlertCreate) *AlertCreateBulk

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

func (*AlertClient) Delete

func (c *AlertClient) Delete() *AlertDelete

Delete returns a delete builder for Alert.

func (*AlertClient) DeleteOne

func (c *AlertClient) DeleteOne(a *Alert) *AlertDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AlertClient) DeleteOneID

func (c *AlertClient) DeleteOneID(id int) *AlertDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*AlertClient) Get

func (c *AlertClient) Get(ctx context.Context, id int) (*Alert, error)

Get returns a Alert entity by its id.

func (*AlertClient) GetX

func (c *AlertClient) GetX(ctx context.Context, id int) *Alert

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

func (*AlertClient) Hooks

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

Hooks returns the client hooks.

func (*AlertClient) Query

func (c *AlertClient) Query() *AlertQuery

Query returns a query builder for Alert.

func (*AlertClient) QueryDecisions

func (c *AlertClient) QueryDecisions(a *Alert) *DecisionQuery

QueryDecisions queries the decisions edge of a Alert.

func (*AlertClient) QueryEvents

func (c *AlertClient) QueryEvents(a *Alert) *EventQuery

QueryEvents queries the events edge of a Alert.

func (*AlertClient) QueryMetas

func (c *AlertClient) QueryMetas(a *Alert) *MetaQuery

QueryMetas queries the metas edge of a Alert.

func (*AlertClient) QueryOwner

func (c *AlertClient) QueryOwner(a *Alert) *MachineQuery

QueryOwner queries the owner edge of a Alert.

func (*AlertClient) Update

func (c *AlertClient) Update() *AlertUpdate

Update returns an update builder for Alert.

func (*AlertClient) UpdateOne

func (c *AlertClient) UpdateOne(a *Alert) *AlertUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AlertClient) UpdateOneID

func (c *AlertClient) UpdateOneID(id int) *AlertUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AlertClient) Use

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

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

type AlertCreate

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

AlertCreate is the builder for creating a Alert entity.

func (*AlertCreate) AddDecisionIDs

func (ac *AlertCreate) AddDecisionIDs(ids ...int) *AlertCreate

AddDecisionIDs adds the "decisions" edge to the Decision entity by IDs.

func (*AlertCreate) AddDecisions

func (ac *AlertCreate) AddDecisions(d ...*Decision) *AlertCreate

AddDecisions adds the "decisions" edges to the Decision entity.

func (*AlertCreate) AddEventIDs

func (ac *AlertCreate) AddEventIDs(ids ...int) *AlertCreate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*AlertCreate) AddEvents

func (ac *AlertCreate) AddEvents(e ...*Event) *AlertCreate

AddEvents adds the "events" edges to the Event entity.

func (*AlertCreate) AddMetaIDs

func (ac *AlertCreate) AddMetaIDs(ids ...int) *AlertCreate

AddMetaIDs adds the "metas" edge to the Meta entity by IDs.

func (*AlertCreate) AddMetas

func (ac *AlertCreate) AddMetas(m ...*Meta) *AlertCreate

AddMetas adds the "metas" edges to the Meta entity.

func (*AlertCreate) Exec added in v1.2.1

func (ac *AlertCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AlertCreate) ExecX added in v1.2.1

func (ac *AlertCreate) ExecX(ctx context.Context)

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

func (*AlertCreate) Mutation

func (ac *AlertCreate) Mutation() *AlertMutation

Mutation returns the AlertMutation object of the builder.

func (*AlertCreate) Save

func (ac *AlertCreate) Save(ctx context.Context) (*Alert, error)

Save creates the Alert in the database.

func (*AlertCreate) SaveX

func (ac *AlertCreate) SaveX(ctx context.Context) *Alert

SaveX calls Save and panics if Save returns an error.

func (*AlertCreate) SetBucketId

func (ac *AlertCreate) SetBucketId(s string) *AlertCreate

SetBucketId sets the "bucketId" field.

func (*AlertCreate) SetCapacity

func (ac *AlertCreate) SetCapacity(i int32) *AlertCreate

SetCapacity sets the "capacity" field.

func (*AlertCreate) SetCreatedAt

func (ac *AlertCreate) SetCreatedAt(t time.Time) *AlertCreate

SetCreatedAt sets the "created_at" field.

func (*AlertCreate) SetEventsCount

func (ac *AlertCreate) SetEventsCount(i int32) *AlertCreate

SetEventsCount sets the "eventsCount" field.

func (*AlertCreate) SetLeakSpeed

func (ac *AlertCreate) SetLeakSpeed(s string) *AlertCreate

SetLeakSpeed sets the "leakSpeed" field.

func (*AlertCreate) SetMessage

func (ac *AlertCreate) SetMessage(s string) *AlertCreate

SetMessage sets the "message" field.

func (*AlertCreate) SetNillableBucketId

func (ac *AlertCreate) SetNillableBucketId(s *string) *AlertCreate

SetNillableBucketId sets the "bucketId" field if the given value is not nil.

func (*AlertCreate) SetNillableCapacity

func (ac *AlertCreate) SetNillableCapacity(i *int32) *AlertCreate

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*AlertCreate) SetNillableCreatedAt

func (ac *AlertCreate) SetNillableCreatedAt(t *time.Time) *AlertCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AlertCreate) SetNillableEventsCount

func (ac *AlertCreate) SetNillableEventsCount(i *int32) *AlertCreate

SetNillableEventsCount sets the "eventsCount" field if the given value is not nil.

func (*AlertCreate) SetNillableLeakSpeed

func (ac *AlertCreate) SetNillableLeakSpeed(s *string) *AlertCreate

SetNillableLeakSpeed sets the "leakSpeed" field if the given value is not nil.

func (*AlertCreate) SetNillableMessage

func (ac *AlertCreate) SetNillableMessage(s *string) *AlertCreate

SetNillableMessage sets the "message" field if the given value is not nil.

func (*AlertCreate) SetNillableOwnerID

func (ac *AlertCreate) SetNillableOwnerID(id *int) *AlertCreate

SetNillableOwnerID sets the "owner" edge to the Machine entity by ID if the given value is not nil.

func (*AlertCreate) SetNillableScenarioHash

func (ac *AlertCreate) SetNillableScenarioHash(s *string) *AlertCreate

SetNillableScenarioHash sets the "scenarioHash" field if the given value is not nil.

func (*AlertCreate) SetNillableScenarioVersion

func (ac *AlertCreate) SetNillableScenarioVersion(s *string) *AlertCreate

SetNillableScenarioVersion sets the "scenarioVersion" field if the given value is not nil.

func (*AlertCreate) SetNillableSimulated

func (ac *AlertCreate) SetNillableSimulated(b *bool) *AlertCreate

SetNillableSimulated sets the "simulated" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceAsName

func (ac *AlertCreate) SetNillableSourceAsName(s *string) *AlertCreate

SetNillableSourceAsName sets the "sourceAsName" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceAsNumber

func (ac *AlertCreate) SetNillableSourceAsNumber(s *string) *AlertCreate

SetNillableSourceAsNumber sets the "sourceAsNumber" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceCountry

func (ac *AlertCreate) SetNillableSourceCountry(s *string) *AlertCreate

SetNillableSourceCountry sets the "sourceCountry" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceIp

func (ac *AlertCreate) SetNillableSourceIp(s *string) *AlertCreate

SetNillableSourceIp sets the "sourceIp" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceLatitude

func (ac *AlertCreate) SetNillableSourceLatitude(f *float32) *AlertCreate

SetNillableSourceLatitude sets the "sourceLatitude" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceLongitude

func (ac *AlertCreate) SetNillableSourceLongitude(f *float32) *AlertCreate

SetNillableSourceLongitude sets the "sourceLongitude" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceRange

func (ac *AlertCreate) SetNillableSourceRange(s *string) *AlertCreate

SetNillableSourceRange sets the "sourceRange" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceScope

func (ac *AlertCreate) SetNillableSourceScope(s *string) *AlertCreate

SetNillableSourceScope sets the "sourceScope" field if the given value is not nil.

func (*AlertCreate) SetNillableSourceValue

func (ac *AlertCreate) SetNillableSourceValue(s *string) *AlertCreate

SetNillableSourceValue sets the "sourceValue" field if the given value is not nil.

func (*AlertCreate) SetNillableStartedAt

func (ac *AlertCreate) SetNillableStartedAt(t *time.Time) *AlertCreate

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

func (*AlertCreate) SetNillableStoppedAt

func (ac *AlertCreate) SetNillableStoppedAt(t *time.Time) *AlertCreate

SetNillableStoppedAt sets the "stoppedAt" field if the given value is not nil.

func (*AlertCreate) SetNillableUpdatedAt

func (ac *AlertCreate) SetNillableUpdatedAt(t *time.Time) *AlertCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*AlertCreate) SetOwner

func (ac *AlertCreate) SetOwner(m *Machine) *AlertCreate

SetOwner sets the "owner" edge to the Machine entity.

func (*AlertCreate) SetOwnerID

func (ac *AlertCreate) SetOwnerID(id int) *AlertCreate

SetOwnerID sets the "owner" edge to the Machine entity by ID.

func (*AlertCreate) SetScenario

func (ac *AlertCreate) SetScenario(s string) *AlertCreate

SetScenario sets the "scenario" field.

func (*AlertCreate) SetScenarioHash

func (ac *AlertCreate) SetScenarioHash(s string) *AlertCreate

SetScenarioHash sets the "scenarioHash" field.

func (*AlertCreate) SetScenarioVersion

func (ac *AlertCreate) SetScenarioVersion(s string) *AlertCreate

SetScenarioVersion sets the "scenarioVersion" field.

func (*AlertCreate) SetSimulated

func (ac *AlertCreate) SetSimulated(b bool) *AlertCreate

SetSimulated sets the "simulated" field.

func (*AlertCreate) SetSourceAsName

func (ac *AlertCreate) SetSourceAsName(s string) *AlertCreate

SetSourceAsName sets the "sourceAsName" field.

func (*AlertCreate) SetSourceAsNumber

func (ac *AlertCreate) SetSourceAsNumber(s string) *AlertCreate

SetSourceAsNumber sets the "sourceAsNumber" field.

func (*AlertCreate) SetSourceCountry

func (ac *AlertCreate) SetSourceCountry(s string) *AlertCreate

SetSourceCountry sets the "sourceCountry" field.

func (*AlertCreate) SetSourceIp

func (ac *AlertCreate) SetSourceIp(s string) *AlertCreate

SetSourceIp sets the "sourceIp" field.

func (*AlertCreate) SetSourceLatitude

func (ac *AlertCreate) SetSourceLatitude(f float32) *AlertCreate

SetSourceLatitude sets the "sourceLatitude" field.

func (*AlertCreate) SetSourceLongitude

func (ac *AlertCreate) SetSourceLongitude(f float32) *AlertCreate

SetSourceLongitude sets the "sourceLongitude" field.

func (*AlertCreate) SetSourceRange

func (ac *AlertCreate) SetSourceRange(s string) *AlertCreate

SetSourceRange sets the "sourceRange" field.

func (*AlertCreate) SetSourceScope

func (ac *AlertCreate) SetSourceScope(s string) *AlertCreate

SetSourceScope sets the "sourceScope" field.

func (*AlertCreate) SetSourceValue

func (ac *AlertCreate) SetSourceValue(s string) *AlertCreate

SetSourceValue sets the "sourceValue" field.

func (*AlertCreate) SetStartedAt

func (ac *AlertCreate) SetStartedAt(t time.Time) *AlertCreate

SetStartedAt sets the "startedAt" field.

func (*AlertCreate) SetStoppedAt

func (ac *AlertCreate) SetStoppedAt(t time.Time) *AlertCreate

SetStoppedAt sets the "stoppedAt" field.

func (*AlertCreate) SetUpdatedAt

func (ac *AlertCreate) SetUpdatedAt(t time.Time) *AlertCreate

SetUpdatedAt sets the "updated_at" field.

type AlertCreateBulk

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

AlertCreateBulk is the builder for creating many Alert entities in bulk.

func (*AlertCreateBulk) Exec added in v1.2.1

func (acb *AlertCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AlertCreateBulk) ExecX added in v1.2.1

func (acb *AlertCreateBulk) ExecX(ctx context.Context)

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

func (*AlertCreateBulk) Save

func (acb *AlertCreateBulk) Save(ctx context.Context) ([]*Alert, error)

Save creates the Alert entities in the database.

func (*AlertCreateBulk) SaveX

func (acb *AlertCreateBulk) SaveX(ctx context.Context) []*Alert

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

type AlertDelete

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

AlertDelete is the builder for deleting a Alert entity.

func (*AlertDelete) Exec

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

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

func (*AlertDelete) ExecX

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

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

func (*AlertDelete) Where

func (ad *AlertDelete) Where(ps ...predicate.Alert) *AlertDelete

Where appends a list predicates to the AlertDelete builder.

type AlertDeleteOne

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

AlertDeleteOne is the builder for deleting a single Alert entity.

func (*AlertDeleteOne) Exec

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

Exec executes the deletion query.

func (*AlertDeleteOne) ExecX

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

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

type AlertEdges

type AlertEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Machine `json:"owner,omitempty"`
	// Decisions holds the value of the decisions edge.
	Decisions []*Decision `json:"decisions,omitempty"`
	// Events holds the value of the events edge.
	Events []*Event `json:"events,omitempty"`
	// Metas holds the value of the metas edge.
	Metas []*Meta `json:"metas,omitempty"`
	// contains filtered or unexported fields
}

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

func (AlertEdges) DecisionsOrErr

func (e AlertEdges) DecisionsOrErr() ([]*Decision, error)

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

func (AlertEdges) EventsOrErr

func (e AlertEdges) EventsOrErr() ([]*Event, error)

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

func (AlertEdges) MetasOrErr

func (e AlertEdges) MetasOrErr() ([]*Meta, error)

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

func (AlertEdges) OwnerOrErr

func (e AlertEdges) OwnerOrErr() (*Machine, error)

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

type AlertGroupBy

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

AlertGroupBy is the group-by builder for Alert entities.

func (*AlertGroupBy) Aggregate

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

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

func (*AlertGroupBy) Bool

func (s *AlertGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*AlertGroupBy) BoolX

func (s *AlertGroupBy) BoolX(ctx context.Context) bool

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

func (*AlertGroupBy) Bools

func (s *AlertGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*AlertGroupBy) BoolsX

func (s *AlertGroupBy) BoolsX(ctx context.Context) []bool

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

func (*AlertGroupBy) Float64

func (s *AlertGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*AlertGroupBy) Float64X

func (s *AlertGroupBy) Float64X(ctx context.Context) float64

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

func (*AlertGroupBy) Float64s

func (s *AlertGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*AlertGroupBy) Float64sX

func (s *AlertGroupBy) Float64sX(ctx context.Context) []float64

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

func (*AlertGroupBy) Int

func (s *AlertGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*AlertGroupBy) IntX

func (s *AlertGroupBy) IntX(ctx context.Context) int

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

func (*AlertGroupBy) Ints

func (s *AlertGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*AlertGroupBy) IntsX

func (s *AlertGroupBy) IntsX(ctx context.Context) []int

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

func (*AlertGroupBy) Scan

func (agb *AlertGroupBy) Scan(ctx context.Context, v any) error

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

func (*AlertGroupBy) ScanX

func (s *AlertGroupBy) ScanX(ctx context.Context, v any)

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

func (*AlertGroupBy) String

func (s *AlertGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*AlertGroupBy) StringX

func (s *AlertGroupBy) StringX(ctx context.Context) string

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

func (*AlertGroupBy) Strings

func (s *AlertGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*AlertGroupBy) StringsX

func (s *AlertGroupBy) StringsX(ctx context.Context) []string

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

type AlertMutation

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

AlertMutation represents an operation that mutates the Alert nodes in the graph.

func (*AlertMutation) AddCapacity

func (m *AlertMutation) AddCapacity(i int32)

AddCapacity adds i to the "capacity" field.

func (*AlertMutation) AddDecisionIDs

func (m *AlertMutation) AddDecisionIDs(ids ...int)

AddDecisionIDs adds the "decisions" edge to the Decision entity by ids.

func (*AlertMutation) AddEventIDs

func (m *AlertMutation) AddEventIDs(ids ...int)

AddEventIDs adds the "events" edge to the Event entity by ids.

func (*AlertMutation) AddEventsCount

func (m *AlertMutation) AddEventsCount(i int32)

AddEventsCount adds i to the "eventsCount" field.

func (*AlertMutation) AddField

func (m *AlertMutation) 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 (*AlertMutation) AddMetaIDs

func (m *AlertMutation) AddMetaIDs(ids ...int)

AddMetaIDs adds the "metas" edge to the Meta entity by ids.

func (*AlertMutation) AddSourceLatitude

func (m *AlertMutation) AddSourceLatitude(f float32)

AddSourceLatitude adds f to the "sourceLatitude" field.

func (*AlertMutation) AddSourceLongitude

func (m *AlertMutation) AddSourceLongitude(f float32)

AddSourceLongitude adds f to the "sourceLongitude" field.

func (*AlertMutation) AddedCapacity

func (m *AlertMutation) AddedCapacity() (r int32, exists bool)

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

func (*AlertMutation) AddedEdges

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

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

func (*AlertMutation) AddedEventsCount

func (m *AlertMutation) AddedEventsCount() (r int32, exists bool)

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

func (*AlertMutation) AddedField

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

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

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

func (*AlertMutation) AddedIDs

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

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

func (*AlertMutation) AddedSourceLatitude

func (m *AlertMutation) AddedSourceLatitude() (r float32, exists bool)

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

func (*AlertMutation) AddedSourceLongitude

func (m *AlertMutation) AddedSourceLongitude() (r float32, exists bool)

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

func (*AlertMutation) BucketId

func (m *AlertMutation) BucketId() (r string, exists bool)

BucketId returns the value of the "bucketId" field in the mutation.

func (*AlertMutation) BucketIdCleared

func (m *AlertMutation) BucketIdCleared() bool

BucketIdCleared returns if the "bucketId" field was cleared in this mutation.

func (*AlertMutation) Capacity

func (m *AlertMutation) Capacity() (r int32, exists bool)

Capacity returns the value of the "capacity" field in the mutation.

func (*AlertMutation) CapacityCleared

func (m *AlertMutation) CapacityCleared() bool

CapacityCleared returns if the "capacity" field was cleared in this mutation.

func (*AlertMutation) ClearBucketId

func (m *AlertMutation) ClearBucketId()

ClearBucketId clears the value of the "bucketId" field.

func (*AlertMutation) ClearCapacity

func (m *AlertMutation) ClearCapacity()

ClearCapacity clears the value of the "capacity" field.

func (*AlertMutation) ClearCreatedAt added in v1.3.0

func (m *AlertMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*AlertMutation) ClearDecisions

func (m *AlertMutation) ClearDecisions()

ClearDecisions clears the "decisions" edge to the Decision entity.

func (*AlertMutation) ClearEdge

func (m *AlertMutation) 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 (*AlertMutation) ClearEvents

func (m *AlertMutation) ClearEvents()

ClearEvents clears the "events" edge to the Event entity.

func (*AlertMutation) ClearEventsCount

func (m *AlertMutation) ClearEventsCount()

ClearEventsCount clears the value of the "eventsCount" field.

func (*AlertMutation) ClearField

func (m *AlertMutation) 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 (*AlertMutation) ClearLeakSpeed

func (m *AlertMutation) ClearLeakSpeed()

ClearLeakSpeed clears the value of the "leakSpeed" field.

func (*AlertMutation) ClearMessage

func (m *AlertMutation) ClearMessage()

ClearMessage clears the value of the "message" field.

func (*AlertMutation) ClearMetas

func (m *AlertMutation) ClearMetas()

ClearMetas clears the "metas" edge to the Meta entity.

func (*AlertMutation) ClearOwner

func (m *AlertMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Machine entity.

func (*AlertMutation) ClearScenarioHash

func (m *AlertMutation) ClearScenarioHash()

ClearScenarioHash clears the value of the "scenarioHash" field.

func (*AlertMutation) ClearScenarioVersion

func (m *AlertMutation) ClearScenarioVersion()

ClearScenarioVersion clears the value of the "scenarioVersion" field.

func (*AlertMutation) ClearSourceAsName

func (m *AlertMutation) ClearSourceAsName()

ClearSourceAsName clears the value of the "sourceAsName" field.

func (*AlertMutation) ClearSourceAsNumber

func (m *AlertMutation) ClearSourceAsNumber()

ClearSourceAsNumber clears the value of the "sourceAsNumber" field.

func (*AlertMutation) ClearSourceCountry

func (m *AlertMutation) ClearSourceCountry()

ClearSourceCountry clears the value of the "sourceCountry" field.

func (*AlertMutation) ClearSourceIp

func (m *AlertMutation) ClearSourceIp()

ClearSourceIp clears the value of the "sourceIp" field.

func (*AlertMutation) ClearSourceLatitude

func (m *AlertMutation) ClearSourceLatitude()

ClearSourceLatitude clears the value of the "sourceLatitude" field.

func (*AlertMutation) ClearSourceLongitude

func (m *AlertMutation) ClearSourceLongitude()

ClearSourceLongitude clears the value of the "sourceLongitude" field.

func (*AlertMutation) ClearSourceRange

func (m *AlertMutation) ClearSourceRange()

ClearSourceRange clears the value of the "sourceRange" field.

func (*AlertMutation) ClearSourceScope

func (m *AlertMutation) ClearSourceScope()

ClearSourceScope clears the value of the "sourceScope" field.

func (*AlertMutation) ClearSourceValue

func (m *AlertMutation) ClearSourceValue()

ClearSourceValue clears the value of the "sourceValue" field.

func (*AlertMutation) ClearStartedAt

func (m *AlertMutation) ClearStartedAt()

ClearStartedAt clears the value of the "startedAt" field.

func (*AlertMutation) ClearStoppedAt

func (m *AlertMutation) ClearStoppedAt()

ClearStoppedAt clears the value of the "stoppedAt" field.

func (*AlertMutation) ClearUpdatedAt added in v1.3.0

func (m *AlertMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AlertMutation) ClearedEdges

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

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

func (*AlertMutation) ClearedFields

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

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

func (AlertMutation) Client

func (m AlertMutation) 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 (*AlertMutation) CreatedAt

func (m *AlertMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*AlertMutation) CreatedAtCleared added in v1.3.0

func (m *AlertMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*AlertMutation) DecisionsCleared

func (m *AlertMutation) DecisionsCleared() bool

DecisionsCleared reports if the "decisions" edge to the Decision entity was cleared.

func (*AlertMutation) DecisionsIDs

func (m *AlertMutation) DecisionsIDs() (ids []int)

DecisionsIDs returns the "decisions" edge IDs in the mutation.

func (*AlertMutation) EdgeCleared

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

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

func (*AlertMutation) EventsCleared

func (m *AlertMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the Event entity was cleared.

func (*AlertMutation) EventsCount

func (m *AlertMutation) EventsCount() (r int32, exists bool)

EventsCount returns the value of the "eventsCount" field in the mutation.

func (*AlertMutation) EventsCountCleared

func (m *AlertMutation) EventsCountCleared() bool

EventsCountCleared returns if the "eventsCount" field was cleared in this mutation.

func (*AlertMutation) EventsIDs

func (m *AlertMutation) EventsIDs() (ids []int)

EventsIDs returns the "events" edge IDs in the mutation.

func (*AlertMutation) Field

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

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

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

func (*AlertMutation) Fields

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

func (m *AlertMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*AlertMutation) IDs added in v1.3.1

func (m *AlertMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*AlertMutation) LeakSpeed

func (m *AlertMutation) LeakSpeed() (r string, exists bool)

LeakSpeed returns the value of the "leakSpeed" field in the mutation.

func (*AlertMutation) LeakSpeedCleared

func (m *AlertMutation) LeakSpeedCleared() bool

LeakSpeedCleared returns if the "leakSpeed" field was cleared in this mutation.

func (*AlertMutation) Message

func (m *AlertMutation) Message() (r string, exists bool)

Message returns the value of the "message" field in the mutation.

func (*AlertMutation) MessageCleared

func (m *AlertMutation) MessageCleared() bool

MessageCleared returns if the "message" field was cleared in this mutation.

func (*AlertMutation) MetasCleared

func (m *AlertMutation) MetasCleared() bool

MetasCleared reports if the "metas" edge to the Meta entity was cleared.

func (*AlertMutation) MetasIDs

func (m *AlertMutation) MetasIDs() (ids []int)

MetasIDs returns the "metas" edge IDs in the mutation.

func (*AlertMutation) OldBucketId

func (m *AlertMutation) OldBucketId(ctx context.Context) (v string, err error)

OldBucketId returns the old "bucketId" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldCapacity

func (m *AlertMutation) OldCapacity(ctx context.Context) (v int32, err error)

OldCapacity returns the old "capacity" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldCreatedAt

func (m *AlertMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldEventsCount

func (m *AlertMutation) OldEventsCount(ctx context.Context) (v int32, err error)

OldEventsCount returns the old "eventsCount" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldField

func (m *AlertMutation) 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 (*AlertMutation) OldLeakSpeed

func (m *AlertMutation) OldLeakSpeed(ctx context.Context) (v string, err error)

OldLeakSpeed returns the old "leakSpeed" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldMessage

func (m *AlertMutation) OldMessage(ctx context.Context) (v string, err error)

OldMessage returns the old "message" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldScenario

func (m *AlertMutation) OldScenario(ctx context.Context) (v string, err error)

OldScenario returns the old "scenario" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldScenarioHash

func (m *AlertMutation) OldScenarioHash(ctx context.Context) (v string, err error)

OldScenarioHash returns the old "scenarioHash" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldScenarioVersion

func (m *AlertMutation) OldScenarioVersion(ctx context.Context) (v string, err error)

OldScenarioVersion returns the old "scenarioVersion" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSimulated

func (m *AlertMutation) OldSimulated(ctx context.Context) (v bool, err error)

OldSimulated returns the old "simulated" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceAsName

func (m *AlertMutation) OldSourceAsName(ctx context.Context) (v string, err error)

OldSourceAsName returns the old "sourceAsName" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceAsNumber

func (m *AlertMutation) OldSourceAsNumber(ctx context.Context) (v string, err error)

OldSourceAsNumber returns the old "sourceAsNumber" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceCountry

func (m *AlertMutation) OldSourceCountry(ctx context.Context) (v string, err error)

OldSourceCountry returns the old "sourceCountry" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceIp

func (m *AlertMutation) OldSourceIp(ctx context.Context) (v string, err error)

OldSourceIp returns the old "sourceIp" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceLatitude

func (m *AlertMutation) OldSourceLatitude(ctx context.Context) (v float32, err error)

OldSourceLatitude returns the old "sourceLatitude" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceLongitude

func (m *AlertMutation) OldSourceLongitude(ctx context.Context) (v float32, err error)

OldSourceLongitude returns the old "sourceLongitude" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceRange

func (m *AlertMutation) OldSourceRange(ctx context.Context) (v string, err error)

OldSourceRange returns the old "sourceRange" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceScope

func (m *AlertMutation) OldSourceScope(ctx context.Context) (v string, err error)

OldSourceScope returns the old "sourceScope" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldSourceValue

func (m *AlertMutation) OldSourceValue(ctx context.Context) (v string, err error)

OldSourceValue returns the old "sourceValue" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldStartedAt

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

OldStartedAt returns the old "startedAt" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldStoppedAt

func (m *AlertMutation) OldStoppedAt(ctx context.Context) (v time.Time, err error)

OldStoppedAt returns the old "stoppedAt" field's value of the Alert entity. If the Alert 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 (*AlertMutation) OldUpdatedAt

func (m *AlertMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Alert entity. If the Alert 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 (*AlertMutation) Op

func (m *AlertMutation) Op() Op

Op returns the operation name.

func (*AlertMutation) OwnerCleared

func (m *AlertMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Machine entity was cleared.

func (*AlertMutation) OwnerID

func (m *AlertMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*AlertMutation) OwnerIDs

func (m *AlertMutation) OwnerIDs() (ids []int)

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

func (*AlertMutation) RemoveDecisionIDs

func (m *AlertMutation) RemoveDecisionIDs(ids ...int)

RemoveDecisionIDs removes the "decisions" edge to the Decision entity by IDs.

func (*AlertMutation) RemoveEventIDs

func (m *AlertMutation) RemoveEventIDs(ids ...int)

RemoveEventIDs removes the "events" edge to the Event entity by IDs.

func (*AlertMutation) RemoveMetaIDs

func (m *AlertMutation) RemoveMetaIDs(ids ...int)

RemoveMetaIDs removes the "metas" edge to the Meta entity by IDs.

func (*AlertMutation) RemovedDecisionsIDs

func (m *AlertMutation) RemovedDecisionsIDs() (ids []int)

RemovedDecisions returns the removed IDs of the "decisions" edge to the Decision entity.

func (*AlertMutation) RemovedEdges

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

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

func (*AlertMutation) RemovedEventsIDs

func (m *AlertMutation) RemovedEventsIDs() (ids []int)

RemovedEvents returns the removed IDs of the "events" edge to the Event entity.

func (*AlertMutation) RemovedIDs

func (m *AlertMutation) 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 (*AlertMutation) RemovedMetasIDs

func (m *AlertMutation) RemovedMetasIDs() (ids []int)

RemovedMetas returns the removed IDs of the "metas" edge to the Meta entity.

func (*AlertMutation) ResetBucketId

func (m *AlertMutation) ResetBucketId()

ResetBucketId resets all changes to the "bucketId" field.

func (*AlertMutation) ResetCapacity

func (m *AlertMutation) ResetCapacity()

ResetCapacity resets all changes to the "capacity" field.

func (*AlertMutation) ResetCreatedAt

func (m *AlertMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AlertMutation) ResetDecisions

func (m *AlertMutation) ResetDecisions()

ResetDecisions resets all changes to the "decisions" edge.

func (*AlertMutation) ResetEdge

func (m *AlertMutation) 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 (*AlertMutation) ResetEvents

func (m *AlertMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*AlertMutation) ResetEventsCount

func (m *AlertMutation) ResetEventsCount()

ResetEventsCount resets all changes to the "eventsCount" field.

func (*AlertMutation) ResetField

func (m *AlertMutation) 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 (*AlertMutation) ResetLeakSpeed

func (m *AlertMutation) ResetLeakSpeed()

ResetLeakSpeed resets all changes to the "leakSpeed" field.

func (*AlertMutation) ResetMessage

func (m *AlertMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*AlertMutation) ResetMetas

func (m *AlertMutation) ResetMetas()

ResetMetas resets all changes to the "metas" edge.

func (*AlertMutation) ResetOwner

func (m *AlertMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*AlertMutation) ResetScenario

func (m *AlertMutation) ResetScenario()

ResetScenario resets all changes to the "scenario" field.

func (*AlertMutation) ResetScenarioHash

func (m *AlertMutation) ResetScenarioHash()

ResetScenarioHash resets all changes to the "scenarioHash" field.

func (*AlertMutation) ResetScenarioVersion

func (m *AlertMutation) ResetScenarioVersion()

ResetScenarioVersion resets all changes to the "scenarioVersion" field.

func (*AlertMutation) ResetSimulated

func (m *AlertMutation) ResetSimulated()

ResetSimulated resets all changes to the "simulated" field.

func (*AlertMutation) ResetSourceAsName

func (m *AlertMutation) ResetSourceAsName()

ResetSourceAsName resets all changes to the "sourceAsName" field.

func (*AlertMutation) ResetSourceAsNumber

func (m *AlertMutation) ResetSourceAsNumber()

ResetSourceAsNumber resets all changes to the "sourceAsNumber" field.

func (*AlertMutation) ResetSourceCountry

func (m *AlertMutation) ResetSourceCountry()

ResetSourceCountry resets all changes to the "sourceCountry" field.

func (*AlertMutation) ResetSourceIp

func (m *AlertMutation) ResetSourceIp()

ResetSourceIp resets all changes to the "sourceIp" field.

func (*AlertMutation) ResetSourceLatitude

func (m *AlertMutation) ResetSourceLatitude()

ResetSourceLatitude resets all changes to the "sourceLatitude" field.

func (*AlertMutation) ResetSourceLongitude

func (m *AlertMutation) ResetSourceLongitude()

ResetSourceLongitude resets all changes to the "sourceLongitude" field.

func (*AlertMutation) ResetSourceRange

func (m *AlertMutation) ResetSourceRange()

ResetSourceRange resets all changes to the "sourceRange" field.

func (*AlertMutation) ResetSourceScope

func (m *AlertMutation) ResetSourceScope()

ResetSourceScope resets all changes to the "sourceScope" field.

func (*AlertMutation) ResetSourceValue

func (m *AlertMutation) ResetSourceValue()

ResetSourceValue resets all changes to the "sourceValue" field.

func (*AlertMutation) ResetStartedAt

func (m *AlertMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "startedAt" field.

func (*AlertMutation) ResetStoppedAt

func (m *AlertMutation) ResetStoppedAt()

ResetStoppedAt resets all changes to the "stoppedAt" field.

func (*AlertMutation) ResetUpdatedAt

func (m *AlertMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AlertMutation) Scenario

func (m *AlertMutation) Scenario() (r string, exists bool)

Scenario returns the value of the "scenario" field in the mutation.

func (*AlertMutation) ScenarioHash

func (m *AlertMutation) ScenarioHash() (r string, exists bool)

ScenarioHash returns the value of the "scenarioHash" field in the mutation.

func (*AlertMutation) ScenarioHashCleared

func (m *AlertMutation) ScenarioHashCleared() bool

ScenarioHashCleared returns if the "scenarioHash" field was cleared in this mutation.

func (*AlertMutation) ScenarioVersion

func (m *AlertMutation) ScenarioVersion() (r string, exists bool)

ScenarioVersion returns the value of the "scenarioVersion" field in the mutation.

func (*AlertMutation) ScenarioVersionCleared

func (m *AlertMutation) ScenarioVersionCleared() bool

ScenarioVersionCleared returns if the "scenarioVersion" field was cleared in this mutation.

func (*AlertMutation) SetBucketId

func (m *AlertMutation) SetBucketId(s string)

SetBucketId sets the "bucketId" field.

func (*AlertMutation) SetCapacity

func (m *AlertMutation) SetCapacity(i int32)

SetCapacity sets the "capacity" field.

func (*AlertMutation) SetCreatedAt

func (m *AlertMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*AlertMutation) SetEventsCount

func (m *AlertMutation) SetEventsCount(i int32)

SetEventsCount sets the "eventsCount" field.

func (*AlertMutation) SetField

func (m *AlertMutation) 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 (*AlertMutation) SetLeakSpeed

func (m *AlertMutation) SetLeakSpeed(s string)

SetLeakSpeed sets the "leakSpeed" field.

func (*AlertMutation) SetMessage

func (m *AlertMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*AlertMutation) SetOwnerID

func (m *AlertMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Machine entity by id.

func (*AlertMutation) SetScenario

func (m *AlertMutation) SetScenario(s string)

SetScenario sets the "scenario" field.

func (*AlertMutation) SetScenarioHash

func (m *AlertMutation) SetScenarioHash(s string)

SetScenarioHash sets the "scenarioHash" field.

func (*AlertMutation) SetScenarioVersion

func (m *AlertMutation) SetScenarioVersion(s string)

SetScenarioVersion sets the "scenarioVersion" field.

func (*AlertMutation) SetSimulated

func (m *AlertMutation) SetSimulated(b bool)

SetSimulated sets the "simulated" field.

func (*AlertMutation) SetSourceAsName

func (m *AlertMutation) SetSourceAsName(s string)

SetSourceAsName sets the "sourceAsName" field.

func (*AlertMutation) SetSourceAsNumber

func (m *AlertMutation) SetSourceAsNumber(s string)

SetSourceAsNumber sets the "sourceAsNumber" field.

func (*AlertMutation) SetSourceCountry

func (m *AlertMutation) SetSourceCountry(s string)

SetSourceCountry sets the "sourceCountry" field.

func (*AlertMutation) SetSourceIp

func (m *AlertMutation) SetSourceIp(s string)

SetSourceIp sets the "sourceIp" field.

func (*AlertMutation) SetSourceLatitude

func (m *AlertMutation) SetSourceLatitude(f float32)

SetSourceLatitude sets the "sourceLatitude" field.

func (*AlertMutation) SetSourceLongitude

func (m *AlertMutation) SetSourceLongitude(f float32)

SetSourceLongitude sets the "sourceLongitude" field.

func (*AlertMutation) SetSourceRange

func (m *AlertMutation) SetSourceRange(s string)

SetSourceRange sets the "sourceRange" field.

func (*AlertMutation) SetSourceScope

func (m *AlertMutation) SetSourceScope(s string)

SetSourceScope sets the "sourceScope" field.

func (*AlertMutation) SetSourceValue

func (m *AlertMutation) SetSourceValue(s string)

SetSourceValue sets the "sourceValue" field.

func (*AlertMutation) SetStartedAt

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

SetStartedAt sets the "startedAt" field.

func (*AlertMutation) SetStoppedAt

func (m *AlertMutation) SetStoppedAt(t time.Time)

SetStoppedAt sets the "stoppedAt" field.

func (*AlertMutation) SetUpdatedAt

func (m *AlertMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*AlertMutation) Simulated

func (m *AlertMutation) Simulated() (r bool, exists bool)

Simulated returns the value of the "simulated" field in the mutation.

func (*AlertMutation) SourceAsName

func (m *AlertMutation) SourceAsName() (r string, exists bool)

SourceAsName returns the value of the "sourceAsName" field in the mutation.

func (*AlertMutation) SourceAsNameCleared

func (m *AlertMutation) SourceAsNameCleared() bool

SourceAsNameCleared returns if the "sourceAsName" field was cleared in this mutation.

func (*AlertMutation) SourceAsNumber

func (m *AlertMutation) SourceAsNumber() (r string, exists bool)

SourceAsNumber returns the value of the "sourceAsNumber" field in the mutation.

func (*AlertMutation) SourceAsNumberCleared

func (m *AlertMutation) SourceAsNumberCleared() bool

SourceAsNumberCleared returns if the "sourceAsNumber" field was cleared in this mutation.

func (*AlertMutation) SourceCountry

func (m *AlertMutation) SourceCountry() (r string, exists bool)

SourceCountry returns the value of the "sourceCountry" field in the mutation.

func (*AlertMutation) SourceCountryCleared

func (m *AlertMutation) SourceCountryCleared() bool

SourceCountryCleared returns if the "sourceCountry" field was cleared in this mutation.

func (*AlertMutation) SourceIp

func (m *AlertMutation) SourceIp() (r string, exists bool)

SourceIp returns the value of the "sourceIp" field in the mutation.

func (*AlertMutation) SourceIpCleared

func (m *AlertMutation) SourceIpCleared() bool

SourceIpCleared returns if the "sourceIp" field was cleared in this mutation.

func (*AlertMutation) SourceLatitude

func (m *AlertMutation) SourceLatitude() (r float32, exists bool)

SourceLatitude returns the value of the "sourceLatitude" field in the mutation.

func (*AlertMutation) SourceLatitudeCleared

func (m *AlertMutation) SourceLatitudeCleared() bool

SourceLatitudeCleared returns if the "sourceLatitude" field was cleared in this mutation.

func (*AlertMutation) SourceLongitude

func (m *AlertMutation) SourceLongitude() (r float32, exists bool)

SourceLongitude returns the value of the "sourceLongitude" field in the mutation.

func (*AlertMutation) SourceLongitudeCleared

func (m *AlertMutation) SourceLongitudeCleared() bool

SourceLongitudeCleared returns if the "sourceLongitude" field was cleared in this mutation.

func (*AlertMutation) SourceRange

func (m *AlertMutation) SourceRange() (r string, exists bool)

SourceRange returns the value of the "sourceRange" field in the mutation.

func (*AlertMutation) SourceRangeCleared

func (m *AlertMutation) SourceRangeCleared() bool

SourceRangeCleared returns if the "sourceRange" field was cleared in this mutation.

func (*AlertMutation) SourceScope

func (m *AlertMutation) SourceScope() (r string, exists bool)

SourceScope returns the value of the "sourceScope" field in the mutation.

func (*AlertMutation) SourceScopeCleared

func (m *AlertMutation) SourceScopeCleared() bool

SourceScopeCleared returns if the "sourceScope" field was cleared in this mutation.

func (*AlertMutation) SourceValue

func (m *AlertMutation) SourceValue() (r string, exists bool)

SourceValue returns the value of the "sourceValue" field in the mutation.

func (*AlertMutation) SourceValueCleared

func (m *AlertMutation) SourceValueCleared() bool

SourceValueCleared returns if the "sourceValue" field was cleared in this mutation.

func (*AlertMutation) StartedAt

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

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

func (*AlertMutation) StartedAtCleared

func (m *AlertMutation) StartedAtCleared() bool

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

func (*AlertMutation) StoppedAt

func (m *AlertMutation) StoppedAt() (r time.Time, exists bool)

StoppedAt returns the value of the "stoppedAt" field in the mutation.

func (*AlertMutation) StoppedAtCleared

func (m *AlertMutation) StoppedAtCleared() bool

StoppedAtCleared returns if the "stoppedAt" field was cleared in this mutation.

func (AlertMutation) Tx

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

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

func (*AlertMutation) Type

func (m *AlertMutation) Type() string

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

func (*AlertMutation) UpdatedAt

func (m *AlertMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*AlertMutation) UpdatedAtCleared added in v1.3.0

func (m *AlertMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*AlertMutation) Where added in v1.2.1

func (m *AlertMutation) Where(ps ...predicate.Alert)

Where appends a list predicates to the AlertMutation builder.

type AlertQuery

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

AlertQuery is the builder for querying Alert entities.

func (*AlertQuery) All

func (aq *AlertQuery) All(ctx context.Context) ([]*Alert, error)

All executes the query and returns a list of Alerts.

func (*AlertQuery) AllX

func (aq *AlertQuery) AllX(ctx context.Context) []*Alert

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

func (*AlertQuery) Clone

func (aq *AlertQuery) Clone() *AlertQuery

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

func (*AlertQuery) Count

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

Count returns the count of the given query.

func (*AlertQuery) CountX

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

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

func (*AlertQuery) Exist

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

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

func (*AlertQuery) ExistX

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

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

func (*AlertQuery) First

func (aq *AlertQuery) First(ctx context.Context) (*Alert, error)

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

func (*AlertQuery) FirstID

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

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

func (*AlertQuery) FirstIDX added in v1.0.3

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

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

func (*AlertQuery) FirstX

func (aq *AlertQuery) FirstX(ctx context.Context) *Alert

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

func (*AlertQuery) GroupBy

func (aq *AlertQuery) GroupBy(field string, fields ...string) *AlertGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Alert.Query().
	GroupBy(alert.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AlertQuery) IDs

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

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

func (*AlertQuery) IDsX

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

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

func (*AlertQuery) Limit

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

Limit adds a limit step to the query.

func (*AlertQuery) Offset

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

Offset adds an offset step to the query.

func (*AlertQuery) Only

func (aq *AlertQuery) Only(ctx context.Context) (*Alert, error)

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

func (*AlertQuery) OnlyID

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

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

func (*AlertQuery) OnlyIDX

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

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

func (*AlertQuery) OnlyX

func (aq *AlertQuery) OnlyX(ctx context.Context) *Alert

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

func (*AlertQuery) Order

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

Order adds an order step to the query.

func (*AlertQuery) QueryDecisions

func (aq *AlertQuery) QueryDecisions() *DecisionQuery

QueryDecisions chains the current query on the "decisions" edge.

func (*AlertQuery) QueryEvents

func (aq *AlertQuery) QueryEvents() *EventQuery

QueryEvents chains the current query on the "events" edge.

func (*AlertQuery) QueryMetas

func (aq *AlertQuery) QueryMetas() *MetaQuery

QueryMetas chains the current query on the "metas" edge.

func (*AlertQuery) QueryOwner

func (aq *AlertQuery) QueryOwner() *MachineQuery

QueryOwner chains the current query on the "owner" edge.

func (*AlertQuery) Select

func (aq *AlertQuery) Select(fields ...string) *AlertSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Alert.Query().
	Select(alert.FieldCreatedAt).
	Scan(ctx, &v)

func (*AlertQuery) Unique added in v1.2.1

func (aq *AlertQuery) Unique(unique bool) *AlertQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*AlertQuery) Where

func (aq *AlertQuery) Where(ps ...predicate.Alert) *AlertQuery

Where adds a new predicate for the AlertQuery builder.

func (*AlertQuery) WithDecisions

func (aq *AlertQuery) WithDecisions(opts ...func(*DecisionQuery)) *AlertQuery

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

func (*AlertQuery) WithEvents

func (aq *AlertQuery) WithEvents(opts ...func(*EventQuery)) *AlertQuery

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

func (*AlertQuery) WithMetas

func (aq *AlertQuery) WithMetas(opts ...func(*MetaQuery)) *AlertQuery

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

func (*AlertQuery) WithOwner

func (aq *AlertQuery) WithOwner(opts ...func(*MachineQuery)) *AlertQuery

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

type AlertSelect

type AlertSelect struct {
	*AlertQuery
	// contains filtered or unexported fields
}

AlertSelect is the builder for selecting fields of Alert entities.

func (*AlertSelect) Bool

func (s *AlertSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*AlertSelect) BoolX

func (s *AlertSelect) BoolX(ctx context.Context) bool

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

func (*AlertSelect) Bools

func (s *AlertSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*AlertSelect) BoolsX

func (s *AlertSelect) BoolsX(ctx context.Context) []bool

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

func (*AlertSelect) Float64

func (s *AlertSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*AlertSelect) Float64X

func (s *AlertSelect) Float64X(ctx context.Context) float64

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

func (*AlertSelect) Float64s

func (s *AlertSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*AlertSelect) Float64sX

func (s *AlertSelect) Float64sX(ctx context.Context) []float64

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

func (*AlertSelect) Int

func (s *AlertSelect) Int(ctx context.Context) (_ int, err error)

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

func (*AlertSelect) IntX

func (s *AlertSelect) IntX(ctx context.Context) int

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

func (*AlertSelect) Ints

func (s *AlertSelect) Ints(ctx context.Context) ([]int, error)

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

func (*AlertSelect) IntsX

func (s *AlertSelect) IntsX(ctx context.Context) []int

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

func (*AlertSelect) Scan

func (as *AlertSelect) Scan(ctx context.Context, v any) error

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

func (*AlertSelect) ScanX

func (s *AlertSelect) ScanX(ctx context.Context, v any)

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

func (*AlertSelect) String

func (s *AlertSelect) String(ctx context.Context) (_ string, err error)

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

func (*AlertSelect) StringX

func (s *AlertSelect) StringX(ctx context.Context) string

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

func (*AlertSelect) Strings

func (s *AlertSelect) Strings(ctx context.Context) ([]string, error)

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

func (*AlertSelect) StringsX

func (s *AlertSelect) StringsX(ctx context.Context) []string

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

type AlertUpdate

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

AlertUpdate is the builder for updating Alert entities.

func (*AlertUpdate) AddCapacity

func (au *AlertUpdate) AddCapacity(i int32) *AlertUpdate

AddCapacity adds i to the "capacity" field.

func (*AlertUpdate) AddDecisionIDs

func (au *AlertUpdate) AddDecisionIDs(ids ...int) *AlertUpdate

AddDecisionIDs adds the "decisions" edge to the Decision entity by IDs.

func (*AlertUpdate) AddDecisions

func (au *AlertUpdate) AddDecisions(d ...*Decision) *AlertUpdate

AddDecisions adds the "decisions" edges to the Decision entity.

func (*AlertUpdate) AddEventIDs

func (au *AlertUpdate) AddEventIDs(ids ...int) *AlertUpdate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*AlertUpdate) AddEvents

func (au *AlertUpdate) AddEvents(e ...*Event) *AlertUpdate

AddEvents adds the "events" edges to the Event entity.

func (*AlertUpdate) AddEventsCount

func (au *AlertUpdate) AddEventsCount(i int32) *AlertUpdate

AddEventsCount adds i to the "eventsCount" field.

func (*AlertUpdate) AddMetaIDs

func (au *AlertUpdate) AddMetaIDs(ids ...int) *AlertUpdate

AddMetaIDs adds the "metas" edge to the Meta entity by IDs.

func (*AlertUpdate) AddMetas

func (au *AlertUpdate) AddMetas(m ...*Meta) *AlertUpdate

AddMetas adds the "metas" edges to the Meta entity.

func (*AlertUpdate) AddSourceLatitude

func (au *AlertUpdate) AddSourceLatitude(f float32) *AlertUpdate

AddSourceLatitude adds f to the "sourceLatitude" field.

func (*AlertUpdate) AddSourceLongitude

func (au *AlertUpdate) AddSourceLongitude(f float32) *AlertUpdate

AddSourceLongitude adds f to the "sourceLongitude" field.

func (*AlertUpdate) ClearBucketId

func (au *AlertUpdate) ClearBucketId() *AlertUpdate

ClearBucketId clears the value of the "bucketId" field.

func (*AlertUpdate) ClearCapacity

func (au *AlertUpdate) ClearCapacity() *AlertUpdate

ClearCapacity clears the value of the "capacity" field.

func (*AlertUpdate) ClearCreatedAt added in v1.3.0

func (au *AlertUpdate) ClearCreatedAt() *AlertUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*AlertUpdate) ClearDecisions

func (au *AlertUpdate) ClearDecisions() *AlertUpdate

ClearDecisions clears all "decisions" edges to the Decision entity.

func (*AlertUpdate) ClearEvents

func (au *AlertUpdate) ClearEvents() *AlertUpdate

ClearEvents clears all "events" edges to the Event entity.

func (*AlertUpdate) ClearEventsCount

func (au *AlertUpdate) ClearEventsCount() *AlertUpdate

ClearEventsCount clears the value of the "eventsCount" field.

func (*AlertUpdate) ClearLeakSpeed

func (au *AlertUpdate) ClearLeakSpeed() *AlertUpdate

ClearLeakSpeed clears the value of the "leakSpeed" field.

func (*AlertUpdate) ClearMessage

func (au *AlertUpdate) ClearMessage() *AlertUpdate

ClearMessage clears the value of the "message" field.

func (*AlertUpdate) ClearMetas

func (au *AlertUpdate) ClearMetas() *AlertUpdate

ClearMetas clears all "metas" edges to the Meta entity.

func (*AlertUpdate) ClearOwner

func (au *AlertUpdate) ClearOwner() *AlertUpdate

ClearOwner clears the "owner" edge to the Machine entity.

func (*AlertUpdate) ClearScenarioHash

func (au *AlertUpdate) ClearScenarioHash() *AlertUpdate

ClearScenarioHash clears the value of the "scenarioHash" field.

func (*AlertUpdate) ClearScenarioVersion

func (au *AlertUpdate) ClearScenarioVersion() *AlertUpdate

ClearScenarioVersion clears the value of the "scenarioVersion" field.

func (*AlertUpdate) ClearSourceAsName

func (au *AlertUpdate) ClearSourceAsName() *AlertUpdate

ClearSourceAsName clears the value of the "sourceAsName" field.

func (*AlertUpdate) ClearSourceAsNumber

func (au *AlertUpdate) ClearSourceAsNumber() *AlertUpdate

ClearSourceAsNumber clears the value of the "sourceAsNumber" field.

func (*AlertUpdate) ClearSourceCountry

func (au *AlertUpdate) ClearSourceCountry() *AlertUpdate

ClearSourceCountry clears the value of the "sourceCountry" field.

func (*AlertUpdate) ClearSourceIp

func (au *AlertUpdate) ClearSourceIp() *AlertUpdate

ClearSourceIp clears the value of the "sourceIp" field.

func (*AlertUpdate) ClearSourceLatitude

func (au *AlertUpdate) ClearSourceLatitude() *AlertUpdate

ClearSourceLatitude clears the value of the "sourceLatitude" field.

func (*AlertUpdate) ClearSourceLongitude

func (au *AlertUpdate) ClearSourceLongitude() *AlertUpdate

ClearSourceLongitude clears the value of the "sourceLongitude" field.

func (*AlertUpdate) ClearSourceRange

func (au *AlertUpdate) ClearSourceRange() *AlertUpdate

ClearSourceRange clears the value of the "sourceRange" field.

func (*AlertUpdate) ClearSourceScope

func (au *AlertUpdate) ClearSourceScope() *AlertUpdate

ClearSourceScope clears the value of the "sourceScope" field.

func (*AlertUpdate) ClearSourceValue

func (au *AlertUpdate) ClearSourceValue() *AlertUpdate

ClearSourceValue clears the value of the "sourceValue" field.

func (*AlertUpdate) ClearStartedAt

func (au *AlertUpdate) ClearStartedAt() *AlertUpdate

ClearStartedAt clears the value of the "startedAt" field.

func (*AlertUpdate) ClearStoppedAt

func (au *AlertUpdate) ClearStoppedAt() *AlertUpdate

ClearStoppedAt clears the value of the "stoppedAt" field.

func (*AlertUpdate) ClearUpdatedAt added in v1.3.0

func (au *AlertUpdate) ClearUpdatedAt() *AlertUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AlertUpdate) Exec

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

Exec executes the query.

func (*AlertUpdate) ExecX

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

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

func (*AlertUpdate) Mutation

func (au *AlertUpdate) Mutation() *AlertMutation

Mutation returns the AlertMutation object of the builder.

func (*AlertUpdate) RemoveDecisionIDs

func (au *AlertUpdate) RemoveDecisionIDs(ids ...int) *AlertUpdate

RemoveDecisionIDs removes the "decisions" edge to Decision entities by IDs.

func (*AlertUpdate) RemoveDecisions

func (au *AlertUpdate) RemoveDecisions(d ...*Decision) *AlertUpdate

RemoveDecisions removes "decisions" edges to Decision entities.

func (*AlertUpdate) RemoveEventIDs

func (au *AlertUpdate) RemoveEventIDs(ids ...int) *AlertUpdate

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*AlertUpdate) RemoveEvents

func (au *AlertUpdate) RemoveEvents(e ...*Event) *AlertUpdate

RemoveEvents removes "events" edges to Event entities.

func (*AlertUpdate) RemoveMetaIDs

func (au *AlertUpdate) RemoveMetaIDs(ids ...int) *AlertUpdate

RemoveMetaIDs removes the "metas" edge to Meta entities by IDs.

func (*AlertUpdate) RemoveMetas

func (au *AlertUpdate) RemoveMetas(m ...*Meta) *AlertUpdate

RemoveMetas removes "metas" edges to Meta entities.

func (*AlertUpdate) Save

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

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

func (*AlertUpdate) SaveX

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

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

func (*AlertUpdate) SetBucketId

func (au *AlertUpdate) SetBucketId(s string) *AlertUpdate

SetBucketId sets the "bucketId" field.

func (*AlertUpdate) SetCapacity

func (au *AlertUpdate) SetCapacity(i int32) *AlertUpdate

SetCapacity sets the "capacity" field.

func (*AlertUpdate) SetCreatedAt

func (au *AlertUpdate) SetCreatedAt(t time.Time) *AlertUpdate

SetCreatedAt sets the "created_at" field.

func (*AlertUpdate) SetEventsCount

func (au *AlertUpdate) SetEventsCount(i int32) *AlertUpdate

SetEventsCount sets the "eventsCount" field.

func (*AlertUpdate) SetLeakSpeed

func (au *AlertUpdate) SetLeakSpeed(s string) *AlertUpdate

SetLeakSpeed sets the "leakSpeed" field.

func (*AlertUpdate) SetMessage

func (au *AlertUpdate) SetMessage(s string) *AlertUpdate

SetMessage sets the "message" field.

func (*AlertUpdate) SetNillableBucketId

func (au *AlertUpdate) SetNillableBucketId(s *string) *AlertUpdate

SetNillableBucketId sets the "bucketId" field if the given value is not nil.

func (*AlertUpdate) SetNillableCapacity

func (au *AlertUpdate) SetNillableCapacity(i *int32) *AlertUpdate

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*AlertUpdate) SetNillableEventsCount

func (au *AlertUpdate) SetNillableEventsCount(i *int32) *AlertUpdate

SetNillableEventsCount sets the "eventsCount" field if the given value is not nil.

func (*AlertUpdate) SetNillableLeakSpeed

func (au *AlertUpdate) SetNillableLeakSpeed(s *string) *AlertUpdate

SetNillableLeakSpeed sets the "leakSpeed" field if the given value is not nil.

func (*AlertUpdate) SetNillableMessage

func (au *AlertUpdate) SetNillableMessage(s *string) *AlertUpdate

SetNillableMessage sets the "message" field if the given value is not nil.

func (*AlertUpdate) SetNillableOwnerID

func (au *AlertUpdate) SetNillableOwnerID(id *int) *AlertUpdate

SetNillableOwnerID sets the "owner" edge to the Machine entity by ID if the given value is not nil.

func (*AlertUpdate) SetNillableScenarioHash

func (au *AlertUpdate) SetNillableScenarioHash(s *string) *AlertUpdate

SetNillableScenarioHash sets the "scenarioHash" field if the given value is not nil.

func (*AlertUpdate) SetNillableScenarioVersion

func (au *AlertUpdate) SetNillableScenarioVersion(s *string) *AlertUpdate

SetNillableScenarioVersion sets the "scenarioVersion" field if the given value is not nil.

func (*AlertUpdate) SetNillableSimulated

func (au *AlertUpdate) SetNillableSimulated(b *bool) *AlertUpdate

SetNillableSimulated sets the "simulated" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceAsName

func (au *AlertUpdate) SetNillableSourceAsName(s *string) *AlertUpdate

SetNillableSourceAsName sets the "sourceAsName" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceAsNumber

func (au *AlertUpdate) SetNillableSourceAsNumber(s *string) *AlertUpdate

SetNillableSourceAsNumber sets the "sourceAsNumber" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceCountry

func (au *AlertUpdate) SetNillableSourceCountry(s *string) *AlertUpdate

SetNillableSourceCountry sets the "sourceCountry" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceIp

func (au *AlertUpdate) SetNillableSourceIp(s *string) *AlertUpdate

SetNillableSourceIp sets the "sourceIp" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceLatitude

func (au *AlertUpdate) SetNillableSourceLatitude(f *float32) *AlertUpdate

SetNillableSourceLatitude sets the "sourceLatitude" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceLongitude

func (au *AlertUpdate) SetNillableSourceLongitude(f *float32) *AlertUpdate

SetNillableSourceLongitude sets the "sourceLongitude" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceRange

func (au *AlertUpdate) SetNillableSourceRange(s *string) *AlertUpdate

SetNillableSourceRange sets the "sourceRange" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceScope

func (au *AlertUpdate) SetNillableSourceScope(s *string) *AlertUpdate

SetNillableSourceScope sets the "sourceScope" field if the given value is not nil.

func (*AlertUpdate) SetNillableSourceValue

func (au *AlertUpdate) SetNillableSourceValue(s *string) *AlertUpdate

SetNillableSourceValue sets the "sourceValue" field if the given value is not nil.

func (*AlertUpdate) SetNillableStartedAt

func (au *AlertUpdate) SetNillableStartedAt(t *time.Time) *AlertUpdate

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

func (*AlertUpdate) SetNillableStoppedAt

func (au *AlertUpdate) SetNillableStoppedAt(t *time.Time) *AlertUpdate

SetNillableStoppedAt sets the "stoppedAt" field if the given value is not nil.

func (*AlertUpdate) SetOwner

func (au *AlertUpdate) SetOwner(m *Machine) *AlertUpdate

SetOwner sets the "owner" edge to the Machine entity.

func (*AlertUpdate) SetOwnerID

func (au *AlertUpdate) SetOwnerID(id int) *AlertUpdate

SetOwnerID sets the "owner" edge to the Machine entity by ID.

func (*AlertUpdate) SetScenario

func (au *AlertUpdate) SetScenario(s string) *AlertUpdate

SetScenario sets the "scenario" field.

func (*AlertUpdate) SetScenarioHash

func (au *AlertUpdate) SetScenarioHash(s string) *AlertUpdate

SetScenarioHash sets the "scenarioHash" field.

func (*AlertUpdate) SetScenarioVersion

func (au *AlertUpdate) SetScenarioVersion(s string) *AlertUpdate

SetScenarioVersion sets the "scenarioVersion" field.

func (*AlertUpdate) SetSimulated

func (au *AlertUpdate) SetSimulated(b bool) *AlertUpdate

SetSimulated sets the "simulated" field.

func (*AlertUpdate) SetSourceAsName

func (au *AlertUpdate) SetSourceAsName(s string) *AlertUpdate

SetSourceAsName sets the "sourceAsName" field.

func (*AlertUpdate) SetSourceAsNumber

func (au *AlertUpdate) SetSourceAsNumber(s string) *AlertUpdate

SetSourceAsNumber sets the "sourceAsNumber" field.

func (*AlertUpdate) SetSourceCountry

func (au *AlertUpdate) SetSourceCountry(s string) *AlertUpdate

SetSourceCountry sets the "sourceCountry" field.

func (*AlertUpdate) SetSourceIp

func (au *AlertUpdate) SetSourceIp(s string) *AlertUpdate

SetSourceIp sets the "sourceIp" field.

func (*AlertUpdate) SetSourceLatitude

func (au *AlertUpdate) SetSourceLatitude(f float32) *AlertUpdate

SetSourceLatitude sets the "sourceLatitude" field.

func (*AlertUpdate) SetSourceLongitude

func (au *AlertUpdate) SetSourceLongitude(f float32) *AlertUpdate

SetSourceLongitude sets the "sourceLongitude" field.

func (*AlertUpdate) SetSourceRange

func (au *AlertUpdate) SetSourceRange(s string) *AlertUpdate

SetSourceRange sets the "sourceRange" field.

func (*AlertUpdate) SetSourceScope

func (au *AlertUpdate) SetSourceScope(s string) *AlertUpdate

SetSourceScope sets the "sourceScope" field.

func (*AlertUpdate) SetSourceValue

func (au *AlertUpdate) SetSourceValue(s string) *AlertUpdate

SetSourceValue sets the "sourceValue" field.

func (*AlertUpdate) SetStartedAt

func (au *AlertUpdate) SetStartedAt(t time.Time) *AlertUpdate

SetStartedAt sets the "startedAt" field.

func (*AlertUpdate) SetStoppedAt

func (au *AlertUpdate) SetStoppedAt(t time.Time) *AlertUpdate

SetStoppedAt sets the "stoppedAt" field.

func (*AlertUpdate) SetUpdatedAt

func (au *AlertUpdate) SetUpdatedAt(t time.Time) *AlertUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AlertUpdate) Where

func (au *AlertUpdate) Where(ps ...predicate.Alert) *AlertUpdate

Where appends a list predicates to the AlertUpdate builder.

type AlertUpdateOne

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

AlertUpdateOne is the builder for updating a single Alert entity.

func (*AlertUpdateOne) AddCapacity

func (auo *AlertUpdateOne) AddCapacity(i int32) *AlertUpdateOne

AddCapacity adds i to the "capacity" field.

func (*AlertUpdateOne) AddDecisionIDs

func (auo *AlertUpdateOne) AddDecisionIDs(ids ...int) *AlertUpdateOne

AddDecisionIDs adds the "decisions" edge to the Decision entity by IDs.

func (*AlertUpdateOne) AddDecisions

func (auo *AlertUpdateOne) AddDecisions(d ...*Decision) *AlertUpdateOne

AddDecisions adds the "decisions" edges to the Decision entity.

func (*AlertUpdateOne) AddEventIDs

func (auo *AlertUpdateOne) AddEventIDs(ids ...int) *AlertUpdateOne

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*AlertUpdateOne) AddEvents

func (auo *AlertUpdateOne) AddEvents(e ...*Event) *AlertUpdateOne

AddEvents adds the "events" edges to the Event entity.

func (*AlertUpdateOne) AddEventsCount

func (auo *AlertUpdateOne) AddEventsCount(i int32) *AlertUpdateOne

AddEventsCount adds i to the "eventsCount" field.

func (*AlertUpdateOne) AddMetaIDs

func (auo *AlertUpdateOne) AddMetaIDs(ids ...int) *AlertUpdateOne

AddMetaIDs adds the "metas" edge to the Meta entity by IDs.

func (*AlertUpdateOne) AddMetas

func (auo *AlertUpdateOne) AddMetas(m ...*Meta) *AlertUpdateOne

AddMetas adds the "metas" edges to the Meta entity.

func (*AlertUpdateOne) AddSourceLatitude

func (auo *AlertUpdateOne) AddSourceLatitude(f float32) *AlertUpdateOne

AddSourceLatitude adds f to the "sourceLatitude" field.

func (*AlertUpdateOne) AddSourceLongitude

func (auo *AlertUpdateOne) AddSourceLongitude(f float32) *AlertUpdateOne

AddSourceLongitude adds f to the "sourceLongitude" field.

func (*AlertUpdateOne) ClearBucketId

func (auo *AlertUpdateOne) ClearBucketId() *AlertUpdateOne

ClearBucketId clears the value of the "bucketId" field.

func (*AlertUpdateOne) ClearCapacity

func (auo *AlertUpdateOne) ClearCapacity() *AlertUpdateOne

ClearCapacity clears the value of the "capacity" field.

func (*AlertUpdateOne) ClearCreatedAt added in v1.3.0

func (auo *AlertUpdateOne) ClearCreatedAt() *AlertUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*AlertUpdateOne) ClearDecisions

func (auo *AlertUpdateOne) ClearDecisions() *AlertUpdateOne

ClearDecisions clears all "decisions" edges to the Decision entity.

func (*AlertUpdateOne) ClearEvents

func (auo *AlertUpdateOne) ClearEvents() *AlertUpdateOne

ClearEvents clears all "events" edges to the Event entity.

func (*AlertUpdateOne) ClearEventsCount

func (auo *AlertUpdateOne) ClearEventsCount() *AlertUpdateOne

ClearEventsCount clears the value of the "eventsCount" field.

func (*AlertUpdateOne) ClearLeakSpeed

func (auo *AlertUpdateOne) ClearLeakSpeed() *AlertUpdateOne

ClearLeakSpeed clears the value of the "leakSpeed" field.

func (*AlertUpdateOne) ClearMessage

func (auo *AlertUpdateOne) ClearMessage() *AlertUpdateOne

ClearMessage clears the value of the "message" field.

func (*AlertUpdateOne) ClearMetas

func (auo *AlertUpdateOne) ClearMetas() *AlertUpdateOne

ClearMetas clears all "metas" edges to the Meta entity.

func (*AlertUpdateOne) ClearOwner

func (auo *AlertUpdateOne) ClearOwner() *AlertUpdateOne

ClearOwner clears the "owner" edge to the Machine entity.

func (*AlertUpdateOne) ClearScenarioHash

func (auo *AlertUpdateOne) ClearScenarioHash() *AlertUpdateOne

ClearScenarioHash clears the value of the "scenarioHash" field.

func (*AlertUpdateOne) ClearScenarioVersion

func (auo *AlertUpdateOne) ClearScenarioVersion() *AlertUpdateOne

ClearScenarioVersion clears the value of the "scenarioVersion" field.

func (*AlertUpdateOne) ClearSourceAsName

func (auo *AlertUpdateOne) ClearSourceAsName() *AlertUpdateOne

ClearSourceAsName clears the value of the "sourceAsName" field.

func (*AlertUpdateOne) ClearSourceAsNumber

func (auo *AlertUpdateOne) ClearSourceAsNumber() *AlertUpdateOne

ClearSourceAsNumber clears the value of the "sourceAsNumber" field.

func (*AlertUpdateOne) ClearSourceCountry

func (auo *AlertUpdateOne) ClearSourceCountry() *AlertUpdateOne

ClearSourceCountry clears the value of the "sourceCountry" field.

func (*AlertUpdateOne) ClearSourceIp

func (auo *AlertUpdateOne) ClearSourceIp() *AlertUpdateOne

ClearSourceIp clears the value of the "sourceIp" field.

func (*AlertUpdateOne) ClearSourceLatitude

func (auo *AlertUpdateOne) ClearSourceLatitude() *AlertUpdateOne

ClearSourceLatitude clears the value of the "sourceLatitude" field.

func (*AlertUpdateOne) ClearSourceLongitude

func (auo *AlertUpdateOne) ClearSourceLongitude() *AlertUpdateOne

ClearSourceLongitude clears the value of the "sourceLongitude" field.

func (*AlertUpdateOne) ClearSourceRange

func (auo *AlertUpdateOne) ClearSourceRange() *AlertUpdateOne

ClearSourceRange clears the value of the "sourceRange" field.

func (*AlertUpdateOne) ClearSourceScope

func (auo *AlertUpdateOne) ClearSourceScope() *AlertUpdateOne

ClearSourceScope clears the value of the "sourceScope" field.

func (*AlertUpdateOne) ClearSourceValue

func (auo *AlertUpdateOne) ClearSourceValue() *AlertUpdateOne

ClearSourceValue clears the value of the "sourceValue" field.

func (*AlertUpdateOne) ClearStartedAt

func (auo *AlertUpdateOne) ClearStartedAt() *AlertUpdateOne

ClearStartedAt clears the value of the "startedAt" field.

func (*AlertUpdateOne) ClearStoppedAt

func (auo *AlertUpdateOne) ClearStoppedAt() *AlertUpdateOne

ClearStoppedAt clears the value of the "stoppedAt" field.

func (*AlertUpdateOne) ClearUpdatedAt added in v1.3.0

func (auo *AlertUpdateOne) ClearUpdatedAt() *AlertUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AlertUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AlertUpdateOne) ExecX

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

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

func (*AlertUpdateOne) Mutation

func (auo *AlertUpdateOne) Mutation() *AlertMutation

Mutation returns the AlertMutation object of the builder.

func (*AlertUpdateOne) RemoveDecisionIDs

func (auo *AlertUpdateOne) RemoveDecisionIDs(ids ...int) *AlertUpdateOne

RemoveDecisionIDs removes the "decisions" edge to Decision entities by IDs.

func (*AlertUpdateOne) RemoveDecisions

func (auo *AlertUpdateOne) RemoveDecisions(d ...*Decision) *AlertUpdateOne

RemoveDecisions removes "decisions" edges to Decision entities.

func (*AlertUpdateOne) RemoveEventIDs

func (auo *AlertUpdateOne) RemoveEventIDs(ids ...int) *AlertUpdateOne

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*AlertUpdateOne) RemoveEvents

func (auo *AlertUpdateOne) RemoveEvents(e ...*Event) *AlertUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*AlertUpdateOne) RemoveMetaIDs

func (auo *AlertUpdateOne) RemoveMetaIDs(ids ...int) *AlertUpdateOne

RemoveMetaIDs removes the "metas" edge to Meta entities by IDs.

func (*AlertUpdateOne) RemoveMetas

func (auo *AlertUpdateOne) RemoveMetas(m ...*Meta) *AlertUpdateOne

RemoveMetas removes "metas" edges to Meta entities.

func (*AlertUpdateOne) Save

func (auo *AlertUpdateOne) Save(ctx context.Context) (*Alert, error)

Save executes the query and returns the updated Alert entity.

func (*AlertUpdateOne) SaveX

func (auo *AlertUpdateOne) SaveX(ctx context.Context) *Alert

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

func (*AlertUpdateOne) Select added in v1.2.1

func (auo *AlertUpdateOne) Select(field string, fields ...string) *AlertUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*AlertUpdateOne) SetBucketId

func (auo *AlertUpdateOne) SetBucketId(s string) *AlertUpdateOne

SetBucketId sets the "bucketId" field.

func (*AlertUpdateOne) SetCapacity

func (auo *AlertUpdateOne) SetCapacity(i int32) *AlertUpdateOne

SetCapacity sets the "capacity" field.

func (*AlertUpdateOne) SetCreatedAt

func (auo *AlertUpdateOne) SetCreatedAt(t time.Time) *AlertUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AlertUpdateOne) SetEventsCount

func (auo *AlertUpdateOne) SetEventsCount(i int32) *AlertUpdateOne

SetEventsCount sets the "eventsCount" field.

func (*AlertUpdateOne) SetLeakSpeed

func (auo *AlertUpdateOne) SetLeakSpeed(s string) *AlertUpdateOne

SetLeakSpeed sets the "leakSpeed" field.

func (*AlertUpdateOne) SetMessage

func (auo *AlertUpdateOne) SetMessage(s string) *AlertUpdateOne

SetMessage sets the "message" field.

func (*AlertUpdateOne) SetNillableBucketId

func (auo *AlertUpdateOne) SetNillableBucketId(s *string) *AlertUpdateOne

SetNillableBucketId sets the "bucketId" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableCapacity

func (auo *AlertUpdateOne) SetNillableCapacity(i *int32) *AlertUpdateOne

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableEventsCount

func (auo *AlertUpdateOne) SetNillableEventsCount(i *int32) *AlertUpdateOne

SetNillableEventsCount sets the "eventsCount" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableLeakSpeed

func (auo *AlertUpdateOne) SetNillableLeakSpeed(s *string) *AlertUpdateOne

SetNillableLeakSpeed sets the "leakSpeed" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableMessage

func (auo *AlertUpdateOne) SetNillableMessage(s *string) *AlertUpdateOne

SetNillableMessage sets the "message" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableOwnerID

func (auo *AlertUpdateOne) SetNillableOwnerID(id *int) *AlertUpdateOne

SetNillableOwnerID sets the "owner" edge to the Machine entity by ID if the given value is not nil.

func (*AlertUpdateOne) SetNillableScenarioHash

func (auo *AlertUpdateOne) SetNillableScenarioHash(s *string) *AlertUpdateOne

SetNillableScenarioHash sets the "scenarioHash" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableScenarioVersion

func (auo *AlertUpdateOne) SetNillableScenarioVersion(s *string) *AlertUpdateOne

SetNillableScenarioVersion sets the "scenarioVersion" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSimulated

func (auo *AlertUpdateOne) SetNillableSimulated(b *bool) *AlertUpdateOne

SetNillableSimulated sets the "simulated" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceAsName

func (auo *AlertUpdateOne) SetNillableSourceAsName(s *string) *AlertUpdateOne

SetNillableSourceAsName sets the "sourceAsName" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceAsNumber

func (auo *AlertUpdateOne) SetNillableSourceAsNumber(s *string) *AlertUpdateOne

SetNillableSourceAsNumber sets the "sourceAsNumber" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceCountry

func (auo *AlertUpdateOne) SetNillableSourceCountry(s *string) *AlertUpdateOne

SetNillableSourceCountry sets the "sourceCountry" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceIp

func (auo *AlertUpdateOne) SetNillableSourceIp(s *string) *AlertUpdateOne

SetNillableSourceIp sets the "sourceIp" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceLatitude

func (auo *AlertUpdateOne) SetNillableSourceLatitude(f *float32) *AlertUpdateOne

SetNillableSourceLatitude sets the "sourceLatitude" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceLongitude

func (auo *AlertUpdateOne) SetNillableSourceLongitude(f *float32) *AlertUpdateOne

SetNillableSourceLongitude sets the "sourceLongitude" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceRange

func (auo *AlertUpdateOne) SetNillableSourceRange(s *string) *AlertUpdateOne

SetNillableSourceRange sets the "sourceRange" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceScope

func (auo *AlertUpdateOne) SetNillableSourceScope(s *string) *AlertUpdateOne

SetNillableSourceScope sets the "sourceScope" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableSourceValue

func (auo *AlertUpdateOne) SetNillableSourceValue(s *string) *AlertUpdateOne

SetNillableSourceValue sets the "sourceValue" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableStartedAt

func (auo *AlertUpdateOne) SetNillableStartedAt(t *time.Time) *AlertUpdateOne

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

func (*AlertUpdateOne) SetNillableStoppedAt

func (auo *AlertUpdateOne) SetNillableStoppedAt(t *time.Time) *AlertUpdateOne

SetNillableStoppedAt sets the "stoppedAt" field if the given value is not nil.

func (*AlertUpdateOne) SetOwner

func (auo *AlertUpdateOne) SetOwner(m *Machine) *AlertUpdateOne

SetOwner sets the "owner" edge to the Machine entity.

func (*AlertUpdateOne) SetOwnerID

func (auo *AlertUpdateOne) SetOwnerID(id int) *AlertUpdateOne

SetOwnerID sets the "owner" edge to the Machine entity by ID.

func (*AlertUpdateOne) SetScenario

func (auo *AlertUpdateOne) SetScenario(s string) *AlertUpdateOne

SetScenario sets the "scenario" field.

func (*AlertUpdateOne) SetScenarioHash

func (auo *AlertUpdateOne) SetScenarioHash(s string) *AlertUpdateOne

SetScenarioHash sets the "scenarioHash" field.

func (*AlertUpdateOne) SetScenarioVersion

func (auo *AlertUpdateOne) SetScenarioVersion(s string) *AlertUpdateOne

SetScenarioVersion sets the "scenarioVersion" field.

func (*AlertUpdateOne) SetSimulated

func (auo *AlertUpdateOne) SetSimulated(b bool) *AlertUpdateOne

SetSimulated sets the "simulated" field.

func (*AlertUpdateOne) SetSourceAsName

func (auo *AlertUpdateOne) SetSourceAsName(s string) *AlertUpdateOne

SetSourceAsName sets the "sourceAsName" field.

func (*AlertUpdateOne) SetSourceAsNumber

func (auo *AlertUpdateOne) SetSourceAsNumber(s string) *AlertUpdateOne

SetSourceAsNumber sets the "sourceAsNumber" field.

func (*AlertUpdateOne) SetSourceCountry

func (auo *AlertUpdateOne) SetSourceCountry(s string) *AlertUpdateOne

SetSourceCountry sets the "sourceCountry" field.

func (*AlertUpdateOne) SetSourceIp

func (auo *AlertUpdateOne) SetSourceIp(s string) *AlertUpdateOne

SetSourceIp sets the "sourceIp" field.

func (*AlertUpdateOne) SetSourceLatitude

func (auo *AlertUpdateOne) SetSourceLatitude(f float32) *AlertUpdateOne

SetSourceLatitude sets the "sourceLatitude" field.

func (*AlertUpdateOne) SetSourceLongitude

func (auo *AlertUpdateOne) SetSourceLongitude(f float32) *AlertUpdateOne

SetSourceLongitude sets the "sourceLongitude" field.

func (*AlertUpdateOne) SetSourceRange

func (auo *AlertUpdateOne) SetSourceRange(s string) *AlertUpdateOne

SetSourceRange sets the "sourceRange" field.

func (*AlertUpdateOne) SetSourceScope

func (auo *AlertUpdateOne) SetSourceScope(s string) *AlertUpdateOne

SetSourceScope sets the "sourceScope" field.

func (*AlertUpdateOne) SetSourceValue

func (auo *AlertUpdateOne) SetSourceValue(s string) *AlertUpdateOne

SetSourceValue sets the "sourceValue" field.

func (*AlertUpdateOne) SetStartedAt

func (auo *AlertUpdateOne) SetStartedAt(t time.Time) *AlertUpdateOne

SetStartedAt sets the "startedAt" field.

func (*AlertUpdateOne) SetStoppedAt

func (auo *AlertUpdateOne) SetStoppedAt(t time.Time) *AlertUpdateOne

SetStoppedAt sets the "stoppedAt" field.

func (*AlertUpdateOne) SetUpdatedAt

func (auo *AlertUpdateOne) SetUpdatedAt(t time.Time) *AlertUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Alerts

type Alerts []*Alert

Alerts is a parsable slice of Alert.

type Bouncer

type Bouncer struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt *time.Time `json:"updated_at"`
	// Name holds the value of the "name" field.
	Name string `json:"name"`
	// APIKey holds the value of the "api_key" field.
	APIKey string `json:"api_key"`
	// Revoked holds the value of the "revoked" field.
	Revoked bool `json:"revoked"`
	// IPAddress holds the value of the "ip_address" field.
	IPAddress string `json:"ip_address"`
	// Type holds the value of the "type" field.
	Type string `json:"type"`
	// Version holds the value of the "version" field.
	Version string `json:"version"`
	// Until holds the value of the "until" field.
	Until time.Time `json:"until"`
	// LastPull holds the value of the "last_pull" field.
	LastPull time.Time `json:"last_pull"`
	// AuthType holds the value of the "auth_type" field.
	AuthType string `json:"auth_type"`
	// contains filtered or unexported fields
}

Bouncer is the model entity for the Bouncer schema.

func (*Bouncer) String

func (b *Bouncer) String() string

String implements the fmt.Stringer.

func (*Bouncer) Unwrap

func (b *Bouncer) Unwrap() *Bouncer

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

func (b *Bouncer) Update() *BouncerUpdateOne

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

type BouncerClient

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

BouncerClient is a client for the Bouncer schema.

func NewBouncerClient

func NewBouncerClient(c config) *BouncerClient

NewBouncerClient returns a client for the Bouncer from the given config.

func (*BouncerClient) Create

func (c *BouncerClient) Create() *BouncerCreate

Create returns a builder for creating a Bouncer entity.

func (*BouncerClient) CreateBulk

func (c *BouncerClient) CreateBulk(builders ...*BouncerCreate) *BouncerCreateBulk

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

func (*BouncerClient) Delete

func (c *BouncerClient) Delete() *BouncerDelete

Delete returns a delete builder for Bouncer.

func (*BouncerClient) DeleteOne

func (c *BouncerClient) DeleteOne(b *Bouncer) *BouncerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BouncerClient) DeleteOneID

func (c *BouncerClient) DeleteOneID(id int) *BouncerDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*BouncerClient) Get

func (c *BouncerClient) Get(ctx context.Context, id int) (*Bouncer, error)

Get returns a Bouncer entity by its id.

func (*BouncerClient) GetX

func (c *BouncerClient) GetX(ctx context.Context, id int) *Bouncer

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

func (*BouncerClient) Hooks

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

Hooks returns the client hooks.

func (*BouncerClient) Query

func (c *BouncerClient) Query() *BouncerQuery

Query returns a query builder for Bouncer.

func (*BouncerClient) Update

func (c *BouncerClient) Update() *BouncerUpdate

Update returns an update builder for Bouncer.

func (*BouncerClient) UpdateOne

func (c *BouncerClient) UpdateOne(b *Bouncer) *BouncerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BouncerClient) UpdateOneID

func (c *BouncerClient) UpdateOneID(id int) *BouncerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BouncerClient) Use

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

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

type BouncerCreate

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

BouncerCreate is the builder for creating a Bouncer entity.

func (*BouncerCreate) Exec added in v1.2.1

func (bc *BouncerCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BouncerCreate) ExecX added in v1.2.1

func (bc *BouncerCreate) ExecX(ctx context.Context)

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

func (*BouncerCreate) Mutation

func (bc *BouncerCreate) Mutation() *BouncerMutation

Mutation returns the BouncerMutation object of the builder.

func (*BouncerCreate) Save

func (bc *BouncerCreate) Save(ctx context.Context) (*Bouncer, error)

Save creates the Bouncer in the database.

func (*BouncerCreate) SaveX

func (bc *BouncerCreate) SaveX(ctx context.Context) *Bouncer

SaveX calls Save and panics if Save returns an error.

func (*BouncerCreate) SetAPIKey

func (bc *BouncerCreate) SetAPIKey(s string) *BouncerCreate

SetAPIKey sets the "api_key" field.

func (*BouncerCreate) SetAuthType added in v1.4.0

func (bc *BouncerCreate) SetAuthType(s string) *BouncerCreate

SetAuthType sets the "auth_type" field.

func (*BouncerCreate) SetCreatedAt

func (bc *BouncerCreate) SetCreatedAt(t time.Time) *BouncerCreate

SetCreatedAt sets the "created_at" field.

func (*BouncerCreate) SetIPAddress

func (bc *BouncerCreate) SetIPAddress(s string) *BouncerCreate

SetIPAddress sets the "ip_address" field.

func (*BouncerCreate) SetLastPull

func (bc *BouncerCreate) SetLastPull(t time.Time) *BouncerCreate

SetLastPull sets the "last_pull" field.

func (*BouncerCreate) SetName

func (bc *BouncerCreate) SetName(s string) *BouncerCreate

SetName sets the "name" field.

func (*BouncerCreate) SetNillableAuthType added in v1.4.0

func (bc *BouncerCreate) SetNillableAuthType(s *string) *BouncerCreate

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*BouncerCreate) SetNillableCreatedAt

func (bc *BouncerCreate) SetNillableCreatedAt(t *time.Time) *BouncerCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*BouncerCreate) SetNillableIPAddress

func (bc *BouncerCreate) SetNillableIPAddress(s *string) *BouncerCreate

SetNillableIPAddress sets the "ip_address" field if the given value is not nil.

func (*BouncerCreate) SetNillableLastPull

func (bc *BouncerCreate) SetNillableLastPull(t *time.Time) *BouncerCreate

SetNillableLastPull sets the "last_pull" field if the given value is not nil.

func (*BouncerCreate) SetNillableType

func (bc *BouncerCreate) SetNillableType(s *string) *BouncerCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*BouncerCreate) SetNillableUntil

func (bc *BouncerCreate) SetNillableUntil(t *time.Time) *BouncerCreate

SetNillableUntil sets the "until" field if the given value is not nil.

func (*BouncerCreate) SetNillableUpdatedAt

func (bc *BouncerCreate) SetNillableUpdatedAt(t *time.Time) *BouncerCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*BouncerCreate) SetNillableVersion

func (bc *BouncerCreate) SetNillableVersion(s *string) *BouncerCreate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*BouncerCreate) SetRevoked

func (bc *BouncerCreate) SetRevoked(b bool) *BouncerCreate

SetRevoked sets the "revoked" field.

func (*BouncerCreate) SetType

func (bc *BouncerCreate) SetType(s string) *BouncerCreate

SetType sets the "type" field.

func (*BouncerCreate) SetUntil

func (bc *BouncerCreate) SetUntil(t time.Time) *BouncerCreate

SetUntil sets the "until" field.

func (*BouncerCreate) SetUpdatedAt

func (bc *BouncerCreate) SetUpdatedAt(t time.Time) *BouncerCreate

SetUpdatedAt sets the "updated_at" field.

func (*BouncerCreate) SetVersion

func (bc *BouncerCreate) SetVersion(s string) *BouncerCreate

SetVersion sets the "version" field.

type BouncerCreateBulk

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

BouncerCreateBulk is the builder for creating many Bouncer entities in bulk.

func (*BouncerCreateBulk) Exec added in v1.2.1

func (bcb *BouncerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BouncerCreateBulk) ExecX added in v1.2.1

func (bcb *BouncerCreateBulk) ExecX(ctx context.Context)

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

func (*BouncerCreateBulk) Save

func (bcb *BouncerCreateBulk) Save(ctx context.Context) ([]*Bouncer, error)

Save creates the Bouncer entities in the database.

func (*BouncerCreateBulk) SaveX

func (bcb *BouncerCreateBulk) SaveX(ctx context.Context) []*Bouncer

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

type BouncerDelete

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

BouncerDelete is the builder for deleting a Bouncer entity.

func (*BouncerDelete) Exec

func (bd *BouncerDelete) Exec(ctx context.Context) (int, error)

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

func (*BouncerDelete) ExecX

func (bd *BouncerDelete) ExecX(ctx context.Context) int

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

func (*BouncerDelete) Where

func (bd *BouncerDelete) Where(ps ...predicate.Bouncer) *BouncerDelete

Where appends a list predicates to the BouncerDelete builder.

type BouncerDeleteOne

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

BouncerDeleteOne is the builder for deleting a single Bouncer entity.

func (*BouncerDeleteOne) Exec

func (bdo *BouncerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BouncerDeleteOne) ExecX

func (bdo *BouncerDeleteOne) ExecX(ctx context.Context)

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

type BouncerGroupBy

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

BouncerGroupBy is the group-by builder for Bouncer entities.

func (*BouncerGroupBy) Aggregate

func (bgb *BouncerGroupBy) Aggregate(fns ...AggregateFunc) *BouncerGroupBy

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

func (*BouncerGroupBy) Bool

func (s *BouncerGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*BouncerGroupBy) BoolX

func (s *BouncerGroupBy) BoolX(ctx context.Context) bool

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

func (*BouncerGroupBy) Bools

func (s *BouncerGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*BouncerGroupBy) BoolsX

func (s *BouncerGroupBy) BoolsX(ctx context.Context) []bool

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

func (*BouncerGroupBy) Float64

func (s *BouncerGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*BouncerGroupBy) Float64X

func (s *BouncerGroupBy) Float64X(ctx context.Context) float64

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

func (*BouncerGroupBy) Float64s

func (s *BouncerGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*BouncerGroupBy) Float64sX

func (s *BouncerGroupBy) Float64sX(ctx context.Context) []float64

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

func (*BouncerGroupBy) Int

func (s *BouncerGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*BouncerGroupBy) IntX

func (s *BouncerGroupBy) IntX(ctx context.Context) int

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

func (*BouncerGroupBy) Ints

func (s *BouncerGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*BouncerGroupBy) IntsX

func (s *BouncerGroupBy) IntsX(ctx context.Context) []int

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

func (*BouncerGroupBy) Scan

func (bgb *BouncerGroupBy) Scan(ctx context.Context, v any) error

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

func (*BouncerGroupBy) ScanX

func (s *BouncerGroupBy) ScanX(ctx context.Context, v any)

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

func (*BouncerGroupBy) String

func (s *BouncerGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*BouncerGroupBy) StringX

func (s *BouncerGroupBy) StringX(ctx context.Context) string

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

func (*BouncerGroupBy) Strings

func (s *BouncerGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*BouncerGroupBy) StringsX

func (s *BouncerGroupBy) StringsX(ctx context.Context) []string

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

type BouncerMutation

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

BouncerMutation represents an operation that mutates the Bouncer nodes in the graph.

func (*BouncerMutation) APIKey

func (m *BouncerMutation) APIKey() (r string, exists bool)

APIKey returns the value of the "api_key" field in the mutation.

func (*BouncerMutation) AddField

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

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

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

func (*BouncerMutation) AddedField

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

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

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

func (*BouncerMutation) AddedIDs

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

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

func (*BouncerMutation) AuthType added in v1.4.0

func (m *BouncerMutation) AuthType() (r string, exists bool)

AuthType returns the value of the "auth_type" field in the mutation.

func (*BouncerMutation) ClearCreatedAt added in v1.3.0

func (m *BouncerMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*BouncerMutation) ClearEdge

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

func (m *BouncerMutation) 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 (*BouncerMutation) ClearIPAddress

func (m *BouncerMutation) ClearIPAddress()

ClearIPAddress clears the value of the "ip_address" field.

func (*BouncerMutation) ClearType

func (m *BouncerMutation) ClearType()

ClearType clears the value of the "type" field.

func (*BouncerMutation) ClearUntil

func (m *BouncerMutation) ClearUntil()

ClearUntil clears the value of the "until" field.

func (*BouncerMutation) ClearUpdatedAt added in v1.3.0

func (m *BouncerMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*BouncerMutation) ClearVersion

func (m *BouncerMutation) ClearVersion()

ClearVersion clears the value of the "version" field.

func (*BouncerMutation) ClearedEdges

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

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

func (*BouncerMutation) ClearedFields

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

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

func (BouncerMutation) Client

func (m BouncerMutation) 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 (*BouncerMutation) CreatedAt

func (m *BouncerMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*BouncerMutation) CreatedAtCleared added in v1.3.0

func (m *BouncerMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*BouncerMutation) EdgeCleared

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

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

func (*BouncerMutation) Field

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

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

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

func (*BouncerMutation) Fields

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

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

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

func (*BouncerMutation) ID

func (m *BouncerMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*BouncerMutation) IDs added in v1.3.1

func (m *BouncerMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*BouncerMutation) IPAddress

func (m *BouncerMutation) IPAddress() (r string, exists bool)

IPAddress returns the value of the "ip_address" field in the mutation.

func (*BouncerMutation) IPAddressCleared

func (m *BouncerMutation) IPAddressCleared() bool

IPAddressCleared returns if the "ip_address" field was cleared in this mutation.

func (*BouncerMutation) LastPull

func (m *BouncerMutation) LastPull() (r time.Time, exists bool)

LastPull returns the value of the "last_pull" field in the mutation.

func (*BouncerMutation) Name

func (m *BouncerMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*BouncerMutation) OldAPIKey

func (m *BouncerMutation) OldAPIKey(ctx context.Context) (v string, err error)

OldAPIKey returns the old "api_key" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldAuthType added in v1.4.0

func (m *BouncerMutation) OldAuthType(ctx context.Context) (v string, err error)

OldAuthType returns the old "auth_type" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldCreatedAt

func (m *BouncerMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldField

func (m *BouncerMutation) 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 (*BouncerMutation) OldIPAddress

func (m *BouncerMutation) OldIPAddress(ctx context.Context) (v string, err error)

OldIPAddress returns the old "ip_address" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldLastPull

func (m *BouncerMutation) OldLastPull(ctx context.Context) (v time.Time, err error)

OldLastPull returns the old "last_pull" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldName

func (m *BouncerMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldRevoked

func (m *BouncerMutation) OldRevoked(ctx context.Context) (v bool, err error)

OldRevoked returns the old "revoked" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldType

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

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

func (m *BouncerMutation) OldUntil(ctx context.Context) (v time.Time, err error)

OldUntil returns the old "until" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldUpdatedAt

func (m *BouncerMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) OldVersion

func (m *BouncerMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the Bouncer entity. If the Bouncer 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 (*BouncerMutation) Op

func (m *BouncerMutation) Op() Op

Op returns the operation name.

func (*BouncerMutation) RemovedEdges

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

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

func (*BouncerMutation) RemovedIDs

func (m *BouncerMutation) 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 (*BouncerMutation) ResetAPIKey

func (m *BouncerMutation) ResetAPIKey()

ResetAPIKey resets all changes to the "api_key" field.

func (*BouncerMutation) ResetAuthType added in v1.4.0

func (m *BouncerMutation) ResetAuthType()

ResetAuthType resets all changes to the "auth_type" field.

func (*BouncerMutation) ResetCreatedAt

func (m *BouncerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BouncerMutation) ResetEdge

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

func (m *BouncerMutation) 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 (*BouncerMutation) ResetIPAddress

func (m *BouncerMutation) ResetIPAddress()

ResetIPAddress resets all changes to the "ip_address" field.

func (*BouncerMutation) ResetLastPull

func (m *BouncerMutation) ResetLastPull()

ResetLastPull resets all changes to the "last_pull" field.

func (*BouncerMutation) ResetName

func (m *BouncerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*BouncerMutation) ResetRevoked

func (m *BouncerMutation) ResetRevoked()

ResetRevoked resets all changes to the "revoked" field.

func (*BouncerMutation) ResetType

func (m *BouncerMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*BouncerMutation) ResetUntil

func (m *BouncerMutation) ResetUntil()

ResetUntil resets all changes to the "until" field.

func (*BouncerMutation) ResetUpdatedAt

func (m *BouncerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BouncerMutation) ResetVersion

func (m *BouncerMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*BouncerMutation) Revoked

func (m *BouncerMutation) Revoked() (r bool, exists bool)

Revoked returns the value of the "revoked" field in the mutation.

func (*BouncerMutation) SetAPIKey

func (m *BouncerMutation) SetAPIKey(s string)

SetAPIKey sets the "api_key" field.

func (*BouncerMutation) SetAuthType added in v1.4.0

func (m *BouncerMutation) SetAuthType(s string)

SetAuthType sets the "auth_type" field.

func (*BouncerMutation) SetCreatedAt

func (m *BouncerMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*BouncerMutation) SetField

func (m *BouncerMutation) 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 (*BouncerMutation) SetIPAddress

func (m *BouncerMutation) SetIPAddress(s string)

SetIPAddress sets the "ip_address" field.

func (*BouncerMutation) SetLastPull

func (m *BouncerMutation) SetLastPull(t time.Time)

SetLastPull sets the "last_pull" field.

func (*BouncerMutation) SetName

func (m *BouncerMutation) SetName(s string)

SetName sets the "name" field.

func (*BouncerMutation) SetRevoked

func (m *BouncerMutation) SetRevoked(b bool)

SetRevoked sets the "revoked" field.

func (*BouncerMutation) SetType

func (m *BouncerMutation) SetType(s string)

SetType sets the "type" field.

func (*BouncerMutation) SetUntil

func (m *BouncerMutation) SetUntil(t time.Time)

SetUntil sets the "until" field.

func (*BouncerMutation) SetUpdatedAt

func (m *BouncerMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*BouncerMutation) SetVersion

func (m *BouncerMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (BouncerMutation) Tx

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

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

func (*BouncerMutation) Type

func (m *BouncerMutation) Type() string

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

func (*BouncerMutation) TypeCleared

func (m *BouncerMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*BouncerMutation) Until

func (m *BouncerMutation) Until() (r time.Time, exists bool)

Until returns the value of the "until" field in the mutation.

func (*BouncerMutation) UntilCleared

func (m *BouncerMutation) UntilCleared() bool

UntilCleared returns if the "until" field was cleared in this mutation.

func (*BouncerMutation) UpdatedAt

func (m *BouncerMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*BouncerMutation) UpdatedAtCleared added in v1.3.0

func (m *BouncerMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*BouncerMutation) Version

func (m *BouncerMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*BouncerMutation) VersionCleared

func (m *BouncerMutation) VersionCleared() bool

VersionCleared returns if the "version" field was cleared in this mutation.

func (*BouncerMutation) Where added in v1.2.1

func (m *BouncerMutation) Where(ps ...predicate.Bouncer)

Where appends a list predicates to the BouncerMutation builder.

type BouncerQuery

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

BouncerQuery is the builder for querying Bouncer entities.

func (*BouncerQuery) All

func (bq *BouncerQuery) All(ctx context.Context) ([]*Bouncer, error)

All executes the query and returns a list of Bouncers.

func (*BouncerQuery) AllX

func (bq *BouncerQuery) AllX(ctx context.Context) []*Bouncer

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

func (*BouncerQuery) Clone

func (bq *BouncerQuery) Clone() *BouncerQuery

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

func (*BouncerQuery) Count

func (bq *BouncerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BouncerQuery) CountX

func (bq *BouncerQuery) CountX(ctx context.Context) int

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

func (*BouncerQuery) Exist

func (bq *BouncerQuery) Exist(ctx context.Context) (bool, error)

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

func (*BouncerQuery) ExistX

func (bq *BouncerQuery) ExistX(ctx context.Context) bool

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

func (*BouncerQuery) First

func (bq *BouncerQuery) First(ctx context.Context) (*Bouncer, error)

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

func (*BouncerQuery) FirstID

func (bq *BouncerQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BouncerQuery) FirstIDX added in v1.0.3

func (bq *BouncerQuery) FirstIDX(ctx context.Context) int

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

func (*BouncerQuery) FirstX

func (bq *BouncerQuery) FirstX(ctx context.Context) *Bouncer

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

func (*BouncerQuery) GroupBy

func (bq *BouncerQuery) GroupBy(field string, fields ...string) *BouncerGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at"`
	Count int `json:"count,omitempty"`
}

client.Bouncer.Query().
	GroupBy(bouncer.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BouncerQuery) IDs

func (bq *BouncerQuery) IDs(ctx context.Context) ([]int, error)

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

func (*BouncerQuery) IDsX

func (bq *BouncerQuery) IDsX(ctx context.Context) []int

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

func (*BouncerQuery) Limit

func (bq *BouncerQuery) Limit(limit int) *BouncerQuery

Limit adds a limit step to the query.

func (*BouncerQuery) Offset

func (bq *BouncerQuery) Offset(offset int) *BouncerQuery

Offset adds an offset step to the query.

func (*BouncerQuery) Only

func (bq *BouncerQuery) Only(ctx context.Context) (*Bouncer, error)

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

func (*BouncerQuery) OnlyID

func (bq *BouncerQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BouncerQuery) OnlyIDX

func (bq *BouncerQuery) OnlyIDX(ctx context.Context) int

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

func (*BouncerQuery) OnlyX

func (bq *BouncerQuery) OnlyX(ctx context.Context) *Bouncer

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

func (*BouncerQuery) Order

func (bq *BouncerQuery) Order(o ...OrderFunc) *BouncerQuery

Order adds an order step to the query.

func (*BouncerQuery) Select

func (bq *BouncerQuery) Select(fields ...string) *BouncerSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at"`
}

client.Bouncer.Query().
	Select(bouncer.FieldCreatedAt).
	Scan(ctx, &v)

func (*BouncerQuery) Unique added in v1.2.1

func (bq *BouncerQuery) Unique(unique bool) *BouncerQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*BouncerQuery) Where

func (bq *BouncerQuery) Where(ps ...predicate.Bouncer) *BouncerQuery

Where adds a new predicate for the BouncerQuery builder.

type BouncerSelect

type BouncerSelect struct {
	*BouncerQuery
	// contains filtered or unexported fields
}

BouncerSelect is the builder for selecting fields of Bouncer entities.

func (*BouncerSelect) Bool

func (s *BouncerSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*BouncerSelect) BoolX

func (s *BouncerSelect) BoolX(ctx context.Context) bool

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

func (*BouncerSelect) Bools

func (s *BouncerSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*BouncerSelect) BoolsX

func (s *BouncerSelect) BoolsX(ctx context.Context) []bool

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

func (*BouncerSelect) Float64

func (s *BouncerSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*BouncerSelect) Float64X

func (s *BouncerSelect) Float64X(ctx context.Context) float64

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

func (*BouncerSelect) Float64s

func (s *BouncerSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*BouncerSelect) Float64sX

func (s *BouncerSelect) Float64sX(ctx context.Context) []float64

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

func (*BouncerSelect) Int

func (s *BouncerSelect) Int(ctx context.Context) (_ int, err error)

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

func (*BouncerSelect) IntX

func (s *BouncerSelect) IntX(ctx context.Context) int

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

func (*BouncerSelect) Ints

func (s *BouncerSelect) Ints(ctx context.Context) ([]int, error)

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

func (*BouncerSelect) IntsX

func (s *BouncerSelect) IntsX(ctx context.Context) []int

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

func (*BouncerSelect) Scan

func (bs *BouncerSelect) Scan(ctx context.Context, v any) error

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

func (*BouncerSelect) ScanX

func (s *BouncerSelect) ScanX(ctx context.Context, v any)

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

func (*BouncerSelect) String

func (s *BouncerSelect) String(ctx context.Context) (_ string, err error)

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

func (*BouncerSelect) StringX

func (s *BouncerSelect) StringX(ctx context.Context) string

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

func (*BouncerSelect) Strings

func (s *BouncerSelect) Strings(ctx context.Context) ([]string, error)

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

func (*BouncerSelect) StringsX

func (s *BouncerSelect) StringsX(ctx context.Context) []string

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

type BouncerUpdate

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

BouncerUpdate is the builder for updating Bouncer entities.

func (*BouncerUpdate) ClearCreatedAt added in v1.3.0

func (bu *BouncerUpdate) ClearCreatedAt() *BouncerUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*BouncerUpdate) ClearIPAddress

func (bu *BouncerUpdate) ClearIPAddress() *BouncerUpdate

ClearIPAddress clears the value of the "ip_address" field.

func (*BouncerUpdate) ClearType

func (bu *BouncerUpdate) ClearType() *BouncerUpdate

ClearType clears the value of the "type" field.

func (*BouncerUpdate) ClearUntil

func (bu *BouncerUpdate) ClearUntil() *BouncerUpdate

ClearUntil clears the value of the "until" field.

func (*BouncerUpdate) ClearUpdatedAt added in v1.3.0

func (bu *BouncerUpdate) ClearUpdatedAt() *BouncerUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*BouncerUpdate) ClearVersion

func (bu *BouncerUpdate) ClearVersion() *BouncerUpdate

ClearVersion clears the value of the "version" field.

func (*BouncerUpdate) Exec

func (bu *BouncerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BouncerUpdate) ExecX

func (bu *BouncerUpdate) ExecX(ctx context.Context)

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

func (*BouncerUpdate) Mutation

func (bu *BouncerUpdate) Mutation() *BouncerMutation

Mutation returns the BouncerMutation object of the builder.

func (*BouncerUpdate) Save

func (bu *BouncerUpdate) Save(ctx context.Context) (int, error)

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

func (*BouncerUpdate) SaveX

func (bu *BouncerUpdate) SaveX(ctx context.Context) int

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

func (*BouncerUpdate) SetAPIKey

func (bu *BouncerUpdate) SetAPIKey(s string) *BouncerUpdate

SetAPIKey sets the "api_key" field.

func (*BouncerUpdate) SetAuthType added in v1.4.0

func (bu *BouncerUpdate) SetAuthType(s string) *BouncerUpdate

SetAuthType sets the "auth_type" field.

func (*BouncerUpdate) SetCreatedAt

func (bu *BouncerUpdate) SetCreatedAt(t time.Time) *BouncerUpdate

SetCreatedAt sets the "created_at" field.

func (*BouncerUpdate) SetIPAddress

func (bu *BouncerUpdate) SetIPAddress(s string) *BouncerUpdate

SetIPAddress sets the "ip_address" field.

func (*BouncerUpdate) SetLastPull

func (bu *BouncerUpdate) SetLastPull(t time.Time) *BouncerUpdate

SetLastPull sets the "last_pull" field.

func (*BouncerUpdate) SetName

func (bu *BouncerUpdate) SetName(s string) *BouncerUpdate

SetName sets the "name" field.

func (*BouncerUpdate) SetNillableAuthType added in v1.4.0

func (bu *BouncerUpdate) SetNillableAuthType(s *string) *BouncerUpdate

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*BouncerUpdate) SetNillableIPAddress

func (bu *BouncerUpdate) SetNillableIPAddress(s *string) *BouncerUpdate

SetNillableIPAddress sets the "ip_address" field if the given value is not nil.

func (*BouncerUpdate) SetNillableLastPull

func (bu *BouncerUpdate) SetNillableLastPull(t *time.Time) *BouncerUpdate

SetNillableLastPull sets the "last_pull" field if the given value is not nil.

func (*BouncerUpdate) SetNillableType

func (bu *BouncerUpdate) SetNillableType(s *string) *BouncerUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*BouncerUpdate) SetNillableUntil

func (bu *BouncerUpdate) SetNillableUntil(t *time.Time) *BouncerUpdate

SetNillableUntil sets the "until" field if the given value is not nil.

func (*BouncerUpdate) SetNillableVersion

func (bu *BouncerUpdate) SetNillableVersion(s *string) *BouncerUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*BouncerUpdate) SetRevoked

func (bu *BouncerUpdate) SetRevoked(b bool) *BouncerUpdate

SetRevoked sets the "revoked" field.

func (*BouncerUpdate) SetType

func (bu *BouncerUpdate) SetType(s string) *BouncerUpdate

SetType sets the "type" field.

func (*BouncerUpdate) SetUntil

func (bu *BouncerUpdate) SetUntil(t time.Time) *BouncerUpdate

SetUntil sets the "until" field.

func (*BouncerUpdate) SetUpdatedAt

func (bu *BouncerUpdate) SetUpdatedAt(t time.Time) *BouncerUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BouncerUpdate) SetVersion

func (bu *BouncerUpdate) SetVersion(s string) *BouncerUpdate

SetVersion sets the "version" field.

func (*BouncerUpdate) Where

func (bu *BouncerUpdate) Where(ps ...predicate.Bouncer) *BouncerUpdate

Where appends a list predicates to the BouncerUpdate builder.

type BouncerUpdateOne

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

BouncerUpdateOne is the builder for updating a single Bouncer entity.

func (*BouncerUpdateOne) ClearCreatedAt added in v1.3.0

func (buo *BouncerUpdateOne) ClearCreatedAt() *BouncerUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*BouncerUpdateOne) ClearIPAddress

func (buo *BouncerUpdateOne) ClearIPAddress() *BouncerUpdateOne

ClearIPAddress clears the value of the "ip_address" field.

func (*BouncerUpdateOne) ClearType

func (buo *BouncerUpdateOne) ClearType() *BouncerUpdateOne

ClearType clears the value of the "type" field.

func (*BouncerUpdateOne) ClearUntil

func (buo *BouncerUpdateOne) ClearUntil() *BouncerUpdateOne

ClearUntil clears the value of the "until" field.

func (*BouncerUpdateOne) ClearUpdatedAt added in v1.3.0

func (buo *BouncerUpdateOne) ClearUpdatedAt() *BouncerUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*BouncerUpdateOne) ClearVersion

func (buo *BouncerUpdateOne) ClearVersion() *BouncerUpdateOne

ClearVersion clears the value of the "version" field.

func (*BouncerUpdateOne) Exec

func (buo *BouncerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BouncerUpdateOne) ExecX

func (buo *BouncerUpdateOne) ExecX(ctx context.Context)

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

func (*BouncerUpdateOne) Mutation

func (buo *BouncerUpdateOne) Mutation() *BouncerMutation

Mutation returns the BouncerMutation object of the builder.

func (*BouncerUpdateOne) Save

func (buo *BouncerUpdateOne) Save(ctx context.Context) (*Bouncer, error)

Save executes the query and returns the updated Bouncer entity.

func (*BouncerUpdateOne) SaveX

func (buo *BouncerUpdateOne) SaveX(ctx context.Context) *Bouncer

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

func (*BouncerUpdateOne) Select added in v1.2.1

func (buo *BouncerUpdateOne) Select(field string, fields ...string) *BouncerUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*BouncerUpdateOne) SetAPIKey

func (buo *BouncerUpdateOne) SetAPIKey(s string) *BouncerUpdateOne

SetAPIKey sets the "api_key" field.

func (*BouncerUpdateOne) SetAuthType added in v1.4.0

func (buo *BouncerUpdateOne) SetAuthType(s string) *BouncerUpdateOne

SetAuthType sets the "auth_type" field.

func (*BouncerUpdateOne) SetCreatedAt

func (buo *BouncerUpdateOne) SetCreatedAt(t time.Time) *BouncerUpdateOne

SetCreatedAt sets the "created_at" field.

func (*BouncerUpdateOne) SetIPAddress

func (buo *BouncerUpdateOne) SetIPAddress(s string) *BouncerUpdateOne

SetIPAddress sets the "ip_address" field.

func (*BouncerUpdateOne) SetLastPull

func (buo *BouncerUpdateOne) SetLastPull(t time.Time) *BouncerUpdateOne

SetLastPull sets the "last_pull" field.

func (*BouncerUpdateOne) SetName

func (buo *BouncerUpdateOne) SetName(s string) *BouncerUpdateOne

SetName sets the "name" field.

func (*BouncerUpdateOne) SetNillableAuthType added in v1.4.0

func (buo *BouncerUpdateOne) SetNillableAuthType(s *string) *BouncerUpdateOne

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableIPAddress

func (buo *BouncerUpdateOne) SetNillableIPAddress(s *string) *BouncerUpdateOne

SetNillableIPAddress sets the "ip_address" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableLastPull

func (buo *BouncerUpdateOne) SetNillableLastPull(t *time.Time) *BouncerUpdateOne

SetNillableLastPull sets the "last_pull" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableType

func (buo *BouncerUpdateOne) SetNillableType(s *string) *BouncerUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableUntil

func (buo *BouncerUpdateOne) SetNillableUntil(t *time.Time) *BouncerUpdateOne

SetNillableUntil sets the "until" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableVersion

func (buo *BouncerUpdateOne) SetNillableVersion(s *string) *BouncerUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*BouncerUpdateOne) SetRevoked

func (buo *BouncerUpdateOne) SetRevoked(b bool) *BouncerUpdateOne

SetRevoked sets the "revoked" field.

func (*BouncerUpdateOne) SetType

func (buo *BouncerUpdateOne) SetType(s string) *BouncerUpdateOne

SetType sets the "type" field.

func (*BouncerUpdateOne) SetUntil

func (buo *BouncerUpdateOne) SetUntil(t time.Time) *BouncerUpdateOne

SetUntil sets the "until" field.

func (*BouncerUpdateOne) SetUpdatedAt

func (buo *BouncerUpdateOne) SetUpdatedAt(t time.Time) *BouncerUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*BouncerUpdateOne) SetVersion

func (buo *BouncerUpdateOne) SetVersion(s string) *BouncerUpdateOne

SetVersion sets the "version" field.

type Bouncers

type Bouncers []*Bouncer

Bouncers is a parsable slice of Bouncer.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Alert is the client for interacting with the Alert builders.
	Alert *AlertClient
	// Bouncer is the client for interacting with the Bouncer builders.
	Bouncer *BouncerClient
	// Decision is the client for interacting with the Decision builders.
	Decision *DecisionClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Machine is the client for interacting with the Machine builders.
	Machine *MachineClient
	// Meta is the client for interacting with the Meta builders.
	Meta *MetaClient
	// 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().
	Alert.
	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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit 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 Decision

type Decision struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// Until holds the value of the "until" field.
	Until *time.Time `json:"until,omitempty"`
	// Scenario holds the value of the "scenario" field.
	Scenario string `json:"scenario,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// StartIP holds the value of the "start_ip" field.
	StartIP int64 `json:"start_ip,omitempty"`
	// EndIP holds the value of the "end_ip" field.
	EndIP int64 `json:"end_ip,omitempty"`
	// StartSuffix holds the value of the "start_suffix" field.
	StartSuffix int64 `json:"start_suffix,omitempty"`
	// EndSuffix holds the value of the "end_suffix" field.
	EndSuffix int64 `json:"end_suffix,omitempty"`
	// IPSize holds the value of the "ip_size" field.
	IPSize int64 `json:"ip_size,omitempty"`
	// Scope holds the value of the "scope" field.
	Scope string `json:"scope,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Origin holds the value of the "origin" field.
	Origin string `json:"origin,omitempty"`
	// Simulated holds the value of the "simulated" field.
	Simulated bool `json:"simulated,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DecisionQuery when eager-loading is set.
	Edges DecisionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Decision is the model entity for the Decision schema.

func (*Decision) QueryOwner

func (d *Decision) QueryOwner() *AlertQuery

QueryOwner queries the "owner" edge of the Decision entity.

func (*Decision) String

func (d *Decision) String() string

String implements the fmt.Stringer.

func (*Decision) Unwrap

func (d *Decision) Unwrap() *Decision

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

func (d *Decision) Update() *DecisionUpdateOne

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

type DecisionClient

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

DecisionClient is a client for the Decision schema.

func NewDecisionClient

func NewDecisionClient(c config) *DecisionClient

NewDecisionClient returns a client for the Decision from the given config.

func (*DecisionClient) Create

func (c *DecisionClient) Create() *DecisionCreate

Create returns a builder for creating a Decision entity.

func (*DecisionClient) CreateBulk

func (c *DecisionClient) CreateBulk(builders ...*DecisionCreate) *DecisionCreateBulk

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

func (*DecisionClient) Delete

func (c *DecisionClient) Delete() *DecisionDelete

Delete returns a delete builder for Decision.

func (*DecisionClient) DeleteOne

func (c *DecisionClient) DeleteOne(d *Decision) *DecisionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DecisionClient) DeleteOneID

func (c *DecisionClient) DeleteOneID(id int) *DecisionDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*DecisionClient) Get

func (c *DecisionClient) Get(ctx context.Context, id int) (*Decision, error)

Get returns a Decision entity by its id.

func (*DecisionClient) GetX

func (c *DecisionClient) GetX(ctx context.Context, id int) *Decision

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

func (*DecisionClient) Hooks

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

Hooks returns the client hooks.

func (*DecisionClient) Query

func (c *DecisionClient) Query() *DecisionQuery

Query returns a query builder for Decision.

func (*DecisionClient) QueryOwner

func (c *DecisionClient) QueryOwner(d *Decision) *AlertQuery

QueryOwner queries the owner edge of a Decision.

func (*DecisionClient) Update

func (c *DecisionClient) Update() *DecisionUpdate

Update returns an update builder for Decision.

func (*DecisionClient) UpdateOne

func (c *DecisionClient) UpdateOne(d *Decision) *DecisionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DecisionClient) UpdateOneID

func (c *DecisionClient) UpdateOneID(id int) *DecisionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DecisionClient) Use

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

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

type DecisionCreate

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

DecisionCreate is the builder for creating a Decision entity.

func (*DecisionCreate) Exec added in v1.2.1

func (dc *DecisionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DecisionCreate) ExecX added in v1.2.1

func (dc *DecisionCreate) ExecX(ctx context.Context)

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

func (*DecisionCreate) Mutation

func (dc *DecisionCreate) Mutation() *DecisionMutation

Mutation returns the DecisionMutation object of the builder.

func (*DecisionCreate) Save

func (dc *DecisionCreate) Save(ctx context.Context) (*Decision, error)

Save creates the Decision in the database.

func (*DecisionCreate) SaveX

func (dc *DecisionCreate) SaveX(ctx context.Context) *Decision

SaveX calls Save and panics if Save returns an error.

func (*DecisionCreate) SetCreatedAt

func (dc *DecisionCreate) SetCreatedAt(t time.Time) *DecisionCreate

SetCreatedAt sets the "created_at" field.

func (*DecisionCreate) SetEndIP

func (dc *DecisionCreate) SetEndIP(i int64) *DecisionCreate

SetEndIP sets the "end_ip" field.

func (*DecisionCreate) SetEndSuffix added in v1.0.3

func (dc *DecisionCreate) SetEndSuffix(i int64) *DecisionCreate

SetEndSuffix sets the "end_suffix" field.

func (*DecisionCreate) SetIPSize added in v1.0.3

func (dc *DecisionCreate) SetIPSize(i int64) *DecisionCreate

SetIPSize sets the "ip_size" field.

func (*DecisionCreate) SetNillableCreatedAt

func (dc *DecisionCreate) SetNillableCreatedAt(t *time.Time) *DecisionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DecisionCreate) SetNillableEndIP

func (dc *DecisionCreate) SetNillableEndIP(i *int64) *DecisionCreate

SetNillableEndIP sets the "end_ip" field if the given value is not nil.

func (*DecisionCreate) SetNillableEndSuffix added in v1.0.3

func (dc *DecisionCreate) SetNillableEndSuffix(i *int64) *DecisionCreate

SetNillableEndSuffix sets the "end_suffix" field if the given value is not nil.

func (*DecisionCreate) SetNillableIPSize added in v1.0.3

func (dc *DecisionCreate) SetNillableIPSize(i *int64) *DecisionCreate

SetNillableIPSize sets the "ip_size" field if the given value is not nil.

func (*DecisionCreate) SetNillableOwnerID

func (dc *DecisionCreate) SetNillableOwnerID(id *int) *DecisionCreate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*DecisionCreate) SetNillableSimulated

func (dc *DecisionCreate) SetNillableSimulated(b *bool) *DecisionCreate

SetNillableSimulated sets the "simulated" field if the given value is not nil.

func (*DecisionCreate) SetNillableStartIP

func (dc *DecisionCreate) SetNillableStartIP(i *int64) *DecisionCreate

SetNillableStartIP sets the "start_ip" field if the given value is not nil.

func (*DecisionCreate) SetNillableStartSuffix added in v1.0.3

func (dc *DecisionCreate) SetNillableStartSuffix(i *int64) *DecisionCreate

SetNillableStartSuffix sets the "start_suffix" field if the given value is not nil.

func (*DecisionCreate) SetNillableUntil added in v1.3.4

func (dc *DecisionCreate) SetNillableUntil(t *time.Time) *DecisionCreate

SetNillableUntil sets the "until" field if the given value is not nil.

func (*DecisionCreate) SetNillableUpdatedAt

func (dc *DecisionCreate) SetNillableUpdatedAt(t *time.Time) *DecisionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*DecisionCreate) SetOrigin

func (dc *DecisionCreate) SetOrigin(s string) *DecisionCreate

SetOrigin sets the "origin" field.

func (*DecisionCreate) SetOwner

func (dc *DecisionCreate) SetOwner(a *Alert) *DecisionCreate

SetOwner sets the "owner" edge to the Alert entity.

func (*DecisionCreate) SetOwnerID

func (dc *DecisionCreate) SetOwnerID(id int) *DecisionCreate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*DecisionCreate) SetScenario

func (dc *DecisionCreate) SetScenario(s string) *DecisionCreate

SetScenario sets the "scenario" field.

func (*DecisionCreate) SetScope

func (dc *DecisionCreate) SetScope(s string) *DecisionCreate

SetScope sets the "scope" field.

func (*DecisionCreate) SetSimulated

func (dc *DecisionCreate) SetSimulated(b bool) *DecisionCreate

SetSimulated sets the "simulated" field.

func (*DecisionCreate) SetStartIP

func (dc *DecisionCreate) SetStartIP(i int64) *DecisionCreate

SetStartIP sets the "start_ip" field.

func (*DecisionCreate) SetStartSuffix added in v1.0.3

func (dc *DecisionCreate) SetStartSuffix(i int64) *DecisionCreate

SetStartSuffix sets the "start_suffix" field.

func (*DecisionCreate) SetType

func (dc *DecisionCreate) SetType(s string) *DecisionCreate

SetType sets the "type" field.

func (*DecisionCreate) SetUntil

func (dc *DecisionCreate) SetUntil(t time.Time) *DecisionCreate

SetUntil sets the "until" field.

func (*DecisionCreate) SetUpdatedAt

func (dc *DecisionCreate) SetUpdatedAt(t time.Time) *DecisionCreate

SetUpdatedAt sets the "updated_at" field.

func (*DecisionCreate) SetValue

func (dc *DecisionCreate) SetValue(s string) *DecisionCreate

SetValue sets the "value" field.

type DecisionCreateBulk

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

DecisionCreateBulk is the builder for creating many Decision entities in bulk.

func (*DecisionCreateBulk) Exec added in v1.2.1

func (dcb *DecisionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DecisionCreateBulk) ExecX added in v1.2.1

func (dcb *DecisionCreateBulk) ExecX(ctx context.Context)

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

func (*DecisionCreateBulk) Save

func (dcb *DecisionCreateBulk) Save(ctx context.Context) ([]*Decision, error)

Save creates the Decision entities in the database.

func (*DecisionCreateBulk) SaveX

func (dcb *DecisionCreateBulk) SaveX(ctx context.Context) []*Decision

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

type DecisionDelete

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

DecisionDelete is the builder for deleting a Decision entity.

func (*DecisionDelete) Exec

func (dd *DecisionDelete) Exec(ctx context.Context) (int, error)

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

func (*DecisionDelete) ExecX

func (dd *DecisionDelete) ExecX(ctx context.Context) int

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

func (*DecisionDelete) Where

func (dd *DecisionDelete) Where(ps ...predicate.Decision) *DecisionDelete

Where appends a list predicates to the DecisionDelete builder.

type DecisionDeleteOne

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

DecisionDeleteOne is the builder for deleting a single Decision entity.

func (*DecisionDeleteOne) Exec

func (ddo *DecisionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DecisionDeleteOne) ExecX

func (ddo *DecisionDeleteOne) ExecX(ctx context.Context)

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

type DecisionEdges

type DecisionEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Alert `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (DecisionEdges) OwnerOrErr

func (e DecisionEdges) OwnerOrErr() (*Alert, error)

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

type DecisionGroupBy

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

DecisionGroupBy is the group-by builder for Decision entities.

func (*DecisionGroupBy) Aggregate

func (dgb *DecisionGroupBy) Aggregate(fns ...AggregateFunc) *DecisionGroupBy

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

func (*DecisionGroupBy) Bool

func (s *DecisionGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*DecisionGroupBy) BoolX

func (s *DecisionGroupBy) BoolX(ctx context.Context) bool

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

func (*DecisionGroupBy) Bools

func (s *DecisionGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*DecisionGroupBy) BoolsX

func (s *DecisionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DecisionGroupBy) Float64

func (s *DecisionGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*DecisionGroupBy) Float64X

func (s *DecisionGroupBy) Float64X(ctx context.Context) float64

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

func (*DecisionGroupBy) Float64s

func (s *DecisionGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*DecisionGroupBy) Float64sX

func (s *DecisionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DecisionGroupBy) Int

func (s *DecisionGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*DecisionGroupBy) IntX

func (s *DecisionGroupBy) IntX(ctx context.Context) int

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

func (*DecisionGroupBy) Ints

func (s *DecisionGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*DecisionGroupBy) IntsX

func (s *DecisionGroupBy) IntsX(ctx context.Context) []int

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

func (*DecisionGroupBy) Scan

func (dgb *DecisionGroupBy) Scan(ctx context.Context, v any) error

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

func (*DecisionGroupBy) ScanX

func (s *DecisionGroupBy) ScanX(ctx context.Context, v any)

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

func (*DecisionGroupBy) String

func (s *DecisionGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*DecisionGroupBy) StringX

func (s *DecisionGroupBy) StringX(ctx context.Context) string

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

func (*DecisionGroupBy) Strings

func (s *DecisionGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*DecisionGroupBy) StringsX

func (s *DecisionGroupBy) StringsX(ctx context.Context) []string

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

type DecisionMutation

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

DecisionMutation represents an operation that mutates the Decision nodes in the graph.

func (*DecisionMutation) AddEndIP

func (m *DecisionMutation) AddEndIP(i int64)

AddEndIP adds i to the "end_ip" field.

func (*DecisionMutation) AddEndSuffix added in v1.0.3

func (m *DecisionMutation) AddEndSuffix(i int64)

AddEndSuffix adds i to the "end_suffix" field.

func (*DecisionMutation) AddField

func (m *DecisionMutation) 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 (*DecisionMutation) AddIPSize added in v1.0.3

func (m *DecisionMutation) AddIPSize(i int64)

AddIPSize adds i to the "ip_size" field.

func (*DecisionMutation) AddStartIP

func (m *DecisionMutation) AddStartIP(i int64)

AddStartIP adds i to the "start_ip" field.

func (*DecisionMutation) AddStartSuffix added in v1.0.3

func (m *DecisionMutation) AddStartSuffix(i int64)

AddStartSuffix adds i to the "start_suffix" field.

func (*DecisionMutation) AddedEdges

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

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

func (*DecisionMutation) AddedEndIP

func (m *DecisionMutation) AddedEndIP() (r int64, exists bool)

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

func (*DecisionMutation) AddedEndSuffix added in v1.0.3

func (m *DecisionMutation) AddedEndSuffix() (r int64, exists bool)

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

func (*DecisionMutation) AddedField

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

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

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

func (*DecisionMutation) AddedIDs

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

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

func (*DecisionMutation) AddedIPSize added in v1.0.3

func (m *DecisionMutation) AddedIPSize() (r int64, exists bool)

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

func (*DecisionMutation) AddedStartIP

func (m *DecisionMutation) AddedStartIP() (r int64, exists bool)

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

func (*DecisionMutation) AddedStartSuffix added in v1.0.3

func (m *DecisionMutation) AddedStartSuffix() (r int64, exists bool)

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

func (*DecisionMutation) ClearCreatedAt added in v1.3.0

func (m *DecisionMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*DecisionMutation) ClearEdge

func (m *DecisionMutation) 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 (*DecisionMutation) ClearEndIP

func (m *DecisionMutation) ClearEndIP()

ClearEndIP clears the value of the "end_ip" field.

func (*DecisionMutation) ClearEndSuffix added in v1.0.3

func (m *DecisionMutation) ClearEndSuffix()

ClearEndSuffix clears the value of the "end_suffix" field.

func (*DecisionMutation) ClearField

func (m *DecisionMutation) 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 (*DecisionMutation) ClearIPSize added in v1.0.3

func (m *DecisionMutation) ClearIPSize()

ClearIPSize clears the value of the "ip_size" field.

func (*DecisionMutation) ClearOwner

func (m *DecisionMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Alert entity.

func (*DecisionMutation) ClearStartIP

func (m *DecisionMutation) ClearStartIP()

ClearStartIP clears the value of the "start_ip" field.

func (*DecisionMutation) ClearStartSuffix added in v1.0.3

func (m *DecisionMutation) ClearStartSuffix()

ClearStartSuffix clears the value of the "start_suffix" field.

func (*DecisionMutation) ClearUntil added in v1.3.4

func (m *DecisionMutation) ClearUntil()

ClearUntil clears the value of the "until" field.

func (*DecisionMutation) ClearUpdatedAt added in v1.3.0

func (m *DecisionMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DecisionMutation) ClearedEdges

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

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

func (*DecisionMutation) ClearedFields

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

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

func (DecisionMutation) Client

func (m DecisionMutation) 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 (*DecisionMutation) CreatedAt

func (m *DecisionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DecisionMutation) CreatedAtCleared added in v1.3.0

func (m *DecisionMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*DecisionMutation) EdgeCleared

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

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

func (*DecisionMutation) EndIP

func (m *DecisionMutation) EndIP() (r int64, exists bool)

EndIP returns the value of the "end_ip" field in the mutation.

func (*DecisionMutation) EndIPCleared

func (m *DecisionMutation) EndIPCleared() bool

EndIPCleared returns if the "end_ip" field was cleared in this mutation.

func (*DecisionMutation) EndSuffix added in v1.0.3

func (m *DecisionMutation) EndSuffix() (r int64, exists bool)

EndSuffix returns the value of the "end_suffix" field in the mutation.

func (*DecisionMutation) EndSuffixCleared added in v1.0.3

func (m *DecisionMutation) EndSuffixCleared() bool

EndSuffixCleared returns if the "end_suffix" field was cleared in this mutation.

func (*DecisionMutation) Field

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

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

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

func (*DecisionMutation) Fields

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

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

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

func (*DecisionMutation) ID

func (m *DecisionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*DecisionMutation) IDs added in v1.3.1

func (m *DecisionMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DecisionMutation) IPSize added in v1.0.3

func (m *DecisionMutation) IPSize() (r int64, exists bool)

IPSize returns the value of the "ip_size" field in the mutation.

func (*DecisionMutation) IPSizeCleared added in v1.0.3

func (m *DecisionMutation) IPSizeCleared() bool

IPSizeCleared returns if the "ip_size" field was cleared in this mutation.

func (*DecisionMutation) OldCreatedAt

func (m *DecisionMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldEndIP

func (m *DecisionMutation) OldEndIP(ctx context.Context) (v int64, err error)

OldEndIP returns the old "end_ip" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldEndSuffix added in v1.0.3

func (m *DecisionMutation) OldEndSuffix(ctx context.Context) (v int64, err error)

OldEndSuffix returns the old "end_suffix" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldField

func (m *DecisionMutation) 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 (*DecisionMutation) OldIPSize added in v1.0.3

func (m *DecisionMutation) OldIPSize(ctx context.Context) (v int64, err error)

OldIPSize returns the old "ip_size" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldOrigin

func (m *DecisionMutation) OldOrigin(ctx context.Context) (v string, err error)

OldOrigin returns the old "origin" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldScenario

func (m *DecisionMutation) OldScenario(ctx context.Context) (v string, err error)

OldScenario returns the old "scenario" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldScope

func (m *DecisionMutation) OldScope(ctx context.Context) (v string, err error)

OldScope returns the old "scope" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldSimulated

func (m *DecisionMutation) OldSimulated(ctx context.Context) (v bool, err error)

OldSimulated returns the old "simulated" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldStartIP

func (m *DecisionMutation) OldStartIP(ctx context.Context) (v int64, err error)

OldStartIP returns the old "start_ip" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldStartSuffix added in v1.0.3

func (m *DecisionMutation) OldStartSuffix(ctx context.Context) (v int64, err error)

OldStartSuffix returns the old "start_suffix" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldType

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

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

func (m *DecisionMutation) OldUntil(ctx context.Context) (v *time.Time, err error)

OldUntil returns the old "until" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldUpdatedAt

func (m *DecisionMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Decision entity. If the Decision 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 (*DecisionMutation) OldValue

func (m *DecisionMutation) OldValue(ctx context.Context) (v string, err error)

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

func (m *DecisionMutation) Op() Op

Op returns the operation name.

func (*DecisionMutation) Origin

func (m *DecisionMutation) Origin() (r string, exists bool)

Origin returns the value of the "origin" field in the mutation.

func (*DecisionMutation) OwnerCleared

func (m *DecisionMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Alert entity was cleared.

func (*DecisionMutation) OwnerID

func (m *DecisionMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*DecisionMutation) OwnerIDs

func (m *DecisionMutation) OwnerIDs() (ids []int)

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

func (*DecisionMutation) RemovedEdges

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

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

func (*DecisionMutation) RemovedIDs

func (m *DecisionMutation) 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 (*DecisionMutation) ResetCreatedAt

func (m *DecisionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DecisionMutation) ResetEdge

func (m *DecisionMutation) 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 (*DecisionMutation) ResetEndIP

func (m *DecisionMutation) ResetEndIP()

ResetEndIP resets all changes to the "end_ip" field.

func (*DecisionMutation) ResetEndSuffix added in v1.0.3

func (m *DecisionMutation) ResetEndSuffix()

ResetEndSuffix resets all changes to the "end_suffix" field.

func (*DecisionMutation) ResetField

func (m *DecisionMutation) 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 (*DecisionMutation) ResetIPSize added in v1.0.3

func (m *DecisionMutation) ResetIPSize()

ResetIPSize resets all changes to the "ip_size" field.

func (*DecisionMutation) ResetOrigin

func (m *DecisionMutation) ResetOrigin()

ResetOrigin resets all changes to the "origin" field.

func (*DecisionMutation) ResetOwner

func (m *DecisionMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*DecisionMutation) ResetScenario

func (m *DecisionMutation) ResetScenario()

ResetScenario resets all changes to the "scenario" field.

func (*DecisionMutation) ResetScope

func (m *DecisionMutation) ResetScope()

ResetScope resets all changes to the "scope" field.

func (*DecisionMutation) ResetSimulated

func (m *DecisionMutation) ResetSimulated()

ResetSimulated resets all changes to the "simulated" field.

func (*DecisionMutation) ResetStartIP

func (m *DecisionMutation) ResetStartIP()

ResetStartIP resets all changes to the "start_ip" field.

func (*DecisionMutation) ResetStartSuffix added in v1.0.3

func (m *DecisionMutation) ResetStartSuffix()

ResetStartSuffix resets all changes to the "start_suffix" field.

func (*DecisionMutation) ResetType

func (m *DecisionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*DecisionMutation) ResetUntil

func (m *DecisionMutation) ResetUntil()

ResetUntil resets all changes to the "until" field.

func (*DecisionMutation) ResetUpdatedAt

func (m *DecisionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DecisionMutation) ResetValue

func (m *DecisionMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*DecisionMutation) Scenario

func (m *DecisionMutation) Scenario() (r string, exists bool)

Scenario returns the value of the "scenario" field in the mutation.

func (*DecisionMutation) Scope

func (m *DecisionMutation) Scope() (r string, exists bool)

Scope returns the value of the "scope" field in the mutation.

func (*DecisionMutation) SetCreatedAt

func (m *DecisionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DecisionMutation) SetEndIP

func (m *DecisionMutation) SetEndIP(i int64)

SetEndIP sets the "end_ip" field.

func (*DecisionMutation) SetEndSuffix added in v1.0.3

func (m *DecisionMutation) SetEndSuffix(i int64)

SetEndSuffix sets the "end_suffix" field.

func (*DecisionMutation) SetField

func (m *DecisionMutation) 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 (*DecisionMutation) SetIPSize added in v1.0.3

func (m *DecisionMutation) SetIPSize(i int64)

SetIPSize sets the "ip_size" field.

func (*DecisionMutation) SetOrigin

func (m *DecisionMutation) SetOrigin(s string)

SetOrigin sets the "origin" field.

func (*DecisionMutation) SetOwnerID

func (m *DecisionMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Alert entity by id.

func (*DecisionMutation) SetScenario

func (m *DecisionMutation) SetScenario(s string)

SetScenario sets the "scenario" field.

func (*DecisionMutation) SetScope

func (m *DecisionMutation) SetScope(s string)

SetScope sets the "scope" field.

func (*DecisionMutation) SetSimulated

func (m *DecisionMutation) SetSimulated(b bool)

SetSimulated sets the "simulated" field.

func (*DecisionMutation) SetStartIP

func (m *DecisionMutation) SetStartIP(i int64)

SetStartIP sets the "start_ip" field.

func (*DecisionMutation) SetStartSuffix added in v1.0.3

func (m *DecisionMutation) SetStartSuffix(i int64)

SetStartSuffix sets the "start_suffix" field.

func (*DecisionMutation) SetType

func (m *DecisionMutation) SetType(s string)

SetType sets the "type" field.

func (*DecisionMutation) SetUntil

func (m *DecisionMutation) SetUntil(t time.Time)

SetUntil sets the "until" field.

func (*DecisionMutation) SetUpdatedAt

func (m *DecisionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*DecisionMutation) SetValue

func (m *DecisionMutation) SetValue(s string)

SetValue sets the "value" field.

func (*DecisionMutation) Simulated

func (m *DecisionMutation) Simulated() (r bool, exists bool)

Simulated returns the value of the "simulated" field in the mutation.

func (*DecisionMutation) StartIP

func (m *DecisionMutation) StartIP() (r int64, exists bool)

StartIP returns the value of the "start_ip" field in the mutation.

func (*DecisionMutation) StartIPCleared

func (m *DecisionMutation) StartIPCleared() bool

StartIPCleared returns if the "start_ip" field was cleared in this mutation.

func (*DecisionMutation) StartSuffix added in v1.0.3

func (m *DecisionMutation) StartSuffix() (r int64, exists bool)

StartSuffix returns the value of the "start_suffix" field in the mutation.

func (*DecisionMutation) StartSuffixCleared added in v1.0.3

func (m *DecisionMutation) StartSuffixCleared() bool

StartSuffixCleared returns if the "start_suffix" field was cleared in this mutation.

func (DecisionMutation) Tx

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

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

func (*DecisionMutation) Type

func (m *DecisionMutation) Type() string

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

func (*DecisionMutation) Until

func (m *DecisionMutation) Until() (r time.Time, exists bool)

Until returns the value of the "until" field in the mutation.

func (*DecisionMutation) UntilCleared added in v1.3.4

func (m *DecisionMutation) UntilCleared() bool

UntilCleared returns if the "until" field was cleared in this mutation.

func (*DecisionMutation) UpdatedAt

func (m *DecisionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*DecisionMutation) UpdatedAtCleared added in v1.3.0

func (m *DecisionMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*DecisionMutation) Value

func (m *DecisionMutation) Value() (r string, exists bool)

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

func (*DecisionMutation) Where added in v1.2.1

func (m *DecisionMutation) Where(ps ...predicate.Decision)

Where appends a list predicates to the DecisionMutation builder.

type DecisionQuery

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

DecisionQuery is the builder for querying Decision entities.

func (*DecisionQuery) All

func (dq *DecisionQuery) All(ctx context.Context) ([]*Decision, error)

All executes the query and returns a list of Decisions.

func (*DecisionQuery) AllX

func (dq *DecisionQuery) AllX(ctx context.Context) []*Decision

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

func (*DecisionQuery) Clone

func (dq *DecisionQuery) Clone() *DecisionQuery

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

func (*DecisionQuery) Count

func (dq *DecisionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DecisionQuery) CountX

func (dq *DecisionQuery) CountX(ctx context.Context) int

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

func (*DecisionQuery) Exist

func (dq *DecisionQuery) Exist(ctx context.Context) (bool, error)

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

func (*DecisionQuery) ExistX

func (dq *DecisionQuery) ExistX(ctx context.Context) bool

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

func (*DecisionQuery) First

func (dq *DecisionQuery) First(ctx context.Context) (*Decision, error)

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

func (*DecisionQuery) FirstID

func (dq *DecisionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DecisionQuery) FirstIDX added in v1.0.3

func (dq *DecisionQuery) FirstIDX(ctx context.Context) int

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

func (*DecisionQuery) FirstX

func (dq *DecisionQuery) FirstX(ctx context.Context) *Decision

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

func (*DecisionQuery) GroupBy

func (dq *DecisionQuery) GroupBy(field string, fields ...string) *DecisionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Decision.Query().
	GroupBy(decision.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DecisionQuery) IDs

func (dq *DecisionQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DecisionQuery) IDsX

func (dq *DecisionQuery) IDsX(ctx context.Context) []int

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

func (*DecisionQuery) Limit

func (dq *DecisionQuery) Limit(limit int) *DecisionQuery

Limit adds a limit step to the query.

func (*DecisionQuery) Offset

func (dq *DecisionQuery) Offset(offset int) *DecisionQuery

Offset adds an offset step to the query.

func (*DecisionQuery) Only

func (dq *DecisionQuery) Only(ctx context.Context) (*Decision, error)

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

func (*DecisionQuery) OnlyID

func (dq *DecisionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DecisionQuery) OnlyIDX

func (dq *DecisionQuery) OnlyIDX(ctx context.Context) int

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

func (*DecisionQuery) OnlyX

func (dq *DecisionQuery) OnlyX(ctx context.Context) *Decision

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

func (*DecisionQuery) Order

func (dq *DecisionQuery) Order(o ...OrderFunc) *DecisionQuery

Order adds an order step to the query.

func (*DecisionQuery) QueryOwner

func (dq *DecisionQuery) QueryOwner() *AlertQuery

QueryOwner chains the current query on the "owner" edge.

func (*DecisionQuery) Select

func (dq *DecisionQuery) Select(fields ...string) *DecisionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Decision.Query().
	Select(decision.FieldCreatedAt).
	Scan(ctx, &v)

func (*DecisionQuery) Unique added in v1.2.1

func (dq *DecisionQuery) Unique(unique bool) *DecisionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DecisionQuery) Where

func (dq *DecisionQuery) Where(ps ...predicate.Decision) *DecisionQuery

Where adds a new predicate for the DecisionQuery builder.

func (*DecisionQuery) WithOwner

func (dq *DecisionQuery) WithOwner(opts ...func(*AlertQuery)) *DecisionQuery

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

type DecisionSelect

type DecisionSelect struct {
	*DecisionQuery
	// contains filtered or unexported fields
}

DecisionSelect is the builder for selecting fields of Decision entities.

func (*DecisionSelect) Bool

func (s *DecisionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DecisionSelect) BoolX

func (s *DecisionSelect) BoolX(ctx context.Context) bool

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

func (*DecisionSelect) Bools

func (s *DecisionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DecisionSelect) BoolsX

func (s *DecisionSelect) BoolsX(ctx context.Context) []bool

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

func (*DecisionSelect) Float64

func (s *DecisionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DecisionSelect) Float64X

func (s *DecisionSelect) Float64X(ctx context.Context) float64

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

func (*DecisionSelect) Float64s

func (s *DecisionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DecisionSelect) Float64sX

func (s *DecisionSelect) Float64sX(ctx context.Context) []float64

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

func (*DecisionSelect) Int

func (s *DecisionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DecisionSelect) IntX

func (s *DecisionSelect) IntX(ctx context.Context) int

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

func (*DecisionSelect) Ints

func (s *DecisionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DecisionSelect) IntsX

func (s *DecisionSelect) IntsX(ctx context.Context) []int

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

func (*DecisionSelect) Scan

func (ds *DecisionSelect) Scan(ctx context.Context, v any) error

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

func (*DecisionSelect) ScanX

func (s *DecisionSelect) ScanX(ctx context.Context, v any)

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

func (*DecisionSelect) String

func (s *DecisionSelect) String(ctx context.Context) (_ string, err error)

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

func (*DecisionSelect) StringX

func (s *DecisionSelect) StringX(ctx context.Context) string

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

func (*DecisionSelect) Strings

func (s *DecisionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DecisionSelect) StringsX

func (s *DecisionSelect) StringsX(ctx context.Context) []string

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

type DecisionUpdate

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

DecisionUpdate is the builder for updating Decision entities.

func (*DecisionUpdate) AddEndIP

func (du *DecisionUpdate) AddEndIP(i int64) *DecisionUpdate

AddEndIP adds i to the "end_ip" field.

func (*DecisionUpdate) AddEndSuffix added in v1.0.3

func (du *DecisionUpdate) AddEndSuffix(i int64) *DecisionUpdate

AddEndSuffix adds i to the "end_suffix" field.

func (*DecisionUpdate) AddIPSize added in v1.0.3

func (du *DecisionUpdate) AddIPSize(i int64) *DecisionUpdate

AddIPSize adds i to the "ip_size" field.

func (*DecisionUpdate) AddStartIP

func (du *DecisionUpdate) AddStartIP(i int64) *DecisionUpdate

AddStartIP adds i to the "start_ip" field.

func (*DecisionUpdate) AddStartSuffix added in v1.0.3

func (du *DecisionUpdate) AddStartSuffix(i int64) *DecisionUpdate

AddStartSuffix adds i to the "start_suffix" field.

func (*DecisionUpdate) ClearCreatedAt added in v1.3.0

func (du *DecisionUpdate) ClearCreatedAt() *DecisionUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*DecisionUpdate) ClearEndIP

func (du *DecisionUpdate) ClearEndIP() *DecisionUpdate

ClearEndIP clears the value of the "end_ip" field.

func (*DecisionUpdate) ClearEndSuffix added in v1.0.3

func (du *DecisionUpdate) ClearEndSuffix() *DecisionUpdate

ClearEndSuffix clears the value of the "end_suffix" field.

func (*DecisionUpdate) ClearIPSize added in v1.0.3

func (du *DecisionUpdate) ClearIPSize() *DecisionUpdate

ClearIPSize clears the value of the "ip_size" field.

func (*DecisionUpdate) ClearOwner

func (du *DecisionUpdate) ClearOwner() *DecisionUpdate

ClearOwner clears the "owner" edge to the Alert entity.

func (*DecisionUpdate) ClearStartIP

func (du *DecisionUpdate) ClearStartIP() *DecisionUpdate

ClearStartIP clears the value of the "start_ip" field.

func (*DecisionUpdate) ClearStartSuffix added in v1.0.3

func (du *DecisionUpdate) ClearStartSuffix() *DecisionUpdate

ClearStartSuffix clears the value of the "start_suffix" field.

func (*DecisionUpdate) ClearUntil added in v1.3.4

func (du *DecisionUpdate) ClearUntil() *DecisionUpdate

ClearUntil clears the value of the "until" field.

func (*DecisionUpdate) ClearUpdatedAt added in v1.3.0

func (du *DecisionUpdate) ClearUpdatedAt() *DecisionUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DecisionUpdate) Exec

func (du *DecisionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DecisionUpdate) ExecX

func (du *DecisionUpdate) ExecX(ctx context.Context)

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

func (*DecisionUpdate) Mutation

func (du *DecisionUpdate) Mutation() *DecisionMutation

Mutation returns the DecisionMutation object of the builder.

func (*DecisionUpdate) Save

func (du *DecisionUpdate) Save(ctx context.Context) (int, error)

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

func (*DecisionUpdate) SaveX

func (du *DecisionUpdate) SaveX(ctx context.Context) int

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

func (*DecisionUpdate) SetCreatedAt

func (du *DecisionUpdate) SetCreatedAt(t time.Time) *DecisionUpdate

SetCreatedAt sets the "created_at" field.

func (*DecisionUpdate) SetEndIP

func (du *DecisionUpdate) SetEndIP(i int64) *DecisionUpdate

SetEndIP sets the "end_ip" field.

func (*DecisionUpdate) SetEndSuffix added in v1.0.3

func (du *DecisionUpdate) SetEndSuffix(i int64) *DecisionUpdate

SetEndSuffix sets the "end_suffix" field.

func (*DecisionUpdate) SetIPSize added in v1.0.3

func (du *DecisionUpdate) SetIPSize(i int64) *DecisionUpdate

SetIPSize sets the "ip_size" field.

func (*DecisionUpdate) SetNillableEndIP

func (du *DecisionUpdate) SetNillableEndIP(i *int64) *DecisionUpdate

SetNillableEndIP sets the "end_ip" field if the given value is not nil.

func (*DecisionUpdate) SetNillableEndSuffix added in v1.0.3

func (du *DecisionUpdate) SetNillableEndSuffix(i *int64) *DecisionUpdate

SetNillableEndSuffix sets the "end_suffix" field if the given value is not nil.

func (*DecisionUpdate) SetNillableIPSize added in v1.0.3

func (du *DecisionUpdate) SetNillableIPSize(i *int64) *DecisionUpdate

SetNillableIPSize sets the "ip_size" field if the given value is not nil.

func (*DecisionUpdate) SetNillableOwnerID

func (du *DecisionUpdate) SetNillableOwnerID(id *int) *DecisionUpdate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*DecisionUpdate) SetNillableSimulated

func (du *DecisionUpdate) SetNillableSimulated(b *bool) *DecisionUpdate

SetNillableSimulated sets the "simulated" field if the given value is not nil.

func (*DecisionUpdate) SetNillableStartIP

func (du *DecisionUpdate) SetNillableStartIP(i *int64) *DecisionUpdate

SetNillableStartIP sets the "start_ip" field if the given value is not nil.

func (*DecisionUpdate) SetNillableStartSuffix added in v1.0.3

func (du *DecisionUpdate) SetNillableStartSuffix(i *int64) *DecisionUpdate

SetNillableStartSuffix sets the "start_suffix" field if the given value is not nil.

func (*DecisionUpdate) SetNillableUntil added in v1.3.4

func (du *DecisionUpdate) SetNillableUntil(t *time.Time) *DecisionUpdate

SetNillableUntil sets the "until" field if the given value is not nil.

func (*DecisionUpdate) SetOrigin

func (du *DecisionUpdate) SetOrigin(s string) *DecisionUpdate

SetOrigin sets the "origin" field.

func (*DecisionUpdate) SetOwner

func (du *DecisionUpdate) SetOwner(a *Alert) *DecisionUpdate

SetOwner sets the "owner" edge to the Alert entity.

func (*DecisionUpdate) SetOwnerID

func (du *DecisionUpdate) SetOwnerID(id int) *DecisionUpdate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*DecisionUpdate) SetScenario

func (du *DecisionUpdate) SetScenario(s string) *DecisionUpdate

SetScenario sets the "scenario" field.

func (*DecisionUpdate) SetScope

func (du *DecisionUpdate) SetScope(s string) *DecisionUpdate

SetScope sets the "scope" field.

func (*DecisionUpdate) SetSimulated

func (du *DecisionUpdate) SetSimulated(b bool) *DecisionUpdate

SetSimulated sets the "simulated" field.

func (*DecisionUpdate) SetStartIP

func (du *DecisionUpdate) SetStartIP(i int64) *DecisionUpdate

SetStartIP sets the "start_ip" field.

func (*DecisionUpdate) SetStartSuffix added in v1.0.3

func (du *DecisionUpdate) SetStartSuffix(i int64) *DecisionUpdate

SetStartSuffix sets the "start_suffix" field.

func (*DecisionUpdate) SetType

func (du *DecisionUpdate) SetType(s string) *DecisionUpdate

SetType sets the "type" field.

func (*DecisionUpdate) SetUntil

func (du *DecisionUpdate) SetUntil(t time.Time) *DecisionUpdate

SetUntil sets the "until" field.

func (*DecisionUpdate) SetUpdatedAt

func (du *DecisionUpdate) SetUpdatedAt(t time.Time) *DecisionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DecisionUpdate) SetValue

func (du *DecisionUpdate) SetValue(s string) *DecisionUpdate

SetValue sets the "value" field.

func (*DecisionUpdate) Where

func (du *DecisionUpdate) Where(ps ...predicate.Decision) *DecisionUpdate

Where appends a list predicates to the DecisionUpdate builder.

type DecisionUpdateOne

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

DecisionUpdateOne is the builder for updating a single Decision entity.

func (*DecisionUpdateOne) AddEndIP

func (duo *DecisionUpdateOne) AddEndIP(i int64) *DecisionUpdateOne

AddEndIP adds i to the "end_ip" field.

func (*DecisionUpdateOne) AddEndSuffix added in v1.0.3

func (duo *DecisionUpdateOne) AddEndSuffix(i int64) *DecisionUpdateOne

AddEndSuffix adds i to the "end_suffix" field.

func (*DecisionUpdateOne) AddIPSize added in v1.0.3

func (duo *DecisionUpdateOne) AddIPSize(i int64) *DecisionUpdateOne

AddIPSize adds i to the "ip_size" field.

func (*DecisionUpdateOne) AddStartIP

func (duo *DecisionUpdateOne) AddStartIP(i int64) *DecisionUpdateOne

AddStartIP adds i to the "start_ip" field.

func (*DecisionUpdateOne) AddStartSuffix added in v1.0.3

func (duo *DecisionUpdateOne) AddStartSuffix(i int64) *DecisionUpdateOne

AddStartSuffix adds i to the "start_suffix" field.

func (*DecisionUpdateOne) ClearCreatedAt added in v1.3.0

func (duo *DecisionUpdateOne) ClearCreatedAt() *DecisionUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*DecisionUpdateOne) ClearEndIP

func (duo *DecisionUpdateOne) ClearEndIP() *DecisionUpdateOne

ClearEndIP clears the value of the "end_ip" field.

func (*DecisionUpdateOne) ClearEndSuffix added in v1.0.3

func (duo *DecisionUpdateOne) ClearEndSuffix() *DecisionUpdateOne

ClearEndSuffix clears the value of the "end_suffix" field.

func (*DecisionUpdateOne) ClearIPSize added in v1.0.3

func (duo *DecisionUpdateOne) ClearIPSize() *DecisionUpdateOne

ClearIPSize clears the value of the "ip_size" field.

func (*DecisionUpdateOne) ClearOwner

func (duo *DecisionUpdateOne) ClearOwner() *DecisionUpdateOne

ClearOwner clears the "owner" edge to the Alert entity.

func (*DecisionUpdateOne) ClearStartIP

func (duo *DecisionUpdateOne) ClearStartIP() *DecisionUpdateOne

ClearStartIP clears the value of the "start_ip" field.

func (*DecisionUpdateOne) ClearStartSuffix added in v1.0.3

func (duo *DecisionUpdateOne) ClearStartSuffix() *DecisionUpdateOne

ClearStartSuffix clears the value of the "start_suffix" field.

func (*DecisionUpdateOne) ClearUntil added in v1.3.4

func (duo *DecisionUpdateOne) ClearUntil() *DecisionUpdateOne

ClearUntil clears the value of the "until" field.

func (*DecisionUpdateOne) ClearUpdatedAt added in v1.3.0

func (duo *DecisionUpdateOne) ClearUpdatedAt() *DecisionUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DecisionUpdateOne) Exec

func (duo *DecisionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DecisionUpdateOne) ExecX

func (duo *DecisionUpdateOne) ExecX(ctx context.Context)

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

func (*DecisionUpdateOne) Mutation

func (duo *DecisionUpdateOne) Mutation() *DecisionMutation

Mutation returns the DecisionMutation object of the builder.

func (*DecisionUpdateOne) Save

func (duo *DecisionUpdateOne) Save(ctx context.Context) (*Decision, error)

Save executes the query and returns the updated Decision entity.

func (*DecisionUpdateOne) SaveX

func (duo *DecisionUpdateOne) SaveX(ctx context.Context) *Decision

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

func (*DecisionUpdateOne) Select added in v1.2.1

func (duo *DecisionUpdateOne) Select(field string, fields ...string) *DecisionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DecisionUpdateOne) SetCreatedAt

func (duo *DecisionUpdateOne) SetCreatedAt(t time.Time) *DecisionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*DecisionUpdateOne) SetEndIP

func (duo *DecisionUpdateOne) SetEndIP(i int64) *DecisionUpdateOne

SetEndIP sets the "end_ip" field.

func (*DecisionUpdateOne) SetEndSuffix added in v1.0.3

func (duo *DecisionUpdateOne) SetEndSuffix(i int64) *DecisionUpdateOne

SetEndSuffix sets the "end_suffix" field.

func (*DecisionUpdateOne) SetIPSize added in v1.0.3

func (duo *DecisionUpdateOne) SetIPSize(i int64) *DecisionUpdateOne

SetIPSize sets the "ip_size" field.

func (*DecisionUpdateOne) SetNillableEndIP

func (duo *DecisionUpdateOne) SetNillableEndIP(i *int64) *DecisionUpdateOne

SetNillableEndIP sets the "end_ip" field if the given value is not nil.

func (*DecisionUpdateOne) SetNillableEndSuffix added in v1.0.3

func (duo *DecisionUpdateOne) SetNillableEndSuffix(i *int64) *DecisionUpdateOne

SetNillableEndSuffix sets the "end_suffix" field if the given value is not nil.

func (*DecisionUpdateOne) SetNillableIPSize added in v1.0.3

func (duo *DecisionUpdateOne) SetNillableIPSize(i *int64) *DecisionUpdateOne

SetNillableIPSize sets the "ip_size" field if the given value is not nil.

func (*DecisionUpdateOne) SetNillableOwnerID

func (duo *DecisionUpdateOne) SetNillableOwnerID(id *int) *DecisionUpdateOne

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*DecisionUpdateOne) SetNillableSimulated

func (duo *DecisionUpdateOne) SetNillableSimulated(b *bool) *DecisionUpdateOne

SetNillableSimulated sets the "simulated" field if the given value is not nil.

func (*DecisionUpdateOne) SetNillableStartIP

func (duo *DecisionUpdateOne) SetNillableStartIP(i *int64) *DecisionUpdateOne

SetNillableStartIP sets the "start_ip" field if the given value is not nil.

func (*DecisionUpdateOne) SetNillableStartSuffix added in v1.0.3

func (duo *DecisionUpdateOne) SetNillableStartSuffix(i *int64) *DecisionUpdateOne

SetNillableStartSuffix sets the "start_suffix" field if the given value is not nil.

func (*DecisionUpdateOne) SetNillableUntil added in v1.3.4

func (duo *DecisionUpdateOne) SetNillableUntil(t *time.Time) *DecisionUpdateOne

SetNillableUntil sets the "until" field if the given value is not nil.

func (*DecisionUpdateOne) SetOrigin

func (duo *DecisionUpdateOne) SetOrigin(s string) *DecisionUpdateOne

SetOrigin sets the "origin" field.

func (*DecisionUpdateOne) SetOwner

func (duo *DecisionUpdateOne) SetOwner(a *Alert) *DecisionUpdateOne

SetOwner sets the "owner" edge to the Alert entity.

func (*DecisionUpdateOne) SetOwnerID

func (duo *DecisionUpdateOne) SetOwnerID(id int) *DecisionUpdateOne

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*DecisionUpdateOne) SetScenario

func (duo *DecisionUpdateOne) SetScenario(s string) *DecisionUpdateOne

SetScenario sets the "scenario" field.

func (*DecisionUpdateOne) SetScope

func (duo *DecisionUpdateOne) SetScope(s string) *DecisionUpdateOne

SetScope sets the "scope" field.

func (*DecisionUpdateOne) SetSimulated

func (duo *DecisionUpdateOne) SetSimulated(b bool) *DecisionUpdateOne

SetSimulated sets the "simulated" field.

func (*DecisionUpdateOne) SetStartIP

func (duo *DecisionUpdateOne) SetStartIP(i int64) *DecisionUpdateOne

SetStartIP sets the "start_ip" field.

func (*DecisionUpdateOne) SetStartSuffix added in v1.0.3

func (duo *DecisionUpdateOne) SetStartSuffix(i int64) *DecisionUpdateOne

SetStartSuffix sets the "start_suffix" field.

func (*DecisionUpdateOne) SetType

func (duo *DecisionUpdateOne) SetType(s string) *DecisionUpdateOne

SetType sets the "type" field.

func (*DecisionUpdateOne) SetUntil

func (duo *DecisionUpdateOne) SetUntil(t time.Time) *DecisionUpdateOne

SetUntil sets the "until" field.

func (*DecisionUpdateOne) SetUpdatedAt

func (duo *DecisionUpdateOne) SetUpdatedAt(t time.Time) *DecisionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DecisionUpdateOne) SetValue

func (duo *DecisionUpdateOne) SetValue(s string) *DecisionUpdateOne

SetValue sets the "value" field.

type Decisions

type Decisions []*Decision

Decisions is a parsable slice of Decision.

type Event

type Event struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// Time holds the value of the "time" field.
	Time time.Time `json:"time,omitempty"`
	// Serialized holds the value of the "serialized" field.
	Serialized string `json:"serialized,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EventQuery when eager-loading is set.
	Edges EventEdges `json:"edges"`
	// contains filtered or unexported fields
}

Event is the model entity for the Event schema.

func (*Event) QueryOwner

func (e *Event) QueryOwner() *AlertQuery

QueryOwner queries the "owner" edge of the Event entity.

func (*Event) String

func (e *Event) String() string

String implements the fmt.Stringer.

func (*Event) Unwrap

func (e *Event) Unwrap() *Event

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

func (e *Event) Update() *EventUpdateOne

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

type EventClient

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

EventClient is a client for the Event schema.

func NewEventClient

func NewEventClient(c config) *EventClient

NewEventClient returns a client for the Event from the given config.

func (*EventClient) Create

func (c *EventClient) Create() *EventCreate

Create returns a builder for creating a Event entity.

func (*EventClient) CreateBulk

func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk

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

func (*EventClient) Delete

func (c *EventClient) Delete() *EventDelete

Delete returns a delete builder for Event.

func (*EventClient) DeleteOne

func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id int) *EventDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*EventClient) Get

func (c *EventClient) Get(ctx context.Context, id int) (*Event, error)

Get returns a Event entity by its id.

func (*EventClient) GetX

func (c *EventClient) GetX(ctx context.Context, id int) *Event

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

func (*EventClient) Hooks

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

Hooks returns the client hooks.

func (*EventClient) Query

func (c *EventClient) Query() *EventQuery

Query returns a query builder for Event.

func (*EventClient) QueryOwner

func (c *EventClient) QueryOwner(e *Event) *AlertQuery

QueryOwner queries the owner edge of a Event.

func (*EventClient) Update

func (c *EventClient) Update() *EventUpdate

Update returns an update builder for Event.

func (*EventClient) UpdateOne

func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EventClient) UpdateOneID

func (c *EventClient) UpdateOneID(id int) *EventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EventClient) Use

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

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

type EventCreate

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

EventCreate is the builder for creating a Event entity.

func (*EventCreate) Exec added in v1.2.1

func (ec *EventCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreate) ExecX added in v1.2.1

func (ec *EventCreate) ExecX(ctx context.Context)

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

func (*EventCreate) Mutation

func (ec *EventCreate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventCreate) Save

func (ec *EventCreate) Save(ctx context.Context) (*Event, error)

Save creates the Event in the database.

func (*EventCreate) SaveX

func (ec *EventCreate) SaveX(ctx context.Context) *Event

SaveX calls Save and panics if Save returns an error.

func (*EventCreate) SetCreatedAt

func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate

SetCreatedAt sets the "created_at" field.

func (*EventCreate) SetNillableCreatedAt

func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*EventCreate) SetNillableOwnerID

func (ec *EventCreate) SetNillableOwnerID(id *int) *EventCreate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*EventCreate) SetNillableUpdatedAt

func (ec *EventCreate) SetNillableUpdatedAt(t *time.Time) *EventCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*EventCreate) SetOwner

func (ec *EventCreate) SetOwner(a *Alert) *EventCreate

SetOwner sets the "owner" edge to the Alert entity.

func (*EventCreate) SetOwnerID

func (ec *EventCreate) SetOwnerID(id int) *EventCreate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*EventCreate) SetSerialized

func (ec *EventCreate) SetSerialized(s string) *EventCreate

SetSerialized sets the "serialized" field.

func (*EventCreate) SetTime

func (ec *EventCreate) SetTime(t time.Time) *EventCreate

SetTime sets the "time" field.

func (*EventCreate) SetUpdatedAt

func (ec *EventCreate) SetUpdatedAt(t time.Time) *EventCreate

SetUpdatedAt sets the "updated_at" field.

type EventCreateBulk

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

EventCreateBulk is the builder for creating many Event entities in bulk.

func (*EventCreateBulk) Exec added in v1.2.1

func (ecb *EventCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreateBulk) ExecX added in v1.2.1

func (ecb *EventCreateBulk) ExecX(ctx context.Context)

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

func (*EventCreateBulk) Save

func (ecb *EventCreateBulk) Save(ctx context.Context) ([]*Event, error)

Save creates the Event entities in the database.

func (*EventCreateBulk) SaveX

func (ecb *EventCreateBulk) SaveX(ctx context.Context) []*Event

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

type EventDelete

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

EventDelete is the builder for deleting a Event entity.

func (*EventDelete) Exec

func (ed *EventDelete) Exec(ctx context.Context) (int, error)

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

func (*EventDelete) ExecX

func (ed *EventDelete) ExecX(ctx context.Context) int

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

func (*EventDelete) Where

func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete

Where appends a list predicates to the EventDelete builder.

type EventDeleteOne

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

EventDeleteOne is the builder for deleting a single Event entity.

func (*EventDeleteOne) Exec

func (edo *EventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EventDeleteOne) ExecX

func (edo *EventDeleteOne) ExecX(ctx context.Context)

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

type EventEdges

type EventEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Alert `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (EventEdges) OwnerOrErr

func (e EventEdges) OwnerOrErr() (*Alert, error)

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

type EventGroupBy

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

EventGroupBy is the group-by builder for Event entities.

func (*EventGroupBy) Aggregate

func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy

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

func (*EventGroupBy) Bool

func (s *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventGroupBy) BoolX

func (s *EventGroupBy) BoolX(ctx context.Context) bool

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

func (*EventGroupBy) Bools

func (s *EventGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*EventGroupBy) BoolsX

func (s *EventGroupBy) BoolsX(ctx context.Context) []bool

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

func (*EventGroupBy) Float64

func (s *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventGroupBy) Float64X

func (s *EventGroupBy) Float64X(ctx context.Context) float64

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

func (*EventGroupBy) Float64s

func (s *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventGroupBy) Float64sX

func (s *EventGroupBy) Float64sX(ctx context.Context) []float64

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

func (*EventGroupBy) Int

func (s *EventGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*EventGroupBy) IntX

func (s *EventGroupBy) IntX(ctx context.Context) int

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

func (*EventGroupBy) Ints

func (s *EventGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*EventGroupBy) IntsX

func (s *EventGroupBy) IntsX(ctx context.Context) []int

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

func (*EventGroupBy) Scan

func (egb *EventGroupBy) Scan(ctx context.Context, v any) error

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

func (*EventGroupBy) ScanX

func (s *EventGroupBy) ScanX(ctx context.Context, v any)

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

func (*EventGroupBy) String

func (s *EventGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*EventGroupBy) StringX

func (s *EventGroupBy) StringX(ctx context.Context) string

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

func (*EventGroupBy) Strings

func (s *EventGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*EventGroupBy) StringsX

func (s *EventGroupBy) StringsX(ctx context.Context) []string

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

type EventMutation

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

EventMutation represents an operation that mutates the Event nodes in the graph.

func (*EventMutation) AddField

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

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

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

func (*EventMutation) AddedField

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

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

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

func (*EventMutation) AddedIDs

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

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

func (*EventMutation) ClearCreatedAt added in v1.3.0

func (m *EventMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*EventMutation) ClearEdge

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

func (m *EventMutation) 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 (*EventMutation) ClearOwner

func (m *EventMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Alert entity.

func (*EventMutation) ClearUpdatedAt added in v1.3.0

func (m *EventMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*EventMutation) ClearedEdges

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

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

func (*EventMutation) ClearedFields

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

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

func (EventMutation) Client

func (m EventMutation) 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 (*EventMutation) CreatedAt

func (m *EventMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*EventMutation) CreatedAtCleared added in v1.3.0

func (m *EventMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*EventMutation) EdgeCleared

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

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

func (*EventMutation) Field

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

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

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

func (*EventMutation) Fields

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

func (m *EventMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*EventMutation) IDs added in v1.3.1

func (m *EventMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*EventMutation) OldCreatedAt

func (m *EventMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Event entity. If the Event 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 (*EventMutation) OldField

func (m *EventMutation) 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 (*EventMutation) OldSerialized

func (m *EventMutation) OldSerialized(ctx context.Context) (v string, err error)

OldSerialized returns the old "serialized" field's value of the Event entity. If the Event 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 (*EventMutation) OldTime

func (m *EventMutation) OldTime(ctx context.Context) (v time.Time, err error)

OldTime returns the old "time" field's value of the Event entity. If the Event 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 (*EventMutation) OldUpdatedAt

func (m *EventMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Event entity. If the Event 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 (*EventMutation) Op

func (m *EventMutation) Op() Op

Op returns the operation name.

func (*EventMutation) OwnerCleared

func (m *EventMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Alert entity was cleared.

func (*EventMutation) OwnerID

func (m *EventMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*EventMutation) OwnerIDs

func (m *EventMutation) OwnerIDs() (ids []int)

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

func (*EventMutation) RemovedEdges

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

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

func (*EventMutation) RemovedIDs

func (m *EventMutation) 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 (*EventMutation) ResetCreatedAt

func (m *EventMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*EventMutation) ResetEdge

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

func (m *EventMutation) 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 (*EventMutation) ResetOwner

func (m *EventMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*EventMutation) ResetSerialized

func (m *EventMutation) ResetSerialized()

ResetSerialized resets all changes to the "serialized" field.

func (*EventMutation) ResetTime

func (m *EventMutation) ResetTime()

ResetTime resets all changes to the "time" field.

func (*EventMutation) ResetUpdatedAt

func (m *EventMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*EventMutation) Serialized

func (m *EventMutation) Serialized() (r string, exists bool)

Serialized returns the value of the "serialized" field in the mutation.

func (*EventMutation) SetCreatedAt

func (m *EventMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*EventMutation) SetField

func (m *EventMutation) 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 (*EventMutation) SetOwnerID

func (m *EventMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Alert entity by id.

func (*EventMutation) SetSerialized

func (m *EventMutation) SetSerialized(s string)

SetSerialized sets the "serialized" field.

func (*EventMutation) SetTime

func (m *EventMutation) SetTime(t time.Time)

SetTime sets the "time" field.

func (*EventMutation) SetUpdatedAt

func (m *EventMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*EventMutation) Time

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

Time returns the value of the "time" field in the mutation.

func (EventMutation) Tx

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

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

func (*EventMutation) Type

func (m *EventMutation) Type() string

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

func (*EventMutation) UpdatedAt

func (m *EventMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*EventMutation) UpdatedAtCleared added in v1.3.0

func (m *EventMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*EventMutation) Where added in v1.2.1

func (m *EventMutation) Where(ps ...predicate.Event)

Where appends a list predicates to the EventMutation builder.

type EventQuery

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

EventQuery is the builder for querying Event entities.

func (*EventQuery) All

func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)

All executes the query and returns a list of Events.

func (*EventQuery) AllX

func (eq *EventQuery) AllX(ctx context.Context) []*Event

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

func (*EventQuery) Clone

func (eq *EventQuery) Clone() *EventQuery

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

func (*EventQuery) Count

func (eq *EventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventQuery) CountX

func (eq *EventQuery) CountX(ctx context.Context) int

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

func (*EventQuery) Exist

func (eq *EventQuery) Exist(ctx context.Context) (bool, error)

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

func (*EventQuery) ExistX

func (eq *EventQuery) ExistX(ctx context.Context) bool

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

func (*EventQuery) First

func (eq *EventQuery) First(ctx context.Context) (*Event, error)

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

func (*EventQuery) FirstID

func (eq *EventQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*EventQuery) FirstIDX added in v1.0.3

func (eq *EventQuery) FirstIDX(ctx context.Context) int

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

func (*EventQuery) FirstX

func (eq *EventQuery) FirstX(ctx context.Context) *Event

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

func (*EventQuery) GroupBy

func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Event.Query().
	GroupBy(event.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventQuery) IDs

func (eq *EventQuery) IDs(ctx context.Context) ([]int, error)

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

func (*EventQuery) IDsX

func (eq *EventQuery) IDsX(ctx context.Context) []int

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

func (*EventQuery) Limit

func (eq *EventQuery) Limit(limit int) *EventQuery

Limit adds a limit step to the query.

func (*EventQuery) Offset

func (eq *EventQuery) Offset(offset int) *EventQuery

Offset adds an offset step to the query.

func (*EventQuery) Only

func (eq *EventQuery) Only(ctx context.Context) (*Event, error)

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

func (*EventQuery) OnlyID

func (eq *EventQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*EventQuery) OnlyIDX

func (eq *EventQuery) OnlyIDX(ctx context.Context) int

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

func (*EventQuery) OnlyX

func (eq *EventQuery) OnlyX(ctx context.Context) *Event

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

func (*EventQuery) Order

func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery

Order adds an order step to the query.

func (*EventQuery) QueryOwner

func (eq *EventQuery) QueryOwner() *AlertQuery

QueryOwner chains the current query on the "owner" edge.

func (*EventQuery) Select

func (eq *EventQuery) Select(fields ...string) *EventSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Event.Query().
	Select(event.FieldCreatedAt).
	Scan(ctx, &v)

func (*EventQuery) Unique added in v1.2.1

func (eq *EventQuery) Unique(unique bool) *EventQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*EventQuery) Where

func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery

Where adds a new predicate for the EventQuery builder.

func (*EventQuery) WithOwner

func (eq *EventQuery) WithOwner(opts ...func(*AlertQuery)) *EventQuery

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

type EventSelect

type EventSelect struct {
	*EventQuery
	// contains filtered or unexported fields
}

EventSelect is the builder for selecting fields of Event entities.

func (*EventSelect) Bool

func (s *EventSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventSelect) BoolX

func (s *EventSelect) BoolX(ctx context.Context) bool

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

func (*EventSelect) Bools

func (s *EventSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*EventSelect) BoolsX

func (s *EventSelect) BoolsX(ctx context.Context) []bool

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

func (*EventSelect) Float64

func (s *EventSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventSelect) Float64X

func (s *EventSelect) Float64X(ctx context.Context) float64

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

func (*EventSelect) Float64s

func (s *EventSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventSelect) Float64sX

func (s *EventSelect) Float64sX(ctx context.Context) []float64

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

func (*EventSelect) Int

func (s *EventSelect) Int(ctx context.Context) (_ int, err error)

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

func (*EventSelect) IntX

func (s *EventSelect) IntX(ctx context.Context) int

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

func (*EventSelect) Ints

func (s *EventSelect) Ints(ctx context.Context) ([]int, error)

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

func (*EventSelect) IntsX

func (s *EventSelect) IntsX(ctx context.Context) []int

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

func (*EventSelect) Scan

func (es *EventSelect) Scan(ctx context.Context, v any) error

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

func (*EventSelect) ScanX

func (s *EventSelect) ScanX(ctx context.Context, v any)

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

func (*EventSelect) String

func (s *EventSelect) String(ctx context.Context) (_ string, err error)

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

func (*EventSelect) StringX

func (s *EventSelect) StringX(ctx context.Context) string

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

func (*EventSelect) Strings

func (s *EventSelect) Strings(ctx context.Context) ([]string, error)

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

func (*EventSelect) StringsX

func (s *EventSelect) StringsX(ctx context.Context) []string

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

type EventUpdate

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

EventUpdate is the builder for updating Event entities.

func (*EventUpdate) ClearCreatedAt added in v1.3.0

func (eu *EventUpdate) ClearCreatedAt() *EventUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*EventUpdate) ClearOwner

func (eu *EventUpdate) ClearOwner() *EventUpdate

ClearOwner clears the "owner" edge to the Alert entity.

func (*EventUpdate) ClearUpdatedAt added in v1.3.0

func (eu *EventUpdate) ClearUpdatedAt() *EventUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*EventUpdate) Exec

func (eu *EventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpdate) ExecX

func (eu *EventUpdate) ExecX(ctx context.Context)

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

func (*EventUpdate) Mutation

func (eu *EventUpdate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdate) Save

func (eu *EventUpdate) Save(ctx context.Context) (int, error)

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

func (*EventUpdate) SaveX

func (eu *EventUpdate) SaveX(ctx context.Context) int

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

func (*EventUpdate) SetCreatedAt

func (eu *EventUpdate) SetCreatedAt(t time.Time) *EventUpdate

SetCreatedAt sets the "created_at" field.

func (*EventUpdate) SetNillableOwnerID

func (eu *EventUpdate) SetNillableOwnerID(id *int) *EventUpdate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*EventUpdate) SetOwner

func (eu *EventUpdate) SetOwner(a *Alert) *EventUpdate

SetOwner sets the "owner" edge to the Alert entity.

func (*EventUpdate) SetOwnerID

func (eu *EventUpdate) SetOwnerID(id int) *EventUpdate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*EventUpdate) SetSerialized

func (eu *EventUpdate) SetSerialized(s string) *EventUpdate

SetSerialized sets the "serialized" field.

func (*EventUpdate) SetTime

func (eu *EventUpdate) SetTime(t time.Time) *EventUpdate

SetTime sets the "time" field.

func (*EventUpdate) SetUpdatedAt

func (eu *EventUpdate) SetUpdatedAt(t time.Time) *EventUpdate

SetUpdatedAt sets the "updated_at" field.

func (*EventUpdate) Where

func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate

Where appends a list predicates to the EventUpdate builder.

type EventUpdateOne

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

EventUpdateOne is the builder for updating a single Event entity.

func (*EventUpdateOne) ClearCreatedAt added in v1.3.0

func (euo *EventUpdateOne) ClearCreatedAt() *EventUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*EventUpdateOne) ClearOwner

func (euo *EventUpdateOne) ClearOwner() *EventUpdateOne

ClearOwner clears the "owner" edge to the Alert entity.

func (*EventUpdateOne) ClearUpdatedAt added in v1.3.0

func (euo *EventUpdateOne) ClearUpdatedAt() *EventUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*EventUpdateOne) Exec

func (euo *EventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EventUpdateOne) ExecX

func (euo *EventUpdateOne) ExecX(ctx context.Context)

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

func (*EventUpdateOne) Mutation

func (euo *EventUpdateOne) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdateOne) Save

func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)

Save executes the query and returns the updated Event entity.

func (*EventUpdateOne) SaveX

func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event

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

func (*EventUpdateOne) Select added in v1.2.1

func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EventUpdateOne) SetCreatedAt

func (euo *EventUpdateOne) SetCreatedAt(t time.Time) *EventUpdateOne

SetCreatedAt sets the "created_at" field.

func (*EventUpdateOne) SetNillableOwnerID

func (euo *EventUpdateOne) SetNillableOwnerID(id *int) *EventUpdateOne

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*EventUpdateOne) SetOwner

func (euo *EventUpdateOne) SetOwner(a *Alert) *EventUpdateOne

SetOwner sets the "owner" edge to the Alert entity.

func (*EventUpdateOne) SetOwnerID

func (euo *EventUpdateOne) SetOwnerID(id int) *EventUpdateOne

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*EventUpdateOne) SetSerialized

func (euo *EventUpdateOne) SetSerialized(s string) *EventUpdateOne

SetSerialized sets the "serialized" field.

func (*EventUpdateOne) SetTime

func (euo *EventUpdateOne) SetTime(t time.Time) *EventUpdateOne

SetTime sets the "time" field.

func (*EventUpdateOne) SetUpdatedAt

func (euo *EventUpdateOne) SetUpdatedAt(t time.Time) *EventUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Events

type Events []*Event

Events is a parsable slice of Event.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Machine

type Machine struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// LastPush holds the value of the "last_push" field.
	LastPush *time.Time `json:"last_push,omitempty"`
	// LastHeartbeat holds the value of the "last_heartbeat" field.
	LastHeartbeat *time.Time `json:"last_heartbeat,omitempty"`
	// MachineId holds the value of the "machineId" field.
	MachineId string `json:"machineId,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// IpAddress holds the value of the "ipAddress" field.
	IpAddress string `json:"ipAddress,omitempty"`
	// Scenarios holds the value of the "scenarios" field.
	Scenarios string `json:"scenarios,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// IsValidated holds the value of the "isValidated" field.
	IsValidated bool `json:"isValidated,omitempty"`
	// Status holds the value of the "status" field.
	Status string `json:"status,omitempty"`
	// AuthType holds the value of the "auth_type" field.
	AuthType string `json:"auth_type"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MachineQuery when eager-loading is set.
	Edges MachineEdges `json:"edges"`
	// contains filtered or unexported fields
}

Machine is the model entity for the Machine schema.

func (*Machine) QueryAlerts

func (m *Machine) QueryAlerts() *AlertQuery

QueryAlerts queries the "alerts" edge of the Machine entity.

func (*Machine) String

func (m *Machine) String() string

String implements the fmt.Stringer.

func (*Machine) Unwrap

func (m *Machine) Unwrap() *Machine

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

func (m *Machine) Update() *MachineUpdateOne

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

type MachineClient

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

MachineClient is a client for the Machine schema.

func NewMachineClient

func NewMachineClient(c config) *MachineClient

NewMachineClient returns a client for the Machine from the given config.

func (*MachineClient) Create

func (c *MachineClient) Create() *MachineCreate

Create returns a builder for creating a Machine entity.

func (*MachineClient) CreateBulk

func (c *MachineClient) CreateBulk(builders ...*MachineCreate) *MachineCreateBulk

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

func (*MachineClient) Delete

func (c *MachineClient) Delete() *MachineDelete

Delete returns a delete builder for Machine.

func (*MachineClient) DeleteOne

func (c *MachineClient) DeleteOne(m *Machine) *MachineDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MachineClient) DeleteOneID

func (c *MachineClient) DeleteOneID(id int) *MachineDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*MachineClient) Get

func (c *MachineClient) Get(ctx context.Context, id int) (*Machine, error)

Get returns a Machine entity by its id.

func (*MachineClient) GetX

func (c *MachineClient) GetX(ctx context.Context, id int) *Machine

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

func (*MachineClient) Hooks

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

Hooks returns the client hooks.

func (*MachineClient) Query

func (c *MachineClient) Query() *MachineQuery

Query returns a query builder for Machine.

func (*MachineClient) QueryAlerts

func (c *MachineClient) QueryAlerts(m *Machine) *AlertQuery

QueryAlerts queries the alerts edge of a Machine.

func (*MachineClient) Update

func (c *MachineClient) Update() *MachineUpdate

Update returns an update builder for Machine.

func (*MachineClient) UpdateOne

func (c *MachineClient) UpdateOne(m *Machine) *MachineUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MachineClient) UpdateOneID

func (c *MachineClient) UpdateOneID(id int) *MachineUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MachineClient) Use

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

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

type MachineCreate

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

MachineCreate is the builder for creating a Machine entity.

func (*MachineCreate) AddAlertIDs

func (mc *MachineCreate) AddAlertIDs(ids ...int) *MachineCreate

AddAlertIDs adds the "alerts" edge to the Alert entity by IDs.

func (*MachineCreate) AddAlerts

func (mc *MachineCreate) AddAlerts(a ...*Alert) *MachineCreate

AddAlerts adds the "alerts" edges to the Alert entity.

func (*MachineCreate) Exec added in v1.2.1

func (mc *MachineCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MachineCreate) ExecX added in v1.2.1

func (mc *MachineCreate) ExecX(ctx context.Context)

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

func (*MachineCreate) Mutation

func (mc *MachineCreate) Mutation() *MachineMutation

Mutation returns the MachineMutation object of the builder.

func (*MachineCreate) Save

func (mc *MachineCreate) Save(ctx context.Context) (*Machine, error)

Save creates the Machine in the database.

func (*MachineCreate) SaveX

func (mc *MachineCreate) SaveX(ctx context.Context) *Machine

SaveX calls Save and panics if Save returns an error.

func (*MachineCreate) SetAuthType added in v1.4.0

func (mc *MachineCreate) SetAuthType(s string) *MachineCreate

SetAuthType sets the "auth_type" field.

func (*MachineCreate) SetCreatedAt

func (mc *MachineCreate) SetCreatedAt(t time.Time) *MachineCreate

SetCreatedAt sets the "created_at" field.

func (*MachineCreate) SetIpAddress

func (mc *MachineCreate) SetIpAddress(s string) *MachineCreate

SetIpAddress sets the "ipAddress" field.

func (*MachineCreate) SetIsValidated

func (mc *MachineCreate) SetIsValidated(b bool) *MachineCreate

SetIsValidated sets the "isValidated" field.

func (*MachineCreate) SetLastHeartbeat added in v1.4.0

func (mc *MachineCreate) SetLastHeartbeat(t time.Time) *MachineCreate

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineCreate) SetLastPush added in v1.3.0

func (mc *MachineCreate) SetLastPush(t time.Time) *MachineCreate

SetLastPush sets the "last_push" field.

func (*MachineCreate) SetMachineId

func (mc *MachineCreate) SetMachineId(s string) *MachineCreate

SetMachineId sets the "machineId" field.

func (*MachineCreate) SetNillableAuthType added in v1.4.0

func (mc *MachineCreate) SetNillableAuthType(s *string) *MachineCreate

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*MachineCreate) SetNillableCreatedAt

func (mc *MachineCreate) SetNillableCreatedAt(t *time.Time) *MachineCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MachineCreate) SetNillableIsValidated

func (mc *MachineCreate) SetNillableIsValidated(b *bool) *MachineCreate

SetNillableIsValidated sets the "isValidated" field if the given value is not nil.

func (*MachineCreate) SetNillableLastHeartbeat added in v1.4.0

func (mc *MachineCreate) SetNillableLastHeartbeat(t *time.Time) *MachineCreate

SetNillableLastHeartbeat sets the "last_heartbeat" field if the given value is not nil.

func (*MachineCreate) SetNillableLastPush added in v1.3.0

func (mc *MachineCreate) SetNillableLastPush(t *time.Time) *MachineCreate

SetNillableLastPush sets the "last_push" field if the given value is not nil.

func (*MachineCreate) SetNillableScenarios

func (mc *MachineCreate) SetNillableScenarios(s *string) *MachineCreate

SetNillableScenarios sets the "scenarios" field if the given value is not nil.

func (*MachineCreate) SetNillableStatus

func (mc *MachineCreate) SetNillableStatus(s *string) *MachineCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*MachineCreate) SetNillableUpdatedAt

func (mc *MachineCreate) SetNillableUpdatedAt(t *time.Time) *MachineCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*MachineCreate) SetNillableVersion

func (mc *MachineCreate) SetNillableVersion(s *string) *MachineCreate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MachineCreate) SetPassword

func (mc *MachineCreate) SetPassword(s string) *MachineCreate

SetPassword sets the "password" field.

func (*MachineCreate) SetScenarios

func (mc *MachineCreate) SetScenarios(s string) *MachineCreate

SetScenarios sets the "scenarios" field.

func (*MachineCreate) SetStatus

func (mc *MachineCreate) SetStatus(s string) *MachineCreate

SetStatus sets the "status" field.

func (*MachineCreate) SetUpdatedAt

func (mc *MachineCreate) SetUpdatedAt(t time.Time) *MachineCreate

SetUpdatedAt sets the "updated_at" field.

func (*MachineCreate) SetVersion

func (mc *MachineCreate) SetVersion(s string) *MachineCreate

SetVersion sets the "version" field.

type MachineCreateBulk

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

MachineCreateBulk is the builder for creating many Machine entities in bulk.

func (*MachineCreateBulk) Exec added in v1.2.1

func (mcb *MachineCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MachineCreateBulk) ExecX added in v1.2.1

func (mcb *MachineCreateBulk) ExecX(ctx context.Context)

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

func (*MachineCreateBulk) Save

func (mcb *MachineCreateBulk) Save(ctx context.Context) ([]*Machine, error)

Save creates the Machine entities in the database.

func (*MachineCreateBulk) SaveX

func (mcb *MachineCreateBulk) SaveX(ctx context.Context) []*Machine

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

type MachineDelete

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

MachineDelete is the builder for deleting a Machine entity.

func (*MachineDelete) Exec

func (md *MachineDelete) Exec(ctx context.Context) (int, error)

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

func (*MachineDelete) ExecX

func (md *MachineDelete) ExecX(ctx context.Context) int

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

func (*MachineDelete) Where

func (md *MachineDelete) Where(ps ...predicate.Machine) *MachineDelete

Where appends a list predicates to the MachineDelete builder.

type MachineDeleteOne

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

MachineDeleteOne is the builder for deleting a single Machine entity.

func (*MachineDeleteOne) Exec

func (mdo *MachineDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MachineDeleteOne) ExecX

func (mdo *MachineDeleteOne) ExecX(ctx context.Context)

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

type MachineEdges

type MachineEdges struct {
	// Alerts holds the value of the alerts edge.
	Alerts []*Alert `json:"alerts,omitempty"`
	// contains filtered or unexported fields
}

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

func (MachineEdges) AlertsOrErr

func (e MachineEdges) AlertsOrErr() ([]*Alert, error)

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

type MachineGroupBy

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

MachineGroupBy is the group-by builder for Machine entities.

func (*MachineGroupBy) Aggregate

func (mgb *MachineGroupBy) Aggregate(fns ...AggregateFunc) *MachineGroupBy

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

func (*MachineGroupBy) Bool

func (s *MachineGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*MachineGroupBy) BoolX

func (s *MachineGroupBy) BoolX(ctx context.Context) bool

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

func (*MachineGroupBy) Bools

func (s *MachineGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*MachineGroupBy) BoolsX

func (s *MachineGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MachineGroupBy) Float64

func (s *MachineGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*MachineGroupBy) Float64X

func (s *MachineGroupBy) Float64X(ctx context.Context) float64

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

func (*MachineGroupBy) Float64s

func (s *MachineGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*MachineGroupBy) Float64sX

func (s *MachineGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MachineGroupBy) Int

func (s *MachineGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*MachineGroupBy) IntX

func (s *MachineGroupBy) IntX(ctx context.Context) int

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

func (*MachineGroupBy) Ints

func (s *MachineGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*MachineGroupBy) IntsX

func (s *MachineGroupBy) IntsX(ctx context.Context) []int

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

func (*MachineGroupBy) Scan

func (mgb *MachineGroupBy) Scan(ctx context.Context, v any) error

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

func (*MachineGroupBy) ScanX

func (s *MachineGroupBy) ScanX(ctx context.Context, v any)

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

func (*MachineGroupBy) String

func (s *MachineGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*MachineGroupBy) StringX

func (s *MachineGroupBy) StringX(ctx context.Context) string

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

func (*MachineGroupBy) Strings

func (s *MachineGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MachineGroupBy) StringsX

func (s *MachineGroupBy) StringsX(ctx context.Context) []string

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

type MachineMutation

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

MachineMutation represents an operation that mutates the Machine nodes in the graph.

func (*MachineMutation) AddAlertIDs

func (m *MachineMutation) AddAlertIDs(ids ...int)

AddAlertIDs adds the "alerts" edge to the Alert entity by ids.

func (*MachineMutation) AddField

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

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

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

func (*MachineMutation) AddedField

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

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

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

func (*MachineMutation) AddedIDs

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

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

func (*MachineMutation) AlertsCleared

func (m *MachineMutation) AlertsCleared() bool

AlertsCleared reports if the "alerts" edge to the Alert entity was cleared.

func (*MachineMutation) AlertsIDs

func (m *MachineMutation) AlertsIDs() (ids []int)

AlertsIDs returns the "alerts" edge IDs in the mutation.

func (*MachineMutation) AuthType added in v1.4.0

func (m *MachineMutation) AuthType() (r string, exists bool)

AuthType returns the value of the "auth_type" field in the mutation.

func (*MachineMutation) ClearAlerts

func (m *MachineMutation) ClearAlerts()

ClearAlerts clears the "alerts" edge to the Alert entity.

func (*MachineMutation) ClearCreatedAt added in v1.3.0

func (m *MachineMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*MachineMutation) ClearEdge

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

func (m *MachineMutation) 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 (*MachineMutation) ClearLastHeartbeat added in v1.4.0

func (m *MachineMutation) ClearLastHeartbeat()

ClearLastHeartbeat clears the value of the "last_heartbeat" field.

func (*MachineMutation) ClearLastPush added in v1.3.0

func (m *MachineMutation) ClearLastPush()

ClearLastPush clears the value of the "last_push" field.

func (*MachineMutation) ClearScenarios

func (m *MachineMutation) ClearScenarios()

ClearScenarios clears the value of the "scenarios" field.

func (*MachineMutation) ClearStatus

func (m *MachineMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*MachineMutation) ClearUpdatedAt added in v1.3.0

func (m *MachineMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MachineMutation) ClearVersion

func (m *MachineMutation) ClearVersion()

ClearVersion clears the value of the "version" field.

func (*MachineMutation) ClearedEdges

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

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

func (*MachineMutation) ClearedFields

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

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

func (MachineMutation) Client

func (m MachineMutation) 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 (*MachineMutation) CreatedAt

func (m *MachineMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MachineMutation) CreatedAtCleared added in v1.3.0

func (m *MachineMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*MachineMutation) EdgeCleared

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

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

func (*MachineMutation) Field

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

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

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

func (*MachineMutation) Fields

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

func (m *MachineMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MachineMutation) IDs added in v1.3.1

func (m *MachineMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MachineMutation) IpAddress

func (m *MachineMutation) IpAddress() (r string, exists bool)

IpAddress returns the value of the "ipAddress" field in the mutation.

func (*MachineMutation) IsValidated

func (m *MachineMutation) IsValidated() (r bool, exists bool)

IsValidated returns the value of the "isValidated" field in the mutation.

func (*MachineMutation) LastHeartbeat added in v1.4.0

func (m *MachineMutation) LastHeartbeat() (r time.Time, exists bool)

LastHeartbeat returns the value of the "last_heartbeat" field in the mutation.

func (*MachineMutation) LastHeartbeatCleared added in v1.4.0

func (m *MachineMutation) LastHeartbeatCleared() bool

LastHeartbeatCleared returns if the "last_heartbeat" field was cleared in this mutation.

func (*MachineMutation) LastPush added in v1.3.0

func (m *MachineMutation) LastPush() (r time.Time, exists bool)

LastPush returns the value of the "last_push" field in the mutation.

func (*MachineMutation) LastPushCleared added in v1.3.0

func (m *MachineMutation) LastPushCleared() bool

LastPushCleared returns if the "last_push" field was cleared in this mutation.

func (*MachineMutation) MachineId

func (m *MachineMutation) MachineId() (r string, exists bool)

MachineId returns the value of the "machineId" field in the mutation.

func (*MachineMutation) OldAuthType added in v1.4.0

func (m *MachineMutation) OldAuthType(ctx context.Context) (v string, err error)

OldAuthType returns the old "auth_type" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldCreatedAt

func (m *MachineMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldField

func (m *MachineMutation) 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 (*MachineMutation) OldIpAddress

func (m *MachineMutation) OldIpAddress(ctx context.Context) (v string, err error)

OldIpAddress returns the old "ipAddress" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldIsValidated

func (m *MachineMutation) OldIsValidated(ctx context.Context) (v bool, err error)

OldIsValidated returns the old "isValidated" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldLastHeartbeat added in v1.4.0

func (m *MachineMutation) OldLastHeartbeat(ctx context.Context) (v *time.Time, err error)

OldLastHeartbeat returns the old "last_heartbeat" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldLastPush added in v1.3.0

func (m *MachineMutation) OldLastPush(ctx context.Context) (v *time.Time, err error)

OldLastPush returns the old "last_push" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldMachineId

func (m *MachineMutation) OldMachineId(ctx context.Context) (v string, err error)

OldMachineId returns the old "machineId" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldPassword

func (m *MachineMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldScenarios

func (m *MachineMutation) OldScenarios(ctx context.Context) (v string, err error)

OldScenarios returns the old "scenarios" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldStatus

func (m *MachineMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old "status" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldUpdatedAt

func (m *MachineMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Machine entity. If the Machine 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 (*MachineMutation) OldVersion

func (m *MachineMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the Machine entity. If the Machine 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 (*MachineMutation) Op

func (m *MachineMutation) Op() Op

Op returns the operation name.

func (*MachineMutation) Password

func (m *MachineMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*MachineMutation) RemoveAlertIDs

func (m *MachineMutation) RemoveAlertIDs(ids ...int)

RemoveAlertIDs removes the "alerts" edge to the Alert entity by IDs.

func (*MachineMutation) RemovedAlertsIDs

func (m *MachineMutation) RemovedAlertsIDs() (ids []int)

RemovedAlerts returns the removed IDs of the "alerts" edge to the Alert entity.

func (*MachineMutation) RemovedEdges

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

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

func (*MachineMutation) RemovedIDs

func (m *MachineMutation) 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 (*MachineMutation) ResetAlerts

func (m *MachineMutation) ResetAlerts()

ResetAlerts resets all changes to the "alerts" edge.

func (*MachineMutation) ResetAuthType added in v1.4.0

func (m *MachineMutation) ResetAuthType()

ResetAuthType resets all changes to the "auth_type" field.

func (*MachineMutation) ResetCreatedAt

func (m *MachineMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MachineMutation) ResetEdge

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

func (m *MachineMutation) 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 (*MachineMutation) ResetIpAddress

func (m *MachineMutation) ResetIpAddress()

ResetIpAddress resets all changes to the "ipAddress" field.

func (*MachineMutation) ResetIsValidated

func (m *MachineMutation) ResetIsValidated()

ResetIsValidated resets all changes to the "isValidated" field.

func (*MachineMutation) ResetLastHeartbeat added in v1.4.0

func (m *MachineMutation) ResetLastHeartbeat()

ResetLastHeartbeat resets all changes to the "last_heartbeat" field.

func (*MachineMutation) ResetLastPush added in v1.3.0

func (m *MachineMutation) ResetLastPush()

ResetLastPush resets all changes to the "last_push" field.

func (*MachineMutation) ResetMachineId

func (m *MachineMutation) ResetMachineId()

ResetMachineId resets all changes to the "machineId" field.

func (*MachineMutation) ResetPassword

func (m *MachineMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*MachineMutation) ResetScenarios

func (m *MachineMutation) ResetScenarios()

ResetScenarios resets all changes to the "scenarios" field.

func (*MachineMutation) ResetStatus

func (m *MachineMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*MachineMutation) ResetUpdatedAt

func (m *MachineMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MachineMutation) ResetVersion

func (m *MachineMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*MachineMutation) Scenarios

func (m *MachineMutation) Scenarios() (r string, exists bool)

Scenarios returns the value of the "scenarios" field in the mutation.

func (*MachineMutation) ScenariosCleared

func (m *MachineMutation) ScenariosCleared() bool

ScenariosCleared returns if the "scenarios" field was cleared in this mutation.

func (*MachineMutation) SetAuthType added in v1.4.0

func (m *MachineMutation) SetAuthType(s string)

SetAuthType sets the "auth_type" field.

func (*MachineMutation) SetCreatedAt

func (m *MachineMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MachineMutation) SetField

func (m *MachineMutation) 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 (*MachineMutation) SetIpAddress

func (m *MachineMutation) SetIpAddress(s string)

SetIpAddress sets the "ipAddress" field.

func (*MachineMutation) SetIsValidated

func (m *MachineMutation) SetIsValidated(b bool)

SetIsValidated sets the "isValidated" field.

func (*MachineMutation) SetLastHeartbeat added in v1.4.0

func (m *MachineMutation) SetLastHeartbeat(t time.Time)

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineMutation) SetLastPush added in v1.3.0

func (m *MachineMutation) SetLastPush(t time.Time)

SetLastPush sets the "last_push" field.

func (*MachineMutation) SetMachineId

func (m *MachineMutation) SetMachineId(s string)

SetMachineId sets the "machineId" field.

func (*MachineMutation) SetPassword

func (m *MachineMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*MachineMutation) SetScenarios

func (m *MachineMutation) SetScenarios(s string)

SetScenarios sets the "scenarios" field.

func (*MachineMutation) SetStatus

func (m *MachineMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*MachineMutation) SetUpdatedAt

func (m *MachineMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*MachineMutation) SetVersion

func (m *MachineMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (*MachineMutation) Status

func (m *MachineMutation) Status() (r string, exists bool)

Status returns the value of the "status" field in the mutation.

func (*MachineMutation) StatusCleared

func (m *MachineMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (MachineMutation) Tx

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

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

func (*MachineMutation) Type

func (m *MachineMutation) Type() string

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

func (*MachineMutation) UpdatedAt

func (m *MachineMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MachineMutation) UpdatedAtCleared added in v1.3.0

func (m *MachineMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*MachineMutation) Version

func (m *MachineMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*MachineMutation) VersionCleared

func (m *MachineMutation) VersionCleared() bool

VersionCleared returns if the "version" field was cleared in this mutation.

func (*MachineMutation) Where added in v1.2.1

func (m *MachineMutation) Where(ps ...predicate.Machine)

Where appends a list predicates to the MachineMutation builder.

type MachineQuery

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

MachineQuery is the builder for querying Machine entities.

func (*MachineQuery) All

func (mq *MachineQuery) All(ctx context.Context) ([]*Machine, error)

All executes the query and returns a list of Machines.

func (*MachineQuery) AllX

func (mq *MachineQuery) AllX(ctx context.Context) []*Machine

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

func (*MachineQuery) Clone

func (mq *MachineQuery) Clone() *MachineQuery

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

func (*MachineQuery) Count

func (mq *MachineQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MachineQuery) CountX

func (mq *MachineQuery) CountX(ctx context.Context) int

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

func (*MachineQuery) Exist

func (mq *MachineQuery) Exist(ctx context.Context) (bool, error)

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

func (*MachineQuery) ExistX

func (mq *MachineQuery) ExistX(ctx context.Context) bool

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

func (*MachineQuery) First

func (mq *MachineQuery) First(ctx context.Context) (*Machine, error)

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

func (*MachineQuery) FirstID

func (mq *MachineQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MachineQuery) FirstIDX added in v1.0.3

func (mq *MachineQuery) FirstIDX(ctx context.Context) int

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

func (*MachineQuery) FirstX

func (mq *MachineQuery) FirstX(ctx context.Context) *Machine

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

func (*MachineQuery) GroupBy

func (mq *MachineQuery) GroupBy(field string, fields ...string) *MachineGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Machine.Query().
	GroupBy(machine.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MachineQuery) IDs

func (mq *MachineQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MachineQuery) IDsX

func (mq *MachineQuery) IDsX(ctx context.Context) []int

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

func (*MachineQuery) Limit

func (mq *MachineQuery) Limit(limit int) *MachineQuery

Limit adds a limit step to the query.

func (*MachineQuery) Offset

func (mq *MachineQuery) Offset(offset int) *MachineQuery

Offset adds an offset step to the query.

func (*MachineQuery) Only

func (mq *MachineQuery) Only(ctx context.Context) (*Machine, error)

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

func (*MachineQuery) OnlyID

func (mq *MachineQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MachineQuery) OnlyIDX

func (mq *MachineQuery) OnlyIDX(ctx context.Context) int

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

func (*MachineQuery) OnlyX

func (mq *MachineQuery) OnlyX(ctx context.Context) *Machine

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

func (*MachineQuery) Order

func (mq *MachineQuery) Order(o ...OrderFunc) *MachineQuery

Order adds an order step to the query.

func (*MachineQuery) QueryAlerts

func (mq *MachineQuery) QueryAlerts() *AlertQuery

QueryAlerts chains the current query on the "alerts" edge.

func (*MachineQuery) Select

func (mq *MachineQuery) Select(fields ...string) *MachineSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Machine.Query().
	Select(machine.FieldCreatedAt).
	Scan(ctx, &v)

func (*MachineQuery) Unique added in v1.2.1

func (mq *MachineQuery) Unique(unique bool) *MachineQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MachineQuery) Where

func (mq *MachineQuery) Where(ps ...predicate.Machine) *MachineQuery

Where adds a new predicate for the MachineQuery builder.

func (*MachineQuery) WithAlerts

func (mq *MachineQuery) WithAlerts(opts ...func(*AlertQuery)) *MachineQuery

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

type MachineSelect

type MachineSelect struct {
	*MachineQuery
	// contains filtered or unexported fields
}

MachineSelect is the builder for selecting fields of Machine entities.

func (*MachineSelect) Bool

func (s *MachineSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MachineSelect) BoolX

func (s *MachineSelect) BoolX(ctx context.Context) bool

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

func (*MachineSelect) Bools

func (s *MachineSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MachineSelect) BoolsX

func (s *MachineSelect) BoolsX(ctx context.Context) []bool

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

func (*MachineSelect) Float64

func (s *MachineSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MachineSelect) Float64X

func (s *MachineSelect) Float64X(ctx context.Context) float64

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

func (*MachineSelect) Float64s

func (s *MachineSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MachineSelect) Float64sX

func (s *MachineSelect) Float64sX(ctx context.Context) []float64

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

func (*MachineSelect) Int

func (s *MachineSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MachineSelect) IntX

func (s *MachineSelect) IntX(ctx context.Context) int

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

func (*MachineSelect) Ints

func (s *MachineSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MachineSelect) IntsX

func (s *MachineSelect) IntsX(ctx context.Context) []int

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

func (*MachineSelect) Scan

func (ms *MachineSelect) Scan(ctx context.Context, v any) error

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

func (*MachineSelect) ScanX

func (s *MachineSelect) ScanX(ctx context.Context, v any)

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

func (*MachineSelect) String

func (s *MachineSelect) String(ctx context.Context) (_ string, err error)

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

func (*MachineSelect) StringX

func (s *MachineSelect) StringX(ctx context.Context) string

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

func (*MachineSelect) Strings

func (s *MachineSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MachineSelect) StringsX

func (s *MachineSelect) StringsX(ctx context.Context) []string

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

type MachineUpdate

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

MachineUpdate is the builder for updating Machine entities.

func (*MachineUpdate) AddAlertIDs

func (mu *MachineUpdate) AddAlertIDs(ids ...int) *MachineUpdate

AddAlertIDs adds the "alerts" edge to the Alert entity by IDs.

func (*MachineUpdate) AddAlerts

func (mu *MachineUpdate) AddAlerts(a ...*Alert) *MachineUpdate

AddAlerts adds the "alerts" edges to the Alert entity.

func (*MachineUpdate) ClearAlerts

func (mu *MachineUpdate) ClearAlerts() *MachineUpdate

ClearAlerts clears all "alerts" edges to the Alert entity.

func (*MachineUpdate) ClearCreatedAt added in v1.3.0

func (mu *MachineUpdate) ClearCreatedAt() *MachineUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*MachineUpdate) ClearLastHeartbeat added in v1.4.0

func (mu *MachineUpdate) ClearLastHeartbeat() *MachineUpdate

ClearLastHeartbeat clears the value of the "last_heartbeat" field.

func (*MachineUpdate) ClearLastPush added in v1.3.0

func (mu *MachineUpdate) ClearLastPush() *MachineUpdate

ClearLastPush clears the value of the "last_push" field.

func (*MachineUpdate) ClearScenarios

func (mu *MachineUpdate) ClearScenarios() *MachineUpdate

ClearScenarios clears the value of the "scenarios" field.

func (*MachineUpdate) ClearStatus

func (mu *MachineUpdate) ClearStatus() *MachineUpdate

ClearStatus clears the value of the "status" field.

func (*MachineUpdate) ClearUpdatedAt added in v1.3.0

func (mu *MachineUpdate) ClearUpdatedAt() *MachineUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MachineUpdate) ClearVersion

func (mu *MachineUpdate) ClearVersion() *MachineUpdate

ClearVersion clears the value of the "version" field.

func (*MachineUpdate) Exec

func (mu *MachineUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MachineUpdate) ExecX

func (mu *MachineUpdate) ExecX(ctx context.Context)

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

func (*MachineUpdate) Mutation

func (mu *MachineUpdate) Mutation() *MachineMutation

Mutation returns the MachineMutation object of the builder.

func (*MachineUpdate) RemoveAlertIDs

func (mu *MachineUpdate) RemoveAlertIDs(ids ...int) *MachineUpdate

RemoveAlertIDs removes the "alerts" edge to Alert entities by IDs.

func (*MachineUpdate) RemoveAlerts

func (mu *MachineUpdate) RemoveAlerts(a ...*Alert) *MachineUpdate

RemoveAlerts removes "alerts" edges to Alert entities.

func (*MachineUpdate) Save

func (mu *MachineUpdate) Save(ctx context.Context) (int, error)

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

func (*MachineUpdate) SaveX

func (mu *MachineUpdate) SaveX(ctx context.Context) int

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

func (*MachineUpdate) SetAuthType added in v1.4.0

func (mu *MachineUpdate) SetAuthType(s string) *MachineUpdate

SetAuthType sets the "auth_type" field.

func (*MachineUpdate) SetCreatedAt

func (mu *MachineUpdate) SetCreatedAt(t time.Time) *MachineUpdate

SetCreatedAt sets the "created_at" field.

func (*MachineUpdate) SetIpAddress

func (mu *MachineUpdate) SetIpAddress(s string) *MachineUpdate

SetIpAddress sets the "ipAddress" field.

func (*MachineUpdate) SetIsValidated

func (mu *MachineUpdate) SetIsValidated(b bool) *MachineUpdate

SetIsValidated sets the "isValidated" field.

func (*MachineUpdate) SetLastHeartbeat added in v1.4.0

func (mu *MachineUpdate) SetLastHeartbeat(t time.Time) *MachineUpdate

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineUpdate) SetLastPush added in v1.3.0

func (mu *MachineUpdate) SetLastPush(t time.Time) *MachineUpdate

SetLastPush sets the "last_push" field.

func (*MachineUpdate) SetMachineId

func (mu *MachineUpdate) SetMachineId(s string) *MachineUpdate

SetMachineId sets the "machineId" field.

func (*MachineUpdate) SetNillableAuthType added in v1.4.0

func (mu *MachineUpdate) SetNillableAuthType(s *string) *MachineUpdate

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*MachineUpdate) SetNillableIsValidated

func (mu *MachineUpdate) SetNillableIsValidated(b *bool) *MachineUpdate

SetNillableIsValidated sets the "isValidated" field if the given value is not nil.

func (*MachineUpdate) SetNillableScenarios

func (mu *MachineUpdate) SetNillableScenarios(s *string) *MachineUpdate

SetNillableScenarios sets the "scenarios" field if the given value is not nil.

func (*MachineUpdate) SetNillableStatus

func (mu *MachineUpdate) SetNillableStatus(s *string) *MachineUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*MachineUpdate) SetNillableVersion

func (mu *MachineUpdate) SetNillableVersion(s *string) *MachineUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MachineUpdate) SetPassword

func (mu *MachineUpdate) SetPassword(s string) *MachineUpdate

SetPassword sets the "password" field.

func (*MachineUpdate) SetScenarios

func (mu *MachineUpdate) SetScenarios(s string) *MachineUpdate

SetScenarios sets the "scenarios" field.

func (*MachineUpdate) SetStatus

func (mu *MachineUpdate) SetStatus(s string) *MachineUpdate

SetStatus sets the "status" field.

func (*MachineUpdate) SetUpdatedAt

func (mu *MachineUpdate) SetUpdatedAt(t time.Time) *MachineUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MachineUpdate) SetVersion

func (mu *MachineUpdate) SetVersion(s string) *MachineUpdate

SetVersion sets the "version" field.

func (*MachineUpdate) Where

func (mu *MachineUpdate) Where(ps ...predicate.Machine) *MachineUpdate

Where appends a list predicates to the MachineUpdate builder.

type MachineUpdateOne

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

MachineUpdateOne is the builder for updating a single Machine entity.

func (*MachineUpdateOne) AddAlertIDs

func (muo *MachineUpdateOne) AddAlertIDs(ids ...int) *MachineUpdateOne

AddAlertIDs adds the "alerts" edge to the Alert entity by IDs.

func (*MachineUpdateOne) AddAlerts

func (muo *MachineUpdateOne) AddAlerts(a ...*Alert) *MachineUpdateOne

AddAlerts adds the "alerts" edges to the Alert entity.

func (*MachineUpdateOne) ClearAlerts

func (muo *MachineUpdateOne) ClearAlerts() *MachineUpdateOne

ClearAlerts clears all "alerts" edges to the Alert entity.

func (*MachineUpdateOne) ClearCreatedAt added in v1.3.0

func (muo *MachineUpdateOne) ClearCreatedAt() *MachineUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*MachineUpdateOne) ClearLastHeartbeat added in v1.4.0

func (muo *MachineUpdateOne) ClearLastHeartbeat() *MachineUpdateOne

ClearLastHeartbeat clears the value of the "last_heartbeat" field.

func (*MachineUpdateOne) ClearLastPush added in v1.3.0

func (muo *MachineUpdateOne) ClearLastPush() *MachineUpdateOne

ClearLastPush clears the value of the "last_push" field.

func (*MachineUpdateOne) ClearScenarios

func (muo *MachineUpdateOne) ClearScenarios() *MachineUpdateOne

ClearScenarios clears the value of the "scenarios" field.

func (*MachineUpdateOne) ClearStatus

func (muo *MachineUpdateOne) ClearStatus() *MachineUpdateOne

ClearStatus clears the value of the "status" field.

func (*MachineUpdateOne) ClearUpdatedAt added in v1.3.0

func (muo *MachineUpdateOne) ClearUpdatedAt() *MachineUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MachineUpdateOne) ClearVersion

func (muo *MachineUpdateOne) ClearVersion() *MachineUpdateOne

ClearVersion clears the value of the "version" field.

func (*MachineUpdateOne) Exec

func (muo *MachineUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MachineUpdateOne) ExecX

func (muo *MachineUpdateOne) ExecX(ctx context.Context)

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

func (*MachineUpdateOne) Mutation

func (muo *MachineUpdateOne) Mutation() *MachineMutation

Mutation returns the MachineMutation object of the builder.

func (*MachineUpdateOne) RemoveAlertIDs

func (muo *MachineUpdateOne) RemoveAlertIDs(ids ...int) *MachineUpdateOne

RemoveAlertIDs removes the "alerts" edge to Alert entities by IDs.

func (*MachineUpdateOne) RemoveAlerts

func (muo *MachineUpdateOne) RemoveAlerts(a ...*Alert) *MachineUpdateOne

RemoveAlerts removes "alerts" edges to Alert entities.

func (*MachineUpdateOne) Save

func (muo *MachineUpdateOne) Save(ctx context.Context) (*Machine, error)

Save executes the query and returns the updated Machine entity.

func (*MachineUpdateOne) SaveX

func (muo *MachineUpdateOne) SaveX(ctx context.Context) *Machine

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

func (*MachineUpdateOne) Select added in v1.2.1

func (muo *MachineUpdateOne) Select(field string, fields ...string) *MachineUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MachineUpdateOne) SetAuthType added in v1.4.0

func (muo *MachineUpdateOne) SetAuthType(s string) *MachineUpdateOne

SetAuthType sets the "auth_type" field.

func (*MachineUpdateOne) SetCreatedAt

func (muo *MachineUpdateOne) SetCreatedAt(t time.Time) *MachineUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MachineUpdateOne) SetIpAddress

func (muo *MachineUpdateOne) SetIpAddress(s string) *MachineUpdateOne

SetIpAddress sets the "ipAddress" field.

func (*MachineUpdateOne) SetIsValidated

func (muo *MachineUpdateOne) SetIsValidated(b bool) *MachineUpdateOne

SetIsValidated sets the "isValidated" field.

func (*MachineUpdateOne) SetLastHeartbeat added in v1.4.0

func (muo *MachineUpdateOne) SetLastHeartbeat(t time.Time) *MachineUpdateOne

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineUpdateOne) SetLastPush added in v1.3.0

func (muo *MachineUpdateOne) SetLastPush(t time.Time) *MachineUpdateOne

SetLastPush sets the "last_push" field.

func (*MachineUpdateOne) SetMachineId

func (muo *MachineUpdateOne) SetMachineId(s string) *MachineUpdateOne

SetMachineId sets the "machineId" field.

func (*MachineUpdateOne) SetNillableAuthType added in v1.4.0

func (muo *MachineUpdateOne) SetNillableAuthType(s *string) *MachineUpdateOne

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableIsValidated

func (muo *MachineUpdateOne) SetNillableIsValidated(b *bool) *MachineUpdateOne

SetNillableIsValidated sets the "isValidated" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableScenarios

func (muo *MachineUpdateOne) SetNillableScenarios(s *string) *MachineUpdateOne

SetNillableScenarios sets the "scenarios" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableStatus

func (muo *MachineUpdateOne) SetNillableStatus(s *string) *MachineUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableVersion

func (muo *MachineUpdateOne) SetNillableVersion(s *string) *MachineUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MachineUpdateOne) SetPassword

func (muo *MachineUpdateOne) SetPassword(s string) *MachineUpdateOne

SetPassword sets the "password" field.

func (*MachineUpdateOne) SetScenarios

func (muo *MachineUpdateOne) SetScenarios(s string) *MachineUpdateOne

SetScenarios sets the "scenarios" field.

func (*MachineUpdateOne) SetStatus

func (muo *MachineUpdateOne) SetStatus(s string) *MachineUpdateOne

SetStatus sets the "status" field.

func (*MachineUpdateOne) SetUpdatedAt

func (muo *MachineUpdateOne) SetUpdatedAt(t time.Time) *MachineUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MachineUpdateOne) SetVersion

func (muo *MachineUpdateOne) SetVersion(s string) *MachineUpdateOne

SetVersion sets the "version" field.

type Machines

type Machines []*Machine

Machines is a parsable slice of Machine.

type Meta

type Meta struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MetaQuery when eager-loading is set.
	Edges MetaEdges `json:"edges"`
	// contains filtered or unexported fields
}

Meta is the model entity for the Meta schema.

func (*Meta) QueryOwner

func (m *Meta) QueryOwner() *AlertQuery

QueryOwner queries the "owner" edge of the Meta entity.

func (*Meta) String

func (m *Meta) String() string

String implements the fmt.Stringer.

func (*Meta) Unwrap

func (m *Meta) Unwrap() *Meta

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

func (m *Meta) Update() *MetaUpdateOne

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

type MetaClient

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

MetaClient is a client for the Meta schema.

func NewMetaClient

func NewMetaClient(c config) *MetaClient

NewMetaClient returns a client for the Meta from the given config.

func (*MetaClient) Create

func (c *MetaClient) Create() *MetaCreate

Create returns a builder for creating a Meta entity.

func (*MetaClient) CreateBulk

func (c *MetaClient) CreateBulk(builders ...*MetaCreate) *MetaCreateBulk

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

func (*MetaClient) Delete

func (c *MetaClient) Delete() *MetaDelete

Delete returns a delete builder for Meta.

func (*MetaClient) DeleteOne

func (c *MetaClient) DeleteOne(m *Meta) *MetaDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MetaClient) DeleteOneID

func (c *MetaClient) DeleteOneID(id int) *MetaDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*MetaClient) Get

func (c *MetaClient) Get(ctx context.Context, id int) (*Meta, error)

Get returns a Meta entity by its id.

func (*MetaClient) GetX

func (c *MetaClient) GetX(ctx context.Context, id int) *Meta

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

func (*MetaClient) Hooks

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

Hooks returns the client hooks.

func (*MetaClient) Query

func (c *MetaClient) Query() *MetaQuery

Query returns a query builder for Meta.

func (*MetaClient) QueryOwner

func (c *MetaClient) QueryOwner(m *Meta) *AlertQuery

QueryOwner queries the owner edge of a Meta.

func (*MetaClient) Update

func (c *MetaClient) Update() *MetaUpdate

Update returns an update builder for Meta.

func (*MetaClient) UpdateOne

func (c *MetaClient) UpdateOne(m *Meta) *MetaUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MetaClient) UpdateOneID

func (c *MetaClient) UpdateOneID(id int) *MetaUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MetaClient) Use

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

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

type MetaCreate

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

MetaCreate is the builder for creating a Meta entity.

func (*MetaCreate) Exec added in v1.2.1

func (mc *MetaCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetaCreate) ExecX added in v1.2.1

func (mc *MetaCreate) ExecX(ctx context.Context)

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

func (*MetaCreate) Mutation

func (mc *MetaCreate) Mutation() *MetaMutation

Mutation returns the MetaMutation object of the builder.

func (*MetaCreate) Save

func (mc *MetaCreate) Save(ctx context.Context) (*Meta, error)

Save creates the Meta in the database.

func (*MetaCreate) SaveX

func (mc *MetaCreate) SaveX(ctx context.Context) *Meta

SaveX calls Save and panics if Save returns an error.

func (*MetaCreate) SetCreatedAt

func (mc *MetaCreate) SetCreatedAt(t time.Time) *MetaCreate

SetCreatedAt sets the "created_at" field.

func (*MetaCreate) SetKey

func (mc *MetaCreate) SetKey(s string) *MetaCreate

SetKey sets the "key" field.

func (*MetaCreate) SetNillableCreatedAt

func (mc *MetaCreate) SetNillableCreatedAt(t *time.Time) *MetaCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MetaCreate) SetNillableOwnerID

func (mc *MetaCreate) SetNillableOwnerID(id *int) *MetaCreate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*MetaCreate) SetNillableUpdatedAt

func (mc *MetaCreate) SetNillableUpdatedAt(t *time.Time) *MetaCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*MetaCreate) SetOwner

func (mc *MetaCreate) SetOwner(a *Alert) *MetaCreate

SetOwner sets the "owner" edge to the Alert entity.

func (*MetaCreate) SetOwnerID

func (mc *MetaCreate) SetOwnerID(id int) *MetaCreate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*MetaCreate) SetUpdatedAt

func (mc *MetaCreate) SetUpdatedAt(t time.Time) *MetaCreate

SetUpdatedAt sets the "updated_at" field.

func (*MetaCreate) SetValue

func (mc *MetaCreate) SetValue(s string) *MetaCreate

SetValue sets the "value" field.

type MetaCreateBulk

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

MetaCreateBulk is the builder for creating many Meta entities in bulk.

func (*MetaCreateBulk) Exec added in v1.2.1

func (mcb *MetaCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MetaCreateBulk) ExecX added in v1.2.1

func (mcb *MetaCreateBulk) ExecX(ctx context.Context)

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

func (*MetaCreateBulk) Save

func (mcb *MetaCreateBulk) Save(ctx context.Context) ([]*Meta, error)

Save creates the Meta entities in the database.

func (*MetaCreateBulk) SaveX

func (mcb *MetaCreateBulk) SaveX(ctx context.Context) []*Meta

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

type MetaDelete

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

MetaDelete is the builder for deleting a Meta entity.

func (*MetaDelete) Exec

func (md *MetaDelete) Exec(ctx context.Context) (int, error)

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

func (*MetaDelete) ExecX

func (md *MetaDelete) ExecX(ctx context.Context) int

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

func (*MetaDelete) Where

func (md *MetaDelete) Where(ps ...predicate.Meta) *MetaDelete

Where appends a list predicates to the MetaDelete builder.

type MetaDeleteOne

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

MetaDeleteOne is the builder for deleting a single Meta entity.

func (*MetaDeleteOne) Exec

func (mdo *MetaDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MetaDeleteOne) ExecX

func (mdo *MetaDeleteOne) ExecX(ctx context.Context)

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

type MetaEdges

type MetaEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Alert `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (MetaEdges) OwnerOrErr

func (e MetaEdges) OwnerOrErr() (*Alert, error)

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

type MetaGroupBy

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

MetaGroupBy is the group-by builder for Meta entities.

func (*MetaGroupBy) Aggregate

func (mgb *MetaGroupBy) Aggregate(fns ...AggregateFunc) *MetaGroupBy

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

func (*MetaGroupBy) Bool

func (s *MetaGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*MetaGroupBy) BoolX

func (s *MetaGroupBy) BoolX(ctx context.Context) bool

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

func (*MetaGroupBy) Bools

func (s *MetaGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*MetaGroupBy) BoolsX

func (s *MetaGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MetaGroupBy) Float64

func (s *MetaGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*MetaGroupBy) Float64X

func (s *MetaGroupBy) Float64X(ctx context.Context) float64

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

func (*MetaGroupBy) Float64s

func (s *MetaGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*MetaGroupBy) Float64sX

func (s *MetaGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MetaGroupBy) Int

func (s *MetaGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*MetaGroupBy) IntX

func (s *MetaGroupBy) IntX(ctx context.Context) int

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

func (*MetaGroupBy) Ints

func (s *MetaGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*MetaGroupBy) IntsX

func (s *MetaGroupBy) IntsX(ctx context.Context) []int

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

func (*MetaGroupBy) Scan

func (mgb *MetaGroupBy) Scan(ctx context.Context, v any) error

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

func (*MetaGroupBy) ScanX

func (s *MetaGroupBy) ScanX(ctx context.Context, v any)

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

func (*MetaGroupBy) String

func (s *MetaGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*MetaGroupBy) StringX

func (s *MetaGroupBy) StringX(ctx context.Context) string

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

func (*MetaGroupBy) Strings

func (s *MetaGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MetaGroupBy) StringsX

func (s *MetaGroupBy) StringsX(ctx context.Context) []string

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

type MetaMutation

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

MetaMutation represents an operation that mutates the Meta nodes in the graph.

func (*MetaMutation) AddField

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

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

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

func (*MetaMutation) AddedField

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

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

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

func (*MetaMutation) AddedIDs

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

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

func (*MetaMutation) ClearCreatedAt added in v1.3.0

func (m *MetaMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*MetaMutation) ClearEdge

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

func (m *MetaMutation) 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 (*MetaMutation) ClearOwner

func (m *MetaMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Alert entity.

func (*MetaMutation) ClearUpdatedAt added in v1.3.0

func (m *MetaMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MetaMutation) ClearedEdges

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

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

func (*MetaMutation) ClearedFields

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

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

func (MetaMutation) Client

func (m MetaMutation) 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 (*MetaMutation) CreatedAt

func (m *MetaMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MetaMutation) CreatedAtCleared added in v1.3.0

func (m *MetaMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*MetaMutation) EdgeCleared

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

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

func (*MetaMutation) Field

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

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

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

func (*MetaMutation) Fields

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

func (m *MetaMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MetaMutation) IDs added in v1.3.1

func (m *MetaMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MetaMutation) Key

func (m *MetaMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*MetaMutation) OldCreatedAt

func (m *MetaMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldField

func (m *MetaMutation) 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 (*MetaMutation) OldKey

func (m *MetaMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldUpdatedAt

func (m *MetaMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldValue

func (m *MetaMutation) OldValue(ctx context.Context) (v string, err error)

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

func (m *MetaMutation) Op() Op

Op returns the operation name.

func (*MetaMutation) OwnerCleared

func (m *MetaMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Alert entity was cleared.

func (*MetaMutation) OwnerID

func (m *MetaMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*MetaMutation) OwnerIDs

func (m *MetaMutation) OwnerIDs() (ids []int)

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

func (*MetaMutation) RemovedEdges

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

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

func (*MetaMutation) RemovedIDs

func (m *MetaMutation) 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 (*MetaMutation) ResetCreatedAt

func (m *MetaMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MetaMutation) ResetEdge

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

func (m *MetaMutation) 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 (*MetaMutation) ResetKey

func (m *MetaMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*MetaMutation) ResetOwner

func (m *MetaMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*MetaMutation) ResetUpdatedAt

func (m *MetaMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MetaMutation) ResetValue

func (m *MetaMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*MetaMutation) SetCreatedAt

func (m *MetaMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MetaMutation) SetField

func (m *MetaMutation) 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 (*MetaMutation) SetKey

func (m *MetaMutation) SetKey(s string)

SetKey sets the "key" field.

func (*MetaMutation) SetOwnerID

func (m *MetaMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Alert entity by id.

func (*MetaMutation) SetUpdatedAt

func (m *MetaMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*MetaMutation) SetValue

func (m *MetaMutation) SetValue(s string)

SetValue sets the "value" field.

func (MetaMutation) Tx

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

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

func (*MetaMutation) Type

func (m *MetaMutation) Type() string

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

func (*MetaMutation) UpdatedAt

func (m *MetaMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MetaMutation) UpdatedAtCleared added in v1.3.0

func (m *MetaMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*MetaMutation) Value

func (m *MetaMutation) Value() (r string, exists bool)

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

func (*MetaMutation) Where added in v1.2.1

func (m *MetaMutation) Where(ps ...predicate.Meta)

Where appends a list predicates to the MetaMutation builder.

type MetaQuery

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

MetaQuery is the builder for querying Meta entities.

func (*MetaQuery) All

func (mq *MetaQuery) All(ctx context.Context) ([]*Meta, error)

All executes the query and returns a list of MetaSlice.

func (*MetaQuery) AllX

func (mq *MetaQuery) AllX(ctx context.Context) []*Meta

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

func (*MetaQuery) Clone

func (mq *MetaQuery) Clone() *MetaQuery

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

func (*MetaQuery) Count

func (mq *MetaQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MetaQuery) CountX

func (mq *MetaQuery) CountX(ctx context.Context) int

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

func (*MetaQuery) Exist

func (mq *MetaQuery) Exist(ctx context.Context) (bool, error)

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

func (*MetaQuery) ExistX

func (mq *MetaQuery) ExistX(ctx context.Context) bool

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

func (*MetaQuery) First

func (mq *MetaQuery) First(ctx context.Context) (*Meta, error)

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

func (*MetaQuery) FirstID

func (mq *MetaQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MetaQuery) FirstIDX added in v1.0.3

func (mq *MetaQuery) FirstIDX(ctx context.Context) int

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

func (*MetaQuery) FirstX

func (mq *MetaQuery) FirstX(ctx context.Context) *Meta

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

func (*MetaQuery) GroupBy

func (mq *MetaQuery) GroupBy(field string, fields ...string) *MetaGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Meta.Query().
	GroupBy(meta.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MetaQuery) IDs

func (mq *MetaQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MetaQuery) IDsX

func (mq *MetaQuery) IDsX(ctx context.Context) []int

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

func (*MetaQuery) Limit

func (mq *MetaQuery) Limit(limit int) *MetaQuery

Limit adds a limit step to the query.

func (*MetaQuery) Offset

func (mq *MetaQuery) Offset(offset int) *MetaQuery

Offset adds an offset step to the query.

func (*MetaQuery) Only

func (mq *MetaQuery) Only(ctx context.Context) (*Meta, error)

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

func (*MetaQuery) OnlyID

func (mq *MetaQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MetaQuery) OnlyIDX

func (mq *MetaQuery) OnlyIDX(ctx context.Context) int

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

func (*MetaQuery) OnlyX

func (mq *MetaQuery) OnlyX(ctx context.Context) *Meta

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

func (*MetaQuery) Order

func (mq *MetaQuery) Order(o ...OrderFunc) *MetaQuery

Order adds an order step to the query.

func (*MetaQuery) QueryOwner

func (mq *MetaQuery) QueryOwner() *AlertQuery

QueryOwner chains the current query on the "owner" edge.

func (*MetaQuery) Select

func (mq *MetaQuery) Select(fields ...string) *MetaSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Meta.Query().
	Select(meta.FieldCreatedAt).
	Scan(ctx, &v)

func (*MetaQuery) Unique added in v1.2.1

func (mq *MetaQuery) Unique(unique bool) *MetaQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MetaQuery) Where

func (mq *MetaQuery) Where(ps ...predicate.Meta) *MetaQuery

Where adds a new predicate for the MetaQuery builder.

func (*MetaQuery) WithOwner

func (mq *MetaQuery) WithOwner(opts ...func(*AlertQuery)) *MetaQuery

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

type MetaSelect

type MetaSelect struct {
	*MetaQuery
	// contains filtered or unexported fields
}

MetaSelect is the builder for selecting fields of Meta entities.

func (*MetaSelect) Bool

func (s *MetaSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MetaSelect) BoolX

func (s *MetaSelect) BoolX(ctx context.Context) bool

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

func (*MetaSelect) Bools

func (s *MetaSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MetaSelect) BoolsX

func (s *MetaSelect) BoolsX(ctx context.Context) []bool

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

func (*MetaSelect) Float64

func (s *MetaSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MetaSelect) Float64X

func (s *MetaSelect) Float64X(ctx context.Context) float64

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

func (*MetaSelect) Float64s

func (s *MetaSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MetaSelect) Float64sX

func (s *MetaSelect) Float64sX(ctx context.Context) []float64

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

func (*MetaSelect) Int

func (s *MetaSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MetaSelect) IntX

func (s *MetaSelect) IntX(ctx context.Context) int

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

func (*MetaSelect) Ints

func (s *MetaSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MetaSelect) IntsX

func (s *MetaSelect) IntsX(ctx context.Context) []int

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

func (*MetaSelect) Scan

func (ms *MetaSelect) Scan(ctx context.Context, v any) error

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

func (*MetaSelect) ScanX

func (s *MetaSelect) ScanX(ctx context.Context, v any)

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

func (*MetaSelect) String

func (s *MetaSelect) String(ctx context.Context) (_ string, err error)

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

func (*MetaSelect) StringX

func (s *MetaSelect) StringX(ctx context.Context) string

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

func (*MetaSelect) Strings

func (s *MetaSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MetaSelect) StringsX

func (s *MetaSelect) StringsX(ctx context.Context) []string

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

type MetaSlice

type MetaSlice []*Meta

MetaSlice is a parsable slice of Meta.

type MetaUpdate

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

MetaUpdate is the builder for updating Meta entities.

func (*MetaUpdate) ClearCreatedAt added in v1.3.0

func (mu *MetaUpdate) ClearCreatedAt() *MetaUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*MetaUpdate) ClearOwner

func (mu *MetaUpdate) ClearOwner() *MetaUpdate

ClearOwner clears the "owner" edge to the Alert entity.

func (*MetaUpdate) ClearUpdatedAt added in v1.3.0

func (mu *MetaUpdate) ClearUpdatedAt() *MetaUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MetaUpdate) Exec

func (mu *MetaUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetaUpdate) ExecX

func (mu *MetaUpdate) ExecX(ctx context.Context)

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

func (*MetaUpdate) Mutation

func (mu *MetaUpdate) Mutation() *MetaMutation

Mutation returns the MetaMutation object of the builder.

func (*MetaUpdate) Save

func (mu *MetaUpdate) Save(ctx context.Context) (int, error)

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

func (*MetaUpdate) SaveX

func (mu *MetaUpdate) SaveX(ctx context.Context) int

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

func (*MetaUpdate) SetCreatedAt

func (mu *MetaUpdate) SetCreatedAt(t time.Time) *MetaUpdate

SetCreatedAt sets the "created_at" field.

func (*MetaUpdate) SetKey

func (mu *MetaUpdate) SetKey(s string) *MetaUpdate

SetKey sets the "key" field.

func (*MetaUpdate) SetNillableOwnerID

func (mu *MetaUpdate) SetNillableOwnerID(id *int) *MetaUpdate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*MetaUpdate) SetOwner

func (mu *MetaUpdate) SetOwner(a *Alert) *MetaUpdate

SetOwner sets the "owner" edge to the Alert entity.

func (*MetaUpdate) SetOwnerID

func (mu *MetaUpdate) SetOwnerID(id int) *MetaUpdate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*MetaUpdate) SetUpdatedAt

func (mu *MetaUpdate) SetUpdatedAt(t time.Time) *MetaUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MetaUpdate) SetValue

func (mu *MetaUpdate) SetValue(s string) *MetaUpdate

SetValue sets the "value" field.

func (*MetaUpdate) Where

func (mu *MetaUpdate) Where(ps ...predicate.Meta) *MetaUpdate

Where appends a list predicates to the MetaUpdate builder.

type MetaUpdateOne

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

MetaUpdateOne is the builder for updating a single Meta entity.

func (*MetaUpdateOne) ClearCreatedAt added in v1.3.0

func (muo *MetaUpdateOne) ClearCreatedAt() *MetaUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*MetaUpdateOne) ClearOwner

func (muo *MetaUpdateOne) ClearOwner() *MetaUpdateOne

ClearOwner clears the "owner" edge to the Alert entity.

func (*MetaUpdateOne) ClearUpdatedAt added in v1.3.0

func (muo *MetaUpdateOne) ClearUpdatedAt() *MetaUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MetaUpdateOne) Exec

func (muo *MetaUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MetaUpdateOne) ExecX

func (muo *MetaUpdateOne) ExecX(ctx context.Context)

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

func (*MetaUpdateOne) Mutation

func (muo *MetaUpdateOne) Mutation() *MetaMutation

Mutation returns the MetaMutation object of the builder.

func (*MetaUpdateOne) Save

func (muo *MetaUpdateOne) Save(ctx context.Context) (*Meta, error)

Save executes the query and returns the updated Meta entity.

func (*MetaUpdateOne) SaveX

func (muo *MetaUpdateOne) SaveX(ctx context.Context) *Meta

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

func (*MetaUpdateOne) Select added in v1.2.1

func (muo *MetaUpdateOne) Select(field string, fields ...string) *MetaUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MetaUpdateOne) SetCreatedAt

func (muo *MetaUpdateOne) SetCreatedAt(t time.Time) *MetaUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MetaUpdateOne) SetKey

func (muo *MetaUpdateOne) SetKey(s string) *MetaUpdateOne

SetKey sets the "key" field.

func (*MetaUpdateOne) SetNillableOwnerID

func (muo *MetaUpdateOne) SetNillableOwnerID(id *int) *MetaUpdateOne

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*MetaUpdateOne) SetOwner

func (muo *MetaUpdateOne) SetOwner(a *Alert) *MetaUpdateOne

SetOwner sets the "owner" edge to the Alert entity.

func (*MetaUpdateOne) SetOwnerID

func (muo *MetaUpdateOne) SetOwnerID(id int) *MetaUpdateOne

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*MetaUpdateOne) SetUpdatedAt

func (muo *MetaUpdateOne) SetUpdatedAt(t time.Time) *MetaUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MetaUpdateOne) SetValue

func (muo *MetaUpdateOne) SetValue(s string) *MetaUpdateOne

SetValue sets the "value" field.

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(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Tx

type Tx struct {

	// Alert is the client for interacting with the Alert builders.
	Alert *AlertClient
	// Bouncer is the client for interacting with the Bouncer builders.
	Bouncer *BouncerClient
	// Decision is the client for interacting with the Decision builders.
	Decision *DecisionClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Machine is the client for interacting with the Machine builders.
	Machine *MachineClient
	// Meta is the client for interacting with the Meta builders.
	Meta *MetaClient
	// 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 or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

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