ent

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 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 validaton error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks nor 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 Client attached.

Types

type AggregateFunc

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

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

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type 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.

func (*Alert) QueryEvents

func (a *Alert) QueryEvents() *EventQuery

QueryEvents queries the events edge of the Alert.

func (*Alert) QueryMetas

func (a *Alert) QueryMetas() *MetaQuery

QueryMetas queries the metas edge of the Alert.

func (*Alert) QueryOwner

func (a *Alert) QueryOwner() *MachineQuery

QueryOwner queries the owner edge of the Alert.

func (*Alert) String

func (a *Alert) String() string

String implements the fmt.Stringer.

func (*Alert) Unwrap

func (a *Alert) Unwrap() *Alert

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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 create builder for Alert.

func (*AlertClient) CreateBulk

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

BulkCreate 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 delete builder for the given entity.

func (*AlertClient) DeleteOneID

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

DeleteOneID returns a delete builder for the given 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 Decision by ids.

func (*AlertCreate) AddDecisions

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

AddDecisions adds the decisions edges to Decision.

func (*AlertCreate) AddEventIDs

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

AddEventIDs adds the events edge to Event by ids.

func (*AlertCreate) AddEvents

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

AddEvents adds the events edges to Event.

func (*AlertCreate) AddMetaIDs

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

AddMetaIDs adds the metas edge to Meta by ids.

func (*AlertCreate) AddMetas

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

AddMetas adds the metas edges to Meta.

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 Machine 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 Machine.

func (*AlertCreate) SetOwnerID

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

SetOwnerID sets the owner edge to Machine 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 a bulk of Alert entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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
	// Decisions holds the value of the decisions edge.
	Decisions []*Decision
	// Events holds the value of the events edge.
	Events []*Event
	// Metas holds the value of the metas edge.
	Metas []*Meta
	// 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 builder for group-by 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 (agb *AlertGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.

func (*AlertGroupBy) BoolX

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

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

func (*AlertGroupBy) Bools

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

Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.

func (*AlertGroupBy) BoolsX

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

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

func (*AlertGroupBy) Float64

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

Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.

func (*AlertGroupBy) Float64X

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

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

func (*AlertGroupBy) Float64s

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

Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.

func (*AlertGroupBy) Float64sX

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

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

func (*AlertGroupBy) Int

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

Int returns a single int from group-by. It is only allowed when querying group-by with one field.

func (*AlertGroupBy) IntX

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

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

func (*AlertGroupBy) Ints

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

Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.

func (*AlertGroupBy) IntsX

func (agb *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 interface{}) error

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

func (*AlertGroupBy) ScanX

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

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

func (*AlertGroupBy) String

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

String returns a single string from group-by. It is only allowed when querying group-by with one field.

func (*AlertGroupBy) StringX

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

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

func (*AlertGroupBy) Strings

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

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

func (*AlertGroupBy) StringsX

func (agb *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 mutate the Alerts nodes in the graph.

func (*AlertMutation) AddCapacity

func (m *AlertMutation) AddCapacity(i int32)

AddCapacity adds i to capacity.

func (*AlertMutation) AddDecisionIDs

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

AddDecisionIDs adds the decisions edge to Decision by ids.

func (*AlertMutation) AddEventIDs

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

AddEventIDs adds the events edge to Event by ids.

func (*AlertMutation) AddEventsCount

func (m *AlertMutation) AddEventsCount(i int32)

AddEventsCount adds i to eventsCount.

func (*AlertMutation) AddField

func (m *AlertMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*AlertMutation) AddMetaIDs

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

AddMetaIDs adds the metas edge to Meta by ids.

func (*AlertMutation) AddSourceLatitude

func (m *AlertMutation) AddSourceLatitude(f float32)

AddSourceLatitude adds f to sourceLatitude.

func (*AlertMutation) AddSourceLongitude

func (m *AlertMutation) AddSourceLongitude(f float32)

AddSourceLongitude adds f to sourceLongitude.

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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*AlertMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

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 bucketId value in the mutation.

func (*AlertMutation) BucketIdCleared

func (m *AlertMutation) BucketIdCleared() bool

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

func (*AlertMutation) Capacity

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

Capacity returns the capacity value in the mutation.

func (*AlertMutation) CapacityCleared

func (m *AlertMutation) CapacityCleared() bool

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

func (*AlertMutation) ClearBucketId

func (m *AlertMutation) ClearBucketId()

ClearBucketId clears the value of bucketId.

func (*AlertMutation) ClearCapacity

func (m *AlertMutation) ClearCapacity()

ClearCapacity clears the value of capacity.

func (*AlertMutation) ClearDecisions

func (m *AlertMutation) ClearDecisions()

ClearDecisions clears the decisions edge to Decision.

func (*AlertMutation) ClearEdge

func (m *AlertMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*AlertMutation) ClearEvents

func (m *AlertMutation) ClearEvents()

ClearEvents clears the events edge to Event.

func (*AlertMutation) ClearEventsCount

func (m *AlertMutation) ClearEventsCount()

ClearEventsCount clears the value of eventsCount.

func (*AlertMutation) ClearField

func (m *AlertMutation) ClearField(name string) error

ClearField clears the value for 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 leakSpeed.

func (*AlertMutation) ClearMessage

func (m *AlertMutation) ClearMessage()

ClearMessage clears the value of message.

func (*AlertMutation) ClearMetas

func (m *AlertMutation) ClearMetas()

ClearMetas clears the metas edge to Meta.

func (*AlertMutation) ClearOwner

func (m *AlertMutation) ClearOwner()

ClearOwner clears the owner edge to Machine.

func (*AlertMutation) ClearScenarioHash

func (m *AlertMutation) ClearScenarioHash()

ClearScenarioHash clears the value of scenarioHash.

func (*AlertMutation) ClearScenarioVersion

func (m *AlertMutation) ClearScenarioVersion()

ClearScenarioVersion clears the value of scenarioVersion.

func (*AlertMutation) ClearSourceAsName

func (m *AlertMutation) ClearSourceAsName()

ClearSourceAsName clears the value of sourceAsName.

func (*AlertMutation) ClearSourceAsNumber

func (m *AlertMutation) ClearSourceAsNumber()

ClearSourceAsNumber clears the value of sourceAsNumber.

func (*AlertMutation) ClearSourceCountry

func (m *AlertMutation) ClearSourceCountry()

ClearSourceCountry clears the value of sourceCountry.

func (*AlertMutation) ClearSourceIp

func (m *AlertMutation) ClearSourceIp()

ClearSourceIp clears the value of sourceIp.

func (*AlertMutation) ClearSourceLatitude

func (m *AlertMutation) ClearSourceLatitude()

ClearSourceLatitude clears the value of sourceLatitude.

func (*AlertMutation) ClearSourceLongitude

func (m *AlertMutation) ClearSourceLongitude()

ClearSourceLongitude clears the value of sourceLongitude.

func (*AlertMutation) ClearSourceRange

func (m *AlertMutation) ClearSourceRange()

ClearSourceRange clears the value of sourceRange.

func (*AlertMutation) ClearSourceScope

func (m *AlertMutation) ClearSourceScope()

ClearSourceScope clears the value of sourceScope.

func (*AlertMutation) ClearSourceValue

func (m *AlertMutation) ClearSourceValue()

ClearSourceValue clears the value of sourceValue.

func (*AlertMutation) ClearStartedAt

func (m *AlertMutation) ClearStartedAt()

ClearStartedAt clears the value of startedAt.

func (*AlertMutation) ClearStoppedAt

func (m *AlertMutation) ClearStoppedAt()

ClearStoppedAt clears the value of stoppedAt.

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 created_at value in the mutation.

func (*AlertMutation) DecisionsCleared

func (m *AlertMutation) DecisionsCleared() bool

DecisionsCleared returns if the edge decisions was cleared.

func (*AlertMutation) DecisionsIDs

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

DecisionsIDs returns the decisions ids in the mutation.

func (*AlertMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*AlertMutation) EventsCleared

func (m *AlertMutation) EventsCleared() bool

EventsCleared returns if the edge events was cleared.

func (*AlertMutation) EventsCount

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

EventsCount returns the eventsCount value in the mutation.

func (*AlertMutation) EventsCountCleared

func (m *AlertMutation) EventsCountCleared() bool

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

func (*AlertMutation) EventsIDs

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

EventsIDs returns the events 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 value indicates that this field was not set, or was not define in the schema.

func (*AlertMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/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 available only if it was provided to the builder.

func (*AlertMutation) LeakSpeed

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

LeakSpeed returns the leakSpeed value in the mutation.

func (*AlertMutation) LeakSpeedCleared

func (m *AlertMutation) LeakSpeedCleared() bool

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

func (*AlertMutation) Message

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

Message returns the message value in the mutation.

func (*AlertMutation) MessageCleared

func (m *AlertMutation) MessageCleared() bool

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

func (*AlertMutation) MetasCleared

func (m *AlertMutation) MetasCleared() bool

MetasCleared returns if the edge metas was cleared.

func (*AlertMutation) MetasIDs

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

MetasIDs returns the metas ids in the mutation.

func (*AlertMutation) OldBucketId

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

OldBucketId returns the old bucketId value of the Alert. 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 database query fails.

func (*AlertMutation) OldCapacity

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

OldCapacity returns the old capacity value of the Alert. 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 database query fails.

func (*AlertMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Alert. 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 database query fails.

func (*AlertMutation) OldEventsCount

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

OldEventsCount returns the old eventsCount value of the Alert. 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 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 was failed.

func (*AlertMutation) OldLeakSpeed

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

OldLeakSpeed returns the old leakSpeed value of the Alert. 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 database query fails.

func (*AlertMutation) OldMessage

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

OldMessage returns the old message value of the Alert. 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 database query fails.

func (*AlertMutation) OldScenario

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

OldScenario returns the old scenario value of the Alert. 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 database query fails.

func (*AlertMutation) OldScenarioHash

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

OldScenarioHash returns the old scenarioHash value of the Alert. 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 database query fails.

func (*AlertMutation) OldScenarioVersion

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

OldScenarioVersion returns the old scenarioVersion value of the Alert. 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 database query fails.

func (*AlertMutation) OldSimulated

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

OldSimulated returns the old simulated value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceAsName

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

OldSourceAsName returns the old sourceAsName value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceAsNumber

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

OldSourceAsNumber returns the old sourceAsNumber value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceCountry

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

OldSourceCountry returns the old sourceCountry value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceIp

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

OldSourceIp returns the old sourceIp value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceLatitude

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

OldSourceLatitude returns the old sourceLatitude value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceLongitude

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

OldSourceLongitude returns the old sourceLongitude value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceRange

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

OldSourceRange returns the old sourceRange value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceScope

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

OldSourceScope returns the old sourceScope value of the Alert. 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 database query fails.

func (*AlertMutation) OldSourceValue

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

OldSourceValue returns the old sourceValue value of the Alert. 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 database query fails.

func (*AlertMutation) OldStartedAt

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

OldStartedAt returns the old startedAt value of the Alert. 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 database query fails.

func (*AlertMutation) OldStoppedAt

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

OldStoppedAt returns the old stoppedAt value of the Alert. 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 database query fails.

func (*AlertMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Alert. 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 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 returns if the edge owner was cleared.

func (*AlertMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*AlertMutation) OwnerIDs

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

OwnerIDs returns the owner 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 Decision by ids.

func (*AlertMutation) RemoveEventIDs

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

RemoveEventIDs removes the events edge to Event by ids.

func (*AlertMutation) RemoveMetaIDs

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

RemoveMetaIDs removes the metas edge to Meta by ids.

func (*AlertMutation) RemovedDecisionsIDs

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

RemovedDecisions returns the removed ids of decisions.

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 events.

func (*AlertMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*AlertMutation) RemovedMetasIDs

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

RemovedMetas returns the removed ids of metas.

func (*AlertMutation) ResetBucketId

func (m *AlertMutation) ResetBucketId()

ResetBucketId reset all changes of the "bucketId" field.

func (*AlertMutation) ResetCapacity

func (m *AlertMutation) ResetCapacity()

ResetCapacity reset all changes of the "capacity" field.

func (*AlertMutation) ResetCreatedAt

func (m *AlertMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*AlertMutation) ResetDecisions

func (m *AlertMutation) ResetDecisions()

ResetDecisions reset all changes of the "decisions" edge.

func (*AlertMutation) ResetEdge

func (m *AlertMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*AlertMutation) ResetEvents

func (m *AlertMutation) ResetEvents()

ResetEvents reset all changes of the "events" edge.

func (*AlertMutation) ResetEventsCount

func (m *AlertMutation) ResetEventsCount()

ResetEventsCount reset all changes of the "eventsCount" field.

func (*AlertMutation) ResetField

func (m *AlertMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*AlertMutation) ResetLeakSpeed

func (m *AlertMutation) ResetLeakSpeed()

ResetLeakSpeed reset all changes of the "leakSpeed" field.

func (*AlertMutation) ResetMessage

func (m *AlertMutation) ResetMessage()

ResetMessage reset all changes of the "message" field.

func (*AlertMutation) ResetMetas

func (m *AlertMutation) ResetMetas()

ResetMetas reset all changes of the "metas" edge.

func (*AlertMutation) ResetOwner

func (m *AlertMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*AlertMutation) ResetScenario

func (m *AlertMutation) ResetScenario()

ResetScenario reset all changes of the "scenario" field.

func (*AlertMutation) ResetScenarioHash

func (m *AlertMutation) ResetScenarioHash()

ResetScenarioHash reset all changes of the "scenarioHash" field.

func (*AlertMutation) ResetScenarioVersion

func (m *AlertMutation) ResetScenarioVersion()

ResetScenarioVersion reset all changes of the "scenarioVersion" field.

func (*AlertMutation) ResetSimulated

func (m *AlertMutation) ResetSimulated()

ResetSimulated reset all changes of the "simulated" field.

func (*AlertMutation) ResetSourceAsName

func (m *AlertMutation) ResetSourceAsName()

ResetSourceAsName reset all changes of the "sourceAsName" field.

func (*AlertMutation) ResetSourceAsNumber

func (m *AlertMutation) ResetSourceAsNumber()

ResetSourceAsNumber reset all changes of the "sourceAsNumber" field.

func (*AlertMutation) ResetSourceCountry

func (m *AlertMutation) ResetSourceCountry()

ResetSourceCountry reset all changes of the "sourceCountry" field.

func (*AlertMutation) ResetSourceIp

func (m *AlertMutation) ResetSourceIp()

ResetSourceIp reset all changes of the "sourceIp" field.

func (*AlertMutation) ResetSourceLatitude

func (m *AlertMutation) ResetSourceLatitude()

ResetSourceLatitude reset all changes of the "sourceLatitude" field.

func (*AlertMutation) ResetSourceLongitude

func (m *AlertMutation) ResetSourceLongitude()

ResetSourceLongitude reset all changes of the "sourceLongitude" field.

func (*AlertMutation) ResetSourceRange

func (m *AlertMutation) ResetSourceRange()

ResetSourceRange reset all changes of the "sourceRange" field.

func (*AlertMutation) ResetSourceScope

func (m *AlertMutation) ResetSourceScope()

ResetSourceScope reset all changes of the "sourceScope" field.

func (*AlertMutation) ResetSourceValue

func (m *AlertMutation) ResetSourceValue()

ResetSourceValue reset all changes of the "sourceValue" field.

func (*AlertMutation) ResetStartedAt

func (m *AlertMutation) ResetStartedAt()

ResetStartedAt reset all changes of the "startedAt" field.

func (*AlertMutation) ResetStoppedAt

func (m *AlertMutation) ResetStoppedAt()

ResetStoppedAt reset all changes of the "stoppedAt" field.

func (*AlertMutation) ResetUpdatedAt

func (m *AlertMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*AlertMutation) Scenario

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

Scenario returns the scenario value in the mutation.

func (*AlertMutation) ScenarioHash

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

ScenarioHash returns the scenarioHash value in the mutation.

func (*AlertMutation) ScenarioHashCleared

func (m *AlertMutation) ScenarioHashCleared() bool

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

func (*AlertMutation) ScenarioVersion

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

ScenarioVersion returns the scenarioVersion value in the mutation.

func (*AlertMutation) ScenarioVersionCleared

func (m *AlertMutation) ScenarioVersionCleared() bool

ScenarioVersionCleared returns if the field scenarioVersion 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 for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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 Machine 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 simulated value in the mutation.

func (*AlertMutation) SourceAsName

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

SourceAsName returns the sourceAsName value in the mutation.

func (*AlertMutation) SourceAsNameCleared

func (m *AlertMutation) SourceAsNameCleared() bool

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

func (*AlertMutation) SourceAsNumber

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

SourceAsNumber returns the sourceAsNumber value in the mutation.

func (*AlertMutation) SourceAsNumberCleared

func (m *AlertMutation) SourceAsNumberCleared() bool

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

func (*AlertMutation) SourceCountry

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

SourceCountry returns the sourceCountry value in the mutation.

func (*AlertMutation) SourceCountryCleared

func (m *AlertMutation) SourceCountryCleared() bool

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

func (*AlertMutation) SourceIp

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

SourceIp returns the sourceIp value in the mutation.

func (*AlertMutation) SourceIpCleared

func (m *AlertMutation) SourceIpCleared() bool

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

func (*AlertMutation) SourceLatitude

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

SourceLatitude returns the sourceLatitude value in the mutation.

func (*AlertMutation) SourceLatitudeCleared

func (m *AlertMutation) SourceLatitudeCleared() bool

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

func (*AlertMutation) SourceLongitude

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

SourceLongitude returns the sourceLongitude value in the mutation.

func (*AlertMutation) SourceLongitudeCleared

func (m *AlertMutation) SourceLongitudeCleared() bool

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

func (*AlertMutation) SourceRange

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

SourceRange returns the sourceRange value in the mutation.

func (*AlertMutation) SourceRangeCleared

func (m *AlertMutation) SourceRangeCleared() bool

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

func (*AlertMutation) SourceScope

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

SourceScope returns the sourceScope value in the mutation.

func (*AlertMutation) SourceScopeCleared

func (m *AlertMutation) SourceScopeCleared() bool

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

func (*AlertMutation) SourceValue

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

SourceValue returns the sourceValue value in the mutation.

func (*AlertMutation) SourceValueCleared

func (m *AlertMutation) SourceValueCleared() bool

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

func (*AlertMutation) StartedAt

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

StartedAt returns the startedAt value in the mutation.

func (*AlertMutation) StartedAtCleared

func (m *AlertMutation) StartedAtCleared() bool

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

func (*AlertMutation) StoppedAt

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

StoppedAt returns the stoppedAt value in the mutation.

func (*AlertMutation) StoppedAtCleared

func (m *AlertMutation) StoppedAtCleared() bool

StoppedAtCleared returns if the field stoppedAt 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 updated_at value in the mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*AlertQuery) FirstX

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

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

func (*AlertQuery) FirstXID

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

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

func (*AlertQuery) GroupBy

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

GroupBy 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 the only Alert entity in the query, returns an error if not exactly one entity was returned.

func (*AlertQuery) OnlyID

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

OnlyID returns the only Alert id in the query, returns an error if not exactly one id was returned.

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(field string, fields ...string) *AlertSelect

Select one or more fields from the given query.

Example:

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

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

func (*AlertQuery) Where

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

Where adds a new predicate for the builder.

func (*AlertQuery) WithDecisions

func (aq *AlertQuery) WithDecisions(opts ...func(*DecisionQuery)) *AlertQuery
WithDecisions tells the query-builder to eager-loads the nodes that are connected to

the "decisions" edge. The optional arguments 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-loads the nodes that are connected to

the "events" edge. The optional arguments 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-loads the nodes that are connected to

the "metas" edge. The optional arguments 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-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type AlertSelect

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

AlertSelect is the builder for select fields of Alert entities.

func (*AlertSelect) Bool

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

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

func (*AlertSelect) BoolX

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

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

func (*AlertSelect) Bools

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

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

func (*AlertSelect) BoolsX

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

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

func (*AlertSelect) Float64

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

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

func (*AlertSelect) Float64X

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

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

func (*AlertSelect) Float64s

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

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

func (*AlertSelect) Float64sX

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

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

func (*AlertSelect) Int

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

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

func (*AlertSelect) IntX

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

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

func (*AlertSelect) Ints

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

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

func (*AlertSelect) IntsX

func (as *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 interface{}) error

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

func (*AlertSelect) ScanX

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

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

func (*AlertSelect) String

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

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

func (*AlertSelect) StringX

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

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

func (*AlertSelect) Strings

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

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

func (*AlertSelect) StringsX

func (as *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 capacity.

func (*AlertUpdate) AddDecisionIDs

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

AddDecisionIDs adds the decisions edge to Decision by ids.

func (*AlertUpdate) AddDecisions

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

AddDecisions adds the decisions edges to Decision.

func (*AlertUpdate) AddEventIDs

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

AddEventIDs adds the events edge to Event by ids.

func (*AlertUpdate) AddEvents

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

AddEvents adds the events edges to Event.

func (*AlertUpdate) AddEventsCount

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

AddEventsCount adds i to eventsCount.

func (*AlertUpdate) AddMetaIDs

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

AddMetaIDs adds the metas edge to Meta by ids.

func (*AlertUpdate) AddMetas

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

AddMetas adds the metas edges to Meta.

func (*AlertUpdate) AddSourceLatitude

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

AddSourceLatitude adds f to sourceLatitude.

func (*AlertUpdate) AddSourceLongitude

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

AddSourceLongitude adds f to sourceLongitude.

func (*AlertUpdate) ClearBucketId

func (au *AlertUpdate) ClearBucketId() *AlertUpdate

ClearBucketId clears the value of bucketId.

func (*AlertUpdate) ClearCapacity

func (au *AlertUpdate) ClearCapacity() *AlertUpdate

ClearCapacity clears the value of capacity.

func (*AlertUpdate) ClearDecisions

func (au *AlertUpdate) ClearDecisions() *AlertUpdate

ClearDecisions clears all "decisions" edges to type Decision.

func (*AlertUpdate) ClearEvents

func (au *AlertUpdate) ClearEvents() *AlertUpdate

ClearEvents clears all "events" edges to type Event.

func (*AlertUpdate) ClearEventsCount

func (au *AlertUpdate) ClearEventsCount() *AlertUpdate

ClearEventsCount clears the value of eventsCount.

func (*AlertUpdate) ClearLeakSpeed

func (au *AlertUpdate) ClearLeakSpeed() *AlertUpdate

ClearLeakSpeed clears the value of leakSpeed.

func (*AlertUpdate) ClearMessage

func (au *AlertUpdate) ClearMessage() *AlertUpdate

ClearMessage clears the value of message.

func (*AlertUpdate) ClearMetas

func (au *AlertUpdate) ClearMetas() *AlertUpdate

ClearMetas clears all "metas" edges to type Meta.

func (*AlertUpdate) ClearOwner

func (au *AlertUpdate) ClearOwner() *AlertUpdate

ClearOwner clears the "owner" edge to type Machine.

func (*AlertUpdate) ClearScenarioHash

func (au *AlertUpdate) ClearScenarioHash() *AlertUpdate

ClearScenarioHash clears the value of scenarioHash.

func (*AlertUpdate) ClearScenarioVersion

func (au *AlertUpdate) ClearScenarioVersion() *AlertUpdate

ClearScenarioVersion clears the value of scenarioVersion.

func (*AlertUpdate) ClearSourceAsName

func (au *AlertUpdate) ClearSourceAsName() *AlertUpdate

ClearSourceAsName clears the value of sourceAsName.

func (*AlertUpdate) ClearSourceAsNumber

func (au *AlertUpdate) ClearSourceAsNumber() *AlertUpdate

ClearSourceAsNumber clears the value of sourceAsNumber.

func (*AlertUpdate) ClearSourceCountry

func (au *AlertUpdate) ClearSourceCountry() *AlertUpdate

ClearSourceCountry clears the value of sourceCountry.

func (*AlertUpdate) ClearSourceIp

func (au *AlertUpdate) ClearSourceIp() *AlertUpdate

ClearSourceIp clears the value of sourceIp.

func (*AlertUpdate) ClearSourceLatitude

func (au *AlertUpdate) ClearSourceLatitude() *AlertUpdate

ClearSourceLatitude clears the value of sourceLatitude.

func (*AlertUpdate) ClearSourceLongitude

func (au *AlertUpdate) ClearSourceLongitude() *AlertUpdate

ClearSourceLongitude clears the value of sourceLongitude.

func (*AlertUpdate) ClearSourceRange

func (au *AlertUpdate) ClearSourceRange() *AlertUpdate

ClearSourceRange clears the value of sourceRange.

func (*AlertUpdate) ClearSourceScope

func (au *AlertUpdate) ClearSourceScope() *AlertUpdate

ClearSourceScope clears the value of sourceScope.

func (*AlertUpdate) ClearSourceValue

func (au *AlertUpdate) ClearSourceValue() *AlertUpdate

ClearSourceValue clears the value of sourceValue.

func (*AlertUpdate) ClearStartedAt

func (au *AlertUpdate) ClearStartedAt() *AlertUpdate

ClearStartedAt clears the value of startedAt.

func (*AlertUpdate) ClearStoppedAt

func (au *AlertUpdate) ClearStoppedAt() *AlertUpdate

ClearStoppedAt clears the value of stoppedAt.

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 by ids.

func (*AlertUpdate) RemoveDecisions

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

RemoveDecisions removes decisions edges to Decision.

func (*AlertUpdate) RemoveEventIDs

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

RemoveEventIDs removes the events edge to Event by ids.

func (*AlertUpdate) RemoveEvents

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

RemoveEvents removes events edges to Event.

func (*AlertUpdate) RemoveMetaIDs

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

RemoveMetaIDs removes the metas edge to Meta by ids.

func (*AlertUpdate) RemoveMetas

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

RemoveMetas removes metas edges to Meta.

func (*AlertUpdate) Save

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

Save executes the query and returns the number of rows/vertices matched by this 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) SetNillableCreatedAt

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

SetNillableCreatedAt sets the created_at 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 Machine 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) SetNillableUpdatedAt

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

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

func (*AlertUpdate) SetOwner

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

SetOwner sets the owner edge to Machine.

func (*AlertUpdate) SetOwnerID

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

SetOwnerID sets the owner edge to Machine 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 adds a new predicate for the 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 capacity.

func (*AlertUpdateOne) AddDecisionIDs

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

AddDecisionIDs adds the decisions edge to Decision by ids.

func (*AlertUpdateOne) AddDecisions

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

AddDecisions adds the decisions edges to Decision.

func (*AlertUpdateOne) AddEventIDs

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

AddEventIDs adds the events edge to Event by ids.

func (*AlertUpdateOne) AddEvents

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

AddEvents adds the events edges to Event.

func (*AlertUpdateOne) AddEventsCount

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

AddEventsCount adds i to eventsCount.

func (*AlertUpdateOne) AddMetaIDs

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

AddMetaIDs adds the metas edge to Meta by ids.

func (*AlertUpdateOne) AddMetas

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

AddMetas adds the metas edges to Meta.

func (*AlertUpdateOne) AddSourceLatitude

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

AddSourceLatitude adds f to sourceLatitude.

func (*AlertUpdateOne) AddSourceLongitude

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

AddSourceLongitude adds f to sourceLongitude.

func (*AlertUpdateOne) ClearBucketId

func (auo *AlertUpdateOne) ClearBucketId() *AlertUpdateOne

ClearBucketId clears the value of bucketId.

func (*AlertUpdateOne) ClearCapacity

func (auo *AlertUpdateOne) ClearCapacity() *AlertUpdateOne

ClearCapacity clears the value of capacity.

func (*AlertUpdateOne) ClearDecisions

func (auo *AlertUpdateOne) ClearDecisions() *AlertUpdateOne

ClearDecisions clears all "decisions" edges to type Decision.

func (*AlertUpdateOne) ClearEvents

func (auo *AlertUpdateOne) ClearEvents() *AlertUpdateOne

ClearEvents clears all "events" edges to type Event.

func (*AlertUpdateOne) ClearEventsCount

func (auo *AlertUpdateOne) ClearEventsCount() *AlertUpdateOne

ClearEventsCount clears the value of eventsCount.

func (*AlertUpdateOne) ClearLeakSpeed

func (auo *AlertUpdateOne) ClearLeakSpeed() *AlertUpdateOne

ClearLeakSpeed clears the value of leakSpeed.

func (*AlertUpdateOne) ClearMessage

func (auo *AlertUpdateOne) ClearMessage() *AlertUpdateOne

ClearMessage clears the value of message.

func (*AlertUpdateOne) ClearMetas

func (auo *AlertUpdateOne) ClearMetas() *AlertUpdateOne

ClearMetas clears all "metas" edges to type Meta.

func (*AlertUpdateOne) ClearOwner

func (auo *AlertUpdateOne) ClearOwner() *AlertUpdateOne

ClearOwner clears the "owner" edge to type Machine.

func (*AlertUpdateOne) ClearScenarioHash

func (auo *AlertUpdateOne) ClearScenarioHash() *AlertUpdateOne

ClearScenarioHash clears the value of scenarioHash.

func (*AlertUpdateOne) ClearScenarioVersion

func (auo *AlertUpdateOne) ClearScenarioVersion() *AlertUpdateOne

ClearScenarioVersion clears the value of scenarioVersion.

func (*AlertUpdateOne) ClearSourceAsName

func (auo *AlertUpdateOne) ClearSourceAsName() *AlertUpdateOne

ClearSourceAsName clears the value of sourceAsName.

func (*AlertUpdateOne) ClearSourceAsNumber

func (auo *AlertUpdateOne) ClearSourceAsNumber() *AlertUpdateOne

ClearSourceAsNumber clears the value of sourceAsNumber.

func (*AlertUpdateOne) ClearSourceCountry

func (auo *AlertUpdateOne) ClearSourceCountry() *AlertUpdateOne

ClearSourceCountry clears the value of sourceCountry.

func (*AlertUpdateOne) ClearSourceIp

func (auo *AlertUpdateOne) ClearSourceIp() *AlertUpdateOne

ClearSourceIp clears the value of sourceIp.

func (*AlertUpdateOne) ClearSourceLatitude

func (auo *AlertUpdateOne) ClearSourceLatitude() *AlertUpdateOne

ClearSourceLatitude clears the value of sourceLatitude.

func (*AlertUpdateOne) ClearSourceLongitude

func (auo *AlertUpdateOne) ClearSourceLongitude() *AlertUpdateOne

ClearSourceLongitude clears the value of sourceLongitude.

func (*AlertUpdateOne) ClearSourceRange

func (auo *AlertUpdateOne) ClearSourceRange() *AlertUpdateOne

ClearSourceRange clears the value of sourceRange.

func (*AlertUpdateOne) ClearSourceScope

func (auo *AlertUpdateOne) ClearSourceScope() *AlertUpdateOne

ClearSourceScope clears the value of sourceScope.

func (*AlertUpdateOne) ClearSourceValue

func (auo *AlertUpdateOne) ClearSourceValue() *AlertUpdateOne

ClearSourceValue clears the value of sourceValue.

func (*AlertUpdateOne) ClearStartedAt

func (auo *AlertUpdateOne) ClearStartedAt() *AlertUpdateOne

ClearStartedAt clears the value of startedAt.

func (*AlertUpdateOne) ClearStoppedAt

func (auo *AlertUpdateOne) ClearStoppedAt() *AlertUpdateOne

ClearStoppedAt clears the value of stoppedAt.

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 by ids.

func (*AlertUpdateOne) RemoveDecisions

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

RemoveDecisions removes decisions edges to Decision.

func (*AlertUpdateOne) RemoveEventIDs

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

RemoveEventIDs removes the events edge to Event by ids.

func (*AlertUpdateOne) RemoveEvents

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

RemoveEvents removes events edges to Event.

func (*AlertUpdateOne) RemoveMetaIDs

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

RemoveMetaIDs removes the metas edge to Meta by ids.

func (*AlertUpdateOne) RemoveMetas

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

RemoveMetas removes metas edges to Meta.

func (*AlertUpdateOne) Save

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

Save executes the query and returns the updated entity.

func (*AlertUpdateOne) SaveX

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

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

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

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

SetNillableCreatedAt sets the created_at 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 Machine 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) SetNillableUpdatedAt

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

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

func (*AlertUpdateOne) SetOwner

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

SetOwner sets the owner edge to Machine.

func (*AlertUpdateOne) SetOwnerID

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

SetOwnerID sets the owner edge to Machine 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,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// APIKey holds the value of the "api_key" field.
	APIKey string `json:"api_key,omitempty"`
	// Revoked holds the value of the "revoked" field.
	Revoked bool `json:"revoked,omitempty"`
	// IPAddress holds the value of the "ip_address" field.
	IPAddress string `json:"ip_address,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// Until holds the value of the "until" field.
	Until time.Time `json:"until,omitempty"`
	// LastPull holds the value of the "last_pull" field.
	LastPull time.Time `json:"last_pull,omitempty"`
	// 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 entity that was returned from a transaction after it was closed, so that all next 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 create builder for Bouncer.

func (*BouncerClient) CreateBulk

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

BulkCreate 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 delete builder for the given entity.

func (*BouncerClient) DeleteOneID

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

DeleteOneID returns a delete builder for the given 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) 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) 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) 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 a bulk of Bouncer entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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 builder for group-by 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 (bgb *BouncerGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.

func (*BouncerGroupBy) BoolX

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

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

func (*BouncerGroupBy) Bools

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

Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.

func (*BouncerGroupBy) BoolsX

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

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

func (*BouncerGroupBy) Float64

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

Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.

func (*BouncerGroupBy) Float64X

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

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

func (*BouncerGroupBy) Float64s

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

Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.

func (*BouncerGroupBy) Float64sX

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

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

func (*BouncerGroupBy) Int

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

Int returns a single int from group-by. It is only allowed when querying group-by with one field.

func (*BouncerGroupBy) IntX

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

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

func (*BouncerGroupBy) Ints

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

Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.

func (*BouncerGroupBy) IntsX

func (bgb *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 interface{}) error

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

func (*BouncerGroupBy) ScanX

func (bgb *BouncerGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*BouncerGroupBy) String

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

String returns a single string from group-by. It is only allowed when querying group-by with one field.

func (*BouncerGroupBy) StringX

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

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

func (*BouncerGroupBy) Strings

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

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

func (*BouncerGroupBy) StringsX

func (bgb *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 mutate the Bouncers nodes in the graph.

func (*BouncerMutation) APIKey

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

APIKey returns the api_key value in the mutation.

func (*BouncerMutation) AddField

func (m *BouncerMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*BouncerMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

func (*BouncerMutation) ClearEdge

func (m *BouncerMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*BouncerMutation) ClearField

func (m *BouncerMutation) ClearField(name string) error

ClearField clears the value for 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 ip_address.

func (*BouncerMutation) ClearType

func (m *BouncerMutation) ClearType()

ClearType clears the value of type.

func (*BouncerMutation) ClearUntil

func (m *BouncerMutation) ClearUntil()

ClearUntil clears the value of until.

func (*BouncerMutation) ClearVersion

func (m *BouncerMutation) ClearVersion()

ClearVersion clears the value of version.

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 created_at value in the mutation.

func (*BouncerMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge 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 value indicates that this field was not set, or was not define in the schema.

func (*BouncerMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/decremented, call AddedFields().

func (*BouncerMutation) GetType

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

GetType returns the type value 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 available only if it was provided to the builder.

func (*BouncerMutation) IPAddress

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

IPAddress returns the ip_address value in the mutation.

func (*BouncerMutation) IPAddressCleared

func (m *BouncerMutation) IPAddressCleared() bool

IPAddressCleared returns if the field ip_address was cleared in this mutation.

func (*BouncerMutation) LastPull

func (m *BouncerMutation) LastPull() (r time.Time, exists bool)

LastPull returns the last_pull value in the mutation.

func (*BouncerMutation) Name

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

Name returns the name value in the mutation.

func (*BouncerMutation) OldAPIKey

func (m *BouncerMutation) OldAPIKey(ctx context.Context) (v string, err error)

OldAPIKey returns the old api_key value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Bouncer. 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 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 was failed.

func (*BouncerMutation) OldIPAddress

func (m *BouncerMutation) OldIPAddress(ctx context.Context) (v string, err error)

OldIPAddress returns the old ip_address value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldLastPull

func (m *BouncerMutation) OldLastPull(ctx context.Context) (v time.Time, err error)

OldLastPull returns the old last_pull value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldName

func (m *BouncerMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old name value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldRevoked

func (m *BouncerMutation) OldRevoked(ctx context.Context) (v bool, err error)

OldRevoked returns the old revoked value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldType

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

OldType returns the old type value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldUntil

func (m *BouncerMutation) OldUntil(ctx context.Context) (v time.Time, err error)

OldUntil returns the old until value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Bouncer. 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 database query fails.

func (*BouncerMutation) OldVersion

func (m *BouncerMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old version value of the Bouncer. 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 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 given edge name.

func (*BouncerMutation) ResetAPIKey

func (m *BouncerMutation) ResetAPIKey()

ResetAPIKey reset all changes of the "api_key" field.

func (*BouncerMutation) ResetCreatedAt

func (m *BouncerMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*BouncerMutation) ResetEdge

func (m *BouncerMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. 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 regarding the given field name. It returns an error if the field is not defined in the schema.

func (*BouncerMutation) ResetIPAddress

func (m *BouncerMutation) ResetIPAddress()

ResetIPAddress reset all changes of the "ip_address" field.

func (*BouncerMutation) ResetLastPull

func (m *BouncerMutation) ResetLastPull()

ResetLastPull reset all changes of the "last_pull" field.

func (*BouncerMutation) ResetName

func (m *BouncerMutation) ResetName()

ResetName reset all changes of the "name" field.

func (*BouncerMutation) ResetRevoked

func (m *BouncerMutation) ResetRevoked()

ResetRevoked reset all changes of the "revoked" field.

func (*BouncerMutation) ResetType

func (m *BouncerMutation) ResetType()

ResetType reset all changes of the "type" field.

func (*BouncerMutation) ResetUntil

func (m *BouncerMutation) ResetUntil()

ResetUntil reset all changes of the "until" field.

func (*BouncerMutation) ResetUpdatedAt

func (m *BouncerMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*BouncerMutation) ResetVersion

func (m *BouncerMutation) ResetVersion()

ResetVersion reset all changes of the "version" field.

func (*BouncerMutation) Revoked

func (m *BouncerMutation) Revoked() (r bool, exists bool)

Revoked returns the revoked value in the mutation.

func (*BouncerMutation) SetAPIKey

func (m *BouncerMutation) SetAPIKey(s string)

SetAPIKey sets the api_key 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 for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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 field type was cleared in this mutation.

func (*BouncerMutation) Until

func (m *BouncerMutation) Until() (r time.Time, exists bool)

Until returns the until value in the mutation.

func (*BouncerMutation) UntilCleared

func (m *BouncerMutation) UntilCleared() bool

UntilCleared returns if the field until was cleared in this mutation.

func (*BouncerMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

func (*BouncerMutation) Version

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

Version returns the version value in the mutation.

func (*BouncerMutation) VersionCleared

func (m *BouncerMutation) VersionCleared() bool

VersionCleared returns if the field version was cleared in this mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*BouncerQuery) FirstX

func (bq *BouncerQuery) FirstX(ctx context.Context) *Bouncer

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

func (*BouncerQuery) FirstXID

func (bq *BouncerQuery) FirstXID(ctx context.Context) int

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

func (*BouncerQuery) GroupBy

func (bq *BouncerQuery) GroupBy(field string, fields ...string) *BouncerGroupBy

GroupBy 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.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 the only Bouncer entity in the query, returns an error if not exactly one entity was returned.

func (*BouncerQuery) OnlyID

func (bq *BouncerQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Bouncer id in the query, returns an error if not exactly one id was returned.

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(field string, fields ...string) *BouncerSelect

Select one or more fields from the given query.

Example:

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

client.Bouncer.Query().
	Select(bouncer.FieldCreatedAt).
	Scan(ctx, &v)

func (*BouncerQuery) Where

func (bq *BouncerQuery) Where(ps ...predicate.Bouncer) *BouncerQuery

Where adds a new predicate for the builder.

type BouncerSelect

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

BouncerSelect is the builder for select fields of Bouncer entities.

func (*BouncerSelect) Bool

func (bs *BouncerSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*BouncerSelect) BoolX

func (bs *BouncerSelect) BoolX(ctx context.Context) bool

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

func (*BouncerSelect) Bools

func (bs *BouncerSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*BouncerSelect) BoolsX

func (bs *BouncerSelect) BoolsX(ctx context.Context) []bool

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

func (*BouncerSelect) Float64

func (bs *BouncerSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*BouncerSelect) Float64X

func (bs *BouncerSelect) Float64X(ctx context.Context) float64

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

func (*BouncerSelect) Float64s

func (bs *BouncerSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*BouncerSelect) Float64sX

func (bs *BouncerSelect) Float64sX(ctx context.Context) []float64

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

func (*BouncerSelect) Int

func (bs *BouncerSelect) Int(ctx context.Context) (_ int, err error)

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

func (*BouncerSelect) IntX

func (bs *BouncerSelect) IntX(ctx context.Context) int

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

func (*BouncerSelect) Ints

func (bs *BouncerSelect) Ints(ctx context.Context) ([]int, error)

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

func (*BouncerSelect) IntsX

func (bs *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 interface{}) error

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

func (*BouncerSelect) ScanX

func (bs *BouncerSelect) ScanX(ctx context.Context, v interface{})

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

func (*BouncerSelect) String

func (bs *BouncerSelect) String(ctx context.Context) (_ string, err error)

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

func (*BouncerSelect) StringX

func (bs *BouncerSelect) StringX(ctx context.Context) string

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

func (*BouncerSelect) Strings

func (bs *BouncerSelect) Strings(ctx context.Context) ([]string, error)

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

func (*BouncerSelect) StringsX

func (bs *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) ClearIPAddress

func (bu *BouncerUpdate) ClearIPAddress() *BouncerUpdate

ClearIPAddress clears the value of ip_address.

func (*BouncerUpdate) ClearType

func (bu *BouncerUpdate) ClearType() *BouncerUpdate

ClearType clears the value of type.

func (*BouncerUpdate) ClearUntil

func (bu *BouncerUpdate) ClearUntil() *BouncerUpdate

ClearUntil clears the value of until.

func (*BouncerUpdate) ClearVersion

func (bu *BouncerUpdate) ClearVersion() *BouncerUpdate

ClearVersion clears the value of version.

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 rows/vertices matched by this 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) 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) SetNillableCreatedAt

func (bu *BouncerUpdate) SetNillableCreatedAt(t *time.Time) *BouncerUpdate

SetNillableCreatedAt sets the created_at 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) SetNillableUpdatedAt

func (bu *BouncerUpdate) SetNillableUpdatedAt(t *time.Time) *BouncerUpdate

SetNillableUpdatedAt sets the updated_at 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 adds a new predicate for the builder.

type BouncerUpdateOne

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

BouncerUpdateOne is the builder for updating a single Bouncer entity.

func (*BouncerUpdateOne) ClearIPAddress

func (buo *BouncerUpdateOne) ClearIPAddress() *BouncerUpdateOne

ClearIPAddress clears the value of ip_address.

func (*BouncerUpdateOne) ClearType

func (buo *BouncerUpdateOne) ClearType() *BouncerUpdateOne

ClearType clears the value of type.

func (*BouncerUpdateOne) ClearUntil

func (buo *BouncerUpdateOne) ClearUntil() *BouncerUpdateOne

ClearUntil clears the value of until.

func (*BouncerUpdateOne) ClearVersion

func (buo *BouncerUpdateOne) ClearVersion() *BouncerUpdateOne

ClearVersion clears the value of version.

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 entity.

func (*BouncerUpdateOne) SaveX

func (buo *BouncerUpdateOne) SaveX(ctx context.Context) *Bouncer

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

func (*BouncerUpdateOne) SetAPIKey

func (buo *BouncerUpdateOne) SetAPIKey(s string) *BouncerUpdateOne

SetAPIKey sets the api_key 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) SetNillableCreatedAt

func (buo *BouncerUpdateOne) SetNillableCreatedAt(t *time.Time) *BouncerUpdateOne

SetNillableCreatedAt sets the created_at 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) SetNillableUpdatedAt

func (buo *BouncerUpdateOne) SetNillableUpdatedAt(t *time.Time) *BouncerUpdateOne

SetNillableUpdatedAt sets the updated_at 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 the Client stored in 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 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(context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Committer method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type 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"`
	// 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.

func (*Decision) String

func (d *Decision) String() string

String implements the fmt.Stringer.

func (*Decision) Unwrap

func (d *Decision) Unwrap() *Decision

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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 create builder for Decision.

func (*DecisionClient) CreateBulk

func (c *DecisionClient) CreateBulk(builders ...*DecisionCreate) *DecisionCreateBulk

BulkCreate 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 delete builder for the given entity.

func (*DecisionClient) DeleteOneID

func (c *DecisionClient) DeleteOneID(id int) *DecisionDeleteOne

DeleteOneID returns a delete builder for the given 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) 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) 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) SetNillableOwnerID

func (dc *DecisionCreate) SetNillableOwnerID(id *int) *DecisionCreate

SetNillableOwnerID sets the owner edge to Alert 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) 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 Alert.

func (*DecisionCreate) SetOwnerID

func (dc *DecisionCreate) SetOwnerID(id int) *DecisionCreate

SetOwnerID sets the owner edge to Alert 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) 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 a bulk of Decision entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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
	// 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 builder for group-by 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 (dgb *DecisionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.

func (*DecisionGroupBy) BoolX

func (dgb *DecisionGroupBy) BoolX(ctx context.Context) bool

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

func (*DecisionGroupBy) Bools

func (dgb *DecisionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.

func (*DecisionGroupBy) BoolsX

func (dgb *DecisionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DecisionGroupBy) Float64

func (dgb *DecisionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.

func (*DecisionGroupBy) Float64X

func (dgb *DecisionGroupBy) Float64X(ctx context.Context) float64

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

func (*DecisionGroupBy) Float64s

func (dgb *DecisionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.

func (*DecisionGroupBy) Float64sX

func (dgb *DecisionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DecisionGroupBy) Int

func (dgb *DecisionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from group-by. It is only allowed when querying group-by with one field.

func (*DecisionGroupBy) IntX

func (dgb *DecisionGroupBy) IntX(ctx context.Context) int

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

func (*DecisionGroupBy) Ints

func (dgb *DecisionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.

func (*DecisionGroupBy) IntsX

func (dgb *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 interface{}) error

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

func (*DecisionGroupBy) ScanX

func (dgb *DecisionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DecisionGroupBy) String

func (dgb *DecisionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from group-by. It is only allowed when querying group-by with one field.

func (*DecisionGroupBy) StringX

func (dgb *DecisionGroupBy) StringX(ctx context.Context) string

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

func (*DecisionGroupBy) Strings

func (dgb *DecisionGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*DecisionGroupBy) StringsX

func (dgb *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 mutate the Decisions nodes in the graph.

func (*DecisionMutation) AddEndIP

func (m *DecisionMutation) AddEndIP(i int64)

AddEndIP adds i to end_ip.

func (*DecisionMutation) AddField

func (m *DecisionMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*DecisionMutation) AddStartIP

func (m *DecisionMutation) AddStartIP(i int64)

AddStartIP adds i to start_ip.

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

func (m *DecisionMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*DecisionMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

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

func (m *DecisionMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*DecisionMutation) ClearEndIP

func (m *DecisionMutation) ClearEndIP()

ClearEndIP clears the value of end_ip.

func (*DecisionMutation) ClearField

func (m *DecisionMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*DecisionMutation) ClearOwner

func (m *DecisionMutation) ClearOwner()

ClearOwner clears the owner edge to Alert.

func (*DecisionMutation) ClearStartIP

func (m *DecisionMutation) ClearStartIP()

ClearStartIP clears the value of start_ip.

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 created_at value in the mutation.

func (*DecisionMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*DecisionMutation) EndIP

func (m *DecisionMutation) EndIP() (r int64, exists bool)

EndIP returns the end_ip value in the mutation.

func (*DecisionMutation) EndIPCleared

func (m *DecisionMutation) EndIPCleared() bool

EndIPCleared returns if the field end_ip 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 value indicates that this field was not set, or was not define in the schema.

func (*DecisionMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/decremented, call AddedFields().

func (*DecisionMutation) GetType

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

GetType returns the type value 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 available only if it was provided to the builder.

func (*DecisionMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Decision. 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 database query fails.

func (*DecisionMutation) OldEndIP

func (m *DecisionMutation) OldEndIP(ctx context.Context) (v int64, err error)

OldEndIP returns the old end_ip value of the Decision. 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 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 was failed.

func (*DecisionMutation) OldOrigin

func (m *DecisionMutation) OldOrigin(ctx context.Context) (v string, err error)

OldOrigin returns the old origin value of the Decision. 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 database query fails.

func (*DecisionMutation) OldScenario

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

OldScenario returns the old scenario value of the Decision. 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 database query fails.

func (*DecisionMutation) OldScope

func (m *DecisionMutation) OldScope(ctx context.Context) (v string, err error)

OldScope returns the old scope value of the Decision. 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 database query fails.

func (*DecisionMutation) OldSimulated

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

OldSimulated returns the old simulated value of the Decision. 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 database query fails.

func (*DecisionMutation) OldStartIP

func (m *DecisionMutation) OldStartIP(ctx context.Context) (v int64, err error)

OldStartIP returns the old start_ip value of the Decision. 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 database query fails.

func (*DecisionMutation) OldType

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

OldType returns the old type value of the Decision. 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 database query fails.

func (*DecisionMutation) OldUntil

func (m *DecisionMutation) OldUntil(ctx context.Context) (v time.Time, err error)

OldUntil returns the old until value of the Decision. 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 database query fails.

func (*DecisionMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Decision. 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 database query fails.

func (*DecisionMutation) OldValue

func (m *DecisionMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old value value of the Decision. 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 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 origin value in the mutation.

func (*DecisionMutation) OwnerCleared

func (m *DecisionMutation) OwnerCleared() bool

OwnerCleared returns if the edge owner was cleared.

func (*DecisionMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*DecisionMutation) OwnerIDs

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

OwnerIDs returns the owner 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 given edge name.

func (*DecisionMutation) ResetCreatedAt

func (m *DecisionMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*DecisionMutation) ResetEdge

func (m *DecisionMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*DecisionMutation) ResetEndIP

func (m *DecisionMutation) ResetEndIP()

ResetEndIP reset all changes of the "end_ip" field.

func (*DecisionMutation) ResetField

func (m *DecisionMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*DecisionMutation) ResetOrigin

func (m *DecisionMutation) ResetOrigin()

ResetOrigin reset all changes of the "origin" field.

func (*DecisionMutation) ResetOwner

func (m *DecisionMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*DecisionMutation) ResetScenario

func (m *DecisionMutation) ResetScenario()

ResetScenario reset all changes of the "scenario" field.

func (*DecisionMutation) ResetScope

func (m *DecisionMutation) ResetScope()

ResetScope reset all changes of the "scope" field.

func (*DecisionMutation) ResetSimulated

func (m *DecisionMutation) ResetSimulated()

ResetSimulated reset all changes of the "simulated" field.

func (*DecisionMutation) ResetStartIP

func (m *DecisionMutation) ResetStartIP()

ResetStartIP reset all changes of the "start_ip" field.

func (*DecisionMutation) ResetType

func (m *DecisionMutation) ResetType()

ResetType reset all changes of the "type" field.

func (*DecisionMutation) ResetUntil

func (m *DecisionMutation) ResetUntil()

ResetUntil reset all changes of the "until" field.

func (*DecisionMutation) ResetUpdatedAt

func (m *DecisionMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*DecisionMutation) ResetValue

func (m *DecisionMutation) ResetValue()

ResetValue reset all changes of the "value" field.

func (*DecisionMutation) Scenario

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

Scenario returns the scenario value in the mutation.

func (*DecisionMutation) Scope

func (m *DecisionMutation) Scope() (r string, exists bool)

Scope returns the scope value 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) SetField

func (m *DecisionMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

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 Alert 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) 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 simulated value in the mutation.

func (*DecisionMutation) StartIP

func (m *DecisionMutation) StartIP() (r int64, exists bool)

StartIP returns the start_ip value in the mutation.

func (*DecisionMutation) StartIPCleared

func (m *DecisionMutation) StartIPCleared() bool

StartIPCleared returns if the field start_ip 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 until value in the mutation.

func (*DecisionMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

func (*DecisionMutation) Value

func (m *DecisionMutation) Value() (r string, exists bool)

Value returns the value value in the mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*DecisionQuery) FirstX

func (dq *DecisionQuery) FirstX(ctx context.Context) *Decision

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

func (*DecisionQuery) FirstXID

func (dq *DecisionQuery) FirstXID(ctx context.Context) int

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

func (*DecisionQuery) GroupBy

func (dq *DecisionQuery) GroupBy(field string, fields ...string) *DecisionGroupBy

GroupBy 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 the only Decision entity in the query, returns an error if not exactly one entity was returned.

func (*DecisionQuery) OnlyID

func (dq *DecisionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Decision id in the query, returns an error if not exactly one id was returned.

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(field string, fields ...string) *DecisionSelect

Select one or more fields from the given query.

Example:

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

client.Decision.Query().
	Select(decision.FieldCreatedAt).
	Scan(ctx, &v)

func (*DecisionQuery) Where

func (dq *DecisionQuery) Where(ps ...predicate.Decision) *DecisionQuery

Where adds a new predicate for the builder.

func (*DecisionQuery) WithOwner

func (dq *DecisionQuery) WithOwner(opts ...func(*AlertQuery)) *DecisionQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type DecisionSelect

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

DecisionSelect is the builder for select fields of Decision entities.

func (*DecisionSelect) Bool

func (ds *DecisionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DecisionSelect) BoolX

func (ds *DecisionSelect) BoolX(ctx context.Context) bool

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

func (*DecisionSelect) Bools

func (ds *DecisionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DecisionSelect) BoolsX

func (ds *DecisionSelect) BoolsX(ctx context.Context) []bool

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

func (*DecisionSelect) Float64

func (ds *DecisionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DecisionSelect) Float64X

func (ds *DecisionSelect) Float64X(ctx context.Context) float64

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

func (*DecisionSelect) Float64s

func (ds *DecisionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DecisionSelect) Float64sX

func (ds *DecisionSelect) Float64sX(ctx context.Context) []float64

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

func (*DecisionSelect) Int

func (ds *DecisionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DecisionSelect) IntX

func (ds *DecisionSelect) IntX(ctx context.Context) int

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

func (*DecisionSelect) Ints

func (ds *DecisionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DecisionSelect) IntsX

func (ds *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 interface{}) error

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

func (*DecisionSelect) ScanX

func (ds *DecisionSelect) ScanX(ctx context.Context, v interface{})

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

func (*DecisionSelect) String

func (ds *DecisionSelect) String(ctx context.Context) (_ string, err error)

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

func (*DecisionSelect) StringX

func (ds *DecisionSelect) StringX(ctx context.Context) string

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

func (*DecisionSelect) Strings

func (ds *DecisionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DecisionSelect) StringsX

func (ds *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 end_ip.

func (*DecisionUpdate) AddStartIP

func (du *DecisionUpdate) AddStartIP(i int64) *DecisionUpdate

AddStartIP adds i to start_ip.

func (*DecisionUpdate) ClearEndIP

func (du *DecisionUpdate) ClearEndIP() *DecisionUpdate

ClearEndIP clears the value of end_ip.

func (*DecisionUpdate) ClearOwner

func (du *DecisionUpdate) ClearOwner() *DecisionUpdate

ClearOwner clears the "owner" edge to type Alert.

func (*DecisionUpdate) ClearStartIP

func (du *DecisionUpdate) ClearStartIP() *DecisionUpdate

ClearStartIP clears the value of start_ip.

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 rows/vertices matched by this 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) SetNillableCreatedAt

func (du *DecisionUpdate) SetNillableCreatedAt(t *time.Time) *DecisionUpdate

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

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

func (du *DecisionUpdate) SetNillableOwnerID(id *int) *DecisionUpdate

SetNillableOwnerID sets the owner edge to Alert 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) SetNillableUpdatedAt

func (du *DecisionUpdate) SetNillableUpdatedAt(t *time.Time) *DecisionUpdate

SetNillableUpdatedAt sets the updated_at 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 Alert.

func (*DecisionUpdate) SetOwnerID

func (du *DecisionUpdate) SetOwnerID(id int) *DecisionUpdate

SetOwnerID sets the owner edge to Alert 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) 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 adds a new predicate for the 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 end_ip.

func (*DecisionUpdateOne) AddStartIP

func (duo *DecisionUpdateOne) AddStartIP(i int64) *DecisionUpdateOne

AddStartIP adds i to start_ip.

func (*DecisionUpdateOne) ClearEndIP

func (duo *DecisionUpdateOne) ClearEndIP() *DecisionUpdateOne

ClearEndIP clears the value of end_ip.

func (*DecisionUpdateOne) ClearOwner

func (duo *DecisionUpdateOne) ClearOwner() *DecisionUpdateOne

ClearOwner clears the "owner" edge to type Alert.

func (*DecisionUpdateOne) ClearStartIP

func (duo *DecisionUpdateOne) ClearStartIP() *DecisionUpdateOne

ClearStartIP clears the value of start_ip.

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 entity.

func (*DecisionUpdateOne) SaveX

func (duo *DecisionUpdateOne) SaveX(ctx context.Context) *Decision

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

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

func (duo *DecisionUpdateOne) SetNillableCreatedAt(t *time.Time) *DecisionUpdateOne

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

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

func (duo *DecisionUpdateOne) SetNillableOwnerID(id *int) *DecisionUpdateOne

SetNillableOwnerID sets the owner edge to Alert 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) SetNillableUpdatedAt

func (duo *DecisionUpdateOne) SetNillableUpdatedAt(t *time.Time) *DecisionUpdateOne

SetNillableUpdatedAt sets the updated_at 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 Alert.

func (*DecisionUpdateOne) SetOwnerID

func (duo *DecisionUpdateOne) SetOwnerID(id int) *DecisionUpdateOne

SetOwnerID sets the owner edge to Alert 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) 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.

func (*Event) String

func (e *Event) String() string

String implements the fmt.Stringer.

func (*Event) Unwrap

func (e *Event) Unwrap() *Event

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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 create builder for Event.

func (*EventClient) CreateBulk

func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk

BulkCreate 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 delete builder for the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id int) *EventDeleteOne

DeleteOneID returns a delete builder for the given 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) 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 Alert 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 Alert.

func (*EventCreate) SetOwnerID

func (ec *EventCreate) SetOwnerID(id int) *EventCreate

SetOwnerID sets the owner edge to Alert 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 a bulk of Event entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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
	// 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 builder for group-by 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 (egb *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.

func (*EventGroupBy) BoolX

func (egb *EventGroupBy) BoolX(ctx context.Context) bool

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

func (*EventGroupBy) Bools

func (egb *EventGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.

func (*EventGroupBy) BoolsX

func (egb *EventGroupBy) BoolsX(ctx context.Context) []bool

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

func (*EventGroupBy) Float64

func (egb *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.

func (*EventGroupBy) Float64X

func (egb *EventGroupBy) Float64X(ctx context.Context) float64

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

func (*EventGroupBy) Float64s

func (egb *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.

func (*EventGroupBy) Float64sX

func (egb *EventGroupBy) Float64sX(ctx context.Context) []float64

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

func (*EventGroupBy) Int

func (egb *EventGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from group-by. It is only allowed when querying group-by with one field.

func (*EventGroupBy) IntX

func (egb *EventGroupBy) IntX(ctx context.Context) int

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

func (*EventGroupBy) Ints

func (egb *EventGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.

func (*EventGroupBy) IntsX

func (egb *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 interface{}) error

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

func (*EventGroupBy) ScanX

func (egb *EventGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*EventGroupBy) String

func (egb *EventGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from group-by. It is only allowed when querying group-by with one field.

func (*EventGroupBy) StringX

func (egb *EventGroupBy) StringX(ctx context.Context) string

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

func (*EventGroupBy) Strings

func (egb *EventGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*EventGroupBy) StringsX

func (egb *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 mutate the Events nodes in the graph.

func (*EventMutation) AddField

func (m *EventMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*EventMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

func (*EventMutation) ClearEdge

func (m *EventMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*EventMutation) ClearField

func (m *EventMutation) ClearField(name string) error

ClearField clears the value for 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 Alert.

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 created_at value in the mutation.

func (*EventMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge 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 value indicates that this field was not set, or was not define in the schema.

func (*EventMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/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 available only if it was provided to the builder.

func (*EventMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Event. 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 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 was failed.

func (*EventMutation) OldSerialized

func (m *EventMutation) OldSerialized(ctx context.Context) (v string, err error)

OldSerialized returns the old serialized value of the Event. 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 database query fails.

func (*EventMutation) OldTime

func (m *EventMutation) OldTime(ctx context.Context) (v time.Time, err error)

OldTime returns the old time value of the Event. 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 database query fails.

func (*EventMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Event. 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 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 returns if the edge owner was cleared.

func (*EventMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*EventMutation) OwnerIDs

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

OwnerIDs returns the owner 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 given edge name.

func (*EventMutation) ResetCreatedAt

func (m *EventMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*EventMutation) ResetEdge

func (m *EventMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. 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 regarding the given field name. It returns an error if the field is not defined in the schema.

func (*EventMutation) ResetOwner

func (m *EventMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*EventMutation) ResetSerialized

func (m *EventMutation) ResetSerialized()

ResetSerialized reset all changes of the "serialized" field.

func (*EventMutation) ResetTime

func (m *EventMutation) ResetTime()

ResetTime reset all changes of the "time" field.

func (*EventMutation) ResetUpdatedAt

func (m *EventMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*EventMutation) Serialized

func (m *EventMutation) Serialized() (r string, exists bool)

Serialized returns the serialized value 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 for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*EventMutation) SetOwnerID

func (m *EventMutation) SetOwnerID(id int)

SetOwnerID sets the owner edge to Alert 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 time value 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 updated_at value in the mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*EventQuery) FirstX

func (eq *EventQuery) FirstX(ctx context.Context) *Event

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

func (*EventQuery) FirstXID

func (eq *EventQuery) FirstXID(ctx context.Context) int

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

func (*EventQuery) GroupBy

func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy

GroupBy 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 the only Event entity in the query, returns an error if not exactly one entity was returned.

func (*EventQuery) OnlyID

func (eq *EventQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Event id in the query, returns an error if not exactly one id was returned.

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(field string, fields ...string) *EventSelect

Select one or more fields from the given query.

Example:

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

client.Event.Query().
	Select(event.FieldCreatedAt).
	Scan(ctx, &v)

func (*EventQuery) Where

func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery

Where adds a new predicate for the builder.

func (*EventQuery) WithOwner

func (eq *EventQuery) WithOwner(opts ...func(*AlertQuery)) *EventQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type EventSelect

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

EventSelect is the builder for select fields of Event entities.

func (*EventSelect) Bool

func (es *EventSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventSelect) BoolX

func (es *EventSelect) BoolX(ctx context.Context) bool

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

func (*EventSelect) Bools

func (es *EventSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*EventSelect) BoolsX

func (es *EventSelect) BoolsX(ctx context.Context) []bool

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

func (*EventSelect) Float64

func (es *EventSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventSelect) Float64X

func (es *EventSelect) Float64X(ctx context.Context) float64

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

func (*EventSelect) Float64s

func (es *EventSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventSelect) Float64sX

func (es *EventSelect) Float64sX(ctx context.Context) []float64

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

func (*EventSelect) Int

func (es *EventSelect) Int(ctx context.Context) (_ int, err error)

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

func (*EventSelect) IntX

func (es *EventSelect) IntX(ctx context.Context) int

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

func (*EventSelect) Ints

func (es *EventSelect) Ints(ctx context.Context) ([]int, error)

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

func (*EventSelect) IntsX

func (es *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 interface{}) error

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

func (*EventSelect) ScanX

func (es *EventSelect) ScanX(ctx context.Context, v interface{})

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

func (*EventSelect) String

func (es *EventSelect) String(ctx context.Context) (_ string, err error)

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

func (*EventSelect) StringX

func (es *EventSelect) StringX(ctx context.Context) string

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

func (*EventSelect) Strings

func (es *EventSelect) Strings(ctx context.Context) ([]string, error)

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

func (*EventSelect) StringsX

func (es *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) ClearOwner

func (eu *EventUpdate) ClearOwner() *EventUpdate

ClearOwner clears the "owner" edge to type Alert.

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 rows/vertices matched by this 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) SetNillableCreatedAt

func (eu *EventUpdate) SetNillableCreatedAt(t *time.Time) *EventUpdate

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

func (*EventUpdate) SetNillableOwnerID

func (eu *EventUpdate) SetNillableOwnerID(id *int) *EventUpdate

SetNillableOwnerID sets the owner edge to Alert by id if the given value is not nil.

func (*EventUpdate) SetNillableUpdatedAt

func (eu *EventUpdate) SetNillableUpdatedAt(t *time.Time) *EventUpdate

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

func (*EventUpdate) SetOwner

func (eu *EventUpdate) SetOwner(a *Alert) *EventUpdate

SetOwner sets the owner edge to Alert.

func (*EventUpdate) SetOwnerID

func (eu *EventUpdate) SetOwnerID(id int) *EventUpdate

SetOwnerID sets the owner edge to Alert 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 adds a new predicate for the builder.

type EventUpdateOne

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

EventUpdateOne is the builder for updating a single Event entity.

func (*EventUpdateOne) ClearOwner

func (euo *EventUpdateOne) ClearOwner() *EventUpdateOne

ClearOwner clears the "owner" edge to type Alert.

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 entity.

func (*EventUpdateOne) SaveX

func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event

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

func (*EventUpdateOne) SetCreatedAt

func (euo *EventUpdateOne) SetCreatedAt(t time.Time) *EventUpdateOne

SetCreatedAt sets the created_at field.

func (*EventUpdateOne) SetNillableCreatedAt

func (euo *EventUpdateOne) SetNillableCreatedAt(t *time.Time) *EventUpdateOne

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

func (*EventUpdateOne) SetNillableOwnerID

func (euo *EventUpdateOne) SetNillableOwnerID(id *int) *EventUpdateOne

SetNillableOwnerID sets the owner edge to Alert by id if the given value is not nil.

func (*EventUpdateOne) SetNillableUpdatedAt

func (euo *EventUpdateOne) SetNillableUpdatedAt(t *time.Time) *EventUpdateOne

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

func (*EventUpdateOne) SetOwner

func (euo *EventUpdateOne) SetOwner(a *Alert) *EventUpdateOne

SetOwner sets the owner edge to Alert.

func (*EventUpdateOne) SetOwnerID

func (euo *EventUpdateOne) SetOwnerID(id int) *EventUpdateOne

SetOwnerID sets the owner edge to Alert 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 conflict 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"`
	// 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"`
	// 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.

func (*Machine) String

func (m *Machine) String() string

String implements the fmt.Stringer.

func (*Machine) Unwrap

func (m *Machine) Unwrap() *Machine

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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 create builder for Machine.

func (*MachineClient) CreateBulk

func (c *MachineClient) CreateBulk(builders ...*MachineCreate) *MachineCreateBulk

BulkCreate 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 delete builder for the given entity.

func (*MachineClient) DeleteOneID

func (c *MachineClient) DeleteOneID(id int) *MachineDeleteOne

DeleteOneID returns a delete builder for the given 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 Alert by ids.

func (*MachineCreate) AddAlerts

func (mc *MachineCreate) AddAlerts(a ...*Alert) *MachineCreate

AddAlerts adds the alerts edges to Alert.

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

func (mc *MachineCreate) SetMachineId(s string) *MachineCreate

SetMachineId sets the machineId field.

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) 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 a bulk of Machine entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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
	// 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 builder for group-by 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 (mgb *MachineGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.

func (*MachineGroupBy) BoolX

func (mgb *MachineGroupBy) BoolX(ctx context.Context) bool

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

func (*MachineGroupBy) Bools

func (mgb *MachineGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.

func (*MachineGroupBy) BoolsX

func (mgb *MachineGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MachineGroupBy) Float64

func (mgb *MachineGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.

func (*MachineGroupBy) Float64X

func (mgb *MachineGroupBy) Float64X(ctx context.Context) float64

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

func (*MachineGroupBy) Float64s

func (mgb *MachineGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.

func (*MachineGroupBy) Float64sX

func (mgb *MachineGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MachineGroupBy) Int

func (mgb *MachineGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from group-by. It is only allowed when querying group-by with one field.

func (*MachineGroupBy) IntX

func (mgb *MachineGroupBy) IntX(ctx context.Context) int

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

func (*MachineGroupBy) Ints

func (mgb *MachineGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.

func (*MachineGroupBy) IntsX

func (mgb *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 interface{}) error

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

func (*MachineGroupBy) ScanX

func (mgb *MachineGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MachineGroupBy) String

func (mgb *MachineGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from group-by. It is only allowed when querying group-by with one field.

func (*MachineGroupBy) StringX

func (mgb *MachineGroupBy) StringX(ctx context.Context) string

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

func (*MachineGroupBy) Strings

func (mgb *MachineGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MachineGroupBy) StringsX

func (mgb *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 mutate the Machines nodes in the graph.

func (*MachineMutation) AddAlertIDs

func (m *MachineMutation) AddAlertIDs(ids ...int)

AddAlertIDs adds the alerts edge to Alert by ids.

func (*MachineMutation) AddField

func (m *MachineMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*MachineMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

func (*MachineMutation) AlertsCleared

func (m *MachineMutation) AlertsCleared() bool

AlertsCleared returns if the edge alerts was cleared.

func (*MachineMutation) AlertsIDs

func (m *MachineMutation) AlertsIDs() (ids []int)

AlertsIDs returns the alerts ids in the mutation.

func (*MachineMutation) ClearAlerts

func (m *MachineMutation) ClearAlerts()

ClearAlerts clears the alerts edge to Alert.

func (*MachineMutation) ClearEdge

func (m *MachineMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*MachineMutation) ClearField

func (m *MachineMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*MachineMutation) ClearScenarios

func (m *MachineMutation) ClearScenarios()

ClearScenarios clears the value of scenarios.

func (*MachineMutation) ClearStatus

func (m *MachineMutation) ClearStatus()

ClearStatus clears the value of status.

func (*MachineMutation) ClearVersion

func (m *MachineMutation) ClearVersion()

ClearVersion clears the value of version.

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 created_at value in the mutation.

func (*MachineMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge 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 value indicates that this field was not set, or was not define in the schema.

func (*MachineMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/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 available only if it was provided to the builder.

func (*MachineMutation) IpAddress

func (m *MachineMutation) IpAddress() (r string, exists bool)

IpAddress returns the ipAddress value in the mutation.

func (*MachineMutation) IsValidated

func (m *MachineMutation) IsValidated() (r bool, exists bool)

IsValidated returns the isValidated value in the mutation.

func (*MachineMutation) MachineId

func (m *MachineMutation) MachineId() (r string, exists bool)

MachineId returns the machineId value in the mutation.

func (*MachineMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Machine. 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 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 was failed.

func (*MachineMutation) OldIpAddress

func (m *MachineMutation) OldIpAddress(ctx context.Context) (v string, err error)

OldIpAddress returns the old ipAddress value of the Machine. 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 database query fails.

func (*MachineMutation) OldIsValidated

func (m *MachineMutation) OldIsValidated(ctx context.Context) (v bool, err error)

OldIsValidated returns the old isValidated value of the Machine. 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 database query fails.

func (*MachineMutation) OldMachineId

func (m *MachineMutation) OldMachineId(ctx context.Context) (v string, err error)

OldMachineId returns the old machineId value of the Machine. 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 database query fails.

func (*MachineMutation) OldPassword

func (m *MachineMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old password value of the Machine. 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 database query fails.

func (*MachineMutation) OldScenarios

func (m *MachineMutation) OldScenarios(ctx context.Context) (v string, err error)

OldScenarios returns the old scenarios value of the Machine. 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 database query fails.

func (*MachineMutation) OldStatus

func (m *MachineMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old status value of the Machine. 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 database query fails.

func (*MachineMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Machine. 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 database query fails.

func (*MachineMutation) OldVersion

func (m *MachineMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old version value of the Machine. 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 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 password value in the mutation.

func (*MachineMutation) RemoveAlertIDs

func (m *MachineMutation) RemoveAlertIDs(ids ...int)

RemoveAlertIDs removes the alerts edge to Alert by ids.

func (*MachineMutation) RemovedAlertsIDs

func (m *MachineMutation) RemovedAlertsIDs() (ids []int)

RemovedAlerts returns the removed ids of alerts.

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 given edge name.

func (*MachineMutation) ResetAlerts

func (m *MachineMutation) ResetAlerts()

ResetAlerts reset all changes of the "alerts" edge.

func (*MachineMutation) ResetCreatedAt

func (m *MachineMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*MachineMutation) ResetEdge

func (m *MachineMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. 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 regarding the given field name. It returns an error if the field is not defined in the schema.

func (*MachineMutation) ResetIpAddress

func (m *MachineMutation) ResetIpAddress()

ResetIpAddress reset all changes of the "ipAddress" field.

func (*MachineMutation) ResetIsValidated

func (m *MachineMutation) ResetIsValidated()

ResetIsValidated reset all changes of the "isValidated" field.

func (*MachineMutation) ResetMachineId

func (m *MachineMutation) ResetMachineId()

ResetMachineId reset all changes of the "machineId" field.

func (*MachineMutation) ResetPassword

func (m *MachineMutation) ResetPassword()

ResetPassword reset all changes of the "password" field.

func (*MachineMutation) ResetScenarios

func (m *MachineMutation) ResetScenarios()

ResetScenarios reset all changes of the "scenarios" field.

func (*MachineMutation) ResetStatus

func (m *MachineMutation) ResetStatus()

ResetStatus reset all changes of the "status" field.

func (*MachineMutation) ResetUpdatedAt

func (m *MachineMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*MachineMutation) ResetVersion

func (m *MachineMutation) ResetVersion()

ResetVersion reset all changes of the "version" field.

func (*MachineMutation) Scenarios

func (m *MachineMutation) Scenarios() (r string, exists bool)

Scenarios returns the scenarios value in the mutation.

func (*MachineMutation) ScenariosCleared

func (m *MachineMutation) ScenariosCleared() bool

ScenariosCleared returns if the field scenarios was cleared in this mutation.

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 for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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) 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 status value in the mutation.

func (*MachineMutation) StatusCleared

func (m *MachineMutation) StatusCleared() bool

StatusCleared returns if the field status 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 updated_at value in the mutation.

func (*MachineMutation) Version

func (m *MachineMutation) Version() (r string, exists bool)

Version returns the version value in the mutation.

func (*MachineMutation) VersionCleared

func (m *MachineMutation) VersionCleared() bool

VersionCleared returns if the field version was cleared in this mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*MachineQuery) FirstX

func (mq *MachineQuery) FirstX(ctx context.Context) *Machine

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

func (*MachineQuery) FirstXID

func (mq *MachineQuery) FirstXID(ctx context.Context) int

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

func (*MachineQuery) GroupBy

func (mq *MachineQuery) GroupBy(field string, fields ...string) *MachineGroupBy

GroupBy 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 the only Machine entity in the query, returns an error if not exactly one entity was returned.

func (*MachineQuery) OnlyID

func (mq *MachineQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Machine id in the query, returns an error if not exactly one id was returned.

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(field string, fields ...string) *MachineSelect

Select one or more fields from the given query.

Example:

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

client.Machine.Query().
	Select(machine.FieldCreatedAt).
	Scan(ctx, &v)

func (*MachineQuery) Where

func (mq *MachineQuery) Where(ps ...predicate.Machine) *MachineQuery

Where adds a new predicate for the builder.

func (*MachineQuery) WithAlerts

func (mq *MachineQuery) WithAlerts(opts ...func(*AlertQuery)) *MachineQuery
WithAlerts tells the query-builder to eager-loads the nodes that are connected to

the "alerts" edge. The optional arguments used to configure the query builder of the edge.

type MachineSelect

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

MachineSelect is the builder for select fields of Machine entities.

func (*MachineSelect) Bool

func (ms *MachineSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MachineSelect) BoolX

func (ms *MachineSelect) BoolX(ctx context.Context) bool

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

func (*MachineSelect) Bools

func (ms *MachineSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MachineSelect) BoolsX

func (ms *MachineSelect) BoolsX(ctx context.Context) []bool

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

func (*MachineSelect) Float64

func (ms *MachineSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MachineSelect) Float64X

func (ms *MachineSelect) Float64X(ctx context.Context) float64

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

func (*MachineSelect) Float64s

func (ms *MachineSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MachineSelect) Float64sX

func (ms *MachineSelect) Float64sX(ctx context.Context) []float64

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

func (*MachineSelect) Int

func (ms *MachineSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MachineSelect) IntX

func (ms *MachineSelect) IntX(ctx context.Context) int

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

func (*MachineSelect) Ints

func (ms *MachineSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MachineSelect) IntsX

func (ms *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 interface{}) error

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

func (*MachineSelect) ScanX

func (ms *MachineSelect) ScanX(ctx context.Context, v interface{})

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

func (*MachineSelect) String

func (ms *MachineSelect) String(ctx context.Context) (_ string, err error)

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

func (*MachineSelect) StringX

func (ms *MachineSelect) StringX(ctx context.Context) string

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

func (*MachineSelect) Strings

func (ms *MachineSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MachineSelect) StringsX

func (ms *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 Alert by ids.

func (*MachineUpdate) AddAlerts

func (mu *MachineUpdate) AddAlerts(a ...*Alert) *MachineUpdate

AddAlerts adds the alerts edges to Alert.

func (*MachineUpdate) ClearAlerts

func (mu *MachineUpdate) ClearAlerts() *MachineUpdate

ClearAlerts clears all "alerts" edges to type Alert.

func (*MachineUpdate) ClearScenarios

func (mu *MachineUpdate) ClearScenarios() *MachineUpdate

ClearScenarios clears the value of scenarios.

func (*MachineUpdate) ClearStatus

func (mu *MachineUpdate) ClearStatus() *MachineUpdate

ClearStatus clears the value of status.

func (*MachineUpdate) ClearVersion

func (mu *MachineUpdate) ClearVersion() *MachineUpdate

ClearVersion clears the value of version.

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 by ids.

func (*MachineUpdate) RemoveAlerts

func (mu *MachineUpdate) RemoveAlerts(a ...*Alert) *MachineUpdate

RemoveAlerts removes alerts edges to Alert.

func (*MachineUpdate) Save

func (mu *MachineUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*MachineUpdate) SaveX

func (mu *MachineUpdate) SaveX(ctx context.Context) int

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

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

func (mu *MachineUpdate) SetMachineId(s string) *MachineUpdate

SetMachineId sets the machineId field.

func (*MachineUpdate) SetNillableCreatedAt

func (mu *MachineUpdate) SetNillableCreatedAt(t *time.Time) *MachineUpdate

SetNillableCreatedAt sets the created_at 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) SetNillableUpdatedAt

func (mu *MachineUpdate) SetNillableUpdatedAt(t *time.Time) *MachineUpdate

SetNillableUpdatedAt sets the updated_at 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 adds a new predicate for the 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 Alert by ids.

func (*MachineUpdateOne) AddAlerts

func (muo *MachineUpdateOne) AddAlerts(a ...*Alert) *MachineUpdateOne

AddAlerts adds the alerts edges to Alert.

func (*MachineUpdateOne) ClearAlerts

func (muo *MachineUpdateOne) ClearAlerts() *MachineUpdateOne

ClearAlerts clears all "alerts" edges to type Alert.

func (*MachineUpdateOne) ClearScenarios

func (muo *MachineUpdateOne) ClearScenarios() *MachineUpdateOne

ClearScenarios clears the value of scenarios.

func (*MachineUpdateOne) ClearStatus

func (muo *MachineUpdateOne) ClearStatus() *MachineUpdateOne

ClearStatus clears the value of status.

func (*MachineUpdateOne) ClearVersion

func (muo *MachineUpdateOne) ClearVersion() *MachineUpdateOne

ClearVersion clears the value of version.

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 by ids.

func (*MachineUpdateOne) RemoveAlerts

func (muo *MachineUpdateOne) RemoveAlerts(a ...*Alert) *MachineUpdateOne

RemoveAlerts removes alerts edges to Alert.

func (*MachineUpdateOne) Save

func (muo *MachineUpdateOne) Save(ctx context.Context) (*Machine, error)

Save executes the query and returns the updated entity.

func (*MachineUpdateOne) SaveX

func (muo *MachineUpdateOne) SaveX(ctx context.Context) *Machine

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

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

func (muo *MachineUpdateOne) SetMachineId(s string) *MachineUpdateOne

SetMachineId sets the machineId field.

func (*MachineUpdateOne) SetNillableCreatedAt

func (muo *MachineUpdateOne) SetNillableCreatedAt(t *time.Time) *MachineUpdateOne

SetNillableCreatedAt sets the created_at 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) SetNillableUpdatedAt

func (muo *MachineUpdateOne) SetNillableUpdatedAt(t *time.Time) *MachineUpdateOne

SetNillableUpdatedAt sets the updated_at 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.

func (*Meta) String

func (m *Meta) String() string

String implements the fmt.Stringer.

func (*Meta) Unwrap

func (m *Meta) Unwrap() *Meta

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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 create builder for Meta.

func (*MetaClient) CreateBulk

func (c *MetaClient) CreateBulk(builders ...*MetaCreate) *MetaCreateBulk

BulkCreate 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 delete builder for the given entity.

func (*MetaClient) DeleteOneID

func (c *MetaClient) DeleteOneID(id int) *MetaDeleteOne

DeleteOneID returns a delete builder for the given 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) 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 Alert 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 Alert.

func (*MetaCreate) SetOwnerID

func (mc *MetaCreate) SetOwnerID(id int) *MetaCreate

SetOwnerID sets the owner edge to Alert 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 a bulk of Meta entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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
	// 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 builder for group-by 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 (mgb *MetaGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.

func (*MetaGroupBy) BoolX

func (mgb *MetaGroupBy) BoolX(ctx context.Context) bool

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

func (*MetaGroupBy) Bools

func (mgb *MetaGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.

func (*MetaGroupBy) BoolsX

func (mgb *MetaGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MetaGroupBy) Float64

func (mgb *MetaGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.

func (*MetaGroupBy) Float64X

func (mgb *MetaGroupBy) Float64X(ctx context.Context) float64

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

func (*MetaGroupBy) Float64s

func (mgb *MetaGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.

func (*MetaGroupBy) Float64sX

func (mgb *MetaGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MetaGroupBy) Int

func (mgb *MetaGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from group-by. It is only allowed when querying group-by with one field.

func (*MetaGroupBy) IntX

func (mgb *MetaGroupBy) IntX(ctx context.Context) int

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

func (*MetaGroupBy) Ints

func (mgb *MetaGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.

func (*MetaGroupBy) IntsX

func (mgb *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 interface{}) error

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

func (*MetaGroupBy) ScanX

func (mgb *MetaGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MetaGroupBy) String

func (mgb *MetaGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from group-by. It is only allowed when querying group-by with one field.

func (*MetaGroupBy) StringX

func (mgb *MetaGroupBy) StringX(ctx context.Context) string

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

func (*MetaGroupBy) Strings

func (mgb *MetaGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MetaGroupBy) StringsX

func (mgb *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 mutate the MetaSlice nodes in the graph.

func (*MetaMutation) AddField

func (m *MetaMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*MetaMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

func (*MetaMutation) ClearEdge

func (m *MetaMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*MetaMutation) ClearField

func (m *MetaMutation) ClearField(name string) error

ClearField clears the value for 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 Alert.

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 created_at value in the mutation.

func (*MetaMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge 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 value indicates that this field was not set, or was not define in the schema.

func (*MetaMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/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 available only if it was provided to the builder.

func (*MetaMutation) Key

func (m *MetaMutation) Key() (r string, exists bool)

Key returns the key value in the mutation.

func (*MetaMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Meta. 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 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 was failed.

func (*MetaMutation) OldKey

func (m *MetaMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old key value of the Meta. 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 database query fails.

func (*MetaMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Meta. 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 database query fails.

func (*MetaMutation) OldValue

func (m *MetaMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old value value of the Meta. 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 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 returns if the edge owner was cleared.

func (*MetaMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*MetaMutation) OwnerIDs

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

OwnerIDs returns the owner 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 given edge name.

func (*MetaMutation) ResetCreatedAt

func (m *MetaMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*MetaMutation) ResetEdge

func (m *MetaMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. 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 regarding the given field name. It returns an error if the field is not defined in the schema.

func (*MetaMutation) ResetKey

func (m *MetaMutation) ResetKey()

ResetKey reset all changes of the "key" field.

func (*MetaMutation) ResetOwner

func (m *MetaMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*MetaMutation) ResetUpdatedAt

func (m *MetaMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*MetaMutation) ResetValue

func (m *MetaMutation) ResetValue()

ResetValue reset all changes of 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 for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch 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 Alert 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 updated_at value in the mutation.

func (*MetaMutation) Value

func (m *MetaMutation) Value() (r string, exists bool)

Value returns the value value in the mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*MetaQuery) FirstX

func (mq *MetaQuery) FirstX(ctx context.Context) *Meta

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

func (*MetaQuery) FirstXID

func (mq *MetaQuery) FirstXID(ctx context.Context) int

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

func (*MetaQuery) GroupBy

func (mq *MetaQuery) GroupBy(field string, fields ...string) *MetaGroupBy

GroupBy 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 the only Meta entity in the query, returns an error if not exactly one entity was returned.

func (*MetaQuery) OnlyID

func (mq *MetaQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Meta id in the query, returns an error if not exactly one id was returned.

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(field string, fields ...string) *MetaSelect

Select one or more fields from the given query.

Example:

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

client.Meta.Query().
	Select(meta.FieldCreatedAt).
	Scan(ctx, &v)

func (*MetaQuery) Where

func (mq *MetaQuery) Where(ps ...predicate.Meta) *MetaQuery

Where adds a new predicate for the builder.

func (*MetaQuery) WithOwner

func (mq *MetaQuery) WithOwner(opts ...func(*AlertQuery)) *MetaQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type MetaSelect

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

MetaSelect is the builder for select fields of Meta entities.

func (*MetaSelect) Bool

func (ms *MetaSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MetaSelect) BoolX

func (ms *MetaSelect) BoolX(ctx context.Context) bool

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

func (*MetaSelect) Bools

func (ms *MetaSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MetaSelect) BoolsX

func (ms *MetaSelect) BoolsX(ctx context.Context) []bool

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

func (*MetaSelect) Float64

func (ms *MetaSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MetaSelect) Float64X

func (ms *MetaSelect) Float64X(ctx context.Context) float64

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

func (*MetaSelect) Float64s

func (ms *MetaSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MetaSelect) Float64sX

func (ms *MetaSelect) Float64sX(ctx context.Context) []float64

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

func (*MetaSelect) Int

func (ms *MetaSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MetaSelect) IntX

func (ms *MetaSelect) IntX(ctx context.Context) int

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

func (*MetaSelect) Ints

func (ms *MetaSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MetaSelect) IntsX

func (ms *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 interface{}) error

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

func (*MetaSelect) ScanX

func (ms *MetaSelect) ScanX(ctx context.Context, v interface{})

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

func (*MetaSelect) String

func (ms *MetaSelect) String(ctx context.Context) (_ string, err error)

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

func (*MetaSelect) StringX

func (ms *MetaSelect) StringX(ctx context.Context) string

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

func (*MetaSelect) Strings

func (ms *MetaSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MetaSelect) StringsX

func (ms *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) ClearOwner

func (mu *MetaUpdate) ClearOwner() *MetaUpdate

ClearOwner clears the "owner" edge to type Alert.

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 rows/vertices matched by this 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) SetNillableCreatedAt

func (mu *MetaUpdate) SetNillableCreatedAt(t *time.Time) *MetaUpdate

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

func (*MetaUpdate) SetNillableOwnerID

func (mu *MetaUpdate) SetNillableOwnerID(id *int) *MetaUpdate

SetNillableOwnerID sets the owner edge to Alert by id if the given value is not nil.

func (*MetaUpdate) SetNillableUpdatedAt

func (mu *MetaUpdate) SetNillableUpdatedAt(t *time.Time) *MetaUpdate

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

func (*MetaUpdate) SetOwner

func (mu *MetaUpdate) SetOwner(a *Alert) *MetaUpdate

SetOwner sets the owner edge to Alert.

func (*MetaUpdate) SetOwnerID

func (mu *MetaUpdate) SetOwnerID(id int) *MetaUpdate

SetOwnerID sets the owner edge to Alert 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 adds a new predicate for the builder.

type MetaUpdateOne

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

MetaUpdateOne is the builder for updating a single Meta entity.

func (*MetaUpdateOne) ClearOwner

func (muo *MetaUpdateOne) ClearOwner() *MetaUpdateOne

ClearOwner clears the "owner" edge to type Alert.

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 entity.

func (*MetaUpdateOne) SaveX

func (muo *MetaUpdateOne) SaveX(ctx context.Context) *Meta

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

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

func (muo *MetaUpdateOne) SetNillableCreatedAt(t *time.Time) *MetaUpdateOne

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

func (*MetaUpdateOne) SetNillableOwnerID

func (muo *MetaUpdateOne) SetNillableOwnerID(id *int) *MetaUpdateOne

SetNillableOwnerID sets the owner edge to Alert by id if the given value is not nil.

func (*MetaUpdateOne) SetNillableUpdatedAt

func (muo *MetaUpdateOne) SetNillableUpdatedAt(t *time.Time) *MetaUpdateOne

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

func (*MetaUpdateOne) SetOwner

func (muo *MetaUpdateOne) SetOwner(a *Alert) *MetaUpdateOne

SetOwner sets the owner edge to Alert.

func (*MetaUpdateOne) SetOwnerID

func (muo *MetaUpdateOne) SetOwnerID(id int) *MetaUpdateOne

SetOwnerID sets the owner edge to Alert 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 conflict in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflict in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflict 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 conflict in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

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

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflict in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflict in user's code.

type RollbackFunc

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

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Tx

type Tx struct {

	// 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 the Tx stored in a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflict 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