ent

package
v1.6.3-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 28 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"
	TypeConfigItem = "ConfigItem"
	TypeDecision   = "Decision"
	TypeEvent      = "Event"
	TypeLock       = "Lock"
	TypeMachine    = "Machine"
	TypeMeta       = "Meta"
	TypeMetric     = "Metric"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Alert

type Alert struct {

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

Alert is the model entity for the Alert schema.

func (*Alert) QueryDecisions

func (a *Alert) QueryDecisions() *DecisionQuery

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

func (*Alert) QueryEvents

func (a *Alert) QueryEvents() *EventQuery

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

func (*Alert) QueryMetas

func (a *Alert) QueryMetas() *MetaQuery

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

func (*Alert) QueryOwner

func (a *Alert) QueryOwner() *MachineQuery

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

func (*Alert) String

func (a *Alert) String() string

String implements the fmt.Stringer.

func (*Alert) Unwrap

func (a *Alert) Unwrap() *Alert

Unwrap unwraps the Alert entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Alert) Update

func (a *Alert) Update() *AlertUpdateOne

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

func (*Alert) Value added in v1.6.1

func (a *Alert) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Alert. This includes values selected through modifiers, order, etc.

type AlertClient

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

AlertClient is a client for the Alert schema.

func NewAlertClient

func NewAlertClient(c config) *AlertClient

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

func (*AlertClient) Create

func (c *AlertClient) Create() *AlertCreate

Create returns a builder for creating a Alert entity.

func (*AlertClient) CreateBulk

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

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

func (*AlertClient) Delete

func (c *AlertClient) Delete() *AlertDelete

Delete returns a delete builder for Alert.

func (*AlertClient) DeleteOne

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

DeleteOne returns a builder for deleting the given entity.

func (*AlertClient) DeleteOneID

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

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

func (*AlertClient) Get

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

Get returns a Alert entity by its id.

func (*AlertClient) GetX

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

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

func (*AlertClient) Hooks

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

Hooks returns the client hooks.

func (*AlertClient) Intercept added in v1.6.1

func (c *AlertClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `alert.Intercept(f(g(h())))`.

func (*AlertClient) Interceptors added in v1.6.1

func (c *AlertClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*AlertClient) MapCreateBulk added in v1.6.1

func (c *AlertClient) MapCreateBulk(slice any, setFunc func(*AlertCreate, int)) *AlertCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AlertClient) Query

func (c *AlertClient) Query() *AlertQuery

Query returns a query builder for Alert.

func (*AlertClient) QueryDecisions

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

QueryDecisions queries the decisions edge of a Alert.

func (*AlertClient) QueryEvents

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

QueryEvents queries the events edge of a Alert.

func (*AlertClient) QueryMetas

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

QueryMetas queries the metas edge of a Alert.

func (*AlertClient) QueryOwner

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

QueryOwner queries the owner edge of a Alert.

func (*AlertClient) Update

func (c *AlertClient) Update() *AlertUpdate

Update returns an update builder for Alert.

func (*AlertClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*AlertClient) UpdateOneID

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

UpdateOneID returns an update builder for the given id.

func (*AlertClient) Use

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

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

type AlertCreate

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

AlertCreate is the builder for creating a Alert entity.

func (*AlertCreate) AddDecisionIDs

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

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

func (*AlertCreate) AddDecisions

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

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

func (*AlertCreate) AddEventIDs

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

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

func (*AlertCreate) AddEvents

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

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

func (*AlertCreate) AddMetaIDs

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

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

func (*AlertCreate) AddMetas

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

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

func (*AlertCreate) Exec added in v1.2.1

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

Exec executes the query.

func (*AlertCreate) ExecX added in v1.2.1

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

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

func (*AlertCreate) Mutation

func (ac *AlertCreate) Mutation() *AlertMutation

Mutation returns the AlertMutation object of the builder.

func (*AlertCreate) Save

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

Save creates the Alert in the database.

func (*AlertCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*AlertCreate) SetBucketId

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

SetBucketId sets the "bucketId" field.

func (*AlertCreate) SetCapacity

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

SetCapacity sets the "capacity" field.

func (*AlertCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AlertCreate) SetEventsCount

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

SetEventsCount sets the "eventsCount" field.

func (*AlertCreate) SetLeakSpeed

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

SetLeakSpeed sets the "leakSpeed" field.

func (*AlertCreate) SetMessage

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

SetMessage sets the "message" field.

func (*AlertCreate) SetNillableBucketId

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

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

func (*AlertCreate) SetNillableCapacity

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

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

func (*AlertCreate) SetNillableCreatedAt

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

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

func (*AlertCreate) SetNillableEventsCount

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

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

func (*AlertCreate) SetNillableLeakSpeed

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

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

func (*AlertCreate) SetNillableMessage

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

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

func (*AlertCreate) SetNillableOwnerID

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

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

func (*AlertCreate) SetNillableRemediation added in v1.6.3

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

SetNillableRemediation sets the "remediation" field 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) SetNillableUUID added in v1.5.0

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

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*AlertCreate) SetNillableUpdatedAt

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

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

func (*AlertCreate) SetOwner

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

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

func (*AlertCreate) SetOwnerID

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

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

func (*AlertCreate) SetRemediation added in v1.6.3

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

SetRemediation sets the "remediation" field.

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) SetUUID added in v1.5.0

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

SetUUID sets the "uuid" field.

func (*AlertCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type AlertCreateBulk

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

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

func (*AlertCreateBulk) Exec added in v1.2.1

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

Exec executes the query.

func (*AlertCreateBulk) ExecX added in v1.2.1

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

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

func (*AlertCreateBulk) Save

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

Save creates the Alert entities in the database.

func (*AlertCreateBulk) SaveX

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

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

type AlertDelete

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

AlertDelete is the builder for deleting a Alert entity.

func (*AlertDelete) Exec

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

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

func (*AlertDelete) ExecX

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

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

func (*AlertDelete) Where

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

Where appends a list predicates to the AlertDelete builder.

type AlertDeleteOne

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

AlertDeleteOne is the builder for deleting a single Alert entity.

func (*AlertDeleteOne) Exec

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

Exec executes the deletion query.

func (*AlertDeleteOne) ExecX

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

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

func (*AlertDeleteOne) Where added in v1.6.1

func (ado *AlertDeleteOne) Where(ps ...predicate.Alert) *AlertDeleteOne

Where appends a list predicates to the AlertDelete builder.

type AlertEdges

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

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

func (AlertEdges) DecisionsOrErr

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

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

func (AlertEdges) EventsOrErr

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

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

func (AlertEdges) MetasOrErr

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

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

func (AlertEdges) OwnerOrErr

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

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

type AlertGroupBy

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

AlertGroupBy is the group-by builder for Alert entities.

func (*AlertGroupBy) Aggregate

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

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

func (*AlertGroupBy) Bool

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

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

func (*AlertGroupBy) BoolX

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

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

func (*AlertGroupBy) Bools

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

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

func (*AlertGroupBy) BoolsX

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

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

func (*AlertGroupBy) Float64

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

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

func (*AlertGroupBy) Float64X

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

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

func (*AlertGroupBy) Float64s

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

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

func (*AlertGroupBy) Float64sX

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

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

func (*AlertGroupBy) Int

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

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

func (*AlertGroupBy) IntX

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

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

func (*AlertGroupBy) Ints

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

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

func (*AlertGroupBy) IntsX

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

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

func (*AlertGroupBy) Scan

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

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

func (*AlertGroupBy) ScanX

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

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

func (*AlertGroupBy) String

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

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

func (*AlertGroupBy) StringX

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

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

func (*AlertGroupBy) Strings

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

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

func (*AlertGroupBy) StringsX

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

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

type AlertMutation

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

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

func (*AlertMutation) AddCapacity

func (m *AlertMutation) AddCapacity(i int32)

AddCapacity adds i to the "capacity" field.

func (*AlertMutation) AddDecisionIDs

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

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

func (*AlertMutation) AddEventIDs

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

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

func (*AlertMutation) AddEventsCount

func (m *AlertMutation) AddEventsCount(i int32)

AddEventsCount adds i to the "eventsCount" field.

func (*AlertMutation) AddField

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

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

func (*AlertMutation) AddMetaIDs

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

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

func (*AlertMutation) AddSourceLatitude

func (m *AlertMutation) AddSourceLatitude(f float32)

AddSourceLatitude adds f to the "sourceLatitude" field.

func (*AlertMutation) AddSourceLongitude

func (m *AlertMutation) AddSourceLongitude(f float32)

AddSourceLongitude adds f to the "sourceLongitude" field.

func (*AlertMutation) AddedCapacity

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

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

func (*AlertMutation) AddedEdges

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

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

func (*AlertMutation) AddedEventsCount

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

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

func (*AlertMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AlertMutation) AddedFields

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

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

func (*AlertMutation) AddedIDs

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

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

func (*AlertMutation) AddedSourceLatitude

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

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

func (*AlertMutation) AddedSourceLongitude

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

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

func (*AlertMutation) BucketId

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

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

func (*AlertMutation) BucketIdCleared

func (m *AlertMutation) BucketIdCleared() bool

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

func (*AlertMutation) Capacity

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

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

func (*AlertMutation) CapacityCleared

func (m *AlertMutation) CapacityCleared() bool

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

func (*AlertMutation) ClearBucketId

func (m *AlertMutation) ClearBucketId()

ClearBucketId clears the value of the "bucketId" field.

func (*AlertMutation) ClearCapacity

func (m *AlertMutation) ClearCapacity()

ClearCapacity clears the value of the "capacity" field.

func (*AlertMutation) ClearDecisions

func (m *AlertMutation) ClearDecisions()

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

func (*AlertMutation) ClearEdge

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

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

func (*AlertMutation) ClearEvents

func (m *AlertMutation) ClearEvents()

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

func (*AlertMutation) ClearEventsCount

func (m *AlertMutation) ClearEventsCount()

ClearEventsCount clears the value of the "eventsCount" field.

func (*AlertMutation) ClearField

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

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

func (*AlertMutation) ClearLeakSpeed

func (m *AlertMutation) ClearLeakSpeed()

ClearLeakSpeed clears the value of the "leakSpeed" field.

func (*AlertMutation) ClearMessage

func (m *AlertMutation) ClearMessage()

ClearMessage clears the value of the "message" field.

func (*AlertMutation) ClearMetas

func (m *AlertMutation) ClearMetas()

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

func (*AlertMutation) ClearOwner

func (m *AlertMutation) ClearOwner()

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

func (*AlertMutation) ClearRemediation added in v1.6.3

func (m *AlertMutation) ClearRemediation()

ClearRemediation clears the value of the "remediation" field.

func (*AlertMutation) ClearScenarioHash

func (m *AlertMutation) ClearScenarioHash()

ClearScenarioHash clears the value of the "scenarioHash" field.

func (*AlertMutation) ClearScenarioVersion

func (m *AlertMutation) ClearScenarioVersion()

ClearScenarioVersion clears the value of the "scenarioVersion" field.

func (*AlertMutation) ClearSourceAsName

func (m *AlertMutation) ClearSourceAsName()

ClearSourceAsName clears the value of the "sourceAsName" field.

func (*AlertMutation) ClearSourceAsNumber

func (m *AlertMutation) ClearSourceAsNumber()

ClearSourceAsNumber clears the value of the "sourceAsNumber" field.

func (*AlertMutation) ClearSourceCountry

func (m *AlertMutation) ClearSourceCountry()

ClearSourceCountry clears the value of the "sourceCountry" field.

func (*AlertMutation) ClearSourceIp

func (m *AlertMutation) ClearSourceIp()

ClearSourceIp clears the value of the "sourceIp" field.

func (*AlertMutation) ClearSourceLatitude

func (m *AlertMutation) ClearSourceLatitude()

ClearSourceLatitude clears the value of the "sourceLatitude" field.

func (*AlertMutation) ClearSourceLongitude

func (m *AlertMutation) ClearSourceLongitude()

ClearSourceLongitude clears the value of the "sourceLongitude" field.

func (*AlertMutation) ClearSourceRange

func (m *AlertMutation) ClearSourceRange()

ClearSourceRange clears the value of the "sourceRange" field.

func (*AlertMutation) ClearSourceScope

func (m *AlertMutation) ClearSourceScope()

ClearSourceScope clears the value of the "sourceScope" field.

func (*AlertMutation) ClearSourceValue

func (m *AlertMutation) ClearSourceValue()

ClearSourceValue clears the value of the "sourceValue" field.

func (*AlertMutation) ClearStartedAt

func (m *AlertMutation) ClearStartedAt()

ClearStartedAt clears the value of the "startedAt" field.

func (*AlertMutation) ClearStoppedAt

func (m *AlertMutation) ClearStoppedAt()

ClearStoppedAt clears the value of the "stoppedAt" field.

func (*AlertMutation) ClearUUID added in v1.5.0

func (m *AlertMutation) ClearUUID()

ClearUUID clears the value of the "uuid" field.

func (*AlertMutation) ClearedEdges

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

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

func (*AlertMutation) ClearedFields

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

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

func (AlertMutation) Client

func (m AlertMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*AlertMutation) CreatedAt

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

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

func (*AlertMutation) DecisionsCleared

func (m *AlertMutation) DecisionsCleared() bool

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

func (*AlertMutation) DecisionsIDs

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

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

func (*AlertMutation) EdgeCleared

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

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

func (*AlertMutation) EventsCleared

func (m *AlertMutation) EventsCleared() bool

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

func (*AlertMutation) EventsCount

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

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

func (*AlertMutation) EventsCountCleared

func (m *AlertMutation) EventsCountCleared() bool

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

func (*AlertMutation) EventsIDs

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

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

func (*AlertMutation) Field

func (m *AlertMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AlertMutation) FieldCleared

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

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

func (*AlertMutation) Fields

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

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*AlertMutation) ID

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

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

func (*AlertMutation) IDs added in v1.3.1

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

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

func (*AlertMutation) LeakSpeed

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

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

func (*AlertMutation) LeakSpeedCleared

func (m *AlertMutation) LeakSpeedCleared() bool

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

func (*AlertMutation) Message

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

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

func (*AlertMutation) MessageCleared

func (m *AlertMutation) MessageCleared() bool

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

func (*AlertMutation) MetasCleared

func (m *AlertMutation) MetasCleared() bool

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

func (*AlertMutation) MetasIDs

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

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

func (*AlertMutation) OldBucketId

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

OldBucketId returns the old "bucketId" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldCapacity

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

OldCapacity returns the old "capacity" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldEventsCount

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

OldEventsCount returns the old "eventsCount" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldField

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

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*AlertMutation) OldLeakSpeed

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

OldLeakSpeed returns the old "leakSpeed" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldMessage

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

OldMessage returns the old "message" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldRemediation added in v1.6.3

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

OldRemediation returns the old "remediation" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldScenario

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

OldScenario returns the old "scenario" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldScenarioHash

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

OldScenarioHash returns the old "scenarioHash" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldScenarioVersion

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

OldScenarioVersion returns the old "scenarioVersion" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSimulated

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

OldSimulated returns the old "simulated" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceAsName

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

OldSourceAsName returns the old "sourceAsName" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceAsNumber

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

OldSourceAsNumber returns the old "sourceAsNumber" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceCountry

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

OldSourceCountry returns the old "sourceCountry" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceIp

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

OldSourceIp returns the old "sourceIp" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceLatitude

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

OldSourceLatitude returns the old "sourceLatitude" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceLongitude

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

OldSourceLongitude returns the old "sourceLongitude" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceRange

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

OldSourceRange returns the old "sourceRange" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceScope

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

OldSourceScope returns the old "sourceScope" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldSourceValue

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

OldSourceValue returns the old "sourceValue" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldStartedAt

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

OldStartedAt returns the old "startedAt" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldStoppedAt

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

OldStoppedAt returns the old "stoppedAt" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldUUID added in v1.5.0

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

OldUUID returns the old "uuid" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Alert entity. If the Alert object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AlertMutation) Op

func (m *AlertMutation) Op() Op

Op returns the operation name.

func (*AlertMutation) OwnerCleared

func (m *AlertMutation) OwnerCleared() bool

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

func (*AlertMutation) OwnerID

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

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

func (*AlertMutation) OwnerIDs

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

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

func (*AlertMutation) Remediation added in v1.6.3

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

Remediation returns the value of the "remediation" field in the mutation.

func (*AlertMutation) RemediationCleared added in v1.6.3

func (m *AlertMutation) RemediationCleared() bool

RemediationCleared returns if the "remediation" field was cleared in this mutation.

func (*AlertMutation) RemoveDecisionIDs

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

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

func (*AlertMutation) RemoveEventIDs

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

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

func (*AlertMutation) RemoveMetaIDs

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

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

func (*AlertMutation) RemovedDecisionsIDs

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

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

func (*AlertMutation) RemovedEdges

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

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

func (*AlertMutation) RemovedEventsIDs

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

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

func (*AlertMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*AlertMutation) RemovedMetasIDs

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

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

func (*AlertMutation) ResetBucketId

func (m *AlertMutation) ResetBucketId()

ResetBucketId resets all changes to the "bucketId" field.

func (*AlertMutation) ResetCapacity

func (m *AlertMutation) ResetCapacity()

ResetCapacity resets all changes to the "capacity" field.

func (*AlertMutation) ResetCreatedAt

func (m *AlertMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AlertMutation) ResetDecisions

func (m *AlertMutation) ResetDecisions()

ResetDecisions resets all changes to the "decisions" edge.

func (*AlertMutation) ResetEdge

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

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

func (*AlertMutation) ResetEvents

func (m *AlertMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*AlertMutation) ResetEventsCount

func (m *AlertMutation) ResetEventsCount()

ResetEventsCount resets all changes to the "eventsCount" field.

func (*AlertMutation) ResetField

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

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

func (*AlertMutation) ResetLeakSpeed

func (m *AlertMutation) ResetLeakSpeed()

ResetLeakSpeed resets all changes to the "leakSpeed" field.

func (*AlertMutation) ResetMessage

func (m *AlertMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*AlertMutation) ResetMetas

func (m *AlertMutation) ResetMetas()

ResetMetas resets all changes to the "metas" edge.

func (*AlertMutation) ResetOwner

func (m *AlertMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*AlertMutation) ResetRemediation added in v1.6.3

func (m *AlertMutation) ResetRemediation()

ResetRemediation resets all changes to the "remediation" field.

func (*AlertMutation) ResetScenario

func (m *AlertMutation) ResetScenario()

ResetScenario resets all changes to the "scenario" field.

func (*AlertMutation) ResetScenarioHash

func (m *AlertMutation) ResetScenarioHash()

ResetScenarioHash resets all changes to the "scenarioHash" field.

func (*AlertMutation) ResetScenarioVersion

func (m *AlertMutation) ResetScenarioVersion()

ResetScenarioVersion resets all changes to the "scenarioVersion" field.

func (*AlertMutation) ResetSimulated

func (m *AlertMutation) ResetSimulated()

ResetSimulated resets all changes to the "simulated" field.

func (*AlertMutation) ResetSourceAsName

func (m *AlertMutation) ResetSourceAsName()

ResetSourceAsName resets all changes to the "sourceAsName" field.

func (*AlertMutation) ResetSourceAsNumber

func (m *AlertMutation) ResetSourceAsNumber()

ResetSourceAsNumber resets all changes to the "sourceAsNumber" field.

func (*AlertMutation) ResetSourceCountry

func (m *AlertMutation) ResetSourceCountry()

ResetSourceCountry resets all changes to the "sourceCountry" field.

func (*AlertMutation) ResetSourceIp

func (m *AlertMutation) ResetSourceIp()

ResetSourceIp resets all changes to the "sourceIp" field.

func (*AlertMutation) ResetSourceLatitude

func (m *AlertMutation) ResetSourceLatitude()

ResetSourceLatitude resets all changes to the "sourceLatitude" field.

func (*AlertMutation) ResetSourceLongitude

func (m *AlertMutation) ResetSourceLongitude()

ResetSourceLongitude resets all changes to the "sourceLongitude" field.

func (*AlertMutation) ResetSourceRange

func (m *AlertMutation) ResetSourceRange()

ResetSourceRange resets all changes to the "sourceRange" field.

func (*AlertMutation) ResetSourceScope

func (m *AlertMutation) ResetSourceScope()

ResetSourceScope resets all changes to the "sourceScope" field.

func (*AlertMutation) ResetSourceValue

func (m *AlertMutation) ResetSourceValue()

ResetSourceValue resets all changes to the "sourceValue" field.

func (*AlertMutation) ResetStartedAt

func (m *AlertMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "startedAt" field.

func (*AlertMutation) ResetStoppedAt

func (m *AlertMutation) ResetStoppedAt()

ResetStoppedAt resets all changes to the "stoppedAt" field.

func (*AlertMutation) ResetUUID added in v1.5.0

func (m *AlertMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*AlertMutation) ResetUpdatedAt

func (m *AlertMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AlertMutation) Scenario

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

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

func (*AlertMutation) ScenarioHash

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

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

func (*AlertMutation) ScenarioHashCleared

func (m *AlertMutation) ScenarioHashCleared() bool

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

func (*AlertMutation) ScenarioVersion

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

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

func (*AlertMutation) ScenarioVersionCleared

func (m *AlertMutation) ScenarioVersionCleared() bool

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

func (*AlertMutation) SetBucketId

func (m *AlertMutation) SetBucketId(s string)

SetBucketId sets the "bucketId" field.

func (*AlertMutation) SetCapacity

func (m *AlertMutation) SetCapacity(i int32)

SetCapacity sets the "capacity" field.

func (*AlertMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AlertMutation) SetEventsCount

func (m *AlertMutation) SetEventsCount(i int32)

SetEventsCount sets the "eventsCount" field.

func (*AlertMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AlertMutation) SetLeakSpeed

func (m *AlertMutation) SetLeakSpeed(s string)

SetLeakSpeed sets the "leakSpeed" field.

func (*AlertMutation) SetMessage

func (m *AlertMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*AlertMutation) SetOp added in v1.6.1

func (m *AlertMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AlertMutation) SetOwnerID

func (m *AlertMutation) SetOwnerID(id int)

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

func (*AlertMutation) SetRemediation added in v1.6.3

func (m *AlertMutation) SetRemediation(b bool)

SetRemediation sets the "remediation" field.

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) SetUUID added in v1.5.0

func (m *AlertMutation) SetUUID(s string)

SetUUID sets the "uuid" field.

func (*AlertMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AlertMutation) Simulated

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

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

func (*AlertMutation) SourceAsName

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

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

func (*AlertMutation) SourceAsNameCleared

func (m *AlertMutation) SourceAsNameCleared() bool

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

func (*AlertMutation) SourceAsNumber

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

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

func (*AlertMutation) SourceAsNumberCleared

func (m *AlertMutation) SourceAsNumberCleared() bool

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

func (*AlertMutation) SourceCountry

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

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

func (*AlertMutation) SourceCountryCleared

func (m *AlertMutation) SourceCountryCleared() bool

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

func (*AlertMutation) SourceIp

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

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

func (*AlertMutation) SourceIpCleared

func (m *AlertMutation) SourceIpCleared() bool

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

func (*AlertMutation) SourceLatitude

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

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

func (*AlertMutation) SourceLatitudeCleared

func (m *AlertMutation) SourceLatitudeCleared() bool

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

func (*AlertMutation) SourceLongitude

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

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

func (*AlertMutation) SourceLongitudeCleared

func (m *AlertMutation) SourceLongitudeCleared() bool

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

func (*AlertMutation) SourceRange

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

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

func (*AlertMutation) SourceRangeCleared

func (m *AlertMutation) SourceRangeCleared() bool

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

func (*AlertMutation) SourceScope

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

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

func (*AlertMutation) SourceScopeCleared

func (m *AlertMutation) SourceScopeCleared() bool

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

func (*AlertMutation) SourceValue

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

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

func (*AlertMutation) SourceValueCleared

func (m *AlertMutation) SourceValueCleared() bool

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

func (*AlertMutation) StartedAt

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

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

func (*AlertMutation) StartedAtCleared

func (m *AlertMutation) StartedAtCleared() bool

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

func (*AlertMutation) StoppedAt

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

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

func (*AlertMutation) StoppedAtCleared

func (m *AlertMutation) StoppedAtCleared() bool

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

func (AlertMutation) Tx

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

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

func (*AlertMutation) Type

func (m *AlertMutation) Type() string

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

func (*AlertMutation) UUID added in v1.5.0

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

UUID returns the value of the "uuid" field in the mutation.

func (*AlertMutation) UUIDCleared added in v1.5.0

func (m *AlertMutation) UUIDCleared() bool

UUIDCleared returns if the "uuid" field was cleared in this mutation.

func (*AlertMutation) UpdatedAt

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

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

func (*AlertMutation) Where added in v1.2.1

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

Where appends a list predicates to the AlertMutation builder.

func (*AlertMutation) WhereP added in v1.6.1

func (m *AlertMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the AlertMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type AlertQuery

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

AlertQuery is the builder for querying Alert entities.

func (*AlertQuery) Aggregate added in v1.6.1

func (aq *AlertQuery) Aggregate(fns ...AggregateFunc) *AlertSelect

Aggregate returns a AlertSelect configured with the given aggregations.

func (*AlertQuery) All

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

All executes the query and returns a list of Alerts.

func (*AlertQuery) AllX

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

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

func (*AlertQuery) Clone

func (aq *AlertQuery) Clone() *AlertQuery

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

func (*AlertQuery) Count

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

Count returns the count of the given query.

func (*AlertQuery) CountX

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

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

func (*AlertQuery) Exist

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

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

func (*AlertQuery) ExistX

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

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

func (*AlertQuery) First

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

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

func (*AlertQuery) FirstID

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

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

func (*AlertQuery) FirstIDX added in v1.0.3

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

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

func (*AlertQuery) FirstX

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

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

func (*AlertQuery) GroupBy

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

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

Example:

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

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

func (*AlertQuery) IDs

func (aq *AlertQuery) IDs(ctx context.Context) (ids []int, err 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 the number of records to be returned by this query.

func (*AlertQuery) Offset

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

Offset to start from.

func (*AlertQuery) Only

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

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

func (*AlertQuery) OnlyID

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

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

func (*AlertQuery) OnlyIDX

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

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

func (*AlertQuery) OnlyX

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

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

func (*AlertQuery) Order

func (aq *AlertQuery) Order(o ...alert.OrderOption) *AlertQuery

Order specifies how the records should be ordered.

func (*AlertQuery) QueryDecisions

func (aq *AlertQuery) QueryDecisions() *DecisionQuery

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

func (*AlertQuery) QueryEvents

func (aq *AlertQuery) QueryEvents() *EventQuery

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

func (*AlertQuery) QueryMetas

func (aq *AlertQuery) QueryMetas() *MetaQuery

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

func (*AlertQuery) QueryOwner

func (aq *AlertQuery) QueryOwner() *MachineQuery

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

func (*AlertQuery) Select

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

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

Example:

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

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

func (*AlertQuery) Unique added in v1.2.1

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

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

func (*AlertQuery) Where

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

Where adds a new predicate for the AlertQuery builder.

func (*AlertQuery) WithDecisions

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

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

func (*AlertQuery) WithEvents

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

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

func (*AlertQuery) WithMetas

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

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

func (*AlertQuery) WithOwner

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

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

type AlertSelect

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

AlertSelect is the builder for selecting fields of Alert entities.

func (*AlertSelect) Aggregate added in v1.6.1

func (as *AlertSelect) Aggregate(fns ...AggregateFunc) *AlertSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AlertSelect) Bool

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

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

func (*AlertSelect) BoolX

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

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

func (*AlertSelect) Bools

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

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

func (*AlertSelect) BoolsX

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

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

func (*AlertSelect) Float64

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

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

func (*AlertSelect) Float64X

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

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

func (*AlertSelect) Float64s

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

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

func (*AlertSelect) Float64sX

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

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

func (*AlertSelect) Int

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

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

func (*AlertSelect) IntX

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

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

func (*AlertSelect) Ints

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

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

func (*AlertSelect) IntsX

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

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

func (*AlertSelect) Scan

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

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

func (*AlertSelect) ScanX

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

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

func (*AlertSelect) String

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

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

func (*AlertSelect) StringX

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

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

func (*AlertSelect) Strings

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

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

func (*AlertSelect) StringsX

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

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

type AlertUpdate

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

AlertUpdate is the builder for updating Alert entities.

func (*AlertUpdate) AddDecisionIDs

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

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

func (*AlertUpdate) AddDecisions

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

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

func (*AlertUpdate) AddEventIDs

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

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

func (*AlertUpdate) AddEvents

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

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

func (*AlertUpdate) AddMetaIDs

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

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

func (*AlertUpdate) AddMetas

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

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

func (*AlertUpdate) ClearDecisions

func (au *AlertUpdate) ClearDecisions() *AlertUpdate

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

func (*AlertUpdate) ClearEvents

func (au *AlertUpdate) ClearEvents() *AlertUpdate

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

func (*AlertUpdate) ClearMetas

func (au *AlertUpdate) ClearMetas() *AlertUpdate

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

func (*AlertUpdate) ClearOwner

func (au *AlertUpdate) ClearOwner() *AlertUpdate

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

func (*AlertUpdate) Exec

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

Exec executes the query.

func (*AlertUpdate) ExecX

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

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

func (*AlertUpdate) Mutation

func (au *AlertUpdate) Mutation() *AlertMutation

Mutation returns the AlertMutation object of the builder.

func (*AlertUpdate) RemoveDecisionIDs

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

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

func (*AlertUpdate) RemoveDecisions

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

RemoveDecisions removes "decisions" edges to Decision entities.

func (*AlertUpdate) RemoveEventIDs

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

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

func (*AlertUpdate) RemoveEvents

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

RemoveEvents removes "events" edges to Event entities.

func (*AlertUpdate) RemoveMetaIDs

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

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

func (*AlertUpdate) RemoveMetas

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

RemoveMetas removes "metas" edges to Meta entities.

func (*AlertUpdate) Save

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

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

func (*AlertUpdate) SaveX

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

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

func (*AlertUpdate) SetNillableOwnerID

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

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

func (*AlertUpdate) SetOwner

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

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

func (*AlertUpdate) SetOwnerID

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

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

func (*AlertUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AlertUpdate) Where

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

Where appends a list predicates to the AlertUpdate builder.

type AlertUpdateOne

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

AlertUpdateOne is the builder for updating a single Alert entity.

func (*AlertUpdateOne) AddDecisionIDs

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

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

func (*AlertUpdateOne) AddDecisions

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

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

func (*AlertUpdateOne) AddEventIDs

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

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

func (*AlertUpdateOne) AddEvents

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

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

func (*AlertUpdateOne) AddMetaIDs

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

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

func (*AlertUpdateOne) AddMetas

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

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

func (*AlertUpdateOne) ClearDecisions

func (auo *AlertUpdateOne) ClearDecisions() *AlertUpdateOne

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

func (*AlertUpdateOne) ClearEvents

func (auo *AlertUpdateOne) ClearEvents() *AlertUpdateOne

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

func (*AlertUpdateOne) ClearMetas

func (auo *AlertUpdateOne) ClearMetas() *AlertUpdateOne

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

func (*AlertUpdateOne) ClearOwner

func (auo *AlertUpdateOne) ClearOwner() *AlertUpdateOne

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

func (*AlertUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AlertUpdateOne) ExecX

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

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

func (*AlertUpdateOne) Mutation

func (auo *AlertUpdateOne) Mutation() *AlertMutation

Mutation returns the AlertMutation object of the builder.

func (*AlertUpdateOne) RemoveDecisionIDs

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

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

func (*AlertUpdateOne) RemoveDecisions

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

RemoveDecisions removes "decisions" edges to Decision entities.

func (*AlertUpdateOne) RemoveEventIDs

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

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

func (*AlertUpdateOne) RemoveEvents

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

RemoveEvents removes "events" edges to Event entities.

func (*AlertUpdateOne) RemoveMetaIDs

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

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

func (*AlertUpdateOne) RemoveMetas

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

RemoveMetas removes "metas" edges to Meta entities.

func (*AlertUpdateOne) Save

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

Save executes the query and returns the updated Alert entity.

func (*AlertUpdateOne) SaveX

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

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

func (*AlertUpdateOne) Select added in v1.2.1

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

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

func (*AlertUpdateOne) SetNillableOwnerID

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

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

func (*AlertUpdateOne) SetOwner

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

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

func (*AlertUpdateOne) SetOwnerID

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

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

func (*AlertUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AlertUpdateOne) Where added in v1.6.1

func (auo *AlertUpdateOne) Where(ps ...predicate.Alert) *AlertUpdateOne

Where appends a list predicates to the AlertUpdate builder.

type Alerts

type Alerts []*Alert

Alerts is a parsable slice of Alert.

type Bouncer

type Bouncer struct {

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

Bouncer is the model entity for the Bouncer schema.

func (*Bouncer) GetFeatureflags added in v1.6.3

func (b *Bouncer) GetFeatureflags() string

func (*Bouncer) GetOsname added in v1.6.3

func (b *Bouncer) GetOsname() string

func (*Bouncer) GetOsversion added in v1.6.3

func (b *Bouncer) GetOsversion() string

func (*Bouncer) String

func (b *Bouncer) String() string

String implements the fmt.Stringer.

func (*Bouncer) Unwrap

func (b *Bouncer) Unwrap() *Bouncer

Unwrap unwraps the Bouncer entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Bouncer) Update

func (b *Bouncer) Update() *BouncerUpdateOne

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

func (*Bouncer) Value added in v1.6.1

func (b *Bouncer) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Bouncer. This includes values selected through modifiers, order, etc.

type BouncerClient

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

BouncerClient is a client for the Bouncer schema.

func NewBouncerClient

func NewBouncerClient(c config) *BouncerClient

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

func (*BouncerClient) Create

func (c *BouncerClient) Create() *BouncerCreate

Create returns a builder for creating a Bouncer entity.

func (*BouncerClient) CreateBulk

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

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

func (*BouncerClient) Delete

func (c *BouncerClient) Delete() *BouncerDelete

Delete returns a delete builder for Bouncer.

func (*BouncerClient) DeleteOne

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

DeleteOne returns a builder for deleting the given entity.

func (*BouncerClient) DeleteOneID

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

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

func (*BouncerClient) Get

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

Get returns a Bouncer entity by its id.

func (*BouncerClient) GetX

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

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

func (*BouncerClient) Hooks

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

Hooks returns the client hooks.

func (*BouncerClient) Intercept added in v1.6.1

func (c *BouncerClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `bouncer.Intercept(f(g(h())))`.

func (*BouncerClient) Interceptors added in v1.6.1

func (c *BouncerClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*BouncerClient) MapCreateBulk added in v1.6.1

func (c *BouncerClient) MapCreateBulk(slice any, setFunc func(*BouncerCreate, int)) *BouncerCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*BouncerClient) Query

func (c *BouncerClient) Query() *BouncerQuery

Query returns a query builder for Bouncer.

func (*BouncerClient) Update

func (c *BouncerClient) Update() *BouncerUpdate

Update returns an update builder for Bouncer.

func (*BouncerClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*BouncerClient) UpdateOneID

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

UpdateOneID returns an update builder for the given id.

func (*BouncerClient) Use

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

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

type BouncerCreate

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

BouncerCreate is the builder for creating a Bouncer entity.

func (*BouncerCreate) Exec added in v1.2.1

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

Exec executes the query.

func (*BouncerCreate) ExecX added in v1.2.1

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

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

func (*BouncerCreate) Mutation

func (bc *BouncerCreate) Mutation() *BouncerMutation

Mutation returns the BouncerMutation object of the builder.

func (*BouncerCreate) Save

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

Save creates the Bouncer in the database.

func (*BouncerCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*BouncerCreate) SetAPIKey

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

SetAPIKey sets the "api_key" field.

func (*BouncerCreate) SetAuthType added in v1.4.0

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

SetAuthType sets the "auth_type" field.

func (*BouncerCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BouncerCreate) SetFeatureflags added in v1.6.3

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

SetFeatureflags sets the "featureflags" field.

func (*BouncerCreate) SetIPAddress

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

SetIPAddress sets the "ip_address" field.

func (*BouncerCreate) SetLastPull

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

SetLastPull sets the "last_pull" field.

func (*BouncerCreate) SetName

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

SetName sets the "name" field.

func (*BouncerCreate) SetNillableAuthType added in v1.4.0

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

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

func (*BouncerCreate) SetNillableCreatedAt

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

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

func (*BouncerCreate) SetNillableFeatureflags added in v1.6.3

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

SetNillableFeatureflags sets the "featureflags" 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) SetNillableOsname added in v1.6.3

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

SetNillableOsname sets the "osname" field if the given value is not nil.

func (*BouncerCreate) SetNillableOsversion added in v1.6.3

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

SetNillableOsversion sets the "osversion" 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) 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) SetOsname added in v1.6.3

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

SetOsname sets the "osname" field.

func (*BouncerCreate) SetOsversion added in v1.6.3

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

SetOsversion sets the "osversion" field.

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

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

SetUpdatedAt sets the "updated_at" field.

func (*BouncerCreate) SetVersion

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

SetVersion sets the "version" field.

type BouncerCreateBulk

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

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

func (*BouncerCreateBulk) Exec added in v1.2.1

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

Exec executes the query.

func (*BouncerCreateBulk) ExecX added in v1.2.1

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

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

func (*BouncerCreateBulk) Save

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

Save creates the Bouncer entities in the database.

func (*BouncerCreateBulk) SaveX

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

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

type BouncerDelete

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

BouncerDelete is the builder for deleting a Bouncer entity.

func (*BouncerDelete) Exec

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

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

func (*BouncerDelete) ExecX

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

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

func (*BouncerDelete) Where

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

Where appends a list predicates to the BouncerDelete builder.

type BouncerDeleteOne

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

BouncerDeleteOne is the builder for deleting a single Bouncer entity.

func (*BouncerDeleteOne) Exec

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

Exec executes the deletion query.

func (*BouncerDeleteOne) ExecX

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

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

func (*BouncerDeleteOne) Where added in v1.6.1

Where appends a list predicates to the BouncerDelete builder.

type BouncerGroupBy

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

BouncerGroupBy is the group-by builder for Bouncer entities.

func (*BouncerGroupBy) Aggregate

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

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

func (*BouncerGroupBy) Bool

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

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

func (*BouncerGroupBy) BoolX

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

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

func (*BouncerGroupBy) Bools

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

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

func (*BouncerGroupBy) BoolsX

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

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

func (*BouncerGroupBy) Float64

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

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

func (*BouncerGroupBy) Float64X

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

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

func (*BouncerGroupBy) Float64s

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

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

func (*BouncerGroupBy) Float64sX

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

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

func (*BouncerGroupBy) Int

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

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

func (*BouncerGroupBy) IntX

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

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

func (*BouncerGroupBy) Ints

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

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

func (*BouncerGroupBy) IntsX

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

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

func (*BouncerGroupBy) Scan

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

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

func (*BouncerGroupBy) ScanX

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

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

func (*BouncerGroupBy) String

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

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

func (*BouncerGroupBy) StringX

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

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

func (*BouncerGroupBy) Strings

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

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

func (*BouncerGroupBy) StringsX

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

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

type BouncerMutation

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

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

func (*BouncerMutation) APIKey

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

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

func (*BouncerMutation) AddField

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

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

func (*BouncerMutation) AddedEdges

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

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

func (*BouncerMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BouncerMutation) AddedFields

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

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

func (*BouncerMutation) AddedIDs

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

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

func (*BouncerMutation) AuthType added in v1.4.0

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

AuthType returns the value of the "auth_type" field in the mutation.

func (*BouncerMutation) ClearEdge

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

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

func (*BouncerMutation) ClearFeatureflags added in v1.6.3

func (m *BouncerMutation) ClearFeatureflags()

ClearFeatureflags clears the value of the "featureflags" field.

func (*BouncerMutation) ClearField

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

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

func (*BouncerMutation) ClearIPAddress

func (m *BouncerMutation) ClearIPAddress()

ClearIPAddress clears the value of the "ip_address" field.

func (*BouncerMutation) ClearLastPull added in v1.6.3

func (m *BouncerMutation) ClearLastPull()

ClearLastPull clears the value of the "last_pull" field.

func (*BouncerMutation) ClearOsname added in v1.6.3

func (m *BouncerMutation) ClearOsname()

ClearOsname clears the value of the "osname" field.

func (*BouncerMutation) ClearOsversion added in v1.6.3

func (m *BouncerMutation) ClearOsversion()

ClearOsversion clears the value of the "osversion" field.

func (*BouncerMutation) ClearType

func (m *BouncerMutation) ClearType()

ClearType clears the value of the "type" field.

func (*BouncerMutation) ClearVersion

func (m *BouncerMutation) ClearVersion()

ClearVersion clears the value of the "version" field.

func (*BouncerMutation) ClearedEdges

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

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

func (*BouncerMutation) ClearedFields

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

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

func (BouncerMutation) Client

func (m BouncerMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*BouncerMutation) CreatedAt

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

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

func (*BouncerMutation) EdgeCleared

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

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

func (*BouncerMutation) Featureflags added in v1.6.3

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

Featureflags returns the value of the "featureflags" field in the mutation.

func (*BouncerMutation) FeatureflagsCleared added in v1.6.3

func (m *BouncerMutation) FeatureflagsCleared() bool

FeatureflagsCleared returns if the "featureflags" field was cleared in this mutation.

func (*BouncerMutation) Field

func (m *BouncerMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BouncerMutation) FieldCleared

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

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

func (*BouncerMutation) Fields

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

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*BouncerMutation) GetType

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

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

func (*BouncerMutation) ID

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

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

func (*BouncerMutation) IDs added in v1.3.1

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

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

func (*BouncerMutation) IPAddress

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

IPAddress returns the value of the "ip_address" field in the mutation.

func (*BouncerMutation) IPAddressCleared

func (m *BouncerMutation) IPAddressCleared() bool

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

func (*BouncerMutation) LastPull

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

LastPull returns the value of the "last_pull" field in the mutation.

func (*BouncerMutation) LastPullCleared added in v1.6.3

func (m *BouncerMutation) LastPullCleared() bool

LastPullCleared returns if the "last_pull" field was cleared in this mutation.

func (*BouncerMutation) Name

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

Name returns the value of the "name" field in the mutation.

func (*BouncerMutation) OldAPIKey

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

OldAPIKey returns the old "api_key" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldAuthType added in v1.4.0

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

OldAuthType returns the old "auth_type" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldFeatureflags added in v1.6.3

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

OldFeatureflags returns the old "featureflags" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldField

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

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*BouncerMutation) OldIPAddress

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

OldIPAddress returns the old "ip_address" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldLastPull

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

OldLastPull returns the old "last_pull" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldName

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

OldName returns the old "name" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldOsname added in v1.6.3

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

OldOsname returns the old "osname" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldOsversion added in v1.6.3

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

OldOsversion returns the old "osversion" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldRevoked

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

OldRevoked returns the old "revoked" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldType

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

OldType returns the old "type" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) OldVersion

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

OldVersion returns the old "version" field's value of the Bouncer entity. If the Bouncer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BouncerMutation) Op

func (m *BouncerMutation) Op() Op

Op returns the operation name.

func (*BouncerMutation) Osname added in v1.6.3

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

Osname returns the value of the "osname" field in the mutation.

func (*BouncerMutation) OsnameCleared added in v1.6.3

func (m *BouncerMutation) OsnameCleared() bool

OsnameCleared returns if the "osname" field was cleared in this mutation.

func (*BouncerMutation) Osversion added in v1.6.3

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

Osversion returns the value of the "osversion" field in the mutation.

func (*BouncerMutation) OsversionCleared added in v1.6.3

func (m *BouncerMutation) OsversionCleared() bool

OsversionCleared returns if the "osversion" field was cleared in this mutation.

func (*BouncerMutation) RemovedEdges

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

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

func (*BouncerMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*BouncerMutation) ResetAPIKey

func (m *BouncerMutation) ResetAPIKey()

ResetAPIKey resets all changes to the "api_key" field.

func (*BouncerMutation) ResetAuthType added in v1.4.0

func (m *BouncerMutation) ResetAuthType()

ResetAuthType resets all changes to the "auth_type" field.

func (*BouncerMutation) ResetCreatedAt

func (m *BouncerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BouncerMutation) ResetEdge

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

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

func (*BouncerMutation) ResetFeatureflags added in v1.6.3

func (m *BouncerMutation) ResetFeatureflags()

ResetFeatureflags resets all changes to the "featureflags" field.

func (*BouncerMutation) ResetField

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

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

func (*BouncerMutation) ResetIPAddress

func (m *BouncerMutation) ResetIPAddress()

ResetIPAddress resets all changes to the "ip_address" field.

func (*BouncerMutation) ResetLastPull

func (m *BouncerMutation) ResetLastPull()

ResetLastPull resets all changes to the "last_pull" field.

func (*BouncerMutation) ResetName

func (m *BouncerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*BouncerMutation) ResetOsname added in v1.6.3

func (m *BouncerMutation) ResetOsname()

ResetOsname resets all changes to the "osname" field.

func (*BouncerMutation) ResetOsversion added in v1.6.3

func (m *BouncerMutation) ResetOsversion()

ResetOsversion resets all changes to the "osversion" field.

func (*BouncerMutation) ResetRevoked

func (m *BouncerMutation) ResetRevoked()

ResetRevoked resets all changes to the "revoked" field.

func (*BouncerMutation) ResetType

func (m *BouncerMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*BouncerMutation) ResetUpdatedAt

func (m *BouncerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BouncerMutation) ResetVersion

func (m *BouncerMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*BouncerMutation) Revoked

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

Revoked returns the value of the "revoked" field in the mutation.

func (*BouncerMutation) SetAPIKey

func (m *BouncerMutation) SetAPIKey(s string)

SetAPIKey sets the "api_key" field.

func (*BouncerMutation) SetAuthType added in v1.4.0

func (m *BouncerMutation) SetAuthType(s string)

SetAuthType sets the "auth_type" field.

func (*BouncerMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BouncerMutation) SetFeatureflags added in v1.6.3

func (m *BouncerMutation) SetFeatureflags(s string)

SetFeatureflags sets the "featureflags" field.

func (*BouncerMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BouncerMutation) SetIPAddress

func (m *BouncerMutation) SetIPAddress(s string)

SetIPAddress sets the "ip_address" field.

func (*BouncerMutation) SetLastPull

func (m *BouncerMutation) SetLastPull(t time.Time)

SetLastPull sets the "last_pull" field.

func (*BouncerMutation) SetName

func (m *BouncerMutation) SetName(s string)

SetName sets the "name" field.

func (*BouncerMutation) SetOp added in v1.6.1

func (m *BouncerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BouncerMutation) SetOsname added in v1.6.3

func (m *BouncerMutation) SetOsname(s string)

SetOsname sets the "osname" field.

func (*BouncerMutation) SetOsversion added in v1.6.3

func (m *BouncerMutation) SetOsversion(s string)

SetOsversion sets the "osversion" 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) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BouncerMutation) SetVersion

func (m *BouncerMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (BouncerMutation) Tx

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

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

func (*BouncerMutation) Type

func (m *BouncerMutation) Type() string

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

func (*BouncerMutation) TypeCleared

func (m *BouncerMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*BouncerMutation) UpdatedAt

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

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

func (*BouncerMutation) Version

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

Version returns the value of the "version" field in the mutation.

func (*BouncerMutation) VersionCleared

func (m *BouncerMutation) VersionCleared() bool

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

func (*BouncerMutation) Where added in v1.2.1

func (m *BouncerMutation) Where(ps ...predicate.Bouncer)

Where appends a list predicates to the BouncerMutation builder.

func (*BouncerMutation) WhereP added in v1.6.1

func (m *BouncerMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the BouncerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type BouncerQuery

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

BouncerQuery is the builder for querying Bouncer entities.

func (*BouncerQuery) Aggregate added in v1.6.1

func (bq *BouncerQuery) Aggregate(fns ...AggregateFunc) *BouncerSelect

Aggregate returns a BouncerSelect configured with the given aggregations.

func (*BouncerQuery) All

func (bq *BouncerQuery) All(ctx context.Context) ([]*Bouncer, error)

All executes the query and returns a list of Bouncers.

func (*BouncerQuery) AllX

func (bq *BouncerQuery) AllX(ctx context.Context) []*Bouncer

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

func (*BouncerQuery) Clone

func (bq *BouncerQuery) Clone() *BouncerQuery

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

func (*BouncerQuery) Count

func (bq *BouncerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BouncerQuery) CountX

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

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

func (*BouncerQuery) Exist

func (bq *BouncerQuery) Exist(ctx context.Context) (bool, error)

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

func (*BouncerQuery) ExistX

func (bq *BouncerQuery) ExistX(ctx context.Context) bool

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

func (*BouncerQuery) First

func (bq *BouncerQuery) First(ctx context.Context) (*Bouncer, error)

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

func (*BouncerQuery) FirstID

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

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

func (*BouncerQuery) FirstIDX added in v1.0.3

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

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

func (*BouncerQuery) FirstX

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

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

func (*BouncerQuery) GroupBy

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

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

Example:

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

client.Bouncer.Query().
	GroupBy(bouncer.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BouncerQuery) IDs

func (bq *BouncerQuery) IDs(ctx context.Context) (ids []int, err 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 the number of records to be returned by this query.

func (*BouncerQuery) Offset

func (bq *BouncerQuery) Offset(offset int) *BouncerQuery

Offset to start from.

func (*BouncerQuery) Only

func (bq *BouncerQuery) Only(ctx context.Context) (*Bouncer, error)

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

func (*BouncerQuery) OnlyID

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

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

func (*BouncerQuery) OnlyIDX

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

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

func (*BouncerQuery) OnlyX

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

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

func (*BouncerQuery) Order

func (bq *BouncerQuery) Order(o ...bouncer.OrderOption) *BouncerQuery

Order specifies how the records should be ordered.

func (*BouncerQuery) Select

func (bq *BouncerQuery) Select(fields ...string) *BouncerSelect

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

Example:

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

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

func (*BouncerQuery) Unique added in v1.2.1

func (bq *BouncerQuery) Unique(unique bool) *BouncerQuery

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

func (*BouncerQuery) Where

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

Where adds a new predicate for the BouncerQuery builder.

type BouncerSelect

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

BouncerSelect is the builder for selecting fields of Bouncer entities.

func (*BouncerSelect) Aggregate added in v1.6.1

func (bs *BouncerSelect) Aggregate(fns ...AggregateFunc) *BouncerSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BouncerSelect) Bool

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

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

func (*BouncerSelect) BoolX

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

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

func (*BouncerSelect) Bools

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

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

func (*BouncerSelect) BoolsX

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

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

func (*BouncerSelect) Float64

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

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

func (*BouncerSelect) Float64X

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

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

func (*BouncerSelect) Float64s

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

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

func (*BouncerSelect) Float64sX

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

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

func (*BouncerSelect) Int

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

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

func (*BouncerSelect) IntX

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

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

func (*BouncerSelect) Ints

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

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

func (*BouncerSelect) IntsX

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

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

func (*BouncerSelect) Scan

func (bs *BouncerSelect) Scan(ctx context.Context, v any) error

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

func (*BouncerSelect) ScanX

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

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

func (*BouncerSelect) String

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

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

func (*BouncerSelect) StringX

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

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

func (*BouncerSelect) Strings

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

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

func (*BouncerSelect) StringsX

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

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

type BouncerUpdate

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

BouncerUpdate is the builder for updating Bouncer entities.

func (*BouncerUpdate) ClearFeatureflags added in v1.6.3

func (bu *BouncerUpdate) ClearFeatureflags() *BouncerUpdate

ClearFeatureflags clears the value of the "featureflags" field.

func (*BouncerUpdate) ClearIPAddress

func (bu *BouncerUpdate) ClearIPAddress() *BouncerUpdate

ClearIPAddress clears the value of the "ip_address" field.

func (*BouncerUpdate) ClearLastPull added in v1.6.3

func (bu *BouncerUpdate) ClearLastPull() *BouncerUpdate

ClearLastPull clears the value of the "last_pull" field.

func (*BouncerUpdate) ClearOsname added in v1.6.3

func (bu *BouncerUpdate) ClearOsname() *BouncerUpdate

ClearOsname clears the value of the "osname" field.

func (*BouncerUpdate) ClearOsversion added in v1.6.3

func (bu *BouncerUpdate) ClearOsversion() *BouncerUpdate

ClearOsversion clears the value of the "osversion" field.

func (*BouncerUpdate) ClearType

func (bu *BouncerUpdate) ClearType() *BouncerUpdate

ClearType clears the value of the "type" field.

func (*BouncerUpdate) ClearVersion

func (bu *BouncerUpdate) ClearVersion() *BouncerUpdate

ClearVersion clears the value of the "version" field.

func (*BouncerUpdate) Exec

func (bu *BouncerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BouncerUpdate) ExecX

func (bu *BouncerUpdate) ExecX(ctx context.Context)

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

func (*BouncerUpdate) Mutation

func (bu *BouncerUpdate) Mutation() *BouncerMutation

Mutation returns the BouncerMutation object of the builder.

func (*BouncerUpdate) Save

func (bu *BouncerUpdate) Save(ctx context.Context) (int, error)

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

func (*BouncerUpdate) SaveX

func (bu *BouncerUpdate) SaveX(ctx context.Context) int

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

func (*BouncerUpdate) SetAPIKey

func (bu *BouncerUpdate) SetAPIKey(s string) *BouncerUpdate

SetAPIKey sets the "api_key" field.

func (*BouncerUpdate) SetAuthType added in v1.4.0

func (bu *BouncerUpdate) SetAuthType(s string) *BouncerUpdate

SetAuthType sets the "auth_type" field.

func (*BouncerUpdate) SetFeatureflags added in v1.6.3

func (bu *BouncerUpdate) SetFeatureflags(s string) *BouncerUpdate

SetFeatureflags sets the "featureflags" 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) SetNillableAPIKey added in v1.6.1

func (bu *BouncerUpdate) SetNillableAPIKey(s *string) *BouncerUpdate

SetNillableAPIKey sets the "api_key" field if the given value is not nil.

func (*BouncerUpdate) SetNillableAuthType added in v1.4.0

func (bu *BouncerUpdate) SetNillableAuthType(s *string) *BouncerUpdate

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

func (*BouncerUpdate) SetNillableFeatureflags added in v1.6.3

func (bu *BouncerUpdate) SetNillableFeatureflags(s *string) *BouncerUpdate

SetNillableFeatureflags sets the "featureflags" 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) SetNillableOsname added in v1.6.3

func (bu *BouncerUpdate) SetNillableOsname(s *string) *BouncerUpdate

SetNillableOsname sets the "osname" field if the given value is not nil.

func (*BouncerUpdate) SetNillableOsversion added in v1.6.3

func (bu *BouncerUpdate) SetNillableOsversion(s *string) *BouncerUpdate

SetNillableOsversion sets the "osversion" field if the given value is not nil.

func (*BouncerUpdate) SetNillableRevoked added in v1.6.1

func (bu *BouncerUpdate) SetNillableRevoked(b *bool) *BouncerUpdate

SetNillableRevoked sets the "revoked" 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) SetNillableVersion

func (bu *BouncerUpdate) SetNillableVersion(s *string) *BouncerUpdate

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

func (*BouncerUpdate) SetOsname added in v1.6.3

func (bu *BouncerUpdate) SetOsname(s string) *BouncerUpdate

SetOsname sets the "osname" field.

func (*BouncerUpdate) SetOsversion added in v1.6.3

func (bu *BouncerUpdate) SetOsversion(s string) *BouncerUpdate

SetOsversion sets the "osversion" field.

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

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

SetUpdatedAt sets the "updated_at" field.

func (*BouncerUpdate) SetVersion

func (bu *BouncerUpdate) SetVersion(s string) *BouncerUpdate

SetVersion sets the "version" field.

func (*BouncerUpdate) Where

func (bu *BouncerUpdate) Where(ps ...predicate.Bouncer) *BouncerUpdate

Where appends a list predicates to the BouncerUpdate builder.

type BouncerUpdateOne

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

BouncerUpdateOne is the builder for updating a single Bouncer entity.

func (*BouncerUpdateOne) ClearFeatureflags added in v1.6.3

func (buo *BouncerUpdateOne) ClearFeatureflags() *BouncerUpdateOne

ClearFeatureflags clears the value of the "featureflags" field.

func (*BouncerUpdateOne) ClearIPAddress

func (buo *BouncerUpdateOne) ClearIPAddress() *BouncerUpdateOne

ClearIPAddress clears the value of the "ip_address" field.

func (*BouncerUpdateOne) ClearLastPull added in v1.6.3

func (buo *BouncerUpdateOne) ClearLastPull() *BouncerUpdateOne

ClearLastPull clears the value of the "last_pull" field.

func (*BouncerUpdateOne) ClearOsname added in v1.6.3

func (buo *BouncerUpdateOne) ClearOsname() *BouncerUpdateOne

ClearOsname clears the value of the "osname" field.

func (*BouncerUpdateOne) ClearOsversion added in v1.6.3

func (buo *BouncerUpdateOne) ClearOsversion() *BouncerUpdateOne

ClearOsversion clears the value of the "osversion" field.

func (*BouncerUpdateOne) ClearType

func (buo *BouncerUpdateOne) ClearType() *BouncerUpdateOne

ClearType clears the value of the "type" field.

func (*BouncerUpdateOne) ClearVersion

func (buo *BouncerUpdateOne) ClearVersion() *BouncerUpdateOne

ClearVersion clears the value of the "version" field.

func (*BouncerUpdateOne) Exec

func (buo *BouncerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BouncerUpdateOne) ExecX

func (buo *BouncerUpdateOne) ExecX(ctx context.Context)

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

func (*BouncerUpdateOne) Mutation

func (buo *BouncerUpdateOne) Mutation() *BouncerMutation

Mutation returns the BouncerMutation object of the builder.

func (*BouncerUpdateOne) Save

func (buo *BouncerUpdateOne) Save(ctx context.Context) (*Bouncer, error)

Save executes the query and returns the updated Bouncer entity.

func (*BouncerUpdateOne) SaveX

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

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

func (*BouncerUpdateOne) Select added in v1.2.1

func (buo *BouncerUpdateOne) Select(field string, fields ...string) *BouncerUpdateOne

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

func (*BouncerUpdateOne) SetAPIKey

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

SetAPIKey sets the "api_key" field.

func (*BouncerUpdateOne) SetAuthType added in v1.4.0

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

SetAuthType sets the "auth_type" field.

func (*BouncerUpdateOne) SetFeatureflags added in v1.6.3

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

SetFeatureflags sets the "featureflags" 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) SetNillableAPIKey added in v1.6.1

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

SetNillableAPIKey sets the "api_key" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableAuthType added in v1.4.0

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

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

func (*BouncerUpdateOne) SetNillableFeatureflags added in v1.6.3

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

SetNillableFeatureflags sets the "featureflags" 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) SetNillableOsname added in v1.6.3

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

SetNillableOsname sets the "osname" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableOsversion added in v1.6.3

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

SetNillableOsversion sets the "osversion" field if the given value is not nil.

func (*BouncerUpdateOne) SetNillableRevoked added in v1.6.1

func (buo *BouncerUpdateOne) SetNillableRevoked(b *bool) *BouncerUpdateOne

SetNillableRevoked sets the "revoked" 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) SetNillableVersion

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

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

func (*BouncerUpdateOne) SetOsname added in v1.6.3

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

SetOsname sets the "osname" field.

func (*BouncerUpdateOne) SetOsversion added in v1.6.3

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

SetOsversion sets the "osversion" field.

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

func (*BouncerUpdateOne) Where added in v1.6.1

Where appends a list predicates to the BouncerUpdate builder.

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
	// ConfigItem is the client for interacting with the ConfigItem builders.
	ConfigItem *ConfigItemClient
	// Decision is the client for interacting with the Decision builders.
	Decision *DecisionClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Lock is the client for interacting with the Lock builders.
	Lock *LockClient
	// Machine is the client for interacting with the Machine builders.
	Machine *MachineClient
	// Meta is the client for interacting with the Meta builders.
	Meta *MetaClient
	// Metric is the client for interacting with the Metric builders.
	Metric *MetricClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

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

func (*Client) Intercept added in v1.6.1

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate added in v1.6.1

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConfigItem added in v1.5.0

type ConfigItem struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// Name holds the value of the "name" field.
	Name string `json:"name"`
	// Value holds the value of the "value" field.
	Value string `json:"value"`
	// contains filtered or unexported fields
}

ConfigItem is the model entity for the ConfigItem schema.

func (*ConfigItem) GetValue added in v1.6.1

func (ci *ConfigItem) GetValue(name string) (ent.Value, error)

GetValue returns the ent.Value that was dynamically selected and assigned to the ConfigItem. This includes values selected through modifiers, order, etc.

func (*ConfigItem) String added in v1.5.0

func (ci *ConfigItem) String() string

String implements the fmt.Stringer.

func (*ConfigItem) Unwrap added in v1.5.0

func (ci *ConfigItem) Unwrap() *ConfigItem

Unwrap unwraps the ConfigItem entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ConfigItem) Update added in v1.5.0

func (ci *ConfigItem) Update() *ConfigItemUpdateOne

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

type ConfigItemClient added in v1.5.0

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

ConfigItemClient is a client for the ConfigItem schema.

func NewConfigItemClient added in v1.5.0

func NewConfigItemClient(c config) *ConfigItemClient

NewConfigItemClient returns a client for the ConfigItem from the given config.

func (*ConfigItemClient) Create added in v1.5.0

func (c *ConfigItemClient) Create() *ConfigItemCreate

Create returns a builder for creating a ConfigItem entity.

func (*ConfigItemClient) CreateBulk added in v1.5.0

func (c *ConfigItemClient) CreateBulk(builders ...*ConfigItemCreate) *ConfigItemCreateBulk

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

func (*ConfigItemClient) Delete added in v1.5.0

func (c *ConfigItemClient) Delete() *ConfigItemDelete

Delete returns a delete builder for ConfigItem.

func (*ConfigItemClient) DeleteOne added in v1.5.0

func (c *ConfigItemClient) DeleteOne(ci *ConfigItem) *ConfigItemDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ConfigItemClient) DeleteOneID added in v1.5.0

func (c *ConfigItemClient) DeleteOneID(id int) *ConfigItemDeleteOne

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

func (*ConfigItemClient) Get added in v1.5.0

func (c *ConfigItemClient) Get(ctx context.Context, id int) (*ConfigItem, error)

Get returns a ConfigItem entity by its id.

func (*ConfigItemClient) GetX added in v1.5.0

func (c *ConfigItemClient) GetX(ctx context.Context, id int) *ConfigItem

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

func (*ConfigItemClient) Hooks added in v1.5.0

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

Hooks returns the client hooks.

func (*ConfigItemClient) Intercept added in v1.6.1

func (c *ConfigItemClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `configitem.Intercept(f(g(h())))`.

func (*ConfigItemClient) Interceptors added in v1.6.1

func (c *ConfigItemClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ConfigItemClient) MapCreateBulk added in v1.6.1

func (c *ConfigItemClient) MapCreateBulk(slice any, setFunc func(*ConfigItemCreate, int)) *ConfigItemCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ConfigItemClient) Query added in v1.5.0

func (c *ConfigItemClient) Query() *ConfigItemQuery

Query returns a query builder for ConfigItem.

func (*ConfigItemClient) Update added in v1.5.0

func (c *ConfigItemClient) Update() *ConfigItemUpdate

Update returns an update builder for ConfigItem.

func (*ConfigItemClient) UpdateOne added in v1.5.0

func (c *ConfigItemClient) UpdateOne(ci *ConfigItem) *ConfigItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ConfigItemClient) UpdateOneID added in v1.5.0

func (c *ConfigItemClient) UpdateOneID(id int) *ConfigItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ConfigItemClient) Use added in v1.5.0

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

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

type ConfigItemCreate added in v1.5.0

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

ConfigItemCreate is the builder for creating a ConfigItem entity.

func (*ConfigItemCreate) Exec added in v1.5.0

func (cic *ConfigItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConfigItemCreate) ExecX added in v1.5.0

func (cic *ConfigItemCreate) ExecX(ctx context.Context)

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

func (*ConfigItemCreate) Mutation added in v1.5.0

func (cic *ConfigItemCreate) Mutation() *ConfigItemMutation

Mutation returns the ConfigItemMutation object of the builder.

func (*ConfigItemCreate) Save added in v1.5.0

func (cic *ConfigItemCreate) Save(ctx context.Context) (*ConfigItem, error)

Save creates the ConfigItem in the database.

func (*ConfigItemCreate) SaveX added in v1.5.0

func (cic *ConfigItemCreate) SaveX(ctx context.Context) *ConfigItem

SaveX calls Save and panics if Save returns an error.

func (*ConfigItemCreate) SetCreatedAt added in v1.5.0

func (cic *ConfigItemCreate) SetCreatedAt(t time.Time) *ConfigItemCreate

SetCreatedAt sets the "created_at" field.

func (*ConfigItemCreate) SetName added in v1.5.0

func (cic *ConfigItemCreate) SetName(s string) *ConfigItemCreate

SetName sets the "name" field.

func (*ConfigItemCreate) SetNillableCreatedAt added in v1.5.0

func (cic *ConfigItemCreate) SetNillableCreatedAt(t *time.Time) *ConfigItemCreate

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

func (*ConfigItemCreate) SetNillableUpdatedAt added in v1.5.0

func (cic *ConfigItemCreate) SetNillableUpdatedAt(t *time.Time) *ConfigItemCreate

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

func (*ConfigItemCreate) SetUpdatedAt added in v1.5.0

func (cic *ConfigItemCreate) SetUpdatedAt(t time.Time) *ConfigItemCreate

SetUpdatedAt sets the "updated_at" field.

func (*ConfigItemCreate) SetValue added in v1.5.0

func (cic *ConfigItemCreate) SetValue(s string) *ConfigItemCreate

SetValue sets the "value" field.

type ConfigItemCreateBulk added in v1.5.0

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

ConfigItemCreateBulk is the builder for creating many ConfigItem entities in bulk.

func (*ConfigItemCreateBulk) Exec added in v1.5.0

func (cicb *ConfigItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ConfigItemCreateBulk) ExecX added in v1.5.0

func (cicb *ConfigItemCreateBulk) ExecX(ctx context.Context)

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

func (*ConfigItemCreateBulk) Save added in v1.5.0

func (cicb *ConfigItemCreateBulk) Save(ctx context.Context) ([]*ConfigItem, error)

Save creates the ConfigItem entities in the database.

func (*ConfigItemCreateBulk) SaveX added in v1.5.0

func (cicb *ConfigItemCreateBulk) SaveX(ctx context.Context) []*ConfigItem

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

type ConfigItemDelete added in v1.5.0

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

ConfigItemDelete is the builder for deleting a ConfigItem entity.

func (*ConfigItemDelete) Exec added in v1.5.0

func (cid *ConfigItemDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ConfigItemDelete) ExecX added in v1.5.0

func (cid *ConfigItemDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ConfigItemDelete) Where added in v1.5.0

Where appends a list predicates to the ConfigItemDelete builder.

type ConfigItemDeleteOne added in v1.5.0

type ConfigItemDeleteOne struct {
	// contains filtered or unexported fields
}

ConfigItemDeleteOne is the builder for deleting a single ConfigItem entity.

func (*ConfigItemDeleteOne) Exec added in v1.5.0

func (cido *ConfigItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ConfigItemDeleteOne) ExecX added in v1.5.0

func (cido *ConfigItemDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ConfigItemDeleteOne) Where added in v1.6.1

Where appends a list predicates to the ConfigItemDelete builder.

type ConfigItemGroupBy added in v1.5.0

type ConfigItemGroupBy struct {
	// contains filtered or unexported fields
}

ConfigItemGroupBy is the group-by builder for ConfigItem entities.

func (*ConfigItemGroupBy) Aggregate added in v1.5.0

func (cigb *ConfigItemGroupBy) Aggregate(fns ...AggregateFunc) *ConfigItemGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ConfigItemGroupBy) Bool added in v1.5.0

func (s *ConfigItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) BoolX added in v1.5.0

func (s *ConfigItemGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ConfigItemGroupBy) Bools added in v1.5.0

func (s *ConfigItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) BoolsX added in v1.5.0

func (s *ConfigItemGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ConfigItemGroupBy) Float64 added in v1.5.0

func (s *ConfigItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) Float64X added in v1.5.0

func (s *ConfigItemGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ConfigItemGroupBy) Float64s added in v1.5.0

func (s *ConfigItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) Float64sX added in v1.5.0

func (s *ConfigItemGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ConfigItemGroupBy) Int added in v1.5.0

func (s *ConfigItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) IntX added in v1.5.0

func (s *ConfigItemGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ConfigItemGroupBy) Ints added in v1.5.0

func (s *ConfigItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) IntsX added in v1.5.0

func (s *ConfigItemGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ConfigItemGroupBy) Scan added in v1.5.0

func (cigb *ConfigItemGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ConfigItemGroupBy) ScanX added in v1.5.0

func (s *ConfigItemGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ConfigItemGroupBy) String added in v1.5.0

func (s *ConfigItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) StringX added in v1.5.0

func (s *ConfigItemGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ConfigItemGroupBy) Strings added in v1.5.0

func (s *ConfigItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ConfigItemGroupBy) StringsX added in v1.5.0

func (s *ConfigItemGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ConfigItemMutation added in v1.5.0

type ConfigItemMutation struct {
	// contains filtered or unexported fields
}

ConfigItemMutation represents an operation that mutates the ConfigItem nodes in the graph.

func (*ConfigItemMutation) AddField added in v1.5.0

func (m *ConfigItemMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ConfigItemMutation) AddedEdges added in v1.5.0

func (m *ConfigItemMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ConfigItemMutation) AddedField added in v1.5.0

func (m *ConfigItemMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ConfigItemMutation) AddedFields added in v1.5.0

func (m *ConfigItemMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ConfigItemMutation) AddedIDs added in v1.5.0

func (m *ConfigItemMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ConfigItemMutation) ClearEdge added in v1.5.0

func (m *ConfigItemMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ConfigItemMutation) ClearField added in v1.5.0

func (m *ConfigItemMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ConfigItemMutation) ClearedEdges added in v1.5.0

func (m *ConfigItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ConfigItemMutation) ClearedFields added in v1.5.0

func (m *ConfigItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ConfigItemMutation) Client added in v1.5.0

func (m ConfigItemMutation) 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 (*ConfigItemMutation) CreatedAt added in v1.5.0

func (m *ConfigItemMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ConfigItemMutation) EdgeCleared added in v1.5.0

func (m *ConfigItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ConfigItemMutation) Field added in v1.5.0

func (m *ConfigItemMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ConfigItemMutation) FieldCleared added in v1.5.0

func (m *ConfigItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ConfigItemMutation) Fields added in v1.5.0

func (m *ConfigItemMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ConfigItemMutation) ID added in v1.5.0

func (m *ConfigItemMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ConfigItemMutation) IDs added in v1.5.0

func (m *ConfigItemMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ConfigItemMutation) Name added in v1.5.0

func (m *ConfigItemMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ConfigItemMutation) OldCreatedAt added in v1.5.0

func (m *ConfigItemMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ConfigItem entity. If the ConfigItem object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ConfigItemMutation) OldField added in v1.5.0

func (m *ConfigItemMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ConfigItemMutation) OldName added in v1.5.0

func (m *ConfigItemMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the ConfigItem entity. If the ConfigItem object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ConfigItemMutation) OldUpdatedAt added in v1.5.0

func (m *ConfigItemMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ConfigItem entity. If the ConfigItem object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ConfigItemMutation) OldValue added in v1.5.0

func (m *ConfigItemMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the ConfigItem entity. If the ConfigItem object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ConfigItemMutation) Op added in v1.5.0

func (m *ConfigItemMutation) Op() Op

Op returns the operation name.

func (*ConfigItemMutation) RemovedEdges added in v1.5.0

func (m *ConfigItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ConfigItemMutation) RemovedIDs added in v1.5.0

func (m *ConfigItemMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ConfigItemMutation) ResetCreatedAt added in v1.5.0

func (m *ConfigItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ConfigItemMutation) ResetEdge added in v1.5.0

func (m *ConfigItemMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ConfigItemMutation) ResetField added in v1.5.0

func (m *ConfigItemMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ConfigItemMutation) ResetName added in v1.5.0

func (m *ConfigItemMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ConfigItemMutation) ResetUpdatedAt added in v1.5.0

func (m *ConfigItemMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ConfigItemMutation) ResetValue added in v1.5.0

func (m *ConfigItemMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*ConfigItemMutation) SetCreatedAt added in v1.5.0

func (m *ConfigItemMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ConfigItemMutation) SetField added in v1.5.0

func (m *ConfigItemMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ConfigItemMutation) SetName added in v1.5.0

func (m *ConfigItemMutation) SetName(s string)

SetName sets the "name" field.

func (*ConfigItemMutation) SetOp added in v1.6.1

func (m *ConfigItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ConfigItemMutation) SetUpdatedAt added in v1.5.0

func (m *ConfigItemMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ConfigItemMutation) SetValue added in v1.5.0

func (m *ConfigItemMutation) SetValue(s string)

SetValue sets the "value" field.

func (ConfigItemMutation) Tx added in v1.5.0

func (m ConfigItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ConfigItemMutation) Type added in v1.5.0

func (m *ConfigItemMutation) Type() string

Type returns the node type of this mutation (ConfigItem).

func (*ConfigItemMutation) UpdatedAt added in v1.5.0

func (m *ConfigItemMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ConfigItemMutation) Value added in v1.5.0

func (m *ConfigItemMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*ConfigItemMutation) Where added in v1.5.0

func (m *ConfigItemMutation) Where(ps ...predicate.ConfigItem)

Where appends a list predicates to the ConfigItemMutation builder.

func (*ConfigItemMutation) WhereP added in v1.6.1

func (m *ConfigItemMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ConfigItemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ConfigItemQuery added in v1.5.0

type ConfigItemQuery struct {
	// contains filtered or unexported fields
}

ConfigItemQuery is the builder for querying ConfigItem entities.

func (*ConfigItemQuery) Aggregate added in v1.6.1

func (ciq *ConfigItemQuery) Aggregate(fns ...AggregateFunc) *ConfigItemSelect

Aggregate returns a ConfigItemSelect configured with the given aggregations.

func (*ConfigItemQuery) All added in v1.5.0

func (ciq *ConfigItemQuery) All(ctx context.Context) ([]*ConfigItem, error)

All executes the query and returns a list of ConfigItems.

func (*ConfigItemQuery) AllX added in v1.5.0

func (ciq *ConfigItemQuery) AllX(ctx context.Context) []*ConfigItem

AllX is like All, but panics if an error occurs.

func (*ConfigItemQuery) Clone added in v1.5.0

func (ciq *ConfigItemQuery) Clone() *ConfigItemQuery

Clone returns a duplicate of the ConfigItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ConfigItemQuery) Count added in v1.5.0

func (ciq *ConfigItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ConfigItemQuery) CountX added in v1.5.0

func (ciq *ConfigItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ConfigItemQuery) Exist added in v1.5.0

func (ciq *ConfigItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ConfigItemQuery) ExistX added in v1.5.0

func (ciq *ConfigItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ConfigItemQuery) First added in v1.5.0

func (ciq *ConfigItemQuery) First(ctx context.Context) (*ConfigItem, error)

First returns the first ConfigItem entity from the query. Returns a *NotFoundError when no ConfigItem was found.

func (*ConfigItemQuery) FirstID added in v1.5.0

func (ciq *ConfigItemQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ConfigItem ID from the query. Returns a *NotFoundError when no ConfigItem ID was found.

func (*ConfigItemQuery) FirstIDX added in v1.5.0

func (ciq *ConfigItemQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ConfigItemQuery) FirstX added in v1.5.0

func (ciq *ConfigItemQuery) FirstX(ctx context.Context) *ConfigItem

FirstX is like First, but panics if an error occurs.

func (*ConfigItemQuery) GroupBy added in v1.5.0

func (ciq *ConfigItemQuery) GroupBy(field string, fields ...string) *ConfigItemGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at"`
	Count int `json:"count,omitempty"`
}

client.ConfigItem.Query().
	GroupBy(configitem.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ConfigItemQuery) IDs added in v1.5.0

func (ciq *ConfigItemQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of ConfigItem IDs.

func (*ConfigItemQuery) IDsX added in v1.5.0

func (ciq *ConfigItemQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ConfigItemQuery) Limit added in v1.5.0

func (ciq *ConfigItemQuery) Limit(limit int) *ConfigItemQuery

Limit the number of records to be returned by this query.

func (*ConfigItemQuery) Offset added in v1.5.0

func (ciq *ConfigItemQuery) Offset(offset int) *ConfigItemQuery

Offset to start from.

func (*ConfigItemQuery) Only added in v1.5.0

func (ciq *ConfigItemQuery) Only(ctx context.Context) (*ConfigItem, error)

Only returns a single ConfigItem entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ConfigItem entity is found. Returns a *NotFoundError when no ConfigItem entities are found.

func (*ConfigItemQuery) OnlyID added in v1.5.0

func (ciq *ConfigItemQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ConfigItem ID in the query. Returns a *NotSingularError when more than one ConfigItem ID is found. Returns a *NotFoundError when no entities are found.

func (*ConfigItemQuery) OnlyIDX added in v1.5.0

func (ciq *ConfigItemQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ConfigItemQuery) OnlyX added in v1.5.0

func (ciq *ConfigItemQuery) OnlyX(ctx context.Context) *ConfigItem

OnlyX is like Only, but panics if an error occurs.

func (*ConfigItemQuery) Order added in v1.5.0

Order specifies how the records should be ordered.

func (*ConfigItemQuery) Select added in v1.5.0

func (ciq *ConfigItemQuery) Select(fields ...string) *ConfigItemSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at"`
}

client.ConfigItem.Query().
	Select(configitem.FieldCreatedAt).
	Scan(ctx, &v)

func (*ConfigItemQuery) Unique added in v1.5.0

func (ciq *ConfigItemQuery) Unique(unique bool) *ConfigItemQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ConfigItemQuery) Where added in v1.5.0

Where adds a new predicate for the ConfigItemQuery builder.

type ConfigItemSelect added in v1.5.0

type ConfigItemSelect struct {
	*ConfigItemQuery
	// contains filtered or unexported fields
}

ConfigItemSelect is the builder for selecting fields of ConfigItem entities.

func (*ConfigItemSelect) Aggregate added in v1.6.1

func (cis *ConfigItemSelect) Aggregate(fns ...AggregateFunc) *ConfigItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ConfigItemSelect) Bool added in v1.5.0

func (s *ConfigItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) BoolX added in v1.5.0

func (s *ConfigItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ConfigItemSelect) Bools added in v1.5.0

func (s *ConfigItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) BoolsX added in v1.5.0

func (s *ConfigItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ConfigItemSelect) Float64 added in v1.5.0

func (s *ConfigItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) Float64X added in v1.5.0

func (s *ConfigItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ConfigItemSelect) Float64s added in v1.5.0

func (s *ConfigItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) Float64sX added in v1.5.0

func (s *ConfigItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ConfigItemSelect) Int added in v1.5.0

func (s *ConfigItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) IntX added in v1.5.0

func (s *ConfigItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ConfigItemSelect) Ints added in v1.5.0

func (s *ConfigItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) IntsX added in v1.5.0

func (s *ConfigItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ConfigItemSelect) Scan added in v1.5.0

func (cis *ConfigItemSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ConfigItemSelect) ScanX added in v1.5.0

func (s *ConfigItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ConfigItemSelect) String added in v1.5.0

func (s *ConfigItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) StringX added in v1.5.0

func (s *ConfigItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ConfigItemSelect) Strings added in v1.5.0

func (s *ConfigItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ConfigItemSelect) StringsX added in v1.5.0

func (s *ConfigItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ConfigItemUpdate added in v1.5.0

type ConfigItemUpdate struct {
	// contains filtered or unexported fields
}

ConfigItemUpdate is the builder for updating ConfigItem entities.

func (*ConfigItemUpdate) Exec added in v1.5.0

func (ciu *ConfigItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConfigItemUpdate) ExecX added in v1.5.0

func (ciu *ConfigItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ConfigItemUpdate) Mutation added in v1.5.0

func (ciu *ConfigItemUpdate) Mutation() *ConfigItemMutation

Mutation returns the ConfigItemMutation object of the builder.

func (*ConfigItemUpdate) Save added in v1.5.0

func (ciu *ConfigItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ConfigItemUpdate) SaveX added in v1.5.0

func (ciu *ConfigItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ConfigItemUpdate) SetNillableValue added in v1.6.1

func (ciu *ConfigItemUpdate) SetNillableValue(s *string) *ConfigItemUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*ConfigItemUpdate) SetUpdatedAt added in v1.5.0

func (ciu *ConfigItemUpdate) SetUpdatedAt(t time.Time) *ConfigItemUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ConfigItemUpdate) SetValue added in v1.5.0

func (ciu *ConfigItemUpdate) SetValue(s string) *ConfigItemUpdate

SetValue sets the "value" field.

func (*ConfigItemUpdate) Where added in v1.5.0

Where appends a list predicates to the ConfigItemUpdate builder.

type ConfigItemUpdateOne added in v1.5.0

type ConfigItemUpdateOne struct {
	// contains filtered or unexported fields
}

ConfigItemUpdateOne is the builder for updating a single ConfigItem entity.

func (*ConfigItemUpdateOne) Exec added in v1.5.0

func (ciuo *ConfigItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ConfigItemUpdateOne) ExecX added in v1.5.0

func (ciuo *ConfigItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ConfigItemUpdateOne) Mutation added in v1.5.0

func (ciuo *ConfigItemUpdateOne) Mutation() *ConfigItemMutation

Mutation returns the ConfigItemMutation object of the builder.

func (*ConfigItemUpdateOne) Save added in v1.5.0

func (ciuo *ConfigItemUpdateOne) Save(ctx context.Context) (*ConfigItem, error)

Save executes the query and returns the updated ConfigItem entity.

func (*ConfigItemUpdateOne) SaveX added in v1.5.0

func (ciuo *ConfigItemUpdateOne) SaveX(ctx context.Context) *ConfigItem

SaveX is like Save, but panics if an error occurs.

func (*ConfigItemUpdateOne) Select added in v1.5.0

func (ciuo *ConfigItemUpdateOne) Select(field string, fields ...string) *ConfigItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ConfigItemUpdateOne) SetNillableValue added in v1.6.1

func (ciuo *ConfigItemUpdateOne) SetNillableValue(s *string) *ConfigItemUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*ConfigItemUpdateOne) SetUpdatedAt added in v1.5.0

func (ciuo *ConfigItemUpdateOne) SetUpdatedAt(t time.Time) *ConfigItemUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ConfigItemUpdateOne) SetValue added in v1.5.0

func (ciuo *ConfigItemUpdateOne) SetValue(s string) *ConfigItemUpdateOne

SetValue sets the "value" field.

func (*ConfigItemUpdateOne) Where added in v1.6.1

Where appends a list predicates to the ConfigItemUpdate builder.

type ConfigItems added in v1.5.0

type ConfigItems []*ConfigItem

ConfigItems is a parsable slice of ConfigItem.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Decision

type Decision struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Until holds the value of the "until" field.
	Until *time.Time `json:"until,omitempty"`
	// Scenario holds the value of the "scenario" field.
	Scenario string `json:"scenario,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// StartIP holds the value of the "start_ip" field.
	StartIP int64 `json:"start_ip,omitempty"`
	// EndIP holds the value of the "end_ip" field.
	EndIP int64 `json:"end_ip,omitempty"`
	// StartSuffix holds the value of the "start_suffix" field.
	StartSuffix int64 `json:"start_suffix,omitempty"`
	// EndSuffix holds the value of the "end_suffix" field.
	EndSuffix int64 `json:"end_suffix,omitempty"`
	// IPSize holds the value of the "ip_size" field.
	IPSize int64 `json:"ip_size,omitempty"`
	// Scope holds the value of the "scope" field.
	Scope string `json:"scope,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Origin holds the value of the "origin" field.
	Origin string `json:"origin,omitempty"`
	// Simulated holds the value of the "simulated" field.
	Simulated bool `json:"simulated,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID string `json:"uuid,omitempty"`
	// AlertDecisions holds the value of the "alert_decisions" field.
	AlertDecisions int `json:"alert_decisions,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) GetValue added in v1.6.1

func (d *Decision) GetValue(name string) (ent.Value, error)

GetValue returns the ent.Value that was dynamically selected and assigned to the Decision. This includes values selected through modifiers, order, etc.

func (*Decision) QueryOwner

func (d *Decision) QueryOwner() *AlertQuery

QueryOwner queries the "owner" edge of the Decision entity.

func (*Decision) String

func (d *Decision) String() string

String implements the fmt.Stringer.

func (*Decision) Unwrap

func (d *Decision) Unwrap() *Decision

Unwrap unwraps the Decision entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Decision) Update

func (d *Decision) Update() *DecisionUpdateOne

Update returns a builder for updating this Decision. Note that you need to call Decision.Unwrap() before calling this method if this Decision was returned from a transaction, and the transaction was committed or rolled back.

type DecisionClient

type DecisionClient struct {
	// contains filtered or unexported fields
}

DecisionClient is a client for the Decision schema.

func NewDecisionClient

func NewDecisionClient(c config) *DecisionClient

NewDecisionClient returns a client for the Decision from the given config.

func (*DecisionClient) Create

func (c *DecisionClient) Create() *DecisionCreate

Create returns a builder for creating a Decision entity.

func (*DecisionClient) CreateBulk

func (c *DecisionClient) CreateBulk(builders ...*DecisionCreate) *DecisionCreateBulk

CreateBulk returns a builder for creating a bulk of Decision entities.

func (*DecisionClient) Delete

func (c *DecisionClient) Delete() *DecisionDelete

Delete returns a delete builder for Decision.

func (*DecisionClient) DeleteOne

func (c *DecisionClient) DeleteOne(d *Decision) *DecisionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DecisionClient) DeleteOneID

func (c *DecisionClient) DeleteOneID(id int) *DecisionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DecisionClient) Get

func (c *DecisionClient) Get(ctx context.Context, id int) (*Decision, error)

Get returns a Decision entity by its id.

func (*DecisionClient) GetX

func (c *DecisionClient) GetX(ctx context.Context, id int) *Decision

GetX is like Get, but panics if an error occurs.

func (*DecisionClient) Hooks

func (c *DecisionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DecisionClient) Intercept added in v1.6.1

func (c *DecisionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `decision.Intercept(f(g(h())))`.

func (*DecisionClient) Interceptors added in v1.6.1

func (c *DecisionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DecisionClient) MapCreateBulk added in v1.6.1

func (c *DecisionClient) MapCreateBulk(slice any, setFunc func(*DecisionCreate, int)) *DecisionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DecisionClient) Query

func (c *DecisionClient) Query() *DecisionQuery

Query returns a query builder for Decision.

func (*DecisionClient) QueryOwner

func (c *DecisionClient) QueryOwner(d *Decision) *AlertQuery

QueryOwner queries the owner edge of a Decision.

func (*DecisionClient) Update

func (c *DecisionClient) Update() *DecisionUpdate

Update returns an update builder for Decision.

func (*DecisionClient) UpdateOne

func (c *DecisionClient) UpdateOne(d *Decision) *DecisionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DecisionClient) UpdateOneID

func (c *DecisionClient) UpdateOneID(id int) *DecisionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DecisionClient) Use

func (c *DecisionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `decision.Hooks(f(g(h())))`.

type DecisionCreate

type DecisionCreate struct {
	// contains filtered or unexported fields
}

DecisionCreate is the builder for creating a Decision entity.

func (*DecisionCreate) Exec added in v1.2.1

func (dc *DecisionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DecisionCreate) ExecX added in v1.2.1

func (dc *DecisionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DecisionCreate) Mutation

func (dc *DecisionCreate) Mutation() *DecisionMutation

Mutation returns the DecisionMutation object of the builder.

func (*DecisionCreate) Save

func (dc *DecisionCreate) Save(ctx context.Context) (*Decision, error)

Save creates the Decision in the database.

func (*DecisionCreate) SaveX

func (dc *DecisionCreate) SaveX(ctx context.Context) *Decision

SaveX calls Save and panics if Save returns an error.

func (*DecisionCreate) SetAlertDecisions added in v1.5.0

func (dc *DecisionCreate) SetAlertDecisions(i int) *DecisionCreate

SetAlertDecisions sets the "alert_decisions" field.

func (*DecisionCreate) SetCreatedAt

func (dc *DecisionCreate) SetCreatedAt(t time.Time) *DecisionCreate

SetCreatedAt sets the "created_at" field.

func (*DecisionCreate) SetEndIP

func (dc *DecisionCreate) SetEndIP(i int64) *DecisionCreate

SetEndIP sets the "end_ip" field.

func (*DecisionCreate) SetEndSuffix added in v1.0.3

func (dc *DecisionCreate) SetEndSuffix(i int64) *DecisionCreate

SetEndSuffix sets the "end_suffix" field.

func (*DecisionCreate) SetIPSize added in v1.0.3

func (dc *DecisionCreate) SetIPSize(i int64) *DecisionCreate

SetIPSize sets the "ip_size" field.

func (*DecisionCreate) SetNillableAlertDecisions added in v1.5.0

func (dc *DecisionCreate) SetNillableAlertDecisions(i *int) *DecisionCreate

SetNillableAlertDecisions sets the "alert_decisions" field if the given value is not nil.

func (*DecisionCreate) SetNillableCreatedAt

func (dc *DecisionCreate) SetNillableCreatedAt(t *time.Time) *DecisionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DecisionCreate) SetNillableEndIP

func (dc *DecisionCreate) SetNillableEndIP(i *int64) *DecisionCreate

SetNillableEndIP sets the "end_ip" field if the given value is not nil.

func (*DecisionCreate) SetNillableEndSuffix added in v1.0.3

func (dc *DecisionCreate) SetNillableEndSuffix(i *int64) *DecisionCreate

SetNillableEndSuffix sets the "end_suffix" field if the given value is not nil.

func (*DecisionCreate) SetNillableIPSize added in v1.0.3

func (dc *DecisionCreate) SetNillableIPSize(i *int64) *DecisionCreate

SetNillableIPSize sets the "ip_size" field if the given value is not nil.

func (*DecisionCreate) SetNillableOwnerID

func (dc *DecisionCreate) SetNillableOwnerID(id *int) *DecisionCreate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*DecisionCreate) SetNillableSimulated

func (dc *DecisionCreate) SetNillableSimulated(b *bool) *DecisionCreate

SetNillableSimulated sets the "simulated" field if the given value is not nil.

func (*DecisionCreate) SetNillableStartIP

func (dc *DecisionCreate) SetNillableStartIP(i *int64) *DecisionCreate

SetNillableStartIP sets the "start_ip" field if the given value is not nil.

func (*DecisionCreate) SetNillableStartSuffix added in v1.0.3

func (dc *DecisionCreate) SetNillableStartSuffix(i *int64) *DecisionCreate

SetNillableStartSuffix sets the "start_suffix" field if the given value is not nil.

func (*DecisionCreate) SetNillableUUID added in v1.5.0

func (dc *DecisionCreate) SetNillableUUID(s *string) *DecisionCreate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DecisionCreate) SetNillableUntil added in v1.3.4

func (dc *DecisionCreate) SetNillableUntil(t *time.Time) *DecisionCreate

SetNillableUntil sets the "until" field if the given value is not nil.

func (*DecisionCreate) SetNillableUpdatedAt

func (dc *DecisionCreate) SetNillableUpdatedAt(t *time.Time) *DecisionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*DecisionCreate) SetOrigin

func (dc *DecisionCreate) SetOrigin(s string) *DecisionCreate

SetOrigin sets the "origin" field.

func (*DecisionCreate) SetOwner

func (dc *DecisionCreate) SetOwner(a *Alert) *DecisionCreate

SetOwner sets the "owner" edge to the Alert entity.

func (*DecisionCreate) SetOwnerID

func (dc *DecisionCreate) SetOwnerID(id int) *DecisionCreate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*DecisionCreate) SetScenario

func (dc *DecisionCreate) SetScenario(s string) *DecisionCreate

SetScenario sets the "scenario" field.

func (*DecisionCreate) SetScope

func (dc *DecisionCreate) SetScope(s string) *DecisionCreate

SetScope sets the "scope" field.

func (*DecisionCreate) SetSimulated

func (dc *DecisionCreate) SetSimulated(b bool) *DecisionCreate

SetSimulated sets the "simulated" field.

func (*DecisionCreate) SetStartIP

func (dc *DecisionCreate) SetStartIP(i int64) *DecisionCreate

SetStartIP sets the "start_ip" field.

func (*DecisionCreate) SetStartSuffix added in v1.0.3

func (dc *DecisionCreate) SetStartSuffix(i int64) *DecisionCreate

SetStartSuffix sets the "start_suffix" field.

func (*DecisionCreate) SetType

func (dc *DecisionCreate) SetType(s string) *DecisionCreate

SetType sets the "type" field.

func (*DecisionCreate) SetUUID added in v1.5.0

func (dc *DecisionCreate) SetUUID(s string) *DecisionCreate

SetUUID sets the "uuid" field.

func (*DecisionCreate) SetUntil

func (dc *DecisionCreate) SetUntil(t time.Time) *DecisionCreate

SetUntil sets the "until" field.

func (*DecisionCreate) SetUpdatedAt

func (dc *DecisionCreate) SetUpdatedAt(t time.Time) *DecisionCreate

SetUpdatedAt sets the "updated_at" field.

func (*DecisionCreate) SetValue

func (dc *DecisionCreate) SetValue(s string) *DecisionCreate

SetValue sets the "value" field.

type DecisionCreateBulk

type DecisionCreateBulk struct {
	// contains filtered or unexported fields
}

DecisionCreateBulk is the builder for creating many Decision entities in bulk.

func (*DecisionCreateBulk) Exec added in v1.2.1

func (dcb *DecisionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DecisionCreateBulk) ExecX added in v1.2.1

func (dcb *DecisionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DecisionCreateBulk) Save

func (dcb *DecisionCreateBulk) Save(ctx context.Context) ([]*Decision, error)

Save creates the Decision entities in the database.

func (*DecisionCreateBulk) SaveX

func (dcb *DecisionCreateBulk) SaveX(ctx context.Context) []*Decision

SaveX is like Save, but panics if an error occurs.

type DecisionDelete

type DecisionDelete struct {
	// contains filtered or unexported fields
}

DecisionDelete is the builder for deleting a Decision entity.

func (*DecisionDelete) Exec

func (dd *DecisionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DecisionDelete) ExecX

func (dd *DecisionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DecisionDelete) Where

func (dd *DecisionDelete) Where(ps ...predicate.Decision) *DecisionDelete

Where appends a list predicates to the DecisionDelete builder.

type DecisionDeleteOne

type DecisionDeleteOne struct {
	// contains filtered or unexported fields
}

DecisionDeleteOne is the builder for deleting a single Decision entity.

func (*DecisionDeleteOne) Exec

func (ddo *DecisionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DecisionDeleteOne) ExecX

func (ddo *DecisionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DecisionDeleteOne) Where added in v1.6.1

Where appends a list predicates to the DecisionDelete builder.

type DecisionEdges

type DecisionEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Alert `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

DecisionEdges holds the relations/edges for other nodes in the graph.

func (DecisionEdges) OwnerOrErr

func (e DecisionEdges) OwnerOrErr() (*Alert, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type DecisionGroupBy

type DecisionGroupBy struct {
	// contains filtered or unexported fields
}

DecisionGroupBy is the group-by builder for Decision entities.

func (*DecisionGroupBy) Aggregate

func (dgb *DecisionGroupBy) Aggregate(fns ...AggregateFunc) *DecisionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DecisionGroupBy) Bool

func (s *DecisionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) BoolX

func (s *DecisionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DecisionGroupBy) Bools

func (s *DecisionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) BoolsX

func (s *DecisionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DecisionGroupBy) Float64

func (s *DecisionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) Float64X

func (s *DecisionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DecisionGroupBy) Float64s

func (s *DecisionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) Float64sX

func (s *DecisionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DecisionGroupBy) Int

func (s *DecisionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) IntX

func (s *DecisionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DecisionGroupBy) Ints

func (s *DecisionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) IntsX

func (s *DecisionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DecisionGroupBy) Scan

func (dgb *DecisionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DecisionGroupBy) ScanX

func (s *DecisionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DecisionGroupBy) String

func (s *DecisionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) StringX

func (s *DecisionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DecisionGroupBy) Strings

func (s *DecisionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DecisionGroupBy) StringsX

func (s *DecisionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DecisionMutation

type DecisionMutation struct {
	// contains filtered or unexported fields
}

DecisionMutation represents an operation that mutates the Decision nodes in the graph.

func (*DecisionMutation) AddEndIP

func (m *DecisionMutation) AddEndIP(i int64)

AddEndIP adds i to the "end_ip" field.

func (*DecisionMutation) AddEndSuffix added in v1.0.3

func (m *DecisionMutation) AddEndSuffix(i int64)

AddEndSuffix adds i to the "end_suffix" field.

func (*DecisionMutation) AddField

func (m *DecisionMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DecisionMutation) AddIPSize added in v1.0.3

func (m *DecisionMutation) AddIPSize(i int64)

AddIPSize adds i to the "ip_size" field.

func (*DecisionMutation) AddStartIP

func (m *DecisionMutation) AddStartIP(i int64)

AddStartIP adds i to the "start_ip" field.

func (*DecisionMutation) AddStartSuffix added in v1.0.3

func (m *DecisionMutation) AddStartSuffix(i int64)

AddStartSuffix adds i to the "start_suffix" field.

func (*DecisionMutation) AddedEdges

func (m *DecisionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DecisionMutation) AddedEndIP

func (m *DecisionMutation) AddedEndIP() (r int64, exists bool)

AddedEndIP returns the value that was added to the "end_ip" field in this mutation.

func (*DecisionMutation) AddedEndSuffix added in v1.0.3

func (m *DecisionMutation) AddedEndSuffix() (r int64, exists bool)

AddedEndSuffix returns the value that was added to the "end_suffix" field in this mutation.

func (*DecisionMutation) AddedField

func (m *DecisionMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DecisionMutation) AddedFields

func (m *DecisionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DecisionMutation) AddedIDs

func (m *DecisionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DecisionMutation) AddedIPSize added in v1.0.3

func (m *DecisionMutation) AddedIPSize() (r int64, exists bool)

AddedIPSize returns the value that was added to the "ip_size" field in this mutation.

func (*DecisionMutation) AddedStartIP

func (m *DecisionMutation) AddedStartIP() (r int64, exists bool)

AddedStartIP returns the value that was added to the "start_ip" field in this mutation.

func (*DecisionMutation) AddedStartSuffix added in v1.0.3

func (m *DecisionMutation) AddedStartSuffix() (r int64, exists bool)

AddedStartSuffix returns the value that was added to the "start_suffix" field in this mutation.

func (*DecisionMutation) AlertDecisions added in v1.5.0

func (m *DecisionMutation) AlertDecisions() (r int, exists bool)

AlertDecisions returns the value of the "alert_decisions" field in the mutation.

func (*DecisionMutation) AlertDecisionsCleared added in v1.5.0

func (m *DecisionMutation) AlertDecisionsCleared() bool

AlertDecisionsCleared returns if the "alert_decisions" field was cleared in this mutation.

func (*DecisionMutation) ClearAlertDecisions added in v1.5.0

func (m *DecisionMutation) ClearAlertDecisions()

ClearAlertDecisions clears the value of the "alert_decisions" field.

func (*DecisionMutation) ClearEdge

func (m *DecisionMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*DecisionMutation) ClearEndIP

func (m *DecisionMutation) ClearEndIP()

ClearEndIP clears the value of the "end_ip" field.

func (*DecisionMutation) ClearEndSuffix added in v1.0.3

func (m *DecisionMutation) ClearEndSuffix()

ClearEndSuffix clears the value of the "end_suffix" field.

func (*DecisionMutation) ClearField

func (m *DecisionMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*DecisionMutation) ClearIPSize added in v1.0.3

func (m *DecisionMutation) ClearIPSize()

ClearIPSize clears the value of the "ip_size" field.

func (*DecisionMutation) ClearOwner

func (m *DecisionMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Alert entity.

func (*DecisionMutation) ClearStartIP

func (m *DecisionMutation) ClearStartIP()

ClearStartIP clears the value of the "start_ip" field.

func (*DecisionMutation) ClearStartSuffix added in v1.0.3

func (m *DecisionMutation) ClearStartSuffix()

ClearStartSuffix clears the value of the "start_suffix" field.

func (*DecisionMutation) ClearUUID added in v1.5.0

func (m *DecisionMutation) ClearUUID()

ClearUUID clears the value of the "uuid" field.

func (*DecisionMutation) ClearUntil added in v1.3.4

func (m *DecisionMutation) ClearUntil()

ClearUntil clears the value of the "until" field.

func (*DecisionMutation) ClearedEdges

func (m *DecisionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DecisionMutation) ClearedFields

func (m *DecisionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DecisionMutation) Client

func (m DecisionMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*DecisionMutation) CreatedAt

func (m *DecisionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DecisionMutation) EdgeCleared

func (m *DecisionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DecisionMutation) EndIP

func (m *DecisionMutation) EndIP() (r int64, exists bool)

EndIP returns the value of the "end_ip" field in the mutation.

func (*DecisionMutation) EndIPCleared

func (m *DecisionMutation) EndIPCleared() bool

EndIPCleared returns if the "end_ip" field was cleared in this mutation.

func (*DecisionMutation) EndSuffix added in v1.0.3

func (m *DecisionMutation) EndSuffix() (r int64, exists bool)

EndSuffix returns the value of the "end_suffix" field in the mutation.

func (*DecisionMutation) EndSuffixCleared added in v1.0.3

func (m *DecisionMutation) EndSuffixCleared() bool

EndSuffixCleared returns if the "end_suffix" field was cleared in this mutation.

func (*DecisionMutation) Field

func (m *DecisionMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DecisionMutation) FieldCleared

func (m *DecisionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DecisionMutation) Fields

func (m *DecisionMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*DecisionMutation) GetType

func (m *DecisionMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*DecisionMutation) ID

func (m *DecisionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*DecisionMutation) IDs added in v1.3.1

func (m *DecisionMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DecisionMutation) IPSize added in v1.0.3

func (m *DecisionMutation) IPSize() (r int64, exists bool)

IPSize returns the value of the "ip_size" field in the mutation.

func (*DecisionMutation) IPSizeCleared added in v1.0.3

func (m *DecisionMutation) IPSizeCleared() bool

IPSizeCleared returns if the "ip_size" field was cleared in this mutation.

func (*DecisionMutation) OldAlertDecisions added in v1.5.0

func (m *DecisionMutation) OldAlertDecisions(ctx context.Context) (v int, err error)

OldAlertDecisions returns the old "alert_decisions" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldCreatedAt

func (m *DecisionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldEndIP

func (m *DecisionMutation) OldEndIP(ctx context.Context) (v int64, err error)

OldEndIP returns the old "end_ip" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldEndSuffix added in v1.0.3

func (m *DecisionMutation) OldEndSuffix(ctx context.Context) (v int64, err error)

OldEndSuffix returns the old "end_suffix" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldField

func (m *DecisionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*DecisionMutation) OldIPSize added in v1.0.3

func (m *DecisionMutation) OldIPSize(ctx context.Context) (v int64, err error)

OldIPSize returns the old "ip_size" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldOrigin

func (m *DecisionMutation) OldOrigin(ctx context.Context) (v string, err error)

OldOrigin returns the old "origin" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldScenario

func (m *DecisionMutation) OldScenario(ctx context.Context) (v string, err error)

OldScenario returns the old "scenario" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldScope

func (m *DecisionMutation) OldScope(ctx context.Context) (v string, err error)

OldScope returns the old "scope" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldSimulated

func (m *DecisionMutation) OldSimulated(ctx context.Context) (v bool, err error)

OldSimulated returns the old "simulated" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldStartIP

func (m *DecisionMutation) OldStartIP(ctx context.Context) (v int64, err error)

OldStartIP returns the old "start_ip" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldStartSuffix added in v1.0.3

func (m *DecisionMutation) OldStartSuffix(ctx context.Context) (v int64, err error)

OldStartSuffix returns the old "start_suffix" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldType

func (m *DecisionMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldUUID added in v1.5.0

func (m *DecisionMutation) OldUUID(ctx context.Context) (v string, err error)

OldUUID returns the old "uuid" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldUntil

func (m *DecisionMutation) OldUntil(ctx context.Context) (v *time.Time, err error)

OldUntil returns the old "until" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldUpdatedAt

func (m *DecisionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) OldValue

func (m *DecisionMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the Decision entity. If the Decision object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DecisionMutation) Op

func (m *DecisionMutation) Op() Op

Op returns the operation name.

func (*DecisionMutation) Origin

func (m *DecisionMutation) Origin() (r string, exists bool)

Origin returns the value of the "origin" field in the mutation.

func (*DecisionMutation) OwnerCleared

func (m *DecisionMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Alert entity was cleared.

func (*DecisionMutation) OwnerID

func (m *DecisionMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*DecisionMutation) OwnerIDs

func (m *DecisionMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*DecisionMutation) RemovedEdges

func (m *DecisionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DecisionMutation) RemovedIDs

func (m *DecisionMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*DecisionMutation) ResetAlertDecisions added in v1.5.0

func (m *DecisionMutation) ResetAlertDecisions()

ResetAlertDecisions resets all changes to the "alert_decisions" field.

func (*DecisionMutation) ResetCreatedAt

func (m *DecisionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DecisionMutation) ResetEdge

func (m *DecisionMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*DecisionMutation) ResetEndIP

func (m *DecisionMutation) ResetEndIP()

ResetEndIP resets all changes to the "end_ip" field.

func (*DecisionMutation) ResetEndSuffix added in v1.0.3

func (m *DecisionMutation) ResetEndSuffix()

ResetEndSuffix resets all changes to the "end_suffix" field.

func (*DecisionMutation) ResetField

func (m *DecisionMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*DecisionMutation) ResetIPSize added in v1.0.3

func (m *DecisionMutation) ResetIPSize()

ResetIPSize resets all changes to the "ip_size" field.

func (*DecisionMutation) ResetOrigin

func (m *DecisionMutation) ResetOrigin()

ResetOrigin resets all changes to the "origin" field.

func (*DecisionMutation) ResetOwner

func (m *DecisionMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*DecisionMutation) ResetScenario

func (m *DecisionMutation) ResetScenario()

ResetScenario resets all changes to the "scenario" field.

func (*DecisionMutation) ResetScope

func (m *DecisionMutation) ResetScope()

ResetScope resets all changes to the "scope" field.

func (*DecisionMutation) ResetSimulated

func (m *DecisionMutation) ResetSimulated()

ResetSimulated resets all changes to the "simulated" field.

func (*DecisionMutation) ResetStartIP

func (m *DecisionMutation) ResetStartIP()

ResetStartIP resets all changes to the "start_ip" field.

func (*DecisionMutation) ResetStartSuffix added in v1.0.3

func (m *DecisionMutation) ResetStartSuffix()

ResetStartSuffix resets all changes to the "start_suffix" field.

func (*DecisionMutation) ResetType

func (m *DecisionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*DecisionMutation) ResetUUID added in v1.5.0

func (m *DecisionMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*DecisionMutation) ResetUntil

func (m *DecisionMutation) ResetUntil()

ResetUntil resets all changes to the "until" field.

func (*DecisionMutation) ResetUpdatedAt

func (m *DecisionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DecisionMutation) ResetValue

func (m *DecisionMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*DecisionMutation) Scenario

func (m *DecisionMutation) Scenario() (r string, exists bool)

Scenario returns the value of the "scenario" field in the mutation.

func (*DecisionMutation) Scope

func (m *DecisionMutation) Scope() (r string, exists bool)

Scope returns the value of the "scope" field in the mutation.

func (*DecisionMutation) SetAlertDecisions added in v1.5.0

func (m *DecisionMutation) SetAlertDecisions(i int)

SetAlertDecisions sets the "alert_decisions" field.

func (*DecisionMutation) SetCreatedAt

func (m *DecisionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DecisionMutation) SetEndIP

func (m *DecisionMutation) SetEndIP(i int64)

SetEndIP sets the "end_ip" field.

func (*DecisionMutation) SetEndSuffix added in v1.0.3

func (m *DecisionMutation) SetEndSuffix(i int64)

SetEndSuffix sets the "end_suffix" field.

func (*DecisionMutation) SetField

func (m *DecisionMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DecisionMutation) SetIPSize added in v1.0.3

func (m *DecisionMutation) SetIPSize(i int64)

SetIPSize sets the "ip_size" field.

func (*DecisionMutation) SetOp added in v1.6.1

func (m *DecisionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DecisionMutation) SetOrigin

func (m *DecisionMutation) SetOrigin(s string)

SetOrigin sets the "origin" field.

func (*DecisionMutation) SetOwnerID

func (m *DecisionMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Alert entity by id.

func (*DecisionMutation) SetScenario

func (m *DecisionMutation) SetScenario(s string)

SetScenario sets the "scenario" field.

func (*DecisionMutation) SetScope

func (m *DecisionMutation) SetScope(s string)

SetScope sets the "scope" field.

func (*DecisionMutation) SetSimulated

func (m *DecisionMutation) SetSimulated(b bool)

SetSimulated sets the "simulated" field.

func (*DecisionMutation) SetStartIP

func (m *DecisionMutation) SetStartIP(i int64)

SetStartIP sets the "start_ip" field.

func (*DecisionMutation) SetStartSuffix added in v1.0.3

func (m *DecisionMutation) SetStartSuffix(i int64)

SetStartSuffix sets the "start_suffix" field.

func (*DecisionMutation) SetType

func (m *DecisionMutation) SetType(s string)

SetType sets the "type" field.

func (*DecisionMutation) SetUUID added in v1.5.0

func (m *DecisionMutation) SetUUID(s string)

SetUUID sets the "uuid" field.

func (*DecisionMutation) SetUntil

func (m *DecisionMutation) SetUntil(t time.Time)

SetUntil sets the "until" field.

func (*DecisionMutation) SetUpdatedAt

func (m *DecisionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*DecisionMutation) SetValue

func (m *DecisionMutation) SetValue(s string)

SetValue sets the "value" field.

func (*DecisionMutation) Simulated

func (m *DecisionMutation) Simulated() (r bool, exists bool)

Simulated returns the value of the "simulated" field in the mutation.

func (*DecisionMutation) StartIP

func (m *DecisionMutation) StartIP() (r int64, exists bool)

StartIP returns the value of the "start_ip" field in the mutation.

func (*DecisionMutation) StartIPCleared

func (m *DecisionMutation) StartIPCleared() bool

StartIPCleared returns if the "start_ip" field was cleared in this mutation.

func (*DecisionMutation) StartSuffix added in v1.0.3

func (m *DecisionMutation) StartSuffix() (r int64, exists bool)

StartSuffix returns the value of the "start_suffix" field in the mutation.

func (*DecisionMutation) StartSuffixCleared added in v1.0.3

func (m *DecisionMutation) StartSuffixCleared() bool

StartSuffixCleared returns if the "start_suffix" field was cleared in this mutation.

func (DecisionMutation) Tx

func (m DecisionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DecisionMutation) Type

func (m *DecisionMutation) Type() string

Type returns the node type of this mutation (Decision).

func (*DecisionMutation) UUID added in v1.5.0

func (m *DecisionMutation) UUID() (r string, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*DecisionMutation) UUIDCleared added in v1.5.0

func (m *DecisionMutation) UUIDCleared() bool

UUIDCleared returns if the "uuid" field was cleared in this mutation.

func (*DecisionMutation) Until

func (m *DecisionMutation) Until() (r time.Time, exists bool)

Until returns the value of the "until" field in the mutation.

func (*DecisionMutation) UntilCleared added in v1.3.4

func (m *DecisionMutation) UntilCleared() bool

UntilCleared returns if the "until" field was cleared in this mutation.

func (*DecisionMutation) UpdatedAt

func (m *DecisionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*DecisionMutation) Value

func (m *DecisionMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*DecisionMutation) Where added in v1.2.1

func (m *DecisionMutation) Where(ps ...predicate.Decision)

Where appends a list predicates to the DecisionMutation builder.

func (*DecisionMutation) WhereP added in v1.6.1

func (m *DecisionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DecisionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DecisionQuery

type DecisionQuery struct {
	// contains filtered or unexported fields
}

DecisionQuery is the builder for querying Decision entities.

func (*DecisionQuery) Aggregate added in v1.6.1

func (dq *DecisionQuery) Aggregate(fns ...AggregateFunc) *DecisionSelect

Aggregate returns a DecisionSelect configured with the given aggregations.

func (*DecisionQuery) All

func (dq *DecisionQuery) All(ctx context.Context) ([]*Decision, error)

All executes the query and returns a list of Decisions.

func (*DecisionQuery) AllX

func (dq *DecisionQuery) AllX(ctx context.Context) []*Decision

AllX is like All, but panics if an error occurs.

func (*DecisionQuery) Clone

func (dq *DecisionQuery) Clone() *DecisionQuery

Clone returns a duplicate of the DecisionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DecisionQuery) Count

func (dq *DecisionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DecisionQuery) CountX

func (dq *DecisionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DecisionQuery) Exist

func (dq *DecisionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DecisionQuery) ExistX

func (dq *DecisionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DecisionQuery) First

func (dq *DecisionQuery) First(ctx context.Context) (*Decision, error)

First returns the first Decision entity from the query. Returns a *NotFoundError when no Decision was found.

func (*DecisionQuery) FirstID

func (dq *DecisionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Decision ID from the query. Returns a *NotFoundError when no Decision ID was found.

func (*DecisionQuery) FirstIDX added in v1.0.3

func (dq *DecisionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*DecisionQuery) FirstX

func (dq *DecisionQuery) FirstX(ctx context.Context) *Decision

FirstX is like First, but panics if an error occurs.

func (*DecisionQuery) GroupBy

func (dq *DecisionQuery) GroupBy(field string, fields ...string) *DecisionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Decision.Query().
	GroupBy(decision.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DecisionQuery) IDs

func (dq *DecisionQuery) IDs(ctx context.Context) (ids []int, err 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 the number of records to be returned by this query.

func (*DecisionQuery) Offset

func (dq *DecisionQuery) Offset(offset int) *DecisionQuery

Offset to start from.

func (*DecisionQuery) Only

func (dq *DecisionQuery) Only(ctx context.Context) (*Decision, error)

Only returns a single Decision entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Decision entity is found. Returns a *NotFoundError when no Decision entities are found.

func (*DecisionQuery) OnlyID

func (dq *DecisionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Decision ID in the query. Returns a *NotSingularError when more than one Decision ID is found. Returns a *NotFoundError when no entities are found.

func (*DecisionQuery) OnlyIDX

func (dq *DecisionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DecisionQuery) OnlyX

func (dq *DecisionQuery) OnlyX(ctx context.Context) *Decision

OnlyX is like Only, but panics if an error occurs.

func (*DecisionQuery) Order

Order specifies how the records should be ordered.

func (*DecisionQuery) QueryOwner

func (dq *DecisionQuery) QueryOwner() *AlertQuery

QueryOwner chains the current query on the "owner" edge.

func (*DecisionQuery) Select

func (dq *DecisionQuery) Select(fields ...string) *DecisionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Decision.Query().
	Select(decision.FieldCreatedAt).
	Scan(ctx, &v)

func (*DecisionQuery) Unique added in v1.2.1

func (dq *DecisionQuery) Unique(unique bool) *DecisionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DecisionQuery) Where

func (dq *DecisionQuery) Where(ps ...predicate.Decision) *DecisionQuery

Where adds a new predicate for the DecisionQuery builder.

func (*DecisionQuery) WithOwner

func (dq *DecisionQuery) WithOwner(opts ...func(*AlertQuery)) *DecisionQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type DecisionSelect

type DecisionSelect struct {
	*DecisionQuery
	// contains filtered or unexported fields
}

DecisionSelect is the builder for selecting fields of Decision entities.

func (*DecisionSelect) Aggregate added in v1.6.1

func (ds *DecisionSelect) Aggregate(fns ...AggregateFunc) *DecisionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DecisionSelect) Bool

func (s *DecisionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) BoolX

func (s *DecisionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DecisionSelect) Bools

func (s *DecisionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) BoolsX

func (s *DecisionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DecisionSelect) Float64

func (s *DecisionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) Float64X

func (s *DecisionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DecisionSelect) Float64s

func (s *DecisionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) Float64sX

func (s *DecisionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DecisionSelect) Int

func (s *DecisionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) IntX

func (s *DecisionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DecisionSelect) Ints

func (s *DecisionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) IntsX

func (s *DecisionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DecisionSelect) Scan

func (ds *DecisionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DecisionSelect) ScanX

func (s *DecisionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DecisionSelect) String

func (s *DecisionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) StringX

func (s *DecisionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DecisionSelect) Strings

func (s *DecisionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DecisionSelect) StringsX

func (s *DecisionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DecisionUpdate

type DecisionUpdate struct {
	// contains filtered or unexported fields
}

DecisionUpdate is the builder for updating Decision entities.

func (*DecisionUpdate) ClearAlertDecisions added in v1.5.0

func (du *DecisionUpdate) ClearAlertDecisions() *DecisionUpdate

ClearAlertDecisions clears the value of the "alert_decisions" field.

func (*DecisionUpdate) ClearOwner

func (du *DecisionUpdate) ClearOwner() *DecisionUpdate

ClearOwner clears the "owner" edge to the Alert entity.

func (*DecisionUpdate) ClearUntil added in v1.3.4

func (du *DecisionUpdate) ClearUntil() *DecisionUpdate

ClearUntil clears the value of the "until" field.

func (*DecisionUpdate) Exec

func (du *DecisionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DecisionUpdate) ExecX

func (du *DecisionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DecisionUpdate) Mutation

func (du *DecisionUpdate) Mutation() *DecisionMutation

Mutation returns the DecisionMutation object of the builder.

func (*DecisionUpdate) Save

func (du *DecisionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DecisionUpdate) SaveX

func (du *DecisionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DecisionUpdate) SetAlertDecisions added in v1.5.0

func (du *DecisionUpdate) SetAlertDecisions(i int) *DecisionUpdate

SetAlertDecisions sets the "alert_decisions" field.

func (*DecisionUpdate) SetNillableAlertDecisions added in v1.5.0

func (du *DecisionUpdate) SetNillableAlertDecisions(i *int) *DecisionUpdate

SetNillableAlertDecisions sets the "alert_decisions" field if the given value is not nil.

func (*DecisionUpdate) SetNillableOwnerID

func (du *DecisionUpdate) SetNillableOwnerID(id *int) *DecisionUpdate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*DecisionUpdate) SetNillableUntil added in v1.3.4

func (du *DecisionUpdate) SetNillableUntil(t *time.Time) *DecisionUpdate

SetNillableUntil sets the "until" field if the given value is not nil.

func (*DecisionUpdate) SetOwner

func (du *DecisionUpdate) SetOwner(a *Alert) *DecisionUpdate

SetOwner sets the "owner" edge to the Alert entity.

func (*DecisionUpdate) SetOwnerID

func (du *DecisionUpdate) SetOwnerID(id int) *DecisionUpdate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*DecisionUpdate) 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) Where

func (du *DecisionUpdate) Where(ps ...predicate.Decision) *DecisionUpdate

Where appends a list predicates to the DecisionUpdate builder.

type DecisionUpdateOne

type DecisionUpdateOne struct {
	// contains filtered or unexported fields
}

DecisionUpdateOne is the builder for updating a single Decision entity.

func (*DecisionUpdateOne) ClearAlertDecisions added in v1.5.0

func (duo *DecisionUpdateOne) ClearAlertDecisions() *DecisionUpdateOne

ClearAlertDecisions clears the value of the "alert_decisions" field.

func (*DecisionUpdateOne) ClearOwner

func (duo *DecisionUpdateOne) ClearOwner() *DecisionUpdateOne

ClearOwner clears the "owner" edge to the Alert entity.

func (*DecisionUpdateOne) ClearUntil added in v1.3.4

func (duo *DecisionUpdateOne) ClearUntil() *DecisionUpdateOne

ClearUntil clears the value of the "until" field.

func (*DecisionUpdateOne) Exec

func (duo *DecisionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DecisionUpdateOne) ExecX

func (duo *DecisionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DecisionUpdateOne) Mutation

func (duo *DecisionUpdateOne) Mutation() *DecisionMutation

Mutation returns the DecisionMutation object of the builder.

func (*DecisionUpdateOne) Save

func (duo *DecisionUpdateOne) Save(ctx context.Context) (*Decision, error)

Save executes the query and returns the updated Decision entity.

func (*DecisionUpdateOne) SaveX

func (duo *DecisionUpdateOne) SaveX(ctx context.Context) *Decision

SaveX is like Save, but panics if an error occurs.

func (*DecisionUpdateOne) Select added in v1.2.1

func (duo *DecisionUpdateOne) Select(field string, fields ...string) *DecisionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DecisionUpdateOne) SetAlertDecisions added in v1.5.0

func (duo *DecisionUpdateOne) SetAlertDecisions(i int) *DecisionUpdateOne

SetAlertDecisions sets the "alert_decisions" field.

func (*DecisionUpdateOne) SetNillableAlertDecisions added in v1.5.0

func (duo *DecisionUpdateOne) SetNillableAlertDecisions(i *int) *DecisionUpdateOne

SetNillableAlertDecisions sets the "alert_decisions" field if the given value is not nil.

func (*DecisionUpdateOne) SetNillableOwnerID

func (duo *DecisionUpdateOne) SetNillableOwnerID(id *int) *DecisionUpdateOne

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*DecisionUpdateOne) SetNillableUntil added in v1.3.4

func (duo *DecisionUpdateOne) SetNillableUntil(t *time.Time) *DecisionUpdateOne

SetNillableUntil sets the "until" field if the given value is not nil.

func (*DecisionUpdateOne) SetOwner

func (duo *DecisionUpdateOne) SetOwner(a *Alert) *DecisionUpdateOne

SetOwner sets the "owner" edge to the Alert entity.

func (*DecisionUpdateOne) SetOwnerID

func (duo *DecisionUpdateOne) SetOwnerID(id int) *DecisionUpdateOne

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*DecisionUpdateOne) 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) Where added in v1.6.1

Where appends a list predicates to the DecisionUpdate builder.

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"`
	// AlertEvents holds the value of the "alert_events" field.
	AlertEvents int `json:"alert_events,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EventQuery when eager-loading is set.
	Edges EventEdges `json:"edges"`
	// contains filtered or unexported fields
}

Event is the model entity for the Event schema.

func (*Event) QueryOwner

func (e *Event) QueryOwner() *AlertQuery

QueryOwner queries the "owner" edge of the Event entity.

func (*Event) String

func (e *Event) String() string

String implements the fmt.Stringer.

func (*Event) Unwrap

func (e *Event) Unwrap() *Event

Unwrap unwraps the Event entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Event) Update

func (e *Event) Update() *EventUpdateOne

Update returns a builder for updating this Event. Note that you need to call Event.Unwrap() before calling this method if this Event was returned from a transaction, and the transaction was committed or rolled back.

func (*Event) Value added in v1.6.1

func (e *Event) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Event. This includes values selected through modifiers, order, etc.

type EventClient

type EventClient struct {
	// contains filtered or unexported fields
}

EventClient is a client for the Event schema.

func NewEventClient

func NewEventClient(c config) *EventClient

NewEventClient returns a client for the Event from the given config.

func (*EventClient) Create

func (c *EventClient) Create() *EventCreate

Create returns a builder for creating a Event entity.

func (*EventClient) CreateBulk

func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk

CreateBulk returns a builder for creating a bulk of Event entities.

func (*EventClient) Delete

func (c *EventClient) Delete() *EventDelete

Delete returns a delete builder for Event.

func (*EventClient) DeleteOne

func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id int) *EventDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*EventClient) Get

func (c *EventClient) Get(ctx context.Context, id int) (*Event, error)

Get returns a Event entity by its id.

func (*EventClient) GetX

func (c *EventClient) GetX(ctx context.Context, id int) *Event

GetX is like Get, but panics if an error occurs.

func (*EventClient) Hooks

func (c *EventClient) Hooks() []Hook

Hooks returns the client hooks.

func (*EventClient) Intercept added in v1.6.1

func (c *EventClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `event.Intercept(f(g(h())))`.

func (*EventClient) Interceptors added in v1.6.1

func (c *EventClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*EventClient) MapCreateBulk added in v1.6.1

func (c *EventClient) MapCreateBulk(slice any, setFunc func(*EventCreate, int)) *EventCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*EventClient) Query

func (c *EventClient) Query() *EventQuery

Query returns a query builder for Event.

func (*EventClient) QueryOwner

func (c *EventClient) QueryOwner(e *Event) *AlertQuery

QueryOwner queries the owner edge of a Event.

func (*EventClient) Update

func (c *EventClient) Update() *EventUpdate

Update returns an update builder for Event.

func (*EventClient) UpdateOne

func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EventClient) UpdateOneID

func (c *EventClient) UpdateOneID(id int) *EventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EventClient) Use

func (c *EventClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `event.Hooks(f(g(h())))`.

type EventCreate

type EventCreate struct {
	// contains filtered or unexported fields
}

EventCreate is the builder for creating a Event entity.

func (*EventCreate) Exec added in v1.2.1

func (ec *EventCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreate) ExecX added in v1.2.1

func (ec *EventCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventCreate) Mutation

func (ec *EventCreate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventCreate) Save

func (ec *EventCreate) Save(ctx context.Context) (*Event, error)

Save creates the Event in the database.

func (*EventCreate) SaveX

func (ec *EventCreate) SaveX(ctx context.Context) *Event

SaveX calls Save and panics if Save returns an error.

func (*EventCreate) SetAlertEvents added in v1.5.0

func (ec *EventCreate) SetAlertEvents(i int) *EventCreate

SetAlertEvents sets the "alert_events" field.

func (*EventCreate) SetCreatedAt

func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate

SetCreatedAt sets the "created_at" field.

func (*EventCreate) SetNillableAlertEvents added in v1.5.0

func (ec *EventCreate) SetNillableAlertEvents(i *int) *EventCreate

SetNillableAlertEvents sets the "alert_events" field if the given value is not nil.

func (*EventCreate) SetNillableCreatedAt

func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*EventCreate) SetNillableOwnerID

func (ec *EventCreate) SetNillableOwnerID(id *int) *EventCreate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*EventCreate) SetNillableUpdatedAt

func (ec *EventCreate) SetNillableUpdatedAt(t *time.Time) *EventCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*EventCreate) SetOwner

func (ec *EventCreate) SetOwner(a *Alert) *EventCreate

SetOwner sets the "owner" edge to the Alert entity.

func (*EventCreate) SetOwnerID

func (ec *EventCreate) SetOwnerID(id int) *EventCreate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*EventCreate) SetSerialized

func (ec *EventCreate) SetSerialized(s string) *EventCreate

SetSerialized sets the "serialized" field.

func (*EventCreate) SetTime

func (ec *EventCreate) SetTime(t time.Time) *EventCreate

SetTime sets the "time" field.

func (*EventCreate) SetUpdatedAt

func (ec *EventCreate) SetUpdatedAt(t time.Time) *EventCreate

SetUpdatedAt sets the "updated_at" field.

type EventCreateBulk

type EventCreateBulk struct {
	// contains filtered or unexported fields
}

EventCreateBulk is the builder for creating many Event entities in bulk.

func (*EventCreateBulk) Exec added in v1.2.1

func (ecb *EventCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreateBulk) ExecX added in v1.2.1

func (ecb *EventCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventCreateBulk) Save

func (ecb *EventCreateBulk) Save(ctx context.Context) ([]*Event, error)

Save creates the Event entities in the database.

func (*EventCreateBulk) SaveX

func (ecb *EventCreateBulk) SaveX(ctx context.Context) []*Event

SaveX is like Save, but panics if an error occurs.

type EventDelete

type EventDelete struct {
	// contains filtered or unexported fields
}

EventDelete is the builder for deleting a Event entity.

func (*EventDelete) Exec

func (ed *EventDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EventDelete) ExecX

func (ed *EventDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EventDelete) Where

func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete

Where appends a list predicates to the EventDelete builder.

type EventDeleteOne

type EventDeleteOne struct {
	// contains filtered or unexported fields
}

EventDeleteOne is the builder for deleting a single Event entity.

func (*EventDeleteOne) Exec

func (edo *EventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EventDeleteOne) ExecX

func (edo *EventDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventDeleteOne) Where added in v1.6.1

func (edo *EventDeleteOne) Where(ps ...predicate.Event) *EventDeleteOne

Where appends a list predicates to the EventDelete builder.

type EventEdges

type EventEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Alert `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

EventEdges holds the relations/edges for other nodes in the graph.

func (EventEdges) OwnerOrErr

func (e EventEdges) OwnerOrErr() (*Alert, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type EventGroupBy

type EventGroupBy struct {
	// contains filtered or unexported fields
}

EventGroupBy is the group-by builder for Event entities.

func (*EventGroupBy) Aggregate

func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*EventGroupBy) Bool

func (s *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) BoolX

func (s *EventGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EventGroupBy) Bools

func (s *EventGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) BoolsX

func (s *EventGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EventGroupBy) Float64

func (s *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) Float64X

func (s *EventGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EventGroupBy) Float64s

func (s *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) Float64sX

func (s *EventGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EventGroupBy) Int

func (s *EventGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) IntX

func (s *EventGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EventGroupBy) Ints

func (s *EventGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) IntsX

func (s *EventGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EventGroupBy) Scan

func (egb *EventGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EventGroupBy) ScanX

func (s *EventGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EventGroupBy) String

func (s *EventGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) StringX

func (s *EventGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EventGroupBy) Strings

func (s *EventGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) StringsX

func (s *EventGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EventMutation

type EventMutation struct {
	// contains filtered or unexported fields
}

EventMutation represents an operation that mutates the Event nodes in the graph.

func (*EventMutation) AddField

func (m *EventMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EventMutation) AddedEdges

func (m *EventMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EventMutation) AddedField

func (m *EventMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EventMutation) AddedFields

func (m *EventMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EventMutation) AddedIDs

func (m *EventMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EventMutation) AlertEvents added in v1.5.0

func (m *EventMutation) AlertEvents() (r int, exists bool)

AlertEvents returns the value of the "alert_events" field in the mutation.

func (*EventMutation) AlertEventsCleared added in v1.5.0

func (m *EventMutation) AlertEventsCleared() bool

AlertEventsCleared returns if the "alert_events" field was cleared in this mutation.

func (*EventMutation) ClearAlertEvents added in v1.5.0

func (m *EventMutation) ClearAlertEvents()

ClearAlertEvents clears the value of the "alert_events" field.

func (*EventMutation) ClearEdge

func (m *EventMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*EventMutation) ClearField

func (m *EventMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*EventMutation) ClearOwner

func (m *EventMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Alert entity.

func (*EventMutation) ClearedEdges

func (m *EventMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EventMutation) ClearedFields

func (m *EventMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EventMutation) Client

func (m EventMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*EventMutation) CreatedAt

func (m *EventMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*EventMutation) EdgeCleared

func (m *EventMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EventMutation) Field

func (m *EventMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EventMutation) FieldCleared

func (m *EventMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EventMutation) Fields

func (m *EventMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*EventMutation) ID

func (m *EventMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*EventMutation) IDs added in v1.3.1

func (m *EventMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*EventMutation) OldAlertEvents added in v1.5.0

func (m *EventMutation) OldAlertEvents(ctx context.Context) (v int, err error)

OldAlertEvents returns the old "alert_events" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) OldCreatedAt

func (m *EventMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) OldField

func (m *EventMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*EventMutation) OldSerialized

func (m *EventMutation) OldSerialized(ctx context.Context) (v string, err error)

OldSerialized returns the old "serialized" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) OldTime

func (m *EventMutation) OldTime(ctx context.Context) (v time.Time, err error)

OldTime returns the old "time" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) OldUpdatedAt

func (m *EventMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) Op

func (m *EventMutation) Op() Op

Op returns the operation name.

func (*EventMutation) OwnerCleared

func (m *EventMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Alert entity was cleared.

func (*EventMutation) OwnerID

func (m *EventMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*EventMutation) OwnerIDs

func (m *EventMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*EventMutation) RemovedEdges

func (m *EventMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EventMutation) RemovedIDs

func (m *EventMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*EventMutation) ResetAlertEvents added in v1.5.0

func (m *EventMutation) ResetAlertEvents()

ResetAlertEvents resets all changes to the "alert_events" field.

func (*EventMutation) ResetCreatedAt

func (m *EventMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*EventMutation) ResetEdge

func (m *EventMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*EventMutation) ResetField

func (m *EventMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*EventMutation) ResetOwner

func (m *EventMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*EventMutation) ResetSerialized

func (m *EventMutation) ResetSerialized()

ResetSerialized resets all changes to the "serialized" field.

func (*EventMutation) ResetTime

func (m *EventMutation) ResetTime()

ResetTime resets all changes to the "time" field.

func (*EventMutation) ResetUpdatedAt

func (m *EventMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*EventMutation) Serialized

func (m *EventMutation) Serialized() (r string, exists bool)

Serialized returns the value of the "serialized" field in the mutation.

func (*EventMutation) SetAlertEvents added in v1.5.0

func (m *EventMutation) SetAlertEvents(i int)

SetAlertEvents sets the "alert_events" field.

func (*EventMutation) SetCreatedAt

func (m *EventMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*EventMutation) SetField

func (m *EventMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EventMutation) SetOp added in v1.6.1

func (m *EventMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EventMutation) SetOwnerID

func (m *EventMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Alert entity by id.

func (*EventMutation) SetSerialized

func (m *EventMutation) SetSerialized(s string)

SetSerialized sets the "serialized" field.

func (*EventMutation) SetTime

func (m *EventMutation) SetTime(t time.Time)

SetTime sets the "time" field.

func (*EventMutation) SetUpdatedAt

func (m *EventMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*EventMutation) Time

func (m *EventMutation) Time() (r time.Time, exists bool)

Time returns the value of the "time" field in the mutation.

func (EventMutation) Tx

func (m EventMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EventMutation) Type

func (m *EventMutation) Type() string

Type returns the node type of this mutation (Event).

func (*EventMutation) UpdatedAt

func (m *EventMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*EventMutation) Where added in v1.2.1

func (m *EventMutation) Where(ps ...predicate.Event)

Where appends a list predicates to the EventMutation builder.

func (*EventMutation) WhereP added in v1.6.1

func (m *EventMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EventMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EventQuery

type EventQuery struct {
	// contains filtered or unexported fields
}

EventQuery is the builder for querying Event entities.

func (*EventQuery) Aggregate added in v1.6.1

func (eq *EventQuery) Aggregate(fns ...AggregateFunc) *EventSelect

Aggregate returns a EventSelect configured with the given aggregations.

func (*EventQuery) All

func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)

All executes the query and returns a list of Events.

func (*EventQuery) AllX

func (eq *EventQuery) AllX(ctx context.Context) []*Event

AllX is like All, but panics if an error occurs.

func (*EventQuery) Clone

func (eq *EventQuery) Clone() *EventQuery

Clone returns a duplicate of the EventQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EventQuery) Count

func (eq *EventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventQuery) CountX

func (eq *EventQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EventQuery) Exist

func (eq *EventQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EventQuery) ExistX

func (eq *EventQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EventQuery) First

func (eq *EventQuery) First(ctx context.Context) (*Event, error)

First returns the first Event entity from the query. Returns a *NotFoundError when no Event was found.

func (*EventQuery) FirstID

func (eq *EventQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Event ID from the query. Returns a *NotFoundError when no Event ID was found.

func (*EventQuery) FirstIDX added in v1.0.3

func (eq *EventQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EventQuery) FirstX

func (eq *EventQuery) FirstX(ctx context.Context) *Event

FirstX is like First, but panics if an error occurs.

func (*EventQuery) GroupBy

func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Event.Query().
	GroupBy(event.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventQuery) IDs

func (eq *EventQuery) IDs(ctx context.Context) (ids []int, err 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 the number of records to be returned by this query.

func (*EventQuery) Offset

func (eq *EventQuery) Offset(offset int) *EventQuery

Offset to start from.

func (*EventQuery) Only

func (eq *EventQuery) Only(ctx context.Context) (*Event, error)

Only returns a single Event entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Event entity is found. Returns a *NotFoundError when no Event entities are found.

func (*EventQuery) OnlyID

func (eq *EventQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Event ID in the query. Returns a *NotSingularError when more than one Event ID is found. Returns a *NotFoundError when no entities are found.

func (*EventQuery) OnlyIDX

func (eq *EventQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EventQuery) OnlyX

func (eq *EventQuery) OnlyX(ctx context.Context) *Event

OnlyX is like Only, but panics if an error occurs.

func (*EventQuery) Order

func (eq *EventQuery) Order(o ...event.OrderOption) *EventQuery

Order specifies how the records should be ordered.

func (*EventQuery) QueryOwner

func (eq *EventQuery) QueryOwner() *AlertQuery

QueryOwner chains the current query on the "owner" edge.

func (*EventQuery) Select

func (eq *EventQuery) Select(fields ...string) *EventSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Event.Query().
	Select(event.FieldCreatedAt).
	Scan(ctx, &v)

func (*EventQuery) Unique added in v1.2.1

func (eq *EventQuery) Unique(unique bool) *EventQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*EventQuery) Where

func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery

Where adds a new predicate for the EventQuery builder.

func (*EventQuery) WithOwner

func (eq *EventQuery) WithOwner(opts ...func(*AlertQuery)) *EventQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type EventSelect

type EventSelect struct {
	*EventQuery
	// contains filtered or unexported fields
}

EventSelect is the builder for selecting fields of Event entities.

func (*EventSelect) Aggregate added in v1.6.1

func (es *EventSelect) Aggregate(fns ...AggregateFunc) *EventSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EventSelect) Bool

func (s *EventSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EventSelect) BoolX

func (s *EventSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EventSelect) Bools

func (s *EventSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EventSelect) BoolsX

func (s *EventSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EventSelect) Float64

func (s *EventSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EventSelect) Float64X

func (s *EventSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EventSelect) Float64s

func (s *EventSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EventSelect) Float64sX

func (s *EventSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EventSelect) Int

func (s *EventSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EventSelect) IntX

func (s *EventSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EventSelect) Ints

func (s *EventSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EventSelect) IntsX

func (s *EventSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EventSelect) Scan

func (es *EventSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EventSelect) ScanX

func (s *EventSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EventSelect) String

func (s *EventSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EventSelect) StringX

func (s *EventSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EventSelect) Strings

func (s *EventSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EventSelect) StringsX

func (s *EventSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EventUpdate

type EventUpdate struct {
	// contains filtered or unexported fields
}

EventUpdate is the builder for updating Event entities.

func (*EventUpdate) ClearAlertEvents added in v1.5.0

func (eu *EventUpdate) ClearAlertEvents() *EventUpdate

ClearAlertEvents clears the value of the "alert_events" field.

func (*EventUpdate) ClearOwner

func (eu *EventUpdate) ClearOwner() *EventUpdate

ClearOwner clears the "owner" edge to the Alert entity.

func (*EventUpdate) Exec

func (eu *EventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpdate) ExecX

func (eu *EventUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventUpdate) Mutation

func (eu *EventUpdate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdate) Save

func (eu *EventUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EventUpdate) SaveX

func (eu *EventUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EventUpdate) SetAlertEvents added in v1.5.0

func (eu *EventUpdate) SetAlertEvents(i int) *EventUpdate

SetAlertEvents sets the "alert_events" field.

func (*EventUpdate) SetNillableAlertEvents added in v1.5.0

func (eu *EventUpdate) SetNillableAlertEvents(i *int) *EventUpdate

SetNillableAlertEvents sets the "alert_events" field if the given value is not nil.

func (*EventUpdate) SetNillableOwnerID

func (eu *EventUpdate) SetNillableOwnerID(id *int) *EventUpdate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*EventUpdate) SetOwner

func (eu *EventUpdate) SetOwner(a *Alert) *EventUpdate

SetOwner sets the "owner" edge to the Alert entity.

func (*EventUpdate) SetOwnerID

func (eu *EventUpdate) SetOwnerID(id int) *EventUpdate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*EventUpdate) SetUpdatedAt

func (eu *EventUpdate) SetUpdatedAt(t time.Time) *EventUpdate

SetUpdatedAt sets the "updated_at" field.

func (*EventUpdate) Where

func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate

Where appends a list predicates to the EventUpdate builder.

type EventUpdateOne

type EventUpdateOne struct {
	// contains filtered or unexported fields
}

EventUpdateOne is the builder for updating a single Event entity.

func (*EventUpdateOne) ClearAlertEvents added in v1.5.0

func (euo *EventUpdateOne) ClearAlertEvents() *EventUpdateOne

ClearAlertEvents clears the value of the "alert_events" field.

func (*EventUpdateOne) ClearOwner

func (euo *EventUpdateOne) ClearOwner() *EventUpdateOne

ClearOwner clears the "owner" edge to the Alert entity.

func (*EventUpdateOne) Exec

func (euo *EventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EventUpdateOne) ExecX

func (euo *EventUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventUpdateOne) Mutation

func (euo *EventUpdateOne) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdateOne) Save

func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)

Save executes the query and returns the updated Event entity.

func (*EventUpdateOne) SaveX

func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event

SaveX is like Save, but panics if an error occurs.

func (*EventUpdateOne) Select added in v1.2.1

func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EventUpdateOne) SetAlertEvents added in v1.5.0

func (euo *EventUpdateOne) SetAlertEvents(i int) *EventUpdateOne

SetAlertEvents sets the "alert_events" field.

func (*EventUpdateOne) SetNillableAlertEvents added in v1.5.0

func (euo *EventUpdateOne) SetNillableAlertEvents(i *int) *EventUpdateOne

SetNillableAlertEvents sets the "alert_events" field if the given value is not nil.

func (*EventUpdateOne) SetNillableOwnerID

func (euo *EventUpdateOne) SetNillableOwnerID(id *int) *EventUpdateOne

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*EventUpdateOne) SetOwner

func (euo *EventUpdateOne) SetOwner(a *Alert) *EventUpdateOne

SetOwner sets the "owner" edge to the Alert entity.

func (*EventUpdateOne) SetOwnerID

func (euo *EventUpdateOne) SetOwnerID(id int) *EventUpdateOne

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*EventUpdateOne) SetUpdatedAt

func (euo *EventUpdateOne) SetUpdatedAt(t time.Time) *EventUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*EventUpdateOne) Where added in v1.6.1

func (euo *EventUpdateOne) Where(ps ...predicate.Event) *EventUpdateOne

Where appends a list predicates to the EventUpdate builder.

type Events

type Events []*Event

Events is a parsable slice of Event.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc added in v1.6.1

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor added in v1.6.1

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Lock added in v1.6.1

type Lock struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// contains filtered or unexported fields
}

Lock is the model entity for the Lock schema.

func (*Lock) String added in v1.6.1

func (l *Lock) String() string

String implements the fmt.Stringer.

func (*Lock) Unwrap added in v1.6.1

func (l *Lock) Unwrap() *Lock

Unwrap unwraps the Lock entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Lock) Update added in v1.6.1

func (l *Lock) Update() *LockUpdateOne

Update returns a builder for updating this Lock. Note that you need to call Lock.Unwrap() before calling this method if this Lock was returned from a transaction, and the transaction was committed or rolled back.

func (*Lock) Value added in v1.6.1

func (l *Lock) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Lock. This includes values selected through modifiers, order, etc.

type LockClient added in v1.6.1

type LockClient struct {
	// contains filtered or unexported fields
}

LockClient is a client for the Lock schema.

func NewLockClient added in v1.6.1

func NewLockClient(c config) *LockClient

NewLockClient returns a client for the Lock from the given config.

func (*LockClient) Create added in v1.6.1

func (c *LockClient) Create() *LockCreate

Create returns a builder for creating a Lock entity.

func (*LockClient) CreateBulk added in v1.6.1

func (c *LockClient) CreateBulk(builders ...*LockCreate) *LockCreateBulk

CreateBulk returns a builder for creating a bulk of Lock entities.

func (*LockClient) Delete added in v1.6.1

func (c *LockClient) Delete() *LockDelete

Delete returns a delete builder for Lock.

func (*LockClient) DeleteOne added in v1.6.1

func (c *LockClient) DeleteOne(l *Lock) *LockDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LockClient) DeleteOneID added in v1.6.1

func (c *LockClient) DeleteOneID(id int) *LockDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LockClient) Get added in v1.6.1

func (c *LockClient) Get(ctx context.Context, id int) (*Lock, error)

Get returns a Lock entity by its id.

func (*LockClient) GetX added in v1.6.1

func (c *LockClient) GetX(ctx context.Context, id int) *Lock

GetX is like Get, but panics if an error occurs.

func (*LockClient) Hooks added in v1.6.1

func (c *LockClient) Hooks() []Hook

Hooks returns the client hooks.

func (*LockClient) Intercept added in v1.6.1

func (c *LockClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `lock.Intercept(f(g(h())))`.

func (*LockClient) Interceptors added in v1.6.1

func (c *LockClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LockClient) MapCreateBulk added in v1.6.1

func (c *LockClient) MapCreateBulk(slice any, setFunc func(*LockCreate, int)) *LockCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*LockClient) Query added in v1.6.1

func (c *LockClient) Query() *LockQuery

Query returns a query builder for Lock.

func (*LockClient) Update added in v1.6.1

func (c *LockClient) Update() *LockUpdate

Update returns an update builder for Lock.

func (*LockClient) UpdateOne added in v1.6.1

func (c *LockClient) UpdateOne(l *Lock) *LockUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LockClient) UpdateOneID added in v1.6.1

func (c *LockClient) UpdateOneID(id int) *LockUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LockClient) Use added in v1.6.1

func (c *LockClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `lock.Hooks(f(g(h())))`.

type LockCreate added in v1.6.1

type LockCreate struct {
	// contains filtered or unexported fields
}

LockCreate is the builder for creating a Lock entity.

func (*LockCreate) Exec added in v1.6.1

func (lc *LockCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LockCreate) ExecX added in v1.6.1

func (lc *LockCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LockCreate) Mutation added in v1.6.1

func (lc *LockCreate) Mutation() *LockMutation

Mutation returns the LockMutation object of the builder.

func (*LockCreate) Save added in v1.6.1

func (lc *LockCreate) Save(ctx context.Context) (*Lock, error)

Save creates the Lock in the database.

func (*LockCreate) SaveX added in v1.6.1

func (lc *LockCreate) SaveX(ctx context.Context) *Lock

SaveX calls Save and panics if Save returns an error.

func (*LockCreate) SetCreatedAt added in v1.6.1

func (lc *LockCreate) SetCreatedAt(t time.Time) *LockCreate

SetCreatedAt sets the "created_at" field.

func (*LockCreate) SetName added in v1.6.1

func (lc *LockCreate) SetName(s string) *LockCreate

SetName sets the "name" field.

func (*LockCreate) SetNillableCreatedAt added in v1.6.1

func (lc *LockCreate) SetNillableCreatedAt(t *time.Time) *LockCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

type LockCreateBulk added in v1.6.1

type LockCreateBulk struct {
	// contains filtered or unexported fields
}

LockCreateBulk is the builder for creating many Lock entities in bulk.

func (*LockCreateBulk) Exec added in v1.6.1

func (lcb *LockCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LockCreateBulk) ExecX added in v1.6.1

func (lcb *LockCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LockCreateBulk) Save added in v1.6.1

func (lcb *LockCreateBulk) Save(ctx context.Context) ([]*Lock, error)

Save creates the Lock entities in the database.

func (*LockCreateBulk) SaveX added in v1.6.1

func (lcb *LockCreateBulk) SaveX(ctx context.Context) []*Lock

SaveX is like Save, but panics if an error occurs.

type LockDelete added in v1.6.1

type LockDelete struct {
	// contains filtered or unexported fields
}

LockDelete is the builder for deleting a Lock entity.

func (*LockDelete) Exec added in v1.6.1

func (ld *LockDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*LockDelete) ExecX added in v1.6.1

func (ld *LockDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*LockDelete) Where added in v1.6.1

func (ld *LockDelete) Where(ps ...predicate.Lock) *LockDelete

Where appends a list predicates to the LockDelete builder.

type LockDeleteOne added in v1.6.1

type LockDeleteOne struct {
	// contains filtered or unexported fields
}

LockDeleteOne is the builder for deleting a single Lock entity.

func (*LockDeleteOne) Exec added in v1.6.1

func (ldo *LockDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LockDeleteOne) ExecX added in v1.6.1

func (ldo *LockDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LockDeleteOne) Where added in v1.6.1

func (ldo *LockDeleteOne) Where(ps ...predicate.Lock) *LockDeleteOne

Where appends a list predicates to the LockDelete builder.

type LockGroupBy added in v1.6.1

type LockGroupBy struct {
	// contains filtered or unexported fields
}

LockGroupBy is the group-by builder for Lock entities.

func (*LockGroupBy) Aggregate added in v1.6.1

func (lgb *LockGroupBy) Aggregate(fns ...AggregateFunc) *LockGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*LockGroupBy) Bool added in v1.6.1

func (s *LockGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) BoolX added in v1.6.1

func (s *LockGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LockGroupBy) Bools added in v1.6.1

func (s *LockGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) BoolsX added in v1.6.1

func (s *LockGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LockGroupBy) Float64 added in v1.6.1

func (s *LockGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) Float64X added in v1.6.1

func (s *LockGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LockGroupBy) Float64s added in v1.6.1

func (s *LockGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) Float64sX added in v1.6.1

func (s *LockGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LockGroupBy) Int added in v1.6.1

func (s *LockGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) IntX added in v1.6.1

func (s *LockGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LockGroupBy) Ints added in v1.6.1

func (s *LockGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) IntsX added in v1.6.1

func (s *LockGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LockGroupBy) Scan added in v1.6.1

func (lgb *LockGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LockGroupBy) ScanX added in v1.6.1

func (s *LockGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LockGroupBy) String added in v1.6.1

func (s *LockGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) StringX added in v1.6.1

func (s *LockGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LockGroupBy) Strings added in v1.6.1

func (s *LockGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LockGroupBy) StringsX added in v1.6.1

func (s *LockGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LockMutation added in v1.6.1

type LockMutation struct {
	// contains filtered or unexported fields
}

LockMutation represents an operation that mutates the Lock nodes in the graph.

func (*LockMutation) AddField added in v1.6.1

func (m *LockMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*LockMutation) AddedEdges added in v1.6.1

func (m *LockMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*LockMutation) AddedField added in v1.6.1

func (m *LockMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*LockMutation) AddedFields added in v1.6.1

func (m *LockMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*LockMutation) AddedIDs added in v1.6.1

func (m *LockMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*LockMutation) ClearEdge added in v1.6.1

func (m *LockMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*LockMutation) ClearField added in v1.6.1

func (m *LockMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*LockMutation) ClearedEdges added in v1.6.1

func (m *LockMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*LockMutation) ClearedFields added in v1.6.1

func (m *LockMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (LockMutation) Client added in v1.6.1

func (m LockMutation) 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 (*LockMutation) CreatedAt added in v1.6.1

func (m *LockMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*LockMutation) EdgeCleared added in v1.6.1

func (m *LockMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*LockMutation) Field added in v1.6.1

func (m *LockMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*LockMutation) FieldCleared added in v1.6.1

func (m *LockMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*LockMutation) Fields added in v1.6.1

func (m *LockMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*LockMutation) ID added in v1.6.1

func (m *LockMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*LockMutation) IDs added in v1.6.1

func (m *LockMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*LockMutation) Name added in v1.6.1

func (m *LockMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*LockMutation) OldCreatedAt added in v1.6.1

func (m *LockMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Lock entity. If the Lock object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LockMutation) OldField added in v1.6.1

func (m *LockMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*LockMutation) OldName added in v1.6.1

func (m *LockMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Lock entity. If the Lock object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LockMutation) Op added in v1.6.1

func (m *LockMutation) Op() Op

Op returns the operation name.

func (*LockMutation) RemovedEdges added in v1.6.1

func (m *LockMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*LockMutation) RemovedIDs added in v1.6.1

func (m *LockMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*LockMutation) ResetCreatedAt added in v1.6.1

func (m *LockMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LockMutation) ResetEdge added in v1.6.1

func (m *LockMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*LockMutation) ResetField added in v1.6.1

func (m *LockMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*LockMutation) ResetName added in v1.6.1

func (m *LockMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LockMutation) SetCreatedAt added in v1.6.1

func (m *LockMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*LockMutation) SetField added in v1.6.1

func (m *LockMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*LockMutation) SetName added in v1.6.1

func (m *LockMutation) SetName(s string)

SetName sets the "name" field.

func (*LockMutation) SetOp added in v1.6.1

func (m *LockMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (LockMutation) Tx added in v1.6.1

func (m LockMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*LockMutation) Type added in v1.6.1

func (m *LockMutation) Type() string

Type returns the node type of this mutation (Lock).

func (*LockMutation) Where added in v1.6.1

func (m *LockMutation) Where(ps ...predicate.Lock)

Where appends a list predicates to the LockMutation builder.

func (*LockMutation) WhereP added in v1.6.1

func (m *LockMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LockMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LockQuery added in v1.6.1

type LockQuery struct {
	// contains filtered or unexported fields
}

LockQuery is the builder for querying Lock entities.

func (*LockQuery) Aggregate added in v1.6.1

func (lq *LockQuery) Aggregate(fns ...AggregateFunc) *LockSelect

Aggregate returns a LockSelect configured with the given aggregations.

func (*LockQuery) All added in v1.6.1

func (lq *LockQuery) All(ctx context.Context) ([]*Lock, error)

All executes the query and returns a list of Locks.

func (*LockQuery) AllX added in v1.6.1

func (lq *LockQuery) AllX(ctx context.Context) []*Lock

AllX is like All, but panics if an error occurs.

func (*LockQuery) Clone added in v1.6.1

func (lq *LockQuery) Clone() *LockQuery

Clone returns a duplicate of the LockQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*LockQuery) Count added in v1.6.1

func (lq *LockQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LockQuery) CountX added in v1.6.1

func (lq *LockQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*LockQuery) Exist added in v1.6.1

func (lq *LockQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*LockQuery) ExistX added in v1.6.1

func (lq *LockQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*LockQuery) First added in v1.6.1

func (lq *LockQuery) First(ctx context.Context) (*Lock, error)

First returns the first Lock entity from the query. Returns a *NotFoundError when no Lock was found.

func (*LockQuery) FirstID added in v1.6.1

func (lq *LockQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Lock ID from the query. Returns a *NotFoundError when no Lock ID was found.

func (*LockQuery) FirstIDX added in v1.6.1

func (lq *LockQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*LockQuery) FirstX added in v1.6.1

func (lq *LockQuery) FirstX(ctx context.Context) *Lock

FirstX is like First, but panics if an error occurs.

func (*LockQuery) GroupBy added in v1.6.1

func (lq *LockQuery) GroupBy(field string, fields ...string) *LockGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name"`
	Count int `json:"count,omitempty"`
}

client.Lock.Query().
	GroupBy(lock.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LockQuery) IDs added in v1.6.1

func (lq *LockQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Lock IDs.

func (*LockQuery) IDsX added in v1.6.1

func (lq *LockQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*LockQuery) Limit added in v1.6.1

func (lq *LockQuery) Limit(limit int) *LockQuery

Limit the number of records to be returned by this query.

func (*LockQuery) Offset added in v1.6.1

func (lq *LockQuery) Offset(offset int) *LockQuery

Offset to start from.

func (*LockQuery) Only added in v1.6.1

func (lq *LockQuery) Only(ctx context.Context) (*Lock, error)

Only returns a single Lock entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Lock entity is found. Returns a *NotFoundError when no Lock entities are found.

func (*LockQuery) OnlyID added in v1.6.1

func (lq *LockQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Lock ID in the query. Returns a *NotSingularError when more than one Lock ID is found. Returns a *NotFoundError when no entities are found.

func (*LockQuery) OnlyIDX added in v1.6.1

func (lq *LockQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*LockQuery) OnlyX added in v1.6.1

func (lq *LockQuery) OnlyX(ctx context.Context) *Lock

OnlyX is like Only, but panics if an error occurs.

func (*LockQuery) Order added in v1.6.1

func (lq *LockQuery) Order(o ...lock.OrderOption) *LockQuery

Order specifies how the records should be ordered.

func (*LockQuery) Select added in v1.6.1

func (lq *LockQuery) Select(fields ...string) *LockSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name"`
}

client.Lock.Query().
	Select(lock.FieldName).
	Scan(ctx, &v)

func (*LockQuery) Unique added in v1.6.1

func (lq *LockQuery) Unique(unique bool) *LockQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*LockQuery) Where added in v1.6.1

func (lq *LockQuery) Where(ps ...predicate.Lock) *LockQuery

Where adds a new predicate for the LockQuery builder.

type LockSelect added in v1.6.1

type LockSelect struct {
	*LockQuery
	// contains filtered or unexported fields
}

LockSelect is the builder for selecting fields of Lock entities.

func (*LockSelect) Aggregate added in v1.6.1

func (ls *LockSelect) Aggregate(fns ...AggregateFunc) *LockSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LockSelect) Bool added in v1.6.1

func (s *LockSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LockSelect) BoolX added in v1.6.1

func (s *LockSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LockSelect) Bools added in v1.6.1

func (s *LockSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LockSelect) BoolsX added in v1.6.1

func (s *LockSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LockSelect) Float64 added in v1.6.1

func (s *LockSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LockSelect) Float64X added in v1.6.1

func (s *LockSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LockSelect) Float64s added in v1.6.1

func (s *LockSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LockSelect) Float64sX added in v1.6.1

func (s *LockSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LockSelect) Int added in v1.6.1

func (s *LockSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LockSelect) IntX added in v1.6.1

func (s *LockSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LockSelect) Ints added in v1.6.1

func (s *LockSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LockSelect) IntsX added in v1.6.1

func (s *LockSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LockSelect) Scan added in v1.6.1

func (ls *LockSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LockSelect) ScanX added in v1.6.1

func (s *LockSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LockSelect) String added in v1.6.1

func (s *LockSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LockSelect) StringX added in v1.6.1

func (s *LockSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LockSelect) Strings added in v1.6.1

func (s *LockSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LockSelect) StringsX added in v1.6.1

func (s *LockSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LockUpdate added in v1.6.1

type LockUpdate struct {
	// contains filtered or unexported fields
}

LockUpdate is the builder for updating Lock entities.

func (*LockUpdate) Exec added in v1.6.1

func (lu *LockUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LockUpdate) ExecX added in v1.6.1

func (lu *LockUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LockUpdate) Mutation added in v1.6.1

func (lu *LockUpdate) Mutation() *LockMutation

Mutation returns the LockMutation object of the builder.

func (*LockUpdate) Save added in v1.6.1

func (lu *LockUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LockUpdate) SaveX added in v1.6.1

func (lu *LockUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LockUpdate) Where added in v1.6.1

func (lu *LockUpdate) Where(ps ...predicate.Lock) *LockUpdate

Where appends a list predicates to the LockUpdate builder.

type LockUpdateOne added in v1.6.1

type LockUpdateOne struct {
	// contains filtered or unexported fields
}

LockUpdateOne is the builder for updating a single Lock entity.

func (*LockUpdateOne) Exec added in v1.6.1

func (luo *LockUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LockUpdateOne) ExecX added in v1.6.1

func (luo *LockUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LockUpdateOne) Mutation added in v1.6.1

func (luo *LockUpdateOne) Mutation() *LockMutation

Mutation returns the LockMutation object of the builder.

func (*LockUpdateOne) Save added in v1.6.1

func (luo *LockUpdateOne) Save(ctx context.Context) (*Lock, error)

Save executes the query and returns the updated Lock entity.

func (*LockUpdateOne) SaveX added in v1.6.1

func (luo *LockUpdateOne) SaveX(ctx context.Context) *Lock

SaveX is like Save, but panics if an error occurs.

func (*LockUpdateOne) Select added in v1.6.1

func (luo *LockUpdateOne) Select(field string, fields ...string) *LockUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LockUpdateOne) Where added in v1.6.1

func (luo *LockUpdateOne) Where(ps ...predicate.Lock) *LockUpdateOne

Where appends a list predicates to the LockUpdate builder.

type Locks added in v1.6.1

type Locks []*Lock

Locks is a parsable slice of Lock.

type Machine

type Machine struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// LastPush holds the value of the "last_push" field.
	LastPush *time.Time `json:"last_push,omitempty"`
	// LastHeartbeat holds the value of the "last_heartbeat" field.
	LastHeartbeat *time.Time `json:"last_heartbeat,omitempty"`
	// MachineId holds the value of the "machineId" field.
	MachineId string `json:"machineId,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// IpAddress holds the value of the "ipAddress" field.
	IpAddress string `json:"ipAddress,omitempty"`
	// Scenarios holds the value of the "scenarios" field.
	Scenarios string `json:"scenarios,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// IsValidated holds the value of the "isValidated" field.
	IsValidated bool `json:"isValidated,omitempty"`
	// AuthType holds the value of the "auth_type" field.
	AuthType string `json:"auth_type"`
	// Osname holds the value of the "osname" field.
	Osname string `json:"osname,omitempty"`
	// Osversion holds the value of the "osversion" field.
	Osversion string `json:"osversion,omitempty"`
	// Featureflags holds the value of the "featureflags" field.
	Featureflags string `json:"featureflags,omitempty"`
	// Hubstate holds the value of the "hubstate" field.
	Hubstate map[string][]schema.ItemState `json:"hubstate,omitempty"`
	// Datasources holds the value of the "datasources" field.
	Datasources map[string]int64 `json:"datasources,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) GetFeatureflags added in v1.6.3

func (m *Machine) GetFeatureflags() string

func (*Machine) GetOsname added in v1.6.3

func (m *Machine) GetOsname() string

func (*Machine) GetOsversion added in v1.6.3

func (m *Machine) GetOsversion() string

func (*Machine) QueryAlerts

func (m *Machine) QueryAlerts() *AlertQuery

QueryAlerts queries the "alerts" edge of the Machine entity.

func (*Machine) String

func (m *Machine) String() string

String implements the fmt.Stringer.

func (*Machine) Unwrap

func (m *Machine) Unwrap() *Machine

Unwrap unwraps the Machine entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Machine) Update

func (m *Machine) Update() *MachineUpdateOne

Update returns a builder for updating this Machine. Note that you need to call Machine.Unwrap() before calling this method if this Machine was returned from a transaction, and the transaction was committed or rolled back.

func (*Machine) Value added in v1.6.1

func (m *Machine) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Machine. This includes values selected through modifiers, order, etc.

type MachineClient

type MachineClient struct {
	// contains filtered or unexported fields
}

MachineClient is a client for the Machine schema.

func NewMachineClient

func NewMachineClient(c config) *MachineClient

NewMachineClient returns a client for the Machine from the given config.

func (*MachineClient) Create

func (c *MachineClient) Create() *MachineCreate

Create returns a builder for creating a Machine entity.

func (*MachineClient) CreateBulk

func (c *MachineClient) CreateBulk(builders ...*MachineCreate) *MachineCreateBulk

CreateBulk returns a builder for creating a bulk of Machine entities.

func (*MachineClient) Delete

func (c *MachineClient) Delete() *MachineDelete

Delete returns a delete builder for Machine.

func (*MachineClient) DeleteOne

func (c *MachineClient) DeleteOne(m *Machine) *MachineDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MachineClient) DeleteOneID

func (c *MachineClient) DeleteOneID(id int) *MachineDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MachineClient) Get

func (c *MachineClient) Get(ctx context.Context, id int) (*Machine, error)

Get returns a Machine entity by its id.

func (*MachineClient) GetX

func (c *MachineClient) GetX(ctx context.Context, id int) *Machine

GetX is like Get, but panics if an error occurs.

func (*MachineClient) Hooks

func (c *MachineClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MachineClient) Intercept added in v1.6.1

func (c *MachineClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `machine.Intercept(f(g(h())))`.

func (*MachineClient) Interceptors added in v1.6.1

func (c *MachineClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MachineClient) MapCreateBulk added in v1.6.1

func (c *MachineClient) MapCreateBulk(slice any, setFunc func(*MachineCreate, int)) *MachineCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MachineClient) Query

func (c *MachineClient) Query() *MachineQuery

Query returns a query builder for Machine.

func (*MachineClient) QueryAlerts

func (c *MachineClient) QueryAlerts(m *Machine) *AlertQuery

QueryAlerts queries the alerts edge of a Machine.

func (*MachineClient) Update

func (c *MachineClient) Update() *MachineUpdate

Update returns an update builder for Machine.

func (*MachineClient) UpdateOne

func (c *MachineClient) UpdateOne(m *Machine) *MachineUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MachineClient) UpdateOneID

func (c *MachineClient) UpdateOneID(id int) *MachineUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MachineClient) Use

func (c *MachineClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `machine.Hooks(f(g(h())))`.

type MachineCreate

type MachineCreate struct {
	// contains filtered or unexported fields
}

MachineCreate is the builder for creating a Machine entity.

func (*MachineCreate) AddAlertIDs

func (mc *MachineCreate) AddAlertIDs(ids ...int) *MachineCreate

AddAlertIDs adds the "alerts" edge to the Alert entity by IDs.

func (*MachineCreate) AddAlerts

func (mc *MachineCreate) AddAlerts(a ...*Alert) *MachineCreate

AddAlerts adds the "alerts" edges to the Alert entity.

func (*MachineCreate) Exec added in v1.2.1

func (mc *MachineCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MachineCreate) ExecX added in v1.2.1

func (mc *MachineCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MachineCreate) Mutation

func (mc *MachineCreate) Mutation() *MachineMutation

Mutation returns the MachineMutation object of the builder.

func (*MachineCreate) Save

func (mc *MachineCreate) Save(ctx context.Context) (*Machine, error)

Save creates the Machine in the database.

func (*MachineCreate) SaveX

func (mc *MachineCreate) SaveX(ctx context.Context) *Machine

SaveX calls Save and panics if Save returns an error.

func (*MachineCreate) SetAuthType added in v1.4.0

func (mc *MachineCreate) SetAuthType(s string) *MachineCreate

SetAuthType sets the "auth_type" field.

func (*MachineCreate) SetCreatedAt

func (mc *MachineCreate) SetCreatedAt(t time.Time) *MachineCreate

SetCreatedAt sets the "created_at" field.

func (*MachineCreate) SetDatasources added in v1.6.3

func (mc *MachineCreate) SetDatasources(m map[string]int64) *MachineCreate

SetDatasources sets the "datasources" field.

func (*MachineCreate) SetFeatureflags added in v1.6.3

func (mc *MachineCreate) SetFeatureflags(s string) *MachineCreate

SetFeatureflags sets the "featureflags" field.

func (*MachineCreate) SetHubstate added in v1.6.3

func (mc *MachineCreate) SetHubstate(ms map[string][]schema.ItemState) *MachineCreate

SetHubstate sets the "hubstate" field.

func (*MachineCreate) SetIpAddress

func (mc *MachineCreate) SetIpAddress(s string) *MachineCreate

SetIpAddress sets the "ipAddress" field.

func (*MachineCreate) SetIsValidated

func (mc *MachineCreate) SetIsValidated(b bool) *MachineCreate

SetIsValidated sets the "isValidated" field.

func (*MachineCreate) SetLastHeartbeat added in v1.4.0

func (mc *MachineCreate) SetLastHeartbeat(t time.Time) *MachineCreate

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineCreate) SetLastPush added in v1.3.0

func (mc *MachineCreate) SetLastPush(t time.Time) *MachineCreate

SetLastPush sets the "last_push" field.

func (*MachineCreate) SetMachineId

func (mc *MachineCreate) SetMachineId(s string) *MachineCreate

SetMachineId sets the "machineId" field.

func (*MachineCreate) SetNillableAuthType added in v1.4.0

func (mc *MachineCreate) SetNillableAuthType(s *string) *MachineCreate

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*MachineCreate) SetNillableCreatedAt

func (mc *MachineCreate) SetNillableCreatedAt(t *time.Time) *MachineCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MachineCreate) SetNillableFeatureflags added in v1.6.3

func (mc *MachineCreate) SetNillableFeatureflags(s *string) *MachineCreate

SetNillableFeatureflags sets the "featureflags" field if the given value is not nil.

func (*MachineCreate) SetNillableIsValidated

func (mc *MachineCreate) SetNillableIsValidated(b *bool) *MachineCreate

SetNillableIsValidated sets the "isValidated" field if the given value is not nil.

func (*MachineCreate) SetNillableLastHeartbeat added in v1.4.0

func (mc *MachineCreate) SetNillableLastHeartbeat(t *time.Time) *MachineCreate

SetNillableLastHeartbeat sets the "last_heartbeat" field if the given value is not nil.

func (*MachineCreate) SetNillableLastPush added in v1.3.0

func (mc *MachineCreate) SetNillableLastPush(t *time.Time) *MachineCreate

SetNillableLastPush sets the "last_push" field if the given value is not nil.

func (*MachineCreate) SetNillableOsname added in v1.6.3

func (mc *MachineCreate) SetNillableOsname(s *string) *MachineCreate

SetNillableOsname sets the "osname" field if the given value is not nil.

func (*MachineCreate) SetNillableOsversion added in v1.6.3

func (mc *MachineCreate) SetNillableOsversion(s *string) *MachineCreate

SetNillableOsversion sets the "osversion" 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) 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) SetOsname added in v1.6.3

func (mc *MachineCreate) SetOsname(s string) *MachineCreate

SetOsname sets the "osname" field.

func (*MachineCreate) SetOsversion added in v1.6.3

func (mc *MachineCreate) SetOsversion(s string) *MachineCreate

SetOsversion sets the "osversion" field.

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) SetUpdatedAt

func (mc *MachineCreate) SetUpdatedAt(t time.Time) *MachineCreate

SetUpdatedAt sets the "updated_at" field.

func (*MachineCreate) SetVersion

func (mc *MachineCreate) SetVersion(s string) *MachineCreate

SetVersion sets the "version" field.

type MachineCreateBulk

type MachineCreateBulk struct {
	// contains filtered or unexported fields
}

MachineCreateBulk is the builder for creating many Machine entities in bulk.

func (*MachineCreateBulk) Exec added in v1.2.1

func (mcb *MachineCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MachineCreateBulk) ExecX added in v1.2.1

func (mcb *MachineCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MachineCreateBulk) Save

func (mcb *MachineCreateBulk) Save(ctx context.Context) ([]*Machine, error)

Save creates the Machine entities in the database.

func (*MachineCreateBulk) SaveX

func (mcb *MachineCreateBulk) SaveX(ctx context.Context) []*Machine

SaveX is like Save, but panics if an error occurs.

type MachineDelete

type MachineDelete struct {
	// contains filtered or unexported fields
}

MachineDelete is the builder for deleting a Machine entity.

func (*MachineDelete) Exec

func (md *MachineDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MachineDelete) ExecX

func (md *MachineDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MachineDelete) Where

func (md *MachineDelete) Where(ps ...predicate.Machine) *MachineDelete

Where appends a list predicates to the MachineDelete builder.

type MachineDeleteOne

type MachineDeleteOne struct {
	// contains filtered or unexported fields
}

MachineDeleteOne is the builder for deleting a single Machine entity.

func (*MachineDeleteOne) Exec

func (mdo *MachineDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MachineDeleteOne) ExecX

func (mdo *MachineDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MachineDeleteOne) Where added in v1.6.1

Where appends a list predicates to the MachineDelete builder.

type MachineEdges

type MachineEdges struct {
	// Alerts holds the value of the alerts edge.
	Alerts []*Alert `json:"alerts,omitempty"`
	// contains filtered or unexported fields
}

MachineEdges holds the relations/edges for other nodes in the graph.

func (MachineEdges) AlertsOrErr

func (e MachineEdges) AlertsOrErr() ([]*Alert, error)

AlertsOrErr returns the Alerts value or an error if the edge was not loaded in eager-loading.

type MachineGroupBy

type MachineGroupBy struct {
	// contains filtered or unexported fields
}

MachineGroupBy is the group-by builder for Machine entities.

func (*MachineGroupBy) Aggregate

func (mgb *MachineGroupBy) Aggregate(fns ...AggregateFunc) *MachineGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MachineGroupBy) Bool

func (s *MachineGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) BoolX

func (s *MachineGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MachineGroupBy) Bools

func (s *MachineGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) BoolsX

func (s *MachineGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MachineGroupBy) Float64

func (s *MachineGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) Float64X

func (s *MachineGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MachineGroupBy) Float64s

func (s *MachineGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) Float64sX

func (s *MachineGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MachineGroupBy) Int

func (s *MachineGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) IntX

func (s *MachineGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MachineGroupBy) Ints

func (s *MachineGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) IntsX

func (s *MachineGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MachineGroupBy) Scan

func (mgb *MachineGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MachineGroupBy) ScanX

func (s *MachineGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MachineGroupBy) String

func (s *MachineGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) StringX

func (s *MachineGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MachineGroupBy) Strings

func (s *MachineGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MachineGroupBy) StringsX

func (s *MachineGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MachineMutation

type MachineMutation struct {
	// contains filtered or unexported fields
}

MachineMutation represents an operation that mutates the Machine nodes in the graph.

func (*MachineMutation) AddAlertIDs

func (m *MachineMutation) AddAlertIDs(ids ...int)

AddAlertIDs adds the "alerts" edge to the Alert entity by ids.

func (*MachineMutation) AddField

func (m *MachineMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MachineMutation) AddedEdges

func (m *MachineMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MachineMutation) AddedField

func (m *MachineMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MachineMutation) AddedFields

func (m *MachineMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MachineMutation) AddedIDs

func (m *MachineMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MachineMutation) AlertsCleared

func (m *MachineMutation) AlertsCleared() bool

AlertsCleared reports if the "alerts" edge to the Alert entity was cleared.

func (*MachineMutation) AlertsIDs

func (m *MachineMutation) AlertsIDs() (ids []int)

AlertsIDs returns the "alerts" edge IDs in the mutation.

func (*MachineMutation) AuthType added in v1.4.0

func (m *MachineMutation) AuthType() (r string, exists bool)

AuthType returns the value of the "auth_type" field in the mutation.

func (*MachineMutation) ClearAlerts

func (m *MachineMutation) ClearAlerts()

ClearAlerts clears the "alerts" edge to the Alert entity.

func (*MachineMutation) ClearDatasources added in v1.6.3

func (m *MachineMutation) ClearDatasources()

ClearDatasources clears the value of the "datasources" field.

func (*MachineMutation) ClearEdge

func (m *MachineMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MachineMutation) ClearFeatureflags added in v1.6.3

func (m *MachineMutation) ClearFeatureflags()

ClearFeatureflags clears the value of the "featureflags" field.

func (*MachineMutation) ClearField

func (m *MachineMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MachineMutation) ClearHubstate added in v1.6.3

func (m *MachineMutation) ClearHubstate()

ClearHubstate clears the value of the "hubstate" field.

func (*MachineMutation) ClearLastHeartbeat added in v1.4.0

func (m *MachineMutation) ClearLastHeartbeat()

ClearLastHeartbeat clears the value of the "last_heartbeat" field.

func (*MachineMutation) ClearLastPush added in v1.3.0

func (m *MachineMutation) ClearLastPush()

ClearLastPush clears the value of the "last_push" field.

func (*MachineMutation) ClearOsname added in v1.6.3

func (m *MachineMutation) ClearOsname()

ClearOsname clears the value of the "osname" field.

func (*MachineMutation) ClearOsversion added in v1.6.3

func (m *MachineMutation) ClearOsversion()

ClearOsversion clears the value of the "osversion" field.

func (*MachineMutation) ClearScenarios

func (m *MachineMutation) ClearScenarios()

ClearScenarios clears the value of the "scenarios" field.

func (*MachineMutation) ClearVersion

func (m *MachineMutation) ClearVersion()

ClearVersion clears the value of the "version" field.

func (*MachineMutation) ClearedEdges

func (m *MachineMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MachineMutation) ClearedFields

func (m *MachineMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MachineMutation) Client

func (m MachineMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MachineMutation) CreatedAt

func (m *MachineMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MachineMutation) Datasources added in v1.6.3

func (m *MachineMutation) Datasources() (r map[string]int64, exists bool)

Datasources returns the value of the "datasources" field in the mutation.

func (*MachineMutation) DatasourcesCleared added in v1.6.3

func (m *MachineMutation) DatasourcesCleared() bool

DatasourcesCleared returns if the "datasources" field was cleared in this mutation.

func (*MachineMutation) EdgeCleared

func (m *MachineMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MachineMutation) Featureflags added in v1.6.3

func (m *MachineMutation) Featureflags() (r string, exists bool)

Featureflags returns the value of the "featureflags" field in the mutation.

func (*MachineMutation) FeatureflagsCleared added in v1.6.3

func (m *MachineMutation) FeatureflagsCleared() bool

FeatureflagsCleared returns if the "featureflags" field was cleared in this mutation.

func (*MachineMutation) Field

func (m *MachineMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MachineMutation) FieldCleared

func (m *MachineMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MachineMutation) Fields

func (m *MachineMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MachineMutation) Hubstate added in v1.6.3

func (m *MachineMutation) Hubstate() (r map[string][]schema.ItemState, exists bool)

Hubstate returns the value of the "hubstate" field in the mutation.

func (*MachineMutation) HubstateCleared added in v1.6.3

func (m *MachineMutation) HubstateCleared() bool

HubstateCleared returns if the "hubstate" field was cleared in this mutation.

func (*MachineMutation) ID

func (m *MachineMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MachineMutation) IDs added in v1.3.1

func (m *MachineMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MachineMutation) IpAddress

func (m *MachineMutation) IpAddress() (r string, exists bool)

IpAddress returns the value of the "ipAddress" field in the mutation.

func (*MachineMutation) IsValidated

func (m *MachineMutation) IsValidated() (r bool, exists bool)

IsValidated returns the value of the "isValidated" field in the mutation.

func (*MachineMutation) LastHeartbeat added in v1.4.0

func (m *MachineMutation) LastHeartbeat() (r time.Time, exists bool)

LastHeartbeat returns the value of the "last_heartbeat" field in the mutation.

func (*MachineMutation) LastHeartbeatCleared added in v1.4.0

func (m *MachineMutation) LastHeartbeatCleared() bool

LastHeartbeatCleared returns if the "last_heartbeat" field was cleared in this mutation.

func (*MachineMutation) LastPush added in v1.3.0

func (m *MachineMutation) LastPush() (r time.Time, exists bool)

LastPush returns the value of the "last_push" field in the mutation.

func (*MachineMutation) LastPushCleared added in v1.3.0

func (m *MachineMutation) LastPushCleared() bool

LastPushCleared returns if the "last_push" field was cleared in this mutation.

func (*MachineMutation) MachineId

func (m *MachineMutation) MachineId() (r string, exists bool)

MachineId returns the value of the "machineId" field in the mutation.

func (*MachineMutation) OldAuthType added in v1.4.0

func (m *MachineMutation) OldAuthType(ctx context.Context) (v string, err error)

OldAuthType returns the old "auth_type" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldCreatedAt

func (m *MachineMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldDatasources added in v1.6.3

func (m *MachineMutation) OldDatasources(ctx context.Context) (v map[string]int64, err error)

OldDatasources returns the old "datasources" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldFeatureflags added in v1.6.3

func (m *MachineMutation) OldFeatureflags(ctx context.Context) (v string, err error)

OldFeatureflags returns the old "featureflags" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldField

func (m *MachineMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MachineMutation) OldHubstate added in v1.6.3

func (m *MachineMutation) OldHubstate(ctx context.Context) (v map[string][]schema.ItemState, err error)

OldHubstate returns the old "hubstate" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldIpAddress

func (m *MachineMutation) OldIpAddress(ctx context.Context) (v string, err error)

OldIpAddress returns the old "ipAddress" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldIsValidated

func (m *MachineMutation) OldIsValidated(ctx context.Context) (v bool, err error)

OldIsValidated returns the old "isValidated" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldLastHeartbeat added in v1.4.0

func (m *MachineMutation) OldLastHeartbeat(ctx context.Context) (v *time.Time, err error)

OldLastHeartbeat returns the old "last_heartbeat" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldLastPush added in v1.3.0

func (m *MachineMutation) OldLastPush(ctx context.Context) (v *time.Time, err error)

OldLastPush returns the old "last_push" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldMachineId

func (m *MachineMutation) OldMachineId(ctx context.Context) (v string, err error)

OldMachineId returns the old "machineId" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldOsname added in v1.6.3

func (m *MachineMutation) OldOsname(ctx context.Context) (v string, err error)

OldOsname returns the old "osname" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldOsversion added in v1.6.3

func (m *MachineMutation) OldOsversion(ctx context.Context) (v string, err error)

OldOsversion returns the old "osversion" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldPassword

func (m *MachineMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldScenarios

func (m *MachineMutation) OldScenarios(ctx context.Context) (v string, err error)

OldScenarios returns the old "scenarios" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldUpdatedAt

func (m *MachineMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) OldVersion

func (m *MachineMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the Machine entity. If the Machine object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MachineMutation) Op

func (m *MachineMutation) Op() Op

Op returns the operation name.

func (*MachineMutation) Osname added in v1.6.3

func (m *MachineMutation) Osname() (r string, exists bool)

Osname returns the value of the "osname" field in the mutation.

func (*MachineMutation) OsnameCleared added in v1.6.3

func (m *MachineMutation) OsnameCleared() bool

OsnameCleared returns if the "osname" field was cleared in this mutation.

func (*MachineMutation) Osversion added in v1.6.3

func (m *MachineMutation) Osversion() (r string, exists bool)

Osversion returns the value of the "osversion" field in the mutation.

func (*MachineMutation) OsversionCleared added in v1.6.3

func (m *MachineMutation) OsversionCleared() bool

OsversionCleared returns if the "osversion" field was cleared in this mutation.

func (*MachineMutation) Password

func (m *MachineMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*MachineMutation) RemoveAlertIDs

func (m *MachineMutation) RemoveAlertIDs(ids ...int)

RemoveAlertIDs removes the "alerts" edge to the Alert entity by IDs.

func (*MachineMutation) RemovedAlertsIDs

func (m *MachineMutation) RemovedAlertsIDs() (ids []int)

RemovedAlerts returns the removed IDs of the "alerts" edge to the Alert entity.

func (*MachineMutation) RemovedEdges

func (m *MachineMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MachineMutation) RemovedIDs

func (m *MachineMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MachineMutation) ResetAlerts

func (m *MachineMutation) ResetAlerts()

ResetAlerts resets all changes to the "alerts" edge.

func (*MachineMutation) ResetAuthType added in v1.4.0

func (m *MachineMutation) ResetAuthType()

ResetAuthType resets all changes to the "auth_type" field.

func (*MachineMutation) ResetCreatedAt

func (m *MachineMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MachineMutation) ResetDatasources added in v1.6.3

func (m *MachineMutation) ResetDatasources()

ResetDatasources resets all changes to the "datasources" field.

func (*MachineMutation) ResetEdge

func (m *MachineMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MachineMutation) ResetFeatureflags added in v1.6.3

func (m *MachineMutation) ResetFeatureflags()

ResetFeatureflags resets all changes to the "featureflags" field.

func (*MachineMutation) ResetField

func (m *MachineMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MachineMutation) ResetHubstate added in v1.6.3

func (m *MachineMutation) ResetHubstate()

ResetHubstate resets all changes to the "hubstate" field.

func (*MachineMutation) ResetIpAddress

func (m *MachineMutation) ResetIpAddress()

ResetIpAddress resets all changes to the "ipAddress" field.

func (*MachineMutation) ResetIsValidated

func (m *MachineMutation) ResetIsValidated()

ResetIsValidated resets all changes to the "isValidated" field.

func (*MachineMutation) ResetLastHeartbeat added in v1.4.0

func (m *MachineMutation) ResetLastHeartbeat()

ResetLastHeartbeat resets all changes to the "last_heartbeat" field.

func (*MachineMutation) ResetLastPush added in v1.3.0

func (m *MachineMutation) ResetLastPush()

ResetLastPush resets all changes to the "last_push" field.

func (*MachineMutation) ResetMachineId

func (m *MachineMutation) ResetMachineId()

ResetMachineId resets all changes to the "machineId" field.

func (*MachineMutation) ResetOsname added in v1.6.3

func (m *MachineMutation) ResetOsname()

ResetOsname resets all changes to the "osname" field.

func (*MachineMutation) ResetOsversion added in v1.6.3

func (m *MachineMutation) ResetOsversion()

ResetOsversion resets all changes to the "osversion" field.

func (*MachineMutation) ResetPassword

func (m *MachineMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*MachineMutation) ResetScenarios

func (m *MachineMutation) ResetScenarios()

ResetScenarios resets all changes to the "scenarios" field.

func (*MachineMutation) ResetUpdatedAt

func (m *MachineMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MachineMutation) ResetVersion

func (m *MachineMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*MachineMutation) Scenarios

func (m *MachineMutation) Scenarios() (r string, exists bool)

Scenarios returns the value of the "scenarios" field in the mutation.

func (*MachineMutation) ScenariosCleared

func (m *MachineMutation) ScenariosCleared() bool

ScenariosCleared returns if the "scenarios" field was cleared in this mutation.

func (*MachineMutation) SetAuthType added in v1.4.0

func (m *MachineMutation) SetAuthType(s string)

SetAuthType sets the "auth_type" field.

func (*MachineMutation) SetCreatedAt

func (m *MachineMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MachineMutation) SetDatasources added in v1.6.3

func (m *MachineMutation) SetDatasources(value map[string]int64)

SetDatasources sets the "datasources" field.

func (*MachineMutation) SetFeatureflags added in v1.6.3

func (m *MachineMutation) SetFeatureflags(s string)

SetFeatureflags sets the "featureflags" field.

func (*MachineMutation) SetField

func (m *MachineMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MachineMutation) SetHubstate added in v1.6.3

func (m *MachineMutation) SetHubstate(ms map[string][]schema.ItemState)

SetHubstate sets the "hubstate" field.

func (*MachineMutation) SetIpAddress

func (m *MachineMutation) SetIpAddress(s string)

SetIpAddress sets the "ipAddress" field.

func (*MachineMutation) SetIsValidated

func (m *MachineMutation) SetIsValidated(b bool)

SetIsValidated sets the "isValidated" field.

func (*MachineMutation) SetLastHeartbeat added in v1.4.0

func (m *MachineMutation) SetLastHeartbeat(t time.Time)

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineMutation) SetLastPush added in v1.3.0

func (m *MachineMutation) SetLastPush(t time.Time)

SetLastPush sets the "last_push" field.

func (*MachineMutation) SetMachineId

func (m *MachineMutation) SetMachineId(s string)

SetMachineId sets the "machineId" field.

func (*MachineMutation) SetOp added in v1.6.1

func (m *MachineMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MachineMutation) SetOsname added in v1.6.3

func (m *MachineMutation) SetOsname(s string)

SetOsname sets the "osname" field.

func (*MachineMutation) SetOsversion added in v1.6.3

func (m *MachineMutation) SetOsversion(s string)

SetOsversion sets the "osversion" 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) 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) Tx

func (m MachineMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MachineMutation) Type

func (m *MachineMutation) Type() string

Type returns the node type of this mutation (Machine).

func (*MachineMutation) UpdatedAt

func (m *MachineMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MachineMutation) Version

func (m *MachineMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*MachineMutation) VersionCleared

func (m *MachineMutation) VersionCleared() bool

VersionCleared returns if the "version" field was cleared in this mutation.

func (*MachineMutation) Where added in v1.2.1

func (m *MachineMutation) Where(ps ...predicate.Machine)

Where appends a list predicates to the MachineMutation builder.

func (*MachineMutation) WhereP added in v1.6.1

func (m *MachineMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MachineMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MachineQuery

type MachineQuery struct {
	// contains filtered or unexported fields
}

MachineQuery is the builder for querying Machine entities.

func (*MachineQuery) Aggregate added in v1.6.1

func (mq *MachineQuery) Aggregate(fns ...AggregateFunc) *MachineSelect

Aggregate returns a MachineSelect configured with the given aggregations.

func (*MachineQuery) All

func (mq *MachineQuery) All(ctx context.Context) ([]*Machine, error)

All executes the query and returns a list of Machines.

func (*MachineQuery) AllX

func (mq *MachineQuery) AllX(ctx context.Context) []*Machine

AllX is like All, but panics if an error occurs.

func (*MachineQuery) Clone

func (mq *MachineQuery) Clone() *MachineQuery

Clone returns a duplicate of the MachineQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MachineQuery) Count

func (mq *MachineQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MachineQuery) CountX

func (mq *MachineQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MachineQuery) Exist

func (mq *MachineQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MachineQuery) ExistX

func (mq *MachineQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MachineQuery) First

func (mq *MachineQuery) First(ctx context.Context) (*Machine, error)

First returns the first Machine entity from the query. Returns a *NotFoundError when no Machine was found.

func (*MachineQuery) FirstID

func (mq *MachineQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Machine ID from the query. Returns a *NotFoundError when no Machine ID was found.

func (*MachineQuery) FirstIDX added in v1.0.3

func (mq *MachineQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MachineQuery) FirstX

func (mq *MachineQuery) FirstX(ctx context.Context) *Machine

FirstX is like First, but panics if an error occurs.

func (*MachineQuery) GroupBy

func (mq *MachineQuery) GroupBy(field string, fields ...string) *MachineGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Machine.Query().
	GroupBy(machine.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MachineQuery) IDs

func (mq *MachineQuery) IDs(ctx context.Context) (ids []int, err 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 the number of records to be returned by this query.

func (*MachineQuery) Offset

func (mq *MachineQuery) Offset(offset int) *MachineQuery

Offset to start from.

func (*MachineQuery) Only

func (mq *MachineQuery) Only(ctx context.Context) (*Machine, error)

Only returns a single Machine entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Machine entity is found. Returns a *NotFoundError when no Machine entities are found.

func (*MachineQuery) OnlyID

func (mq *MachineQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Machine ID in the query. Returns a *NotSingularError when more than one Machine ID is found. Returns a *NotFoundError when no entities are found.

func (*MachineQuery) OnlyIDX

func (mq *MachineQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MachineQuery) OnlyX

func (mq *MachineQuery) OnlyX(ctx context.Context) *Machine

OnlyX is like Only, but panics if an error occurs.

func (*MachineQuery) Order

func (mq *MachineQuery) Order(o ...machine.OrderOption) *MachineQuery

Order specifies how the records should be ordered.

func (*MachineQuery) QueryAlerts

func (mq *MachineQuery) QueryAlerts() *AlertQuery

QueryAlerts chains the current query on the "alerts" edge.

func (*MachineQuery) Select

func (mq *MachineQuery) Select(fields ...string) *MachineSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Machine.Query().
	Select(machine.FieldCreatedAt).
	Scan(ctx, &v)

func (*MachineQuery) Unique added in v1.2.1

func (mq *MachineQuery) Unique(unique bool) *MachineQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MachineQuery) Where

func (mq *MachineQuery) Where(ps ...predicate.Machine) *MachineQuery

Where adds a new predicate for the MachineQuery builder.

func (*MachineQuery) WithAlerts

func (mq *MachineQuery) WithAlerts(opts ...func(*AlertQuery)) *MachineQuery

WithAlerts tells the query-builder to eager-load the nodes that are connected to the "alerts" edge. The optional arguments are used to configure the query builder of the edge.

type MachineSelect

type MachineSelect struct {
	*MachineQuery
	// contains filtered or unexported fields
}

MachineSelect is the builder for selecting fields of Machine entities.

func (*MachineSelect) Aggregate added in v1.6.1

func (ms *MachineSelect) Aggregate(fns ...AggregateFunc) *MachineSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MachineSelect) Bool

func (s *MachineSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MachineSelect) BoolX

func (s *MachineSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MachineSelect) Bools

func (s *MachineSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MachineSelect) BoolsX

func (s *MachineSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MachineSelect) Float64

func (s *MachineSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MachineSelect) Float64X

func (s *MachineSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MachineSelect) Float64s

func (s *MachineSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MachineSelect) Float64sX

func (s *MachineSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MachineSelect) Int

func (s *MachineSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MachineSelect) IntX

func (s *MachineSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MachineSelect) Ints

func (s *MachineSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MachineSelect) IntsX

func (s *MachineSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MachineSelect) Scan

func (ms *MachineSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MachineSelect) ScanX

func (s *MachineSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MachineSelect) String

func (s *MachineSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MachineSelect) StringX

func (s *MachineSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MachineSelect) Strings

func (s *MachineSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MachineSelect) StringsX

func (s *MachineSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MachineUpdate

type MachineUpdate struct {
	// contains filtered or unexported fields
}

MachineUpdate is the builder for updating Machine entities.

func (*MachineUpdate) AddAlertIDs

func (mu *MachineUpdate) AddAlertIDs(ids ...int) *MachineUpdate

AddAlertIDs adds the "alerts" edge to the Alert entity by IDs.

func (*MachineUpdate) AddAlerts

func (mu *MachineUpdate) AddAlerts(a ...*Alert) *MachineUpdate

AddAlerts adds the "alerts" edges to the Alert entity.

func (*MachineUpdate) ClearAlerts

func (mu *MachineUpdate) ClearAlerts() *MachineUpdate

ClearAlerts clears all "alerts" edges to the Alert entity.

func (*MachineUpdate) ClearDatasources added in v1.6.3

func (mu *MachineUpdate) ClearDatasources() *MachineUpdate

ClearDatasources clears the value of the "datasources" field.

func (*MachineUpdate) ClearFeatureflags added in v1.6.3

func (mu *MachineUpdate) ClearFeatureflags() *MachineUpdate

ClearFeatureflags clears the value of the "featureflags" field.

func (*MachineUpdate) ClearHubstate added in v1.6.3

func (mu *MachineUpdate) ClearHubstate() *MachineUpdate

ClearHubstate clears the value of the "hubstate" field.

func (*MachineUpdate) ClearLastHeartbeat added in v1.4.0

func (mu *MachineUpdate) ClearLastHeartbeat() *MachineUpdate

ClearLastHeartbeat clears the value of the "last_heartbeat" field.

func (*MachineUpdate) ClearLastPush added in v1.3.0

func (mu *MachineUpdate) ClearLastPush() *MachineUpdate

ClearLastPush clears the value of the "last_push" field.

func (*MachineUpdate) ClearOsname added in v1.6.3

func (mu *MachineUpdate) ClearOsname() *MachineUpdate

ClearOsname clears the value of the "osname" field.

func (*MachineUpdate) ClearOsversion added in v1.6.3

func (mu *MachineUpdate) ClearOsversion() *MachineUpdate

ClearOsversion clears the value of the "osversion" field.

func (*MachineUpdate) ClearScenarios

func (mu *MachineUpdate) ClearScenarios() *MachineUpdate

ClearScenarios clears the value of the "scenarios" field.

func (*MachineUpdate) ClearVersion

func (mu *MachineUpdate) ClearVersion() *MachineUpdate

ClearVersion clears the value of the "version" field.

func (*MachineUpdate) Exec

func (mu *MachineUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MachineUpdate) ExecX

func (mu *MachineUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MachineUpdate) Mutation

func (mu *MachineUpdate) Mutation() *MachineMutation

Mutation returns the MachineMutation object of the builder.

func (*MachineUpdate) RemoveAlertIDs

func (mu *MachineUpdate) RemoveAlertIDs(ids ...int) *MachineUpdate

RemoveAlertIDs removes the "alerts" edge to Alert entities by IDs.

func (*MachineUpdate) RemoveAlerts

func (mu *MachineUpdate) RemoveAlerts(a ...*Alert) *MachineUpdate

RemoveAlerts removes "alerts" edges to Alert entities.

func (*MachineUpdate) Save

func (mu *MachineUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MachineUpdate) SaveX

func (mu *MachineUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MachineUpdate) SetAuthType added in v1.4.0

func (mu *MachineUpdate) SetAuthType(s string) *MachineUpdate

SetAuthType sets the "auth_type" field.

func (*MachineUpdate) SetDatasources added in v1.6.3

func (mu *MachineUpdate) SetDatasources(m map[string]int64) *MachineUpdate

SetDatasources sets the "datasources" field.

func (*MachineUpdate) SetFeatureflags added in v1.6.3

func (mu *MachineUpdate) SetFeatureflags(s string) *MachineUpdate

SetFeatureflags sets the "featureflags" field.

func (*MachineUpdate) SetHubstate added in v1.6.3

func (mu *MachineUpdate) SetHubstate(ms map[string][]schema.ItemState) *MachineUpdate

SetHubstate sets the "hubstate" field.

func (*MachineUpdate) SetIpAddress

func (mu *MachineUpdate) SetIpAddress(s string) *MachineUpdate

SetIpAddress sets the "ipAddress" field.

func (*MachineUpdate) SetIsValidated

func (mu *MachineUpdate) SetIsValidated(b bool) *MachineUpdate

SetIsValidated sets the "isValidated" field.

func (*MachineUpdate) SetLastHeartbeat added in v1.4.0

func (mu *MachineUpdate) SetLastHeartbeat(t time.Time) *MachineUpdate

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineUpdate) SetLastPush added in v1.3.0

func (mu *MachineUpdate) SetLastPush(t time.Time) *MachineUpdate

SetLastPush sets the "last_push" field.

func (*MachineUpdate) SetNillableAuthType added in v1.4.0

func (mu *MachineUpdate) SetNillableAuthType(s *string) *MachineUpdate

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*MachineUpdate) SetNillableFeatureflags added in v1.6.3

func (mu *MachineUpdate) SetNillableFeatureflags(s *string) *MachineUpdate

SetNillableFeatureflags sets the "featureflags" field if the given value is not nil.

func (*MachineUpdate) SetNillableIpAddress added in v1.6.1

func (mu *MachineUpdate) SetNillableIpAddress(s *string) *MachineUpdate

SetNillableIpAddress sets the "ipAddress" 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) SetNillableLastHeartbeat added in v1.6.2

func (mu *MachineUpdate) SetNillableLastHeartbeat(t *time.Time) *MachineUpdate

SetNillableLastHeartbeat sets the "last_heartbeat" field if the given value is not nil.

func (*MachineUpdate) SetNillableLastPush added in v1.6.2

func (mu *MachineUpdate) SetNillableLastPush(t *time.Time) *MachineUpdate

SetNillableLastPush sets the "last_push" field if the given value is not nil.

func (*MachineUpdate) SetNillableOsname added in v1.6.3

func (mu *MachineUpdate) SetNillableOsname(s *string) *MachineUpdate

SetNillableOsname sets the "osname" field if the given value is not nil.

func (*MachineUpdate) SetNillableOsversion added in v1.6.3

func (mu *MachineUpdate) SetNillableOsversion(s *string) *MachineUpdate

SetNillableOsversion sets the "osversion" field if the given value is not nil.

func (*MachineUpdate) SetNillablePassword added in v1.6.1

func (mu *MachineUpdate) SetNillablePassword(s *string) *MachineUpdate

SetNillablePassword sets the "password" 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) SetNillableVersion

func (mu *MachineUpdate) SetNillableVersion(s *string) *MachineUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MachineUpdate) SetOsname added in v1.6.3

func (mu *MachineUpdate) SetOsname(s string) *MachineUpdate

SetOsname sets the "osname" field.

func (*MachineUpdate) SetOsversion added in v1.6.3

func (mu *MachineUpdate) SetOsversion(s string) *MachineUpdate

SetOsversion sets the "osversion" field.

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) SetUpdatedAt

func (mu *MachineUpdate) SetUpdatedAt(t time.Time) *MachineUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MachineUpdate) SetVersion

func (mu *MachineUpdate) SetVersion(s string) *MachineUpdate

SetVersion sets the "version" field.

func (*MachineUpdate) Where

func (mu *MachineUpdate) Where(ps ...predicate.Machine) *MachineUpdate

Where appends a list predicates to the MachineUpdate builder.

type MachineUpdateOne

type MachineUpdateOne struct {
	// contains filtered or unexported fields
}

MachineUpdateOne is the builder for updating a single Machine entity.

func (*MachineUpdateOne) AddAlertIDs

func (muo *MachineUpdateOne) AddAlertIDs(ids ...int) *MachineUpdateOne

AddAlertIDs adds the "alerts" edge to the Alert entity by IDs.

func (*MachineUpdateOne) AddAlerts

func (muo *MachineUpdateOne) AddAlerts(a ...*Alert) *MachineUpdateOne

AddAlerts adds the "alerts" edges to the Alert entity.

func (*MachineUpdateOne) ClearAlerts

func (muo *MachineUpdateOne) ClearAlerts() *MachineUpdateOne

ClearAlerts clears all "alerts" edges to the Alert entity.

func (*MachineUpdateOne) ClearDatasources added in v1.6.3

func (muo *MachineUpdateOne) ClearDatasources() *MachineUpdateOne

ClearDatasources clears the value of the "datasources" field.

func (*MachineUpdateOne) ClearFeatureflags added in v1.6.3

func (muo *MachineUpdateOne) ClearFeatureflags() *MachineUpdateOne

ClearFeatureflags clears the value of the "featureflags" field.

func (*MachineUpdateOne) ClearHubstate added in v1.6.3

func (muo *MachineUpdateOne) ClearHubstate() *MachineUpdateOne

ClearHubstate clears the value of the "hubstate" field.

func (*MachineUpdateOne) ClearLastHeartbeat added in v1.4.0

func (muo *MachineUpdateOne) ClearLastHeartbeat() *MachineUpdateOne

ClearLastHeartbeat clears the value of the "last_heartbeat" field.

func (*MachineUpdateOne) ClearLastPush added in v1.3.0

func (muo *MachineUpdateOne) ClearLastPush() *MachineUpdateOne

ClearLastPush clears the value of the "last_push" field.

func (*MachineUpdateOne) ClearOsname added in v1.6.3

func (muo *MachineUpdateOne) ClearOsname() *MachineUpdateOne

ClearOsname clears the value of the "osname" field.

func (*MachineUpdateOne) ClearOsversion added in v1.6.3

func (muo *MachineUpdateOne) ClearOsversion() *MachineUpdateOne

ClearOsversion clears the value of the "osversion" field.

func (*MachineUpdateOne) ClearScenarios

func (muo *MachineUpdateOne) ClearScenarios() *MachineUpdateOne

ClearScenarios clears the value of the "scenarios" field.

func (*MachineUpdateOne) ClearVersion

func (muo *MachineUpdateOne) ClearVersion() *MachineUpdateOne

ClearVersion clears the value of the "version" field.

func (*MachineUpdateOne) Exec

func (muo *MachineUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MachineUpdateOne) ExecX

func (muo *MachineUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MachineUpdateOne) Mutation

func (muo *MachineUpdateOne) Mutation() *MachineMutation

Mutation returns the MachineMutation object of the builder.

func (*MachineUpdateOne) RemoveAlertIDs

func (muo *MachineUpdateOne) RemoveAlertIDs(ids ...int) *MachineUpdateOne

RemoveAlertIDs removes the "alerts" edge to Alert entities by IDs.

func (*MachineUpdateOne) RemoveAlerts

func (muo *MachineUpdateOne) RemoveAlerts(a ...*Alert) *MachineUpdateOne

RemoveAlerts removes "alerts" edges to Alert entities.

func (*MachineUpdateOne) Save

func (muo *MachineUpdateOne) Save(ctx context.Context) (*Machine, error)

Save executes the query and returns the updated Machine entity.

func (*MachineUpdateOne) SaveX

func (muo *MachineUpdateOne) SaveX(ctx context.Context) *Machine

SaveX is like Save, but panics if an error occurs.

func (*MachineUpdateOne) Select added in v1.2.1

func (muo *MachineUpdateOne) Select(field string, fields ...string) *MachineUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MachineUpdateOne) SetAuthType added in v1.4.0

func (muo *MachineUpdateOne) SetAuthType(s string) *MachineUpdateOne

SetAuthType sets the "auth_type" field.

func (*MachineUpdateOne) SetDatasources added in v1.6.3

func (muo *MachineUpdateOne) SetDatasources(m map[string]int64) *MachineUpdateOne

SetDatasources sets the "datasources" field.

func (*MachineUpdateOne) SetFeatureflags added in v1.6.3

func (muo *MachineUpdateOne) SetFeatureflags(s string) *MachineUpdateOne

SetFeatureflags sets the "featureflags" field.

func (*MachineUpdateOne) SetHubstate added in v1.6.3

func (muo *MachineUpdateOne) SetHubstate(ms map[string][]schema.ItemState) *MachineUpdateOne

SetHubstate sets the "hubstate" field.

func (*MachineUpdateOne) SetIpAddress

func (muo *MachineUpdateOne) SetIpAddress(s string) *MachineUpdateOne

SetIpAddress sets the "ipAddress" field.

func (*MachineUpdateOne) SetIsValidated

func (muo *MachineUpdateOne) SetIsValidated(b bool) *MachineUpdateOne

SetIsValidated sets the "isValidated" field.

func (*MachineUpdateOne) SetLastHeartbeat added in v1.4.0

func (muo *MachineUpdateOne) SetLastHeartbeat(t time.Time) *MachineUpdateOne

SetLastHeartbeat sets the "last_heartbeat" field.

func (*MachineUpdateOne) SetLastPush added in v1.3.0

func (muo *MachineUpdateOne) SetLastPush(t time.Time) *MachineUpdateOne

SetLastPush sets the "last_push" field.

func (*MachineUpdateOne) SetNillableAuthType added in v1.4.0

func (muo *MachineUpdateOne) SetNillableAuthType(s *string) *MachineUpdateOne

SetNillableAuthType sets the "auth_type" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableFeatureflags added in v1.6.3

func (muo *MachineUpdateOne) SetNillableFeatureflags(s *string) *MachineUpdateOne

SetNillableFeatureflags sets the "featureflags" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableIpAddress added in v1.6.1

func (muo *MachineUpdateOne) SetNillableIpAddress(s *string) *MachineUpdateOne

SetNillableIpAddress sets the "ipAddress" 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) SetNillableLastHeartbeat added in v1.6.2

func (muo *MachineUpdateOne) SetNillableLastHeartbeat(t *time.Time) *MachineUpdateOne

SetNillableLastHeartbeat sets the "last_heartbeat" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableLastPush added in v1.6.2

func (muo *MachineUpdateOne) SetNillableLastPush(t *time.Time) *MachineUpdateOne

SetNillableLastPush sets the "last_push" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableOsname added in v1.6.3

func (muo *MachineUpdateOne) SetNillableOsname(s *string) *MachineUpdateOne

SetNillableOsname sets the "osname" field if the given value is not nil.

func (*MachineUpdateOne) SetNillableOsversion added in v1.6.3

func (muo *MachineUpdateOne) SetNillableOsversion(s *string) *MachineUpdateOne

SetNillableOsversion sets the "osversion" field if the given value is not nil.

func (*MachineUpdateOne) SetNillablePassword added in v1.6.1

func (muo *MachineUpdateOne) SetNillablePassword(s *string) *MachineUpdateOne

SetNillablePassword sets the "password" 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) SetNillableVersion

func (muo *MachineUpdateOne) SetNillableVersion(s *string) *MachineUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MachineUpdateOne) SetOsname added in v1.6.3

func (muo *MachineUpdateOne) SetOsname(s string) *MachineUpdateOne

SetOsname sets the "osname" field.

func (*MachineUpdateOne) SetOsversion added in v1.6.3

func (muo *MachineUpdateOne) SetOsversion(s string) *MachineUpdateOne

SetOsversion sets the "osversion" field.

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) 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.

func (*MachineUpdateOne) Where added in v1.6.1

Where appends a list predicates to the MachineUpdate builder.

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"`
	// AlertMetas holds the value of the "alert_metas" field.
	AlertMetas int `json:"alert_metas,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) GetValue added in v1.6.1

func (m *Meta) GetValue(name string) (ent.Value, error)

GetValue returns the ent.Value that was dynamically selected and assigned to the Meta. This includes values selected through modifiers, order, etc.

func (*Meta) QueryOwner

func (m *Meta) QueryOwner() *AlertQuery

QueryOwner queries the "owner" edge of the Meta entity.

func (*Meta) String

func (m *Meta) String() string

String implements the fmt.Stringer.

func (*Meta) Unwrap

func (m *Meta) Unwrap() *Meta

Unwrap unwraps the Meta entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Meta) Update

func (m *Meta) Update() *MetaUpdateOne

Update returns a builder for updating this Meta. Note that you need to call Meta.Unwrap() before calling this method if this Meta was returned from a transaction, and the transaction was committed or rolled back.

type MetaClient

type MetaClient struct {
	// contains filtered or unexported fields
}

MetaClient is a client for the Meta schema.

func NewMetaClient

func NewMetaClient(c config) *MetaClient

NewMetaClient returns a client for the Meta from the given config.

func (*MetaClient) Create

func (c *MetaClient) Create() *MetaCreate

Create returns a builder for creating a Meta entity.

func (*MetaClient) CreateBulk

func (c *MetaClient) CreateBulk(builders ...*MetaCreate) *MetaCreateBulk

CreateBulk returns a builder for creating a bulk of Meta entities.

func (*MetaClient) Delete

func (c *MetaClient) Delete() *MetaDelete

Delete returns a delete builder for Meta.

func (*MetaClient) DeleteOne

func (c *MetaClient) DeleteOne(m *Meta) *MetaDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MetaClient) DeleteOneID

func (c *MetaClient) DeleteOneID(id int) *MetaDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MetaClient) Get

func (c *MetaClient) Get(ctx context.Context, id int) (*Meta, error)

Get returns a Meta entity by its id.

func (*MetaClient) GetX

func (c *MetaClient) GetX(ctx context.Context, id int) *Meta

GetX is like Get, but panics if an error occurs.

func (*MetaClient) Hooks

func (c *MetaClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MetaClient) Intercept added in v1.6.1

func (c *MetaClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `meta.Intercept(f(g(h())))`.

func (*MetaClient) Interceptors added in v1.6.1

func (c *MetaClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MetaClient) MapCreateBulk added in v1.6.1

func (c *MetaClient) MapCreateBulk(slice any, setFunc func(*MetaCreate, int)) *MetaCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MetaClient) Query

func (c *MetaClient) Query() *MetaQuery

Query returns a query builder for Meta.

func (*MetaClient) QueryOwner

func (c *MetaClient) QueryOwner(m *Meta) *AlertQuery

QueryOwner queries the owner edge of a Meta.

func (*MetaClient) Update

func (c *MetaClient) Update() *MetaUpdate

Update returns an update builder for Meta.

func (*MetaClient) UpdateOne

func (c *MetaClient) UpdateOne(m *Meta) *MetaUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MetaClient) UpdateOneID

func (c *MetaClient) UpdateOneID(id int) *MetaUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MetaClient) Use

func (c *MetaClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `meta.Hooks(f(g(h())))`.

type MetaCreate

type MetaCreate struct {
	// contains filtered or unexported fields
}

MetaCreate is the builder for creating a Meta entity.

func (*MetaCreate) Exec added in v1.2.1

func (mc *MetaCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetaCreate) ExecX added in v1.2.1

func (mc *MetaCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetaCreate) Mutation

func (mc *MetaCreate) Mutation() *MetaMutation

Mutation returns the MetaMutation object of the builder.

func (*MetaCreate) Save

func (mc *MetaCreate) Save(ctx context.Context) (*Meta, error)

Save creates the Meta in the database.

func (*MetaCreate) SaveX

func (mc *MetaCreate) SaveX(ctx context.Context) *Meta

SaveX calls Save and panics if Save returns an error.

func (*MetaCreate) SetAlertMetas added in v1.5.0

func (mc *MetaCreate) SetAlertMetas(i int) *MetaCreate

SetAlertMetas sets the "alert_metas" field.

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) SetNillableAlertMetas added in v1.5.0

func (mc *MetaCreate) SetNillableAlertMetas(i *int) *MetaCreate

SetNillableAlertMetas sets the "alert_metas" field if the given value is not nil.

func (*MetaCreate) SetNillableCreatedAt

func (mc *MetaCreate) SetNillableCreatedAt(t *time.Time) *MetaCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MetaCreate) SetNillableOwnerID

func (mc *MetaCreate) SetNillableOwnerID(id *int) *MetaCreate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*MetaCreate) SetNillableUpdatedAt

func (mc *MetaCreate) SetNillableUpdatedAt(t *time.Time) *MetaCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*MetaCreate) SetOwner

func (mc *MetaCreate) SetOwner(a *Alert) *MetaCreate

SetOwner sets the "owner" edge to the Alert entity.

func (*MetaCreate) SetOwnerID

func (mc *MetaCreate) SetOwnerID(id int) *MetaCreate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*MetaCreate) SetUpdatedAt

func (mc *MetaCreate) SetUpdatedAt(t time.Time) *MetaCreate

SetUpdatedAt sets the "updated_at" field.

func (*MetaCreate) SetValue

func (mc *MetaCreate) SetValue(s string) *MetaCreate

SetValue sets the "value" field.

type MetaCreateBulk

type MetaCreateBulk struct {
	// contains filtered or unexported fields
}

MetaCreateBulk is the builder for creating many Meta entities in bulk.

func (*MetaCreateBulk) Exec added in v1.2.1

func (mcb *MetaCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MetaCreateBulk) ExecX added in v1.2.1

func (mcb *MetaCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetaCreateBulk) Save

func (mcb *MetaCreateBulk) Save(ctx context.Context) ([]*Meta, error)

Save creates the Meta entities in the database.

func (*MetaCreateBulk) SaveX

func (mcb *MetaCreateBulk) SaveX(ctx context.Context) []*Meta

SaveX is like Save, but panics if an error occurs.

type MetaDelete

type MetaDelete struct {
	// contains filtered or unexported fields
}

MetaDelete is the builder for deleting a Meta entity.

func (*MetaDelete) Exec

func (md *MetaDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MetaDelete) ExecX

func (md *MetaDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MetaDelete) Where

func (md *MetaDelete) Where(ps ...predicate.Meta) *MetaDelete

Where appends a list predicates to the MetaDelete builder.

type MetaDeleteOne

type MetaDeleteOne struct {
	// contains filtered or unexported fields
}

MetaDeleteOne is the builder for deleting a single Meta entity.

func (*MetaDeleteOne) Exec

func (mdo *MetaDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MetaDeleteOne) ExecX

func (mdo *MetaDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetaDeleteOne) Where added in v1.6.1

func (mdo *MetaDeleteOne) Where(ps ...predicate.Meta) *MetaDeleteOne

Where appends a list predicates to the MetaDelete builder.

type MetaEdges

type MetaEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Alert `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

MetaEdges holds the relations/edges for other nodes in the graph.

func (MetaEdges) OwnerOrErr

func (e MetaEdges) OwnerOrErr() (*Alert, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MetaGroupBy

type MetaGroupBy struct {
	// contains filtered or unexported fields
}

MetaGroupBy is the group-by builder for Meta entities.

func (*MetaGroupBy) Aggregate

func (mgb *MetaGroupBy) Aggregate(fns ...AggregateFunc) *MetaGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MetaGroupBy) Bool

func (s *MetaGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) BoolX

func (s *MetaGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MetaGroupBy) Bools

func (s *MetaGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) BoolsX

func (s *MetaGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MetaGroupBy) Float64

func (s *MetaGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) Float64X

func (s *MetaGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MetaGroupBy) Float64s

func (s *MetaGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) Float64sX

func (s *MetaGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MetaGroupBy) Int

func (s *MetaGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) IntX

func (s *MetaGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MetaGroupBy) Ints

func (s *MetaGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) IntsX

func (s *MetaGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MetaGroupBy) Scan

func (mgb *MetaGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MetaGroupBy) ScanX

func (s *MetaGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MetaGroupBy) String

func (s *MetaGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) StringX

func (s *MetaGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MetaGroupBy) Strings

func (s *MetaGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MetaGroupBy) StringsX

func (s *MetaGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MetaMutation

type MetaMutation struct {
	// contains filtered or unexported fields
}

MetaMutation represents an operation that mutates the Meta nodes in the graph.

func (*MetaMutation) AddField

func (m *MetaMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MetaMutation) AddedEdges

func (m *MetaMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MetaMutation) AddedField

func (m *MetaMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MetaMutation) AddedFields

func (m *MetaMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MetaMutation) AddedIDs

func (m *MetaMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MetaMutation) AlertMetas added in v1.5.0

func (m *MetaMutation) AlertMetas() (r int, exists bool)

AlertMetas returns the value of the "alert_metas" field in the mutation.

func (*MetaMutation) AlertMetasCleared added in v1.5.0

func (m *MetaMutation) AlertMetasCleared() bool

AlertMetasCleared returns if the "alert_metas" field was cleared in this mutation.

func (*MetaMutation) ClearAlertMetas added in v1.5.0

func (m *MetaMutation) ClearAlertMetas()

ClearAlertMetas clears the value of the "alert_metas" field.

func (*MetaMutation) ClearEdge

func (m *MetaMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MetaMutation) ClearField

func (m *MetaMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MetaMutation) ClearOwner

func (m *MetaMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Alert entity.

func (*MetaMutation) ClearedEdges

func (m *MetaMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MetaMutation) ClearedFields

func (m *MetaMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MetaMutation) Client

func (m MetaMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MetaMutation) CreatedAt

func (m *MetaMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MetaMutation) EdgeCleared

func (m *MetaMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MetaMutation) Field

func (m *MetaMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MetaMutation) FieldCleared

func (m *MetaMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MetaMutation) Fields

func (m *MetaMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MetaMutation) ID

func (m *MetaMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MetaMutation) IDs added in v1.3.1

func (m *MetaMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MetaMutation) Key

func (m *MetaMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*MetaMutation) OldAlertMetas added in v1.5.0

func (m *MetaMutation) OldAlertMetas(ctx context.Context) (v int, err error)

OldAlertMetas returns the old "alert_metas" field's value of the Meta entity. If the Meta object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetaMutation) OldCreatedAt

func (m *MetaMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Meta entity. If the Meta object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetaMutation) OldField

func (m *MetaMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MetaMutation) OldKey

func (m *MetaMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Meta entity. If the Meta object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetaMutation) OldUpdatedAt

func (m *MetaMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Meta entity. If the Meta object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetaMutation) OldValue

func (m *MetaMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the Meta entity. If the Meta object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetaMutation) Op

func (m *MetaMutation) Op() Op

Op returns the operation name.

func (*MetaMutation) OwnerCleared

func (m *MetaMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Alert entity was cleared.

func (*MetaMutation) OwnerID

func (m *MetaMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*MetaMutation) OwnerIDs

func (m *MetaMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*MetaMutation) RemovedEdges

func (m *MetaMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MetaMutation) RemovedIDs

func (m *MetaMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MetaMutation) ResetAlertMetas added in v1.5.0

func (m *MetaMutation) ResetAlertMetas()

ResetAlertMetas resets all changes to the "alert_metas" field.

func (*MetaMutation) ResetCreatedAt

func (m *MetaMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MetaMutation) ResetEdge

func (m *MetaMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MetaMutation) ResetField

func (m *MetaMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MetaMutation) ResetKey

func (m *MetaMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*MetaMutation) ResetOwner

func (m *MetaMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*MetaMutation) ResetUpdatedAt

func (m *MetaMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MetaMutation) ResetValue

func (m *MetaMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*MetaMutation) SetAlertMetas added in v1.5.0

func (m *MetaMutation) SetAlertMetas(i int)

SetAlertMetas sets the "alert_metas" field.

func (*MetaMutation) SetCreatedAt

func (m *MetaMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MetaMutation) SetField

func (m *MetaMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MetaMutation) SetKey

func (m *MetaMutation) SetKey(s string)

SetKey sets the "key" field.

func (*MetaMutation) SetOp added in v1.6.1

func (m *MetaMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MetaMutation) SetOwnerID

func (m *MetaMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Alert entity by id.

func (*MetaMutation) SetUpdatedAt

func (m *MetaMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*MetaMutation) SetValue

func (m *MetaMutation) SetValue(s string)

SetValue sets the "value" field.

func (MetaMutation) Tx

func (m MetaMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MetaMutation) Type

func (m *MetaMutation) Type() string

Type returns the node type of this mutation (Meta).

func (*MetaMutation) UpdatedAt

func (m *MetaMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MetaMutation) Value

func (m *MetaMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*MetaMutation) Where added in v1.2.1

func (m *MetaMutation) Where(ps ...predicate.Meta)

Where appends a list predicates to the MetaMutation builder.

func (*MetaMutation) WhereP added in v1.6.1

func (m *MetaMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MetaMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MetaQuery

type MetaQuery struct {
	// contains filtered or unexported fields
}

MetaQuery is the builder for querying Meta entities.

func (*MetaQuery) Aggregate added in v1.6.1

func (mq *MetaQuery) Aggregate(fns ...AggregateFunc) *MetaSelect

Aggregate returns a MetaSelect configured with the given aggregations.

func (*MetaQuery) All

func (mq *MetaQuery) All(ctx context.Context) ([]*Meta, error)

All executes the query and returns a list of MetaSlice.

func (*MetaQuery) AllX

func (mq *MetaQuery) AllX(ctx context.Context) []*Meta

AllX is like All, but panics if an error occurs.

func (*MetaQuery) Clone

func (mq *MetaQuery) Clone() *MetaQuery

Clone returns a duplicate of the MetaQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MetaQuery) Count

func (mq *MetaQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MetaQuery) CountX

func (mq *MetaQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MetaQuery) Exist

func (mq *MetaQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MetaQuery) ExistX

func (mq *MetaQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MetaQuery) First

func (mq *MetaQuery) First(ctx context.Context) (*Meta, error)

First returns the first Meta entity from the query. Returns a *NotFoundError when no Meta was found.

func (*MetaQuery) FirstID

func (mq *MetaQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Meta ID from the query. Returns a *NotFoundError when no Meta ID was found.

func (*MetaQuery) FirstIDX added in v1.0.3

func (mq *MetaQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MetaQuery) FirstX

func (mq *MetaQuery) FirstX(ctx context.Context) *Meta

FirstX is like First, but panics if an error occurs.

func (*MetaQuery) GroupBy

func (mq *MetaQuery) GroupBy(field string, fields ...string) *MetaGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Meta.Query().
	GroupBy(meta.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MetaQuery) IDs

func (mq *MetaQuery) IDs(ctx context.Context) (ids []int, err 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 the number of records to be returned by this query.

func (*MetaQuery) Offset

func (mq *MetaQuery) Offset(offset int) *MetaQuery

Offset to start from.

func (*MetaQuery) Only

func (mq *MetaQuery) Only(ctx context.Context) (*Meta, error)

Only returns a single Meta entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Meta entity is found. Returns a *NotFoundError when no Meta entities are found.

func (*MetaQuery) OnlyID

func (mq *MetaQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Meta ID in the query. Returns a *NotSingularError when more than one Meta ID is found. Returns a *NotFoundError when no entities are found.

func (*MetaQuery) OnlyIDX

func (mq *MetaQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MetaQuery) OnlyX

func (mq *MetaQuery) OnlyX(ctx context.Context) *Meta

OnlyX is like Only, but panics if an error occurs.

func (*MetaQuery) Order

func (mq *MetaQuery) Order(o ...meta.OrderOption) *MetaQuery

Order specifies how the records should be ordered.

func (*MetaQuery) QueryOwner

func (mq *MetaQuery) QueryOwner() *AlertQuery

QueryOwner chains the current query on the "owner" edge.

func (*MetaQuery) Select

func (mq *MetaQuery) Select(fields ...string) *MetaSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Meta.Query().
	Select(meta.FieldCreatedAt).
	Scan(ctx, &v)

func (*MetaQuery) Unique added in v1.2.1

func (mq *MetaQuery) Unique(unique bool) *MetaQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MetaQuery) Where

func (mq *MetaQuery) Where(ps ...predicate.Meta) *MetaQuery

Where adds a new predicate for the MetaQuery builder.

func (*MetaQuery) WithOwner

func (mq *MetaQuery) WithOwner(opts ...func(*AlertQuery)) *MetaQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type MetaSelect

type MetaSelect struct {
	*MetaQuery
	// contains filtered or unexported fields
}

MetaSelect is the builder for selecting fields of Meta entities.

func (*MetaSelect) Aggregate added in v1.6.1

func (ms *MetaSelect) Aggregate(fns ...AggregateFunc) *MetaSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MetaSelect) Bool

func (s *MetaSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MetaSelect) BoolX

func (s *MetaSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MetaSelect) Bools

func (s *MetaSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MetaSelect) BoolsX

func (s *MetaSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MetaSelect) Float64

func (s *MetaSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MetaSelect) Float64X

func (s *MetaSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MetaSelect) Float64s

func (s *MetaSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MetaSelect) Float64sX

func (s *MetaSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MetaSelect) Int

func (s *MetaSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MetaSelect) IntX

func (s *MetaSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MetaSelect) Ints

func (s *MetaSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MetaSelect) IntsX

func (s *MetaSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MetaSelect) Scan

func (ms *MetaSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MetaSelect) ScanX

func (s *MetaSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MetaSelect) String

func (s *MetaSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MetaSelect) StringX

func (s *MetaSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MetaSelect) Strings

func (s *MetaSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MetaSelect) StringsX

func (s *MetaSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MetaSlice

type MetaSlice []*Meta

MetaSlice is a parsable slice of Meta.

type MetaUpdate

type MetaUpdate struct {
	// contains filtered or unexported fields
}

MetaUpdate is the builder for updating Meta entities.

func (*MetaUpdate) ClearAlertMetas added in v1.5.0

func (mu *MetaUpdate) ClearAlertMetas() *MetaUpdate

ClearAlertMetas clears the value of the "alert_metas" field.

func (*MetaUpdate) ClearOwner

func (mu *MetaUpdate) ClearOwner() *MetaUpdate

ClearOwner clears the "owner" edge to the Alert entity.

func (*MetaUpdate) Exec

func (mu *MetaUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetaUpdate) ExecX

func (mu *MetaUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetaUpdate) Mutation

func (mu *MetaUpdate) Mutation() *MetaMutation

Mutation returns the MetaMutation object of the builder.

func (*MetaUpdate) Save

func (mu *MetaUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MetaUpdate) SaveX

func (mu *MetaUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MetaUpdate) SetAlertMetas added in v1.5.0

func (mu *MetaUpdate) SetAlertMetas(i int) *MetaUpdate

SetAlertMetas sets the "alert_metas" field.

func (*MetaUpdate) SetNillableAlertMetas added in v1.5.0

func (mu *MetaUpdate) SetNillableAlertMetas(i *int) *MetaUpdate

SetNillableAlertMetas sets the "alert_metas" field if the given value is not nil.

func (*MetaUpdate) SetNillableOwnerID

func (mu *MetaUpdate) SetNillableOwnerID(id *int) *MetaUpdate

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*MetaUpdate) SetOwner

func (mu *MetaUpdate) SetOwner(a *Alert) *MetaUpdate

SetOwner sets the "owner" edge to the Alert entity.

func (*MetaUpdate) SetOwnerID

func (mu *MetaUpdate) SetOwnerID(id int) *MetaUpdate

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*MetaUpdate) SetUpdatedAt

func (mu *MetaUpdate) SetUpdatedAt(t time.Time) *MetaUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MetaUpdate) Where

func (mu *MetaUpdate) Where(ps ...predicate.Meta) *MetaUpdate

Where appends a list predicates to the MetaUpdate builder.

type MetaUpdateOne

type MetaUpdateOne struct {
	// contains filtered or unexported fields
}

MetaUpdateOne is the builder for updating a single Meta entity.

func (*MetaUpdateOne) ClearAlertMetas added in v1.5.0

func (muo *MetaUpdateOne) ClearAlertMetas() *MetaUpdateOne

ClearAlertMetas clears the value of the "alert_metas" field.

func (*MetaUpdateOne) ClearOwner

func (muo *MetaUpdateOne) ClearOwner() *MetaUpdateOne

ClearOwner clears the "owner" edge to the Alert entity.

func (*MetaUpdateOne) Exec

func (muo *MetaUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MetaUpdateOne) ExecX

func (muo *MetaUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetaUpdateOne) Mutation

func (muo *MetaUpdateOne) Mutation() *MetaMutation

Mutation returns the MetaMutation object of the builder.

func (*MetaUpdateOne) Save

func (muo *MetaUpdateOne) Save(ctx context.Context) (*Meta, error)

Save executes the query and returns the updated Meta entity.

func (*MetaUpdateOne) SaveX

func (muo *MetaUpdateOne) SaveX(ctx context.Context) *Meta

SaveX is like Save, but panics if an error occurs.

func (*MetaUpdateOne) Select added in v1.2.1

func (muo *MetaUpdateOne) Select(field string, fields ...string) *MetaUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MetaUpdateOne) SetAlertMetas added in v1.5.0

func (muo *MetaUpdateOne) SetAlertMetas(i int) *MetaUpdateOne

SetAlertMetas sets the "alert_metas" field.

func (*MetaUpdateOne) SetNillableAlertMetas added in v1.5.0

func (muo *MetaUpdateOne) SetNillableAlertMetas(i *int) *MetaUpdateOne

SetNillableAlertMetas sets the "alert_metas" field if the given value is not nil.

func (*MetaUpdateOne) SetNillableOwnerID

func (muo *MetaUpdateOne) SetNillableOwnerID(id *int) *MetaUpdateOne

SetNillableOwnerID sets the "owner" edge to the Alert entity by ID if the given value is not nil.

func (*MetaUpdateOne) SetOwner

func (muo *MetaUpdateOne) SetOwner(a *Alert) *MetaUpdateOne

SetOwner sets the "owner" edge to the Alert entity.

func (*MetaUpdateOne) SetOwnerID

func (muo *MetaUpdateOne) SetOwnerID(id int) *MetaUpdateOne

SetOwnerID sets the "owner" edge to the Alert entity by ID.

func (*MetaUpdateOne) SetUpdatedAt

func (muo *MetaUpdateOne) SetUpdatedAt(t time.Time) *MetaUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MetaUpdateOne) Where added in v1.6.1

func (muo *MetaUpdateOne) Where(ps ...predicate.Meta) *MetaUpdateOne

Where appends a list predicates to the MetaUpdate builder.

type Metric added in v1.6.3

type Metric struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type of the metrics source: LP=logprocessor, RC=remediation
	GeneratedType metric.GeneratedType `json:"generated_type,omitempty"`
	// Source of the metrics: machine id, bouncer name...
	// It must come from the auth middleware.
	GeneratedBy string `json:"generated_by,omitempty"`
	// When the metrics are received by LAPI
	ReceivedAt time.Time `json:"received_at,omitempty"`
	// When the metrics are sent to the console
	PushedAt *time.Time `json:"pushed_at,omitempty"`
	// The actual metrics (item0)
	Payload string `json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Metric is the model entity for the Metric schema.

func (*Metric) String added in v1.6.3

func (m *Metric) String() string

String implements the fmt.Stringer.

func (*Metric) Unwrap added in v1.6.3

func (m *Metric) Unwrap() *Metric

Unwrap unwraps the Metric entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Metric) Update added in v1.6.3

func (m *Metric) Update() *MetricUpdateOne

Update returns a builder for updating this Metric. Note that you need to call Metric.Unwrap() before calling this method if this Metric was returned from a transaction, and the transaction was committed or rolled back.

func (*Metric) Value added in v1.6.3

func (m *Metric) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Metric. This includes values selected through modifiers, order, etc.

type MetricClient added in v1.6.3

type MetricClient struct {
	// contains filtered or unexported fields
}

MetricClient is a client for the Metric schema.

func NewMetricClient added in v1.6.3

func NewMetricClient(c config) *MetricClient

NewMetricClient returns a client for the Metric from the given config.

func (*MetricClient) Create added in v1.6.3

func (c *MetricClient) Create() *MetricCreate

Create returns a builder for creating a Metric entity.

func (*MetricClient) CreateBulk added in v1.6.3

func (c *MetricClient) CreateBulk(builders ...*MetricCreate) *MetricCreateBulk

CreateBulk returns a builder for creating a bulk of Metric entities.

func (*MetricClient) Delete added in v1.6.3

func (c *MetricClient) Delete() *MetricDelete

Delete returns a delete builder for Metric.

func (*MetricClient) DeleteOne added in v1.6.3

func (c *MetricClient) DeleteOne(m *Metric) *MetricDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MetricClient) DeleteOneID added in v1.6.3

func (c *MetricClient) DeleteOneID(id int) *MetricDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MetricClient) Get added in v1.6.3

func (c *MetricClient) Get(ctx context.Context, id int) (*Metric, error)

Get returns a Metric entity by its id.

func (*MetricClient) GetX added in v1.6.3

func (c *MetricClient) GetX(ctx context.Context, id int) *Metric

GetX is like Get, but panics if an error occurs.

func (*MetricClient) Hooks added in v1.6.3

func (c *MetricClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MetricClient) Intercept added in v1.6.3

func (c *MetricClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `metric.Intercept(f(g(h())))`.

func (*MetricClient) Interceptors added in v1.6.3

func (c *MetricClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MetricClient) MapCreateBulk added in v1.6.3

func (c *MetricClient) MapCreateBulk(slice any, setFunc func(*MetricCreate, int)) *MetricCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MetricClient) Query added in v1.6.3

func (c *MetricClient) Query() *MetricQuery

Query returns a query builder for Metric.

func (*MetricClient) Update added in v1.6.3

func (c *MetricClient) Update() *MetricUpdate

Update returns an update builder for Metric.

func (*MetricClient) UpdateOne added in v1.6.3

func (c *MetricClient) UpdateOne(m *Metric) *MetricUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MetricClient) UpdateOneID added in v1.6.3

func (c *MetricClient) UpdateOneID(id int) *MetricUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MetricClient) Use added in v1.6.3

func (c *MetricClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `metric.Hooks(f(g(h())))`.

type MetricCreate added in v1.6.3

type MetricCreate struct {
	// contains filtered or unexported fields
}

MetricCreate is the builder for creating a Metric entity.

func (*MetricCreate) Exec added in v1.6.3

func (mc *MetricCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetricCreate) ExecX added in v1.6.3

func (mc *MetricCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetricCreate) Mutation added in v1.6.3

func (mc *MetricCreate) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricCreate) Save added in v1.6.3

func (mc *MetricCreate) Save(ctx context.Context) (*Metric, error)

Save creates the Metric in the database.

func (*MetricCreate) SaveX added in v1.6.3

func (mc *MetricCreate) SaveX(ctx context.Context) *Metric

SaveX calls Save and panics if Save returns an error.

func (*MetricCreate) SetGeneratedBy added in v1.6.3

func (mc *MetricCreate) SetGeneratedBy(s string) *MetricCreate

SetGeneratedBy sets the "generated_by" field.

func (*MetricCreate) SetGeneratedType added in v1.6.3

func (mc *MetricCreate) SetGeneratedType(mt metric.GeneratedType) *MetricCreate

SetGeneratedType sets the "generated_type" field.

func (*MetricCreate) SetNillablePushedAt added in v1.6.3

func (mc *MetricCreate) SetNillablePushedAt(t *time.Time) *MetricCreate

SetNillablePushedAt sets the "pushed_at" field if the given value is not nil.

func (*MetricCreate) SetPayload added in v1.6.3

func (mc *MetricCreate) SetPayload(s string) *MetricCreate

SetPayload sets the "payload" field.

func (*MetricCreate) SetPushedAt added in v1.6.3

func (mc *MetricCreate) SetPushedAt(t time.Time) *MetricCreate

SetPushedAt sets the "pushed_at" field.

func (*MetricCreate) SetReceivedAt added in v1.6.3

func (mc *MetricCreate) SetReceivedAt(t time.Time) *MetricCreate

SetReceivedAt sets the "received_at" field.

type MetricCreateBulk added in v1.6.3

type MetricCreateBulk struct {
	// contains filtered or unexported fields
}

MetricCreateBulk is the builder for creating many Metric entities in bulk.

func (*MetricCreateBulk) Exec added in v1.6.3

func (mcb *MetricCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MetricCreateBulk) ExecX added in v1.6.3

func (mcb *MetricCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetricCreateBulk) Save added in v1.6.3

func (mcb *MetricCreateBulk) Save(ctx context.Context) ([]*Metric, error)

Save creates the Metric entities in the database.

func (*MetricCreateBulk) SaveX added in v1.6.3

func (mcb *MetricCreateBulk) SaveX(ctx context.Context) []*Metric

SaveX is like Save, but panics if an error occurs.

type MetricDelete added in v1.6.3

type MetricDelete struct {
	// contains filtered or unexported fields
}

MetricDelete is the builder for deleting a Metric entity.

func (*MetricDelete) Exec added in v1.6.3

func (md *MetricDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MetricDelete) ExecX added in v1.6.3

func (md *MetricDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MetricDelete) Where added in v1.6.3

func (md *MetricDelete) Where(ps ...predicate.Metric) *MetricDelete

Where appends a list predicates to the MetricDelete builder.

type MetricDeleteOne added in v1.6.3

type MetricDeleteOne struct {
	// contains filtered or unexported fields
}

MetricDeleteOne is the builder for deleting a single Metric entity.

func (*MetricDeleteOne) Exec added in v1.6.3

func (mdo *MetricDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MetricDeleteOne) ExecX added in v1.6.3

func (mdo *MetricDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetricDeleteOne) Where added in v1.6.3

func (mdo *MetricDeleteOne) Where(ps ...predicate.Metric) *MetricDeleteOne

Where appends a list predicates to the MetricDelete builder.

type MetricGroupBy added in v1.6.3

type MetricGroupBy struct {
	// contains filtered or unexported fields
}

MetricGroupBy is the group-by builder for Metric entities.

func (*MetricGroupBy) Aggregate added in v1.6.3

func (mgb *MetricGroupBy) Aggregate(fns ...AggregateFunc) *MetricGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MetricGroupBy) Bool added in v1.6.3

func (s *MetricGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) BoolX added in v1.6.3

func (s *MetricGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MetricGroupBy) Bools added in v1.6.3

func (s *MetricGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) BoolsX added in v1.6.3

func (s *MetricGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MetricGroupBy) Float64 added in v1.6.3

func (s *MetricGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) Float64X added in v1.6.3

func (s *MetricGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MetricGroupBy) Float64s added in v1.6.3

func (s *MetricGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) Float64sX added in v1.6.3

func (s *MetricGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MetricGroupBy) Int added in v1.6.3

func (s *MetricGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) IntX added in v1.6.3

func (s *MetricGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MetricGroupBy) Ints added in v1.6.3

func (s *MetricGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) IntsX added in v1.6.3

func (s *MetricGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MetricGroupBy) Scan added in v1.6.3

func (mgb *MetricGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MetricGroupBy) ScanX added in v1.6.3

func (s *MetricGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MetricGroupBy) String added in v1.6.3

func (s *MetricGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) StringX added in v1.6.3

func (s *MetricGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MetricGroupBy) Strings added in v1.6.3

func (s *MetricGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MetricGroupBy) StringsX added in v1.6.3

func (s *MetricGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MetricMutation added in v1.6.3

type MetricMutation struct {
	// contains filtered or unexported fields
}

MetricMutation represents an operation that mutates the Metric nodes in the graph.

func (*MetricMutation) AddField added in v1.6.3

func (m *MetricMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MetricMutation) AddedEdges added in v1.6.3

func (m *MetricMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MetricMutation) AddedField added in v1.6.3

func (m *MetricMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MetricMutation) AddedFields added in v1.6.3

func (m *MetricMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MetricMutation) AddedIDs added in v1.6.3

func (m *MetricMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MetricMutation) ClearEdge added in v1.6.3

func (m *MetricMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MetricMutation) ClearField added in v1.6.3

func (m *MetricMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MetricMutation) ClearPushedAt added in v1.6.3

func (m *MetricMutation) ClearPushedAt()

ClearPushedAt clears the value of the "pushed_at" field.

func (*MetricMutation) ClearedEdges added in v1.6.3

func (m *MetricMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MetricMutation) ClearedFields added in v1.6.3

func (m *MetricMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MetricMutation) Client added in v1.6.3

func (m MetricMutation) 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 (*MetricMutation) EdgeCleared added in v1.6.3

func (m *MetricMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MetricMutation) Field added in v1.6.3

func (m *MetricMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MetricMutation) FieldCleared added in v1.6.3

func (m *MetricMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MetricMutation) Fields added in v1.6.3

func (m *MetricMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MetricMutation) GeneratedBy added in v1.6.3

func (m *MetricMutation) GeneratedBy() (r string, exists bool)

GeneratedBy returns the value of the "generated_by" field in the mutation.

func (*MetricMutation) GeneratedType added in v1.6.3

func (m *MetricMutation) GeneratedType() (r metric.GeneratedType, exists bool)

GeneratedType returns the value of the "generated_type" field in the mutation.

func (*MetricMutation) ID added in v1.6.3

func (m *MetricMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MetricMutation) IDs added in v1.6.3

func (m *MetricMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MetricMutation) OldField added in v1.6.3

func (m *MetricMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MetricMutation) OldGeneratedBy added in v1.6.3

func (m *MetricMutation) OldGeneratedBy(ctx context.Context) (v string, err error)

OldGeneratedBy returns the old "generated_by" field's value of the Metric entity. If the Metric object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetricMutation) OldGeneratedType added in v1.6.3

func (m *MetricMutation) OldGeneratedType(ctx context.Context) (v metric.GeneratedType, err error)

OldGeneratedType returns the old "generated_type" field's value of the Metric entity. If the Metric object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetricMutation) OldPayload added in v1.6.3

func (m *MetricMutation) OldPayload(ctx context.Context) (v string, err error)

OldPayload returns the old "payload" field's value of the Metric entity. If the Metric object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetricMutation) OldPushedAt added in v1.6.3

func (m *MetricMutation) OldPushedAt(ctx context.Context) (v *time.Time, err error)

OldPushedAt returns the old "pushed_at" field's value of the Metric entity. If the Metric object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetricMutation) OldReceivedAt added in v1.6.3

func (m *MetricMutation) OldReceivedAt(ctx context.Context) (v time.Time, err error)

OldReceivedAt returns the old "received_at" field's value of the Metric entity. If the Metric object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MetricMutation) Op added in v1.6.3

func (m *MetricMutation) Op() Op

Op returns the operation name.

func (*MetricMutation) Payload added in v1.6.3

func (m *MetricMutation) Payload() (r string, exists bool)

Payload returns the value of the "payload" field in the mutation.

func (*MetricMutation) PushedAt added in v1.6.3

func (m *MetricMutation) PushedAt() (r time.Time, exists bool)

PushedAt returns the value of the "pushed_at" field in the mutation.

func (*MetricMutation) PushedAtCleared added in v1.6.3

func (m *MetricMutation) PushedAtCleared() bool

PushedAtCleared returns if the "pushed_at" field was cleared in this mutation.

func (*MetricMutation) ReceivedAt added in v1.6.3

func (m *MetricMutation) ReceivedAt() (r time.Time, exists bool)

ReceivedAt returns the value of the "received_at" field in the mutation.

func (*MetricMutation) RemovedEdges added in v1.6.3

func (m *MetricMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MetricMutation) RemovedIDs added in v1.6.3

func (m *MetricMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MetricMutation) ResetEdge added in v1.6.3

func (m *MetricMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MetricMutation) ResetField added in v1.6.3

func (m *MetricMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MetricMutation) ResetGeneratedBy added in v1.6.3

func (m *MetricMutation) ResetGeneratedBy()

ResetGeneratedBy resets all changes to the "generated_by" field.

func (*MetricMutation) ResetGeneratedType added in v1.6.3

func (m *MetricMutation) ResetGeneratedType()

ResetGeneratedType resets all changes to the "generated_type" field.

func (*MetricMutation) ResetPayload added in v1.6.3

func (m *MetricMutation) ResetPayload()

ResetPayload resets all changes to the "payload" field.

func (*MetricMutation) ResetPushedAt added in v1.6.3

func (m *MetricMutation) ResetPushedAt()

ResetPushedAt resets all changes to the "pushed_at" field.

func (*MetricMutation) ResetReceivedAt added in v1.6.3

func (m *MetricMutation) ResetReceivedAt()

ResetReceivedAt resets all changes to the "received_at" field.

func (*MetricMutation) SetField added in v1.6.3

func (m *MetricMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MetricMutation) SetGeneratedBy added in v1.6.3

func (m *MetricMutation) SetGeneratedBy(s string)

SetGeneratedBy sets the "generated_by" field.

func (*MetricMutation) SetGeneratedType added in v1.6.3

func (m *MetricMutation) SetGeneratedType(mt metric.GeneratedType)

SetGeneratedType sets the "generated_type" field.

func (*MetricMutation) SetOp added in v1.6.3

func (m *MetricMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MetricMutation) SetPayload added in v1.6.3

func (m *MetricMutation) SetPayload(s string)

SetPayload sets the "payload" field.

func (*MetricMutation) SetPushedAt added in v1.6.3

func (m *MetricMutation) SetPushedAt(t time.Time)

SetPushedAt sets the "pushed_at" field.

func (*MetricMutation) SetReceivedAt added in v1.6.3

func (m *MetricMutation) SetReceivedAt(t time.Time)

SetReceivedAt sets the "received_at" field.

func (MetricMutation) Tx added in v1.6.3

func (m MetricMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MetricMutation) Type added in v1.6.3

func (m *MetricMutation) Type() string

Type returns the node type of this mutation (Metric).

func (*MetricMutation) Where added in v1.6.3

func (m *MetricMutation) Where(ps ...predicate.Metric)

Where appends a list predicates to the MetricMutation builder.

func (*MetricMutation) WhereP added in v1.6.3

func (m *MetricMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MetricMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MetricQuery added in v1.6.3

type MetricQuery struct {
	// contains filtered or unexported fields
}

MetricQuery is the builder for querying Metric entities.

func (*MetricQuery) Aggregate added in v1.6.3

func (mq *MetricQuery) Aggregate(fns ...AggregateFunc) *MetricSelect

Aggregate returns a MetricSelect configured with the given aggregations.

func (*MetricQuery) All added in v1.6.3

func (mq *MetricQuery) All(ctx context.Context) ([]*Metric, error)

All executes the query and returns a list of Metrics.

func (*MetricQuery) AllX added in v1.6.3

func (mq *MetricQuery) AllX(ctx context.Context) []*Metric

AllX is like All, but panics if an error occurs.

func (*MetricQuery) Clone added in v1.6.3

func (mq *MetricQuery) Clone() *MetricQuery

Clone returns a duplicate of the MetricQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MetricQuery) Count added in v1.6.3

func (mq *MetricQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MetricQuery) CountX added in v1.6.3

func (mq *MetricQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MetricQuery) Exist added in v1.6.3

func (mq *MetricQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MetricQuery) ExistX added in v1.6.3

func (mq *MetricQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MetricQuery) First added in v1.6.3

func (mq *MetricQuery) First(ctx context.Context) (*Metric, error)

First returns the first Metric entity from the query. Returns a *NotFoundError when no Metric was found.

func (*MetricQuery) FirstID added in v1.6.3

func (mq *MetricQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Metric ID from the query. Returns a *NotFoundError when no Metric ID was found.

func (*MetricQuery) FirstIDX added in v1.6.3

func (mq *MetricQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MetricQuery) FirstX added in v1.6.3

func (mq *MetricQuery) FirstX(ctx context.Context) *Metric

FirstX is like First, but panics if an error occurs.

func (*MetricQuery) GroupBy added in v1.6.3

func (mq *MetricQuery) GroupBy(field string, fields ...string) *MetricGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	GeneratedType metric.GeneratedType `json:"generated_type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Metric.Query().
	GroupBy(metric.FieldGeneratedType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MetricQuery) IDs added in v1.6.3

func (mq *MetricQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Metric IDs.

func (*MetricQuery) IDsX added in v1.6.3

func (mq *MetricQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MetricQuery) Limit added in v1.6.3

func (mq *MetricQuery) Limit(limit int) *MetricQuery

Limit the number of records to be returned by this query.

func (*MetricQuery) Offset added in v1.6.3

func (mq *MetricQuery) Offset(offset int) *MetricQuery

Offset to start from.

func (*MetricQuery) Only added in v1.6.3

func (mq *MetricQuery) Only(ctx context.Context) (*Metric, error)

Only returns a single Metric entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Metric entity is found. Returns a *NotFoundError when no Metric entities are found.

func (*MetricQuery) OnlyID added in v1.6.3

func (mq *MetricQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Metric ID in the query. Returns a *NotSingularError when more than one Metric ID is found. Returns a *NotFoundError when no entities are found.

func (*MetricQuery) OnlyIDX added in v1.6.3

func (mq *MetricQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MetricQuery) OnlyX added in v1.6.3

func (mq *MetricQuery) OnlyX(ctx context.Context) *Metric

OnlyX is like Only, but panics if an error occurs.

func (*MetricQuery) Order added in v1.6.3

func (mq *MetricQuery) Order(o ...metric.OrderOption) *MetricQuery

Order specifies how the records should be ordered.

func (*MetricQuery) Select added in v1.6.3

func (mq *MetricQuery) Select(fields ...string) *MetricSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	GeneratedType metric.GeneratedType `json:"generated_type,omitempty"`
}

client.Metric.Query().
	Select(metric.FieldGeneratedType).
	Scan(ctx, &v)

func (*MetricQuery) Unique added in v1.6.3

func (mq *MetricQuery) Unique(unique bool) *MetricQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MetricQuery) Where added in v1.6.3

func (mq *MetricQuery) Where(ps ...predicate.Metric) *MetricQuery

Where adds a new predicate for the MetricQuery builder.

type MetricSelect added in v1.6.3

type MetricSelect struct {
	*MetricQuery
	// contains filtered or unexported fields
}

MetricSelect is the builder for selecting fields of Metric entities.

func (*MetricSelect) Aggregate added in v1.6.3

func (ms *MetricSelect) Aggregate(fns ...AggregateFunc) *MetricSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MetricSelect) Bool added in v1.6.3

func (s *MetricSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MetricSelect) BoolX added in v1.6.3

func (s *MetricSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MetricSelect) Bools added in v1.6.3

func (s *MetricSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MetricSelect) BoolsX added in v1.6.3

func (s *MetricSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MetricSelect) Float64 added in v1.6.3

func (s *MetricSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MetricSelect) Float64X added in v1.6.3

func (s *MetricSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MetricSelect) Float64s added in v1.6.3

func (s *MetricSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MetricSelect) Float64sX added in v1.6.3

func (s *MetricSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MetricSelect) Int added in v1.6.3

func (s *MetricSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MetricSelect) IntX added in v1.6.3

func (s *MetricSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MetricSelect) Ints added in v1.6.3

func (s *MetricSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MetricSelect) IntsX added in v1.6.3

func (s *MetricSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MetricSelect) Scan added in v1.6.3

func (ms *MetricSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MetricSelect) ScanX added in v1.6.3

func (s *MetricSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MetricSelect) String added in v1.6.3

func (s *MetricSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MetricSelect) StringX added in v1.6.3

func (s *MetricSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MetricSelect) Strings added in v1.6.3

func (s *MetricSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MetricSelect) StringsX added in v1.6.3

func (s *MetricSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MetricUpdate added in v1.6.3

type MetricUpdate struct {
	// contains filtered or unexported fields
}

MetricUpdate is the builder for updating Metric entities.

func (*MetricUpdate) ClearPushedAt added in v1.6.3

func (mu *MetricUpdate) ClearPushedAt() *MetricUpdate

ClearPushedAt clears the value of the "pushed_at" field.

func (*MetricUpdate) Exec added in v1.6.3

func (mu *MetricUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetricUpdate) ExecX added in v1.6.3

func (mu *MetricUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetricUpdate) Mutation added in v1.6.3

func (mu *MetricUpdate) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricUpdate) Save added in v1.6.3

func (mu *MetricUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MetricUpdate) SaveX added in v1.6.3

func (mu *MetricUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MetricUpdate) SetNillablePushedAt added in v1.6.3

func (mu *MetricUpdate) SetNillablePushedAt(t *time.Time) *MetricUpdate

SetNillablePushedAt sets the "pushed_at" field if the given value is not nil.

func (*MetricUpdate) SetPushedAt added in v1.6.3

func (mu *MetricUpdate) SetPushedAt(t time.Time) *MetricUpdate

SetPushedAt sets the "pushed_at" field.

func (*MetricUpdate) Where added in v1.6.3

func (mu *MetricUpdate) Where(ps ...predicate.Metric) *MetricUpdate

Where appends a list predicates to the MetricUpdate builder.

type MetricUpdateOne added in v1.6.3

type MetricUpdateOne struct {
	// contains filtered or unexported fields
}

MetricUpdateOne is the builder for updating a single Metric entity.

func (*MetricUpdateOne) ClearPushedAt added in v1.6.3

func (muo *MetricUpdateOne) ClearPushedAt() *MetricUpdateOne

ClearPushedAt clears the value of the "pushed_at" field.

func (*MetricUpdateOne) Exec added in v1.6.3

func (muo *MetricUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MetricUpdateOne) ExecX added in v1.6.3

func (muo *MetricUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetricUpdateOne) Mutation added in v1.6.3

func (muo *MetricUpdateOne) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricUpdateOne) Save added in v1.6.3

func (muo *MetricUpdateOne) Save(ctx context.Context) (*Metric, error)

Save executes the query and returns the updated Metric entity.

func (*MetricUpdateOne) SaveX added in v1.6.3

func (muo *MetricUpdateOne) SaveX(ctx context.Context) *Metric

SaveX is like Save, but panics if an error occurs.

func (*MetricUpdateOne) Select added in v1.6.3

func (muo *MetricUpdateOne) Select(field string, fields ...string) *MetricUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MetricUpdateOne) SetNillablePushedAt added in v1.6.3

func (muo *MetricUpdateOne) SetNillablePushedAt(t *time.Time) *MetricUpdateOne

SetNillablePushedAt sets the "pushed_at" field if the given value is not nil.

func (*MetricUpdateOne) SetPushedAt added in v1.6.3

func (muo *MetricUpdateOne) SetPushedAt(t time.Time) *MetricUpdateOne

SetPushedAt sets the "pushed_at" field.

func (*MetricUpdateOne) Where added in v1.6.3

func (muo *MetricUpdateOne) Where(ps ...predicate.Metric) *MetricUpdateOne

Where appends a list predicates to the MetricUpdate builder.

type Metrics added in v1.6.3

type Metrics []*Metric

Metrics is a parsable slice of Metric.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier added in v1.6.1

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc added in v1.6.1

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext added in v1.6.1

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc added in v1.6.1

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser added in v1.6.1

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

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
	// ConfigItem is the client for interacting with the ConfigItem builders.
	ConfigItem *ConfigItemClient
	// Decision is the client for interacting with the Decision builders.
	Decision *DecisionClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Lock is the client for interacting with the Lock builders.
	Lock *LockClient
	// Machine is the client for interacting with the Machine builders.
	Machine *MachineClient
	// Meta is the client for interacting with the Meta builders.
	Meta *MetaClient
	// Metric is the client for interacting with the Metric builders.
	Metric *MetricClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL