ent

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 35 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"
	TypeCounter  = "Counter"
	TypeFailure  = "Failure"
	TypeFile     = "File"
	TypeIncident = "Incident"
	TypeStatus   = "Status"
)

Variables

View Source
var DefaultAlertOrder = &AlertOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &AlertOrderField{
		Value: func(a *Alert) (ent.Value, error) {
			return a.ID, nil
		},
		column: alert.FieldID,
		toTerm: alert.ByID,
		toCursor: func(a *Alert) Cursor {
			return Cursor{ID: a.ID}
		},
	},
}

DefaultAlertOrder is the default ordering of Alert.

View Source
var DefaultCounterOrder = &CounterOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &CounterOrderField{
		Value: func(c *Counter) (ent.Value, error) {
			return c.ID, nil
		},
		column: counter.FieldID,
		toTerm: counter.ByID,
		toCursor: func(c *Counter) Cursor {
			return Cursor{ID: c.ID}
		},
	},
}

DefaultCounterOrder is the default ordering of Counter.

View Source
var DefaultFailureOrder = &FailureOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &FailureOrderField{
		Value: func(f *Failure) (ent.Value, error) {
			return f.ID, nil
		},
		column: failure.FieldID,
		toTerm: failure.ByID,
		toCursor: func(f *Failure) Cursor {
			return Cursor{ID: f.ID}
		},
	},
}

DefaultFailureOrder is the default ordering of Failure.

View Source
var DefaultFileOrder = &FileOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.ID, nil
		},
		column: file.FieldID,
		toTerm: file.ByID,
		toCursor: func(f *File) Cursor {
			return Cursor{ID: f.ID}
		},
	},
}

DefaultFileOrder is the default ordering of File.

View Source
var DefaultIncidentOrder = &IncidentOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &IncidentOrderField{
		Value: func(i *Incident) (ent.Value, error) {
			return i.ID, nil
		},
		column: incident.FieldID,
		toTerm: incident.ByID,
		toCursor: func(i *Incident) Cursor {
			return Cursor{ID: i.ID}
		},
	},
}

DefaultIncidentOrder is the default ordering of Incident.

View Source
var DefaultStatusOrder = &StatusOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &StatusOrderField{
		Value: func(s *Status) (ent.Value, error) {
			return s.ID, nil
		},
		column: status.FieldID,
		toTerm: status.ByID,
		toCursor: func(s *Status) Cursor {
			return Cursor{ID: s.ID}
		},
	},
}

DefaultStatusOrder is the default ordering of Status.

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.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

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"`
	// UUID holds the value of the "UUID" field.
	UUID uuid.UUID `json:"UUID,omitempty"`
	// IncidentID holds the value of the "IncidentID" field.
	IncidentID uuid.UUID `json:"IncidentID,omitempty"`
	// Name holds the value of the "Name" field.
	Name string `json:"Name,omitempty"`
	// Time holds the value of the "Time" field.
	Time time.Time `json:"Time,omitempty"`
	// IntLevel holds the value of the "IntLevel" field.
	IntLevel int `json:"IntLevel,omitempty"`
	// Username holds the value of the "Username" field.
	Username string `json:"Username,omitempty"`
	// Region holds the value of the "Region" field.
	Region string `json:"Region,omitempty"`
	// ProbeOS holds the value of the "ProbeOS" field.
	ProbeOS string `json:"ProbeOS,omitempty"`
	// ProbeHost holds the value of the "ProbeHost" field.
	ProbeHost string `json:"ProbeHost,omitempty"`
	// Error holds the value of the "Error" field.
	Error string `json:"Error,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) Counters

func (a *Alert) Counters(ctx context.Context) (result []*Counter, err error)

func (*Alert) Failures

func (a *Alert) Failures(ctx context.Context) (result []*Failure, err error)

func (*Alert) Files

func (a *Alert) Files(ctx context.Context) (result []*File, err error)

func (*Alert) IsNode added in v0.14.0

func (n *Alert) IsNode()

IsNode implements the Node interface check for GQLGen.

func (Alert) Level

func (a Alert) Level() status.Level

Level returns the level

func (*Alert) NamedCounters

func (a *Alert) NamedCounters(name string) ([]*Counter, error)

NamedCounters returns the Counters named value or an error if the edge was not loaded in eager-loading with this name.

func (*Alert) NamedFailures

func (a *Alert) NamedFailures(name string) ([]*Failure, error)

NamedFailures returns the Failures named value or an error if the edge was not loaded in eager-loading with this name.

func (*Alert) NamedFiles

func (a *Alert) NamedFiles(name string) ([]*File, error)

NamedFiles returns the Files named value or an error if the edge was not loaded in eager-loading with this name.

func (*Alert) NamedStati

func (a *Alert) NamedStati(name string) ([]*Status, error)

NamedStati returns the Stati named value or an error if the edge was not loaded in eager-loading with this name.

func (*Alert) QueryCounters

func (a *Alert) QueryCounters() *CounterQuery

QueryCounters queries the "Counters" edge of the Alert entity.

func (*Alert) QueryFailures

func (a *Alert) QueryFailures() *FailureQuery

QueryFailures queries the "Failures" edge of the Alert entity.

func (*Alert) QueryFiles

func (a *Alert) QueryFiles() *FileQuery

QueryFiles queries the "Files" edge of the Alert entity.

func (*Alert) QueryStati

func (a *Alert) QueryStati() *StatusQuery

QueryStati queries the "Stati" edge of the Alert entity.

func (*Alert) Stati

func (a *Alert) Stati(ctx context.Context) (result []*Status, err error)

func (*Alert) String

func (a *Alert) String() string

String implements the fmt.Stringer.

func (*Alert) ToEdge

func (a *Alert) ToEdge(order *AlertOrder) *AlertEdge

ToEdge converts Alert into AlertEdge.

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 v0.14.0

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 v0.14.0

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 v0.14.0

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

Interceptors returns the client interceptors.

func (*AlertClient) Query

func (c *AlertClient) Query() *AlertQuery

Query returns a query builder for Alert.

func (*AlertClient) QueryCounters

func (c *AlertClient) QueryCounters(a *Alert) *CounterQuery

QueryCounters queries the Counters edge of a Alert.

func (*AlertClient) QueryFailures

func (c *AlertClient) QueryFailures(a *Alert) *FailureQuery

QueryFailures queries the Failures edge of a Alert.

func (*AlertClient) QueryFiles

func (c *AlertClient) QueryFiles(a *Alert) *FileQuery

QueryFiles queries the Files edge of a Alert.

func (*AlertClient) QueryStati

func (c *AlertClient) QueryStati(a *Alert) *StatusQuery

QueryStati queries the Stati 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 AlertConnection

type AlertConnection struct {
	Edges      []*AlertEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

AlertConnection is the connection containing edges to Alert.

type AlertCreate

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

AlertCreate is the builder for creating a Alert entity.

func (*AlertCreate) AddCounterIDs

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

AddCounterIDs adds the "Counters" edge to the Counter entity by IDs.

func (*AlertCreate) AddCounters

func (ac *AlertCreate) AddCounters(c ...*Counter) *AlertCreate

AddCounters adds the "Counters" edges to the Counter entity.

func (*AlertCreate) AddFailureIDs

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

AddFailureIDs adds the "Failures" edge to the Failure entity by IDs.

func (*AlertCreate) AddFailures

func (ac *AlertCreate) AddFailures(f ...*Failure) *AlertCreate

AddFailures adds the "Failures" edges to the Failure entity.

func (*AlertCreate) AddFileIDs

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

AddFileIDs adds the "Files" edge to the File entity by IDs.

func (*AlertCreate) AddFiles

func (ac *AlertCreate) AddFiles(f ...*File) *AlertCreate

AddFiles adds the "Files" edges to the File entity.

func (*AlertCreate) AddStati

func (ac *AlertCreate) AddStati(s ...*Status) *AlertCreate

AddStati adds the "Stati" edges to the Status entity.

func (*AlertCreate) AddStatiIDs

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

AddStatiIDs adds the "Stati" edge to the Status entity by IDs.

func (*AlertCreate) Exec

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

Exec executes the query.

func (*AlertCreate) ExecX

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

func (ac *AlertCreate) OnConflict(opts ...sql.ConflictOption) *AlertUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Alert.Create().
	SetUUID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AlertUpsert) {
		SetUUID(v+v).
	}).
	Exec(ctx)

func (*AlertCreate) OnConflictColumns

func (ac *AlertCreate) OnConflictColumns(columns ...string) *AlertUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Alert.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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

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

SetError sets the "Error" field.

func (*AlertCreate) SetIncidentID

func (ac *AlertCreate) SetIncidentID(u uuid.UUID) *AlertCreate

SetIncidentID sets the "IncidentID" field.

func (*AlertCreate) SetIntLevel

func (ac *AlertCreate) SetIntLevel(i int) *AlertCreate

SetIntLevel sets the "IntLevel" field.

func (*AlertCreate) SetName

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

SetName sets the "Name" field.

func (*AlertCreate) SetNillableError

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

SetNillableError sets the "Error" field if the given value is not nil.

func (*AlertCreate) SetNillableIncidentID

func (ac *AlertCreate) SetNillableIncidentID(u *uuid.UUID) *AlertCreate

SetNillableIncidentID sets the "IncidentID" field if the given value is not nil.

func (*AlertCreate) SetProbeHost

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

SetProbeHost sets the "ProbeHost" field.

func (*AlertCreate) SetProbeOS

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

SetProbeOS sets the "ProbeOS" field.

func (*AlertCreate) SetRegion

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

SetRegion sets the "Region" field.

func (*AlertCreate) SetTime

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

SetTime sets the "Time" field.

func (*AlertCreate) SetUUID

func (ac *AlertCreate) SetUUID(u uuid.UUID) *AlertCreate

SetUUID sets the "UUID" field.

func (*AlertCreate) SetUsername

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

SetUsername sets the "Username" 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

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

Exec executes the query.

func (*AlertCreateBulk) ExecX

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

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

func (*AlertCreateBulk) OnConflict

func (acb *AlertCreateBulk) OnConflict(opts ...sql.ConflictOption) *AlertUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Alert.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AlertUpsert) {
		SetUUID(v+v).
	}).
	Exec(ctx)

func (*AlertCreateBulk) OnConflictColumns

func (acb *AlertCreateBulk) OnConflictColumns(columns ...string) *AlertUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Alert.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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 v0.14.0

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

Where appends a list predicates to the AlertDelete builder.

type AlertEdge

type AlertEdge struct {
	Node   *Alert `json:"node"`
	Cursor Cursor `json:"cursor"`
}

AlertEdge is the edge representation of Alert.

type AlertEdges

type AlertEdges struct {
	// Counters holds the value of the Counters edge.
	Counters []*Counter `json:"Counters,omitempty"`
	// Stati holds the value of the Stati edge.
	Stati []*Status `json:"Stati,omitempty"`
	// Failures holds the value of the Failures edge.
	Failures []*Failure `json:"Failures,omitempty"`
	// Files holds the value of the Files edge.
	Files []*File `json:"Files,omitempty"`
	// contains filtered or unexported fields
}

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

func (AlertEdges) CountersOrErr

func (e AlertEdges) CountersOrErr() ([]*Counter, error)

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

func (AlertEdges) FailuresOrErr

func (e AlertEdges) FailuresOrErr() ([]*Failure, error)

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

func (AlertEdges) FilesOrErr

func (e AlertEdges) FilesOrErr() ([]*File, error)

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

func (AlertEdges) StatiOrErr

func (e AlertEdges) StatiOrErr() ([]*Status, error)

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

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

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

AddCounterIDs adds the "Counters" edge to the Counter entity by ids.

func (*AlertMutation) AddFailureIDs

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

AddFailureIDs adds the "Failures" edge to the Failure entity by ids.

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

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

AddFileIDs adds the "Files" edge to the File entity by ids.

func (*AlertMutation) AddIntLevel

func (m *AlertMutation) AddIntLevel(i int)

AddIntLevel adds i to the "IntLevel" field.

func (*AlertMutation) AddStatiIDs

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

AddStatiIDs adds the "Stati" edge to the Status entity by ids.

func (*AlertMutation) AddedEdges

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

AddedEdges returns all edge names that were set/added 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) AddedIntLevel

func (m *AlertMutation) AddedIntLevel() (r int, exists bool)

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

func (*AlertMutation) ClearCounters

func (m *AlertMutation) ClearCounters()

ClearCounters clears the "Counters" edge to the Counter 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) ClearError

func (m *AlertMutation) ClearError()

ClearError clears the value of the "Error" field.

func (*AlertMutation) ClearFailures

func (m *AlertMutation) ClearFailures()

ClearFailures clears the "Failures" edge to the Failure entity.

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

func (m *AlertMutation) ClearFiles()

ClearFiles clears the "Files" edge to the File entity.

func (*AlertMutation) ClearIncidentID

func (m *AlertMutation) ClearIncidentID()

ClearIncidentID clears the value of the "IncidentID" field.

func (*AlertMutation) ClearStati

func (m *AlertMutation) ClearStati()

ClearStati clears the "Stati" edge to the Status entity.

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

func (m *AlertMutation) CountersCleared() bool

CountersCleared reports if the "Counters" edge to the Counter entity was cleared.

func (*AlertMutation) CountersIDs

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

CountersIDs returns the "Counters" 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) Error

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

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

func (*AlertMutation) ErrorCleared

func (m *AlertMutation) ErrorCleared() bool

ErrorCleared returns if the "Error" field was cleared in this mutation.

func (*AlertMutation) FailuresCleared

func (m *AlertMutation) FailuresCleared() bool

FailuresCleared reports if the "Failures" edge to the Failure entity was cleared.

func (*AlertMutation) FailuresIDs

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

FailuresIDs returns the "Failures" 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) FilesCleared

func (m *AlertMutation) FilesCleared() bool

FilesCleared reports if the "Files" edge to the File entity was cleared.

func (*AlertMutation) FilesIDs

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

FilesIDs returns the "Files" edge IDs in the mutation.

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

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

func (m *AlertMutation) IncidentID() (r uuid.UUID, exists bool)

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

func (*AlertMutation) IncidentIDCleared

func (m *AlertMutation) IncidentIDCleared() bool

IncidentIDCleared returns if the "IncidentID" field was cleared in this mutation.

func (*AlertMutation) IntLevel

func (m *AlertMutation) IntLevel() (r int, exists bool)

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

func (*AlertMutation) Name

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

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

func (*AlertMutation) OldError

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

OldError returns the old "Error" 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) OldIncidentID

func (m *AlertMutation) OldIncidentID(ctx context.Context) (v uuid.UUID, err error)

OldIncidentID returns the old "IncidentID" 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) OldIntLevel

func (m *AlertMutation) OldIntLevel(ctx context.Context) (v int, err error)

OldIntLevel returns the old "IntLevel" 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) OldName

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

OldName returns the old "Name" 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) OldProbeHost

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

OldProbeHost returns the old "ProbeHost" 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) OldProbeOS

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

OldProbeOS returns the old "ProbeOS" 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) OldRegion

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

OldRegion returns the old "Region" 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) OldTime

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

OldTime returns the old "Time" 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

func (m *AlertMutation) OldUUID(ctx context.Context) (v uuid.UUID, 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) OldUsername

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

OldUsername returns the old "Username" 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) ProbeHost

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

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

func (*AlertMutation) ProbeOS

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

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

func (*AlertMutation) Region

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

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

func (*AlertMutation) RemoveCounterIDs

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

RemoveCounterIDs removes the "Counters" edge to the Counter entity by IDs.

func (*AlertMutation) RemoveFailureIDs

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

RemoveFailureIDs removes the "Failures" edge to the Failure entity by IDs.

func (*AlertMutation) RemoveFileIDs

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

RemoveFileIDs removes the "Files" edge to the File entity by IDs.

func (*AlertMutation) RemoveStatiIDs

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

RemoveStatiIDs removes the "Stati" edge to the Status entity by IDs.

func (*AlertMutation) RemovedCountersIDs

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

RemovedCounters returns the removed IDs of the "Counters" edge to the Counter entity.

func (*AlertMutation) RemovedEdges

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

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

func (*AlertMutation) RemovedFailuresIDs

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

RemovedFailures returns the removed IDs of the "Failures" edge to the Failure entity.

func (*AlertMutation) RemovedFilesIDs

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

RemovedFiles returns the removed IDs of the "Files" edge to the File 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) RemovedStatiIDs

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

RemovedStati returns the removed IDs of the "Stati" edge to the Status entity.

func (*AlertMutation) ResetCounters

func (m *AlertMutation) ResetCounters()

ResetCounters resets all changes to the "Counters" 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) ResetError

func (m *AlertMutation) ResetError()

ResetError resets all changes to the "Error" field.

func (*AlertMutation) ResetFailures

func (m *AlertMutation) ResetFailures()

ResetFailures resets all changes to the "Failures" edge.

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

func (m *AlertMutation) ResetFiles()

ResetFiles resets all changes to the "Files" edge.

func (*AlertMutation) ResetIncidentID

func (m *AlertMutation) ResetIncidentID()

ResetIncidentID resets all changes to the "IncidentID" field.

func (*AlertMutation) ResetIntLevel

func (m *AlertMutation) ResetIntLevel()

ResetIntLevel resets all changes to the "IntLevel" field.

func (*AlertMutation) ResetName

func (m *AlertMutation) ResetName()

ResetName resets all changes to the "Name" field.

func (*AlertMutation) ResetProbeHost

func (m *AlertMutation) ResetProbeHost()

ResetProbeHost resets all changes to the "ProbeHost" field.

func (*AlertMutation) ResetProbeOS

func (m *AlertMutation) ResetProbeOS()

ResetProbeOS resets all changes to the "ProbeOS" field.

func (*AlertMutation) ResetRegion

func (m *AlertMutation) ResetRegion()

ResetRegion resets all changes to the "Region" field.

func (*AlertMutation) ResetStati

func (m *AlertMutation) ResetStati()

ResetStati resets all changes to the "Stati" edge.

func (*AlertMutation) ResetTime

func (m *AlertMutation) ResetTime()

ResetTime resets all changes to the "Time" field.

func (*AlertMutation) ResetUUID

func (m *AlertMutation) ResetUUID()

ResetUUID resets all changes to the "UUID" field.

func (*AlertMutation) ResetUsername

func (m *AlertMutation) ResetUsername()

ResetUsername resets all changes to the "Username" field.

func (*AlertMutation) SetError

func (m *AlertMutation) SetError(s string)

SetError sets the "Error" 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) SetIncidentID

func (m *AlertMutation) SetIncidentID(u uuid.UUID)

SetIncidentID sets the "IncidentID" field.

func (*AlertMutation) SetIntLevel

func (m *AlertMutation) SetIntLevel(i int)

SetIntLevel sets the "IntLevel" field.

func (*AlertMutation) SetName

func (m *AlertMutation) SetName(s string)

SetName sets the "Name" field.

func (*AlertMutation) SetOp added in v0.14.0

func (m *AlertMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AlertMutation) SetProbeHost

func (m *AlertMutation) SetProbeHost(s string)

SetProbeHost sets the "ProbeHost" field.

func (*AlertMutation) SetProbeOS

func (m *AlertMutation) SetProbeOS(s string)

SetProbeOS sets the "ProbeOS" field.

func (*AlertMutation) SetRegion

func (m *AlertMutation) SetRegion(s string)

SetRegion sets the "Region" field.

func (*AlertMutation) SetTime

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

SetTime sets the "Time" field.

func (*AlertMutation) SetUUID

func (m *AlertMutation) SetUUID(u uuid.UUID)

SetUUID sets the "UUID" field.

func (*AlertMutation) SetUsername

func (m *AlertMutation) SetUsername(s string)

SetUsername sets the "Username" field.

func (*AlertMutation) StatiCleared

func (m *AlertMutation) StatiCleared() bool

StatiCleared reports if the "Stati" edge to the Status entity was cleared.

func (*AlertMutation) StatiIDs

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

StatiIDs returns the "Stati" edge IDs in the mutation.

func (*AlertMutation) Time

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

Time returns the value of the "Time" field in the 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

func (m *AlertMutation) UUID() (r uuid.UUID, exists bool)

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

func (*AlertMutation) Username

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

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

func (*AlertMutation) Where

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

Where appends a list predicates to the AlertMutation builder.

func (*AlertMutation) WhereP added in v0.14.0

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 AlertOrder

type AlertOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *AlertOrderField `json:"field"`
}

AlertOrder defines the ordering of Alert.

type AlertOrderField

type AlertOrderField struct {
	// Value extracts the ordering value from the given Alert.
	Value func(*Alert) (ent.Value, error)
	// contains filtered or unexported fields
}

AlertOrderField defines the ordering field of Alert.

type AlertPaginateOption

type AlertPaginateOption func(*alertPager) error

AlertPaginateOption enables pagination customization.

func WithAlertFilter

func WithAlertFilter(filter func(*AlertQuery) (*AlertQuery, error)) AlertPaginateOption

WithAlertFilter configures pagination filter.

func WithAlertOrder

func WithAlertOrder(order *AlertOrder) AlertPaginateOption

WithAlertOrder configures pagination ordering.

type AlertQuery

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

AlertQuery is the builder for querying Alert entities.

func (*AlertQuery) Aggregate added in v0.12.0

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

func (a *AlertQuery) CollectFields(ctx context.Context, satisfies ...string) (*AlertQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

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

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 {
	UUID uuid.UUID `json:"UUID,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Alert.Query().
	GroupBy(alert.FieldUUID).
	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) Paginate

func (a *AlertQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...AlertPaginateOption,
) (*AlertConnection, error)

Paginate executes the query and returns a relay based cursor connection to Alert.

func (*AlertQuery) QueryCounters

func (aq *AlertQuery) QueryCounters() *CounterQuery

QueryCounters chains the current query on the "Counters" edge.

func (*AlertQuery) QueryFailures

func (aq *AlertQuery) QueryFailures() *FailureQuery

QueryFailures chains the current query on the "Failures" edge.

func (*AlertQuery) QueryFiles

func (aq *AlertQuery) QueryFiles() *FileQuery

QueryFiles chains the current query on the "Files" edge.

func (*AlertQuery) QueryStati

func (aq *AlertQuery) QueryStati() *StatusQuery

QueryStati chains the current query on the "Stati" 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 {
	UUID uuid.UUID `json:"UUID,omitempty"`
}

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

func (*AlertQuery) Unique

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

func (aq *AlertQuery) WithCounters(opts ...func(*CounterQuery)) *AlertQuery

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

func (*AlertQuery) WithFailures

func (aq *AlertQuery) WithFailures(opts ...func(*FailureQuery)) *AlertQuery

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

func (*AlertQuery) WithFiles

func (aq *AlertQuery) WithFiles(opts ...func(*FileQuery)) *AlertQuery

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

func (*AlertQuery) WithNamedCounters

func (aq *AlertQuery) WithNamedCounters(name string, opts ...func(*CounterQuery)) *AlertQuery

WithNamedCounters tells the query-builder to eager-load the nodes that are connected to the "Counters" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*AlertQuery) WithNamedFailures

func (aq *AlertQuery) WithNamedFailures(name string, opts ...func(*FailureQuery)) *AlertQuery

WithNamedFailures tells the query-builder to eager-load the nodes that are connected to the "Failures" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*AlertQuery) WithNamedFiles

func (aq *AlertQuery) WithNamedFiles(name string, opts ...func(*FileQuery)) *AlertQuery

WithNamedFiles tells the query-builder to eager-load the nodes that are connected to the "Files" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*AlertQuery) WithNamedStati

func (aq *AlertQuery) WithNamedStati(name string, opts ...func(*StatusQuery)) *AlertQuery

WithNamedStati tells the query-builder to eager-load the nodes that are connected to the "Stati" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*AlertQuery) WithStati

func (aq *AlertQuery) WithStati(opts ...func(*StatusQuery)) *AlertQuery

WithStati tells the query-builder to eager-load the nodes that are connected to the "Stati" 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 v0.12.0

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

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

AddCounterIDs adds the "Counters" edge to the Counter entity by IDs.

func (*AlertUpdate) AddCounters

func (au *AlertUpdate) AddCounters(c ...*Counter) *AlertUpdate

AddCounters adds the "Counters" edges to the Counter entity.

func (*AlertUpdate) AddFailureIDs

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

AddFailureIDs adds the "Failures" edge to the Failure entity by IDs.

func (*AlertUpdate) AddFailures

func (au *AlertUpdate) AddFailures(f ...*Failure) *AlertUpdate

AddFailures adds the "Failures" edges to the Failure entity.

func (*AlertUpdate) AddFileIDs

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

AddFileIDs adds the "Files" edge to the File entity by IDs.

func (*AlertUpdate) AddFiles

func (au *AlertUpdate) AddFiles(f ...*File) *AlertUpdate

AddFiles adds the "Files" edges to the File entity.

func (*AlertUpdate) AddIntLevel

func (au *AlertUpdate) AddIntLevel(i int) *AlertUpdate

AddIntLevel adds i to the "IntLevel" field.

func (*AlertUpdate) AddStati

func (au *AlertUpdate) AddStati(s ...*Status) *AlertUpdate

AddStati adds the "Stati" edges to the Status entity.

func (*AlertUpdate) AddStatiIDs

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

AddStatiIDs adds the "Stati" edge to the Status entity by IDs.

func (*AlertUpdate) ClearCounters

func (au *AlertUpdate) ClearCounters() *AlertUpdate

ClearCounters clears all "Counters" edges to the Counter entity.

func (*AlertUpdate) ClearError

func (au *AlertUpdate) ClearError() *AlertUpdate

ClearError clears the value of the "Error" field.

func (*AlertUpdate) ClearFailures

func (au *AlertUpdate) ClearFailures() *AlertUpdate

ClearFailures clears all "Failures" edges to the Failure entity.

func (*AlertUpdate) ClearFiles

func (au *AlertUpdate) ClearFiles() *AlertUpdate

ClearFiles clears all "Files" edges to the File entity.

func (*AlertUpdate) ClearIncidentID

func (au *AlertUpdate) ClearIncidentID() *AlertUpdate

ClearIncidentID clears the value of the "IncidentID" field.

func (*AlertUpdate) ClearStati

func (au *AlertUpdate) ClearStati() *AlertUpdate

ClearStati clears all "Stati" edges to the Status 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) RemoveCounterIDs

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

RemoveCounterIDs removes the "Counters" edge to Counter entities by IDs.

func (*AlertUpdate) RemoveCounters

func (au *AlertUpdate) RemoveCounters(c ...*Counter) *AlertUpdate

RemoveCounters removes "Counters" edges to Counter entities.

func (*AlertUpdate) RemoveFailureIDs

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

RemoveFailureIDs removes the "Failures" edge to Failure entities by IDs.

func (*AlertUpdate) RemoveFailures

func (au *AlertUpdate) RemoveFailures(f ...*Failure) *AlertUpdate

RemoveFailures removes "Failures" edges to Failure entities.

func (*AlertUpdate) RemoveFileIDs

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

RemoveFileIDs removes the "Files" edge to File entities by IDs.

func (*AlertUpdate) RemoveFiles

func (au *AlertUpdate) RemoveFiles(f ...*File) *AlertUpdate

RemoveFiles removes "Files" edges to File entities.

func (*AlertUpdate) RemoveStati

func (au *AlertUpdate) RemoveStati(s ...*Status) *AlertUpdate

RemoveStati removes "Stati" edges to Status entities.

func (*AlertUpdate) RemoveStatiIDs

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

RemoveStatiIDs removes the "Stati" edge to Status entities by IDs.

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

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

SetError sets the "Error" field.

func (*AlertUpdate) SetIncidentID

func (au *AlertUpdate) SetIncidentID(u uuid.UUID) *AlertUpdate

SetIncidentID sets the "IncidentID" field.

func (*AlertUpdate) SetIntLevel

func (au *AlertUpdate) SetIntLevel(i int) *AlertUpdate

SetIntLevel sets the "IntLevel" field.

func (*AlertUpdate) SetName

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

SetName sets the "Name" field.

func (*AlertUpdate) SetNillableError

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

SetNillableError sets the "Error" field if the given value is not nil.

func (*AlertUpdate) SetNillableIncidentID

func (au *AlertUpdate) SetNillableIncidentID(u *uuid.UUID) *AlertUpdate

SetNillableIncidentID sets the "IncidentID" field if the given value is not nil.

func (*AlertUpdate) SetProbeHost

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

SetProbeHost sets the "ProbeHost" field.

func (*AlertUpdate) SetProbeOS

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

SetProbeOS sets the "ProbeOS" field.

func (*AlertUpdate) SetRegion

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

SetRegion sets the "Region" field.

func (*AlertUpdate) SetTime

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

SetTime sets the "Time" field.

func (*AlertUpdate) SetUUID

func (au *AlertUpdate) SetUUID(u uuid.UUID) *AlertUpdate

SetUUID sets the "UUID" field.

func (*AlertUpdate) SetUsername

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

SetUsername sets the "Username" 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) AddCounterIDs

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

AddCounterIDs adds the "Counters" edge to the Counter entity by IDs.

func (*AlertUpdateOne) AddCounters

func (auo *AlertUpdateOne) AddCounters(c ...*Counter) *AlertUpdateOne

AddCounters adds the "Counters" edges to the Counter entity.

func (*AlertUpdateOne) AddFailureIDs

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

AddFailureIDs adds the "Failures" edge to the Failure entity by IDs.

func (*AlertUpdateOne) AddFailures

func (auo *AlertUpdateOne) AddFailures(f ...*Failure) *AlertUpdateOne

AddFailures adds the "Failures" edges to the Failure entity.

func (*AlertUpdateOne) AddFileIDs

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

AddFileIDs adds the "Files" edge to the File entity by IDs.

func (*AlertUpdateOne) AddFiles

func (auo *AlertUpdateOne) AddFiles(f ...*File) *AlertUpdateOne

AddFiles adds the "Files" edges to the File entity.

func (*AlertUpdateOne) AddIntLevel

func (auo *AlertUpdateOne) AddIntLevel(i int) *AlertUpdateOne

AddIntLevel adds i to the "IntLevel" field.

func (*AlertUpdateOne) AddStati

func (auo *AlertUpdateOne) AddStati(s ...*Status) *AlertUpdateOne

AddStati adds the "Stati" edges to the Status entity.

func (*AlertUpdateOne) AddStatiIDs

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

AddStatiIDs adds the "Stati" edge to the Status entity by IDs.

func (*AlertUpdateOne) ClearCounters

func (auo *AlertUpdateOne) ClearCounters() *AlertUpdateOne

ClearCounters clears all "Counters" edges to the Counter entity.

func (*AlertUpdateOne) ClearError

func (auo *AlertUpdateOne) ClearError() *AlertUpdateOne

ClearError clears the value of the "Error" field.

func (*AlertUpdateOne) ClearFailures

func (auo *AlertUpdateOne) ClearFailures() *AlertUpdateOne

ClearFailures clears all "Failures" edges to the Failure entity.

func (*AlertUpdateOne) ClearFiles

func (auo *AlertUpdateOne) ClearFiles() *AlertUpdateOne

ClearFiles clears all "Files" edges to the File entity.

func (*AlertUpdateOne) ClearIncidentID

func (auo *AlertUpdateOne) ClearIncidentID() *AlertUpdateOne

ClearIncidentID clears the value of the "IncidentID" field.

func (*AlertUpdateOne) ClearStati

func (auo *AlertUpdateOne) ClearStati() *AlertUpdateOne

ClearStati clears all "Stati" edges to the Status 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) RemoveCounterIDs

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

RemoveCounterIDs removes the "Counters" edge to Counter entities by IDs.

func (*AlertUpdateOne) RemoveCounters

func (auo *AlertUpdateOne) RemoveCounters(c ...*Counter) *AlertUpdateOne

RemoveCounters removes "Counters" edges to Counter entities.

func (*AlertUpdateOne) RemoveFailureIDs

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

RemoveFailureIDs removes the "Failures" edge to Failure entities by IDs.

func (*AlertUpdateOne) RemoveFailures

func (auo *AlertUpdateOne) RemoveFailures(f ...*Failure) *AlertUpdateOne

RemoveFailures removes "Failures" edges to Failure entities.

func (*AlertUpdateOne) RemoveFileIDs

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

RemoveFileIDs removes the "Files" edge to File entities by IDs.

func (*AlertUpdateOne) RemoveFiles

func (auo *AlertUpdateOne) RemoveFiles(f ...*File) *AlertUpdateOne

RemoveFiles removes "Files" edges to File entities.

func (*AlertUpdateOne) RemoveStati

func (auo *AlertUpdateOne) RemoveStati(s ...*Status) *AlertUpdateOne

RemoveStati removes "Stati" edges to Status entities.

func (*AlertUpdateOne) RemoveStatiIDs

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

RemoveStatiIDs removes the "Stati" edge to Status entities by IDs.

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

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

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

SetError sets the "Error" field.

func (*AlertUpdateOne) SetIncidentID

func (auo *AlertUpdateOne) SetIncidentID(u uuid.UUID) *AlertUpdateOne

SetIncidentID sets the "IncidentID" field.

func (*AlertUpdateOne) SetIntLevel

func (auo *AlertUpdateOne) SetIntLevel(i int) *AlertUpdateOne

SetIntLevel sets the "IntLevel" field.

func (*AlertUpdateOne) SetName

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

SetName sets the "Name" field.

func (*AlertUpdateOne) SetNillableError

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

SetNillableError sets the "Error" field if the given value is not nil.

func (*AlertUpdateOne) SetNillableIncidentID

func (auo *AlertUpdateOne) SetNillableIncidentID(u *uuid.UUID) *AlertUpdateOne

SetNillableIncidentID sets the "IncidentID" field if the given value is not nil.

func (*AlertUpdateOne) SetProbeHost

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

SetProbeHost sets the "ProbeHost" field.

func (*AlertUpdateOne) SetProbeOS

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

SetProbeOS sets the "ProbeOS" field.

func (*AlertUpdateOne) SetRegion

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

SetRegion sets the "Region" field.

func (*AlertUpdateOne) SetTime

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

SetTime sets the "Time" field.

func (*AlertUpdateOne) SetUUID

func (auo *AlertUpdateOne) SetUUID(u uuid.UUID) *AlertUpdateOne

SetUUID sets the "UUID" field.

func (*AlertUpdateOne) SetUsername

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

SetUsername sets the "Username" field.

func (*AlertUpdateOne) Where added in v0.14.0

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

Where appends a list predicates to the AlertUpdate builder.

type AlertUpsert

type AlertUpsert struct {
	*sql.UpdateSet
}

AlertUpsert is the "OnConflict" setter.

func (*AlertUpsert) AddIntLevel

func (u *AlertUpsert) AddIntLevel(v int) *AlertUpsert

AddIntLevel adds v to the "IntLevel" field.

func (*AlertUpsert) ClearError

func (u *AlertUpsert) ClearError() *AlertUpsert

ClearError clears the value of the "Error" field.

func (*AlertUpsert) ClearIncidentID

func (u *AlertUpsert) ClearIncidentID() *AlertUpsert

ClearIncidentID clears the value of the "IncidentID" field.

func (*AlertUpsert) SetError

func (u *AlertUpsert) SetError(v string) *AlertUpsert

SetError sets the "Error" field.

func (*AlertUpsert) SetIncidentID

func (u *AlertUpsert) SetIncidentID(v uuid.UUID) *AlertUpsert

SetIncidentID sets the "IncidentID" field.

func (*AlertUpsert) SetIntLevel

func (u *AlertUpsert) SetIntLevel(v int) *AlertUpsert

SetIntLevel sets the "IntLevel" field.

func (*AlertUpsert) SetName

func (u *AlertUpsert) SetName(v string) *AlertUpsert

SetName sets the "Name" field.

func (*AlertUpsert) SetProbeHost

func (u *AlertUpsert) SetProbeHost(v string) *AlertUpsert

SetProbeHost sets the "ProbeHost" field.

func (*AlertUpsert) SetProbeOS

func (u *AlertUpsert) SetProbeOS(v string) *AlertUpsert

SetProbeOS sets the "ProbeOS" field.

func (*AlertUpsert) SetRegion

func (u *AlertUpsert) SetRegion(v string) *AlertUpsert

SetRegion sets the "Region" field.

func (*AlertUpsert) SetTime

func (u *AlertUpsert) SetTime(v time.Time) *AlertUpsert

SetTime sets the "Time" field.

func (*AlertUpsert) SetUUID

func (u *AlertUpsert) SetUUID(v uuid.UUID) *AlertUpsert

SetUUID sets the "UUID" field.

func (*AlertUpsert) SetUsername

func (u *AlertUpsert) SetUsername(v string) *AlertUpsert

SetUsername sets the "Username" field.

func (*AlertUpsert) UpdateError

func (u *AlertUpsert) UpdateError() *AlertUpsert

UpdateError sets the "Error" field to the value that was provided on create.

func (*AlertUpsert) UpdateIncidentID

func (u *AlertUpsert) UpdateIncidentID() *AlertUpsert

UpdateIncidentID sets the "IncidentID" field to the value that was provided on create.

func (*AlertUpsert) UpdateIntLevel

func (u *AlertUpsert) UpdateIntLevel() *AlertUpsert

UpdateIntLevel sets the "IntLevel" field to the value that was provided on create.

func (*AlertUpsert) UpdateName

func (u *AlertUpsert) UpdateName() *AlertUpsert

UpdateName sets the "Name" field to the value that was provided on create.

func (*AlertUpsert) UpdateProbeHost

func (u *AlertUpsert) UpdateProbeHost() *AlertUpsert

UpdateProbeHost sets the "ProbeHost" field to the value that was provided on create.

func (*AlertUpsert) UpdateProbeOS

func (u *AlertUpsert) UpdateProbeOS() *AlertUpsert

UpdateProbeOS sets the "ProbeOS" field to the value that was provided on create.

func (*AlertUpsert) UpdateRegion

func (u *AlertUpsert) UpdateRegion() *AlertUpsert

UpdateRegion sets the "Region" field to the value that was provided on create.

func (*AlertUpsert) UpdateTime

func (u *AlertUpsert) UpdateTime() *AlertUpsert

UpdateTime sets the "Time" field to the value that was provided on create.

func (*AlertUpsert) UpdateUUID

func (u *AlertUpsert) UpdateUUID() *AlertUpsert

UpdateUUID sets the "UUID" field to the value that was provided on create.

func (*AlertUpsert) UpdateUsername

func (u *AlertUpsert) UpdateUsername() *AlertUpsert

UpdateUsername sets the "Username" field to the value that was provided on create.

type AlertUpsertBulk

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

AlertUpsertBulk is the builder for "upsert"-ing a bulk of Alert nodes.

func (*AlertUpsertBulk) AddIntLevel

func (u *AlertUpsertBulk) AddIntLevel(v int) *AlertUpsertBulk

AddIntLevel adds v to the "IntLevel" field.

func (*AlertUpsertBulk) ClearError

func (u *AlertUpsertBulk) ClearError() *AlertUpsertBulk

ClearError clears the value of the "Error" field.

func (*AlertUpsertBulk) ClearIncidentID

func (u *AlertUpsertBulk) ClearIncidentID() *AlertUpsertBulk

ClearIncidentID clears the value of the "IncidentID" field.

func (*AlertUpsertBulk) DoNothing

func (u *AlertUpsertBulk) DoNothing() *AlertUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*AlertUpsertBulk) Exec

func (u *AlertUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AlertUpsertBulk) ExecX

func (u *AlertUpsertBulk) ExecX(ctx context.Context)

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

func (*AlertUpsertBulk) Ignore

func (u *AlertUpsertBulk) Ignore() *AlertUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Alert.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*AlertUpsertBulk) SetError

func (u *AlertUpsertBulk) SetError(v string) *AlertUpsertBulk

SetError sets the "Error" field.

func (*AlertUpsertBulk) SetIncidentID

func (u *AlertUpsertBulk) SetIncidentID(v uuid.UUID) *AlertUpsertBulk

SetIncidentID sets the "IncidentID" field.

func (*AlertUpsertBulk) SetIntLevel

func (u *AlertUpsertBulk) SetIntLevel(v int) *AlertUpsertBulk

SetIntLevel sets the "IntLevel" field.

func (*AlertUpsertBulk) SetName

func (u *AlertUpsertBulk) SetName(v string) *AlertUpsertBulk

SetName sets the "Name" field.

func (*AlertUpsertBulk) SetProbeHost

func (u *AlertUpsertBulk) SetProbeHost(v string) *AlertUpsertBulk

SetProbeHost sets the "ProbeHost" field.

func (*AlertUpsertBulk) SetProbeOS

func (u *AlertUpsertBulk) SetProbeOS(v string) *AlertUpsertBulk

SetProbeOS sets the "ProbeOS" field.

func (*AlertUpsertBulk) SetRegion

func (u *AlertUpsertBulk) SetRegion(v string) *AlertUpsertBulk

SetRegion sets the "Region" field.

func (*AlertUpsertBulk) SetTime

func (u *AlertUpsertBulk) SetTime(v time.Time) *AlertUpsertBulk

SetTime sets the "Time" field.

func (*AlertUpsertBulk) SetUUID

func (u *AlertUpsertBulk) SetUUID(v uuid.UUID) *AlertUpsertBulk

SetUUID sets the "UUID" field.

func (*AlertUpsertBulk) SetUsername

func (u *AlertUpsertBulk) SetUsername(v string) *AlertUpsertBulk

SetUsername sets the "Username" field.

func (*AlertUpsertBulk) Update

func (u *AlertUpsertBulk) Update(set func(*AlertUpsert)) *AlertUpsertBulk

Update allows overriding fields `UPDATE` values. See the AlertCreateBulk.OnConflict documentation for more info.

func (*AlertUpsertBulk) UpdateError

func (u *AlertUpsertBulk) UpdateError() *AlertUpsertBulk

UpdateError sets the "Error" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateIncidentID

func (u *AlertUpsertBulk) UpdateIncidentID() *AlertUpsertBulk

UpdateIncidentID sets the "IncidentID" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateIntLevel

func (u *AlertUpsertBulk) UpdateIntLevel() *AlertUpsertBulk

UpdateIntLevel sets the "IntLevel" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateName

func (u *AlertUpsertBulk) UpdateName() *AlertUpsertBulk

UpdateName sets the "Name" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateNewValues

func (u *AlertUpsertBulk) UpdateNewValues() *AlertUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Alert.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*AlertUpsertBulk) UpdateProbeHost

func (u *AlertUpsertBulk) UpdateProbeHost() *AlertUpsertBulk

UpdateProbeHost sets the "ProbeHost" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateProbeOS

func (u *AlertUpsertBulk) UpdateProbeOS() *AlertUpsertBulk

UpdateProbeOS sets the "ProbeOS" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateRegion

func (u *AlertUpsertBulk) UpdateRegion() *AlertUpsertBulk

UpdateRegion sets the "Region" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateTime

func (u *AlertUpsertBulk) UpdateTime() *AlertUpsertBulk

UpdateTime sets the "Time" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateUUID

func (u *AlertUpsertBulk) UpdateUUID() *AlertUpsertBulk

UpdateUUID sets the "UUID" field to the value that was provided on create.

func (*AlertUpsertBulk) UpdateUsername

func (u *AlertUpsertBulk) UpdateUsername() *AlertUpsertBulk

UpdateUsername sets the "Username" field to the value that was provided on create.

type AlertUpsertOne

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

AlertUpsertOne is the builder for "upsert"-ing

one Alert node.

func (*AlertUpsertOne) AddIntLevel

func (u *AlertUpsertOne) AddIntLevel(v int) *AlertUpsertOne

AddIntLevel adds v to the "IntLevel" field.

func (*AlertUpsertOne) ClearError

func (u *AlertUpsertOne) ClearError() *AlertUpsertOne

ClearError clears the value of the "Error" field.

func (*AlertUpsertOne) ClearIncidentID

func (u *AlertUpsertOne) ClearIncidentID() *AlertUpsertOne

ClearIncidentID clears the value of the "IncidentID" field.

func (*AlertUpsertOne) DoNothing

func (u *AlertUpsertOne) DoNothing() *AlertUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*AlertUpsertOne) Exec

func (u *AlertUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*AlertUpsertOne) ExecX

func (u *AlertUpsertOne) ExecX(ctx context.Context)

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

func (*AlertUpsertOne) ID

func (u *AlertUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*AlertUpsertOne) IDX

func (u *AlertUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*AlertUpsertOne) Ignore

func (u *AlertUpsertOne) Ignore() *AlertUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Alert.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*AlertUpsertOne) SetError

func (u *AlertUpsertOne) SetError(v string) *AlertUpsertOne

SetError sets the "Error" field.

func (*AlertUpsertOne) SetIncidentID

func (u *AlertUpsertOne) SetIncidentID(v uuid.UUID) *AlertUpsertOne

SetIncidentID sets the "IncidentID" field.

func (*AlertUpsertOne) SetIntLevel

func (u *AlertUpsertOne) SetIntLevel(v int) *AlertUpsertOne

SetIntLevel sets the "IntLevel" field.

func (*AlertUpsertOne) SetName

func (u *AlertUpsertOne) SetName(v string) *AlertUpsertOne

SetName sets the "Name" field.

func (*AlertUpsertOne) SetProbeHost

func (u *AlertUpsertOne) SetProbeHost(v string) *AlertUpsertOne

SetProbeHost sets the "ProbeHost" field.

func (*AlertUpsertOne) SetProbeOS

func (u *AlertUpsertOne) SetProbeOS(v string) *AlertUpsertOne

SetProbeOS sets the "ProbeOS" field.

func (*AlertUpsertOne) SetRegion

func (u *AlertUpsertOne) SetRegion(v string) *AlertUpsertOne

SetRegion sets the "Region" field.

func (*AlertUpsertOne) SetTime

func (u *AlertUpsertOne) SetTime(v time.Time) *AlertUpsertOne

SetTime sets the "Time" field.

func (*AlertUpsertOne) SetUUID

func (u *AlertUpsertOne) SetUUID(v uuid.UUID) *AlertUpsertOne

SetUUID sets the "UUID" field.

func (*AlertUpsertOne) SetUsername

func (u *AlertUpsertOne) SetUsername(v string) *AlertUpsertOne

SetUsername sets the "Username" field.

func (*AlertUpsertOne) Update

func (u *AlertUpsertOne) Update(set func(*AlertUpsert)) *AlertUpsertOne

Update allows overriding fields `UPDATE` values. See the AlertCreate.OnConflict documentation for more info.

func (*AlertUpsertOne) UpdateError

func (u *AlertUpsertOne) UpdateError() *AlertUpsertOne

UpdateError sets the "Error" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateIncidentID

func (u *AlertUpsertOne) UpdateIncidentID() *AlertUpsertOne

UpdateIncidentID sets the "IncidentID" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateIntLevel

func (u *AlertUpsertOne) UpdateIntLevel() *AlertUpsertOne

UpdateIntLevel sets the "IntLevel" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateName

func (u *AlertUpsertOne) UpdateName() *AlertUpsertOne

UpdateName sets the "Name" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateNewValues

func (u *AlertUpsertOne) UpdateNewValues() *AlertUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Alert.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*AlertUpsertOne) UpdateProbeHost

func (u *AlertUpsertOne) UpdateProbeHost() *AlertUpsertOne

UpdateProbeHost sets the "ProbeHost" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateProbeOS

func (u *AlertUpsertOne) UpdateProbeOS() *AlertUpsertOne

UpdateProbeOS sets the "ProbeOS" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateRegion

func (u *AlertUpsertOne) UpdateRegion() *AlertUpsertOne

UpdateRegion sets the "Region" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateTime

func (u *AlertUpsertOne) UpdateTime() *AlertUpsertOne

UpdateTime sets the "Time" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateUUID

func (u *AlertUpsertOne) UpdateUUID() *AlertUpsertOne

UpdateUUID sets the "UUID" field to the value that was provided on create.

func (*AlertUpsertOne) UpdateUsername

func (u *AlertUpsertOne) UpdateUsername() *AlertUpsertOne

UpdateUsername sets the "Username" field to the value that was provided on create.

type Alerts

type Alerts []*Alert

Alerts is a parsable slice of Alert.

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
	// Counter is the client for interacting with the Counter builders.
	Counter *CounterClient
	// Failure is the client for interacting with the Failure builders.
	Failure *FailureClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Incident is the client for interacting with the Incident builders.
	Incident *IncidentClient
	// Status is the client for interacting with the Status builders.
	Status *StatusClient
	// 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 v0.14.0

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 v0.14.0

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Noder

func (c *Client) Noder(ctx context.Context, id int, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []int, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Counter

type Counter struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "Name" field.
	Name string `json:"Name,omitempty"`
	// Value holds the value of the "Value" field.
	Value float64 `json:"Value,omitempty"`
	// contains filtered or unexported fields
}

Counter is the model entity for the Counter schema.

func (*Counter) GetValue added in v0.14.0

func (c *Counter) GetValue(name string) (ent.Value, error)

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

func (*Counter) IsNode added in v0.14.0

func (n *Counter) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Counter) String

func (c *Counter) String() string

String implements the fmt.Stringer.

func (*Counter) ToEdge

func (c *Counter) ToEdge(order *CounterOrder) *CounterEdge

ToEdge converts Counter into CounterEdge.

func (*Counter) Unwrap

func (c *Counter) Unwrap() *Counter

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

func (c *Counter) Update() *CounterUpdateOne

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

type CounterClient

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

CounterClient is a client for the Counter schema.

func NewCounterClient

func NewCounterClient(c config) *CounterClient

NewCounterClient returns a client for the Counter from the given config.

func (*CounterClient) Create

func (c *CounterClient) Create() *CounterCreate

Create returns a builder for creating a Counter entity.

func (*CounterClient) CreateBulk

func (c *CounterClient) CreateBulk(builders ...*CounterCreate) *CounterCreateBulk

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

func (*CounterClient) Delete

func (c *CounterClient) Delete() *CounterDelete

Delete returns a delete builder for Counter.

func (*CounterClient) DeleteOne

func (c *CounterClient) DeleteOne(co *Counter) *CounterDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CounterClient) DeleteOneID

func (c *CounterClient) DeleteOneID(id int) *CounterDeleteOne

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

func (*CounterClient) Get

func (c *CounterClient) Get(ctx context.Context, id int) (*Counter, error)

Get returns a Counter entity by its id.

func (*CounterClient) GetX

func (c *CounterClient) GetX(ctx context.Context, id int) *Counter

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

func (*CounterClient) Hooks

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

Hooks returns the client hooks.

func (*CounterClient) Intercept added in v0.14.0

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

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

func (*CounterClient) Interceptors added in v0.14.0

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

Interceptors returns the client interceptors.

func (*CounterClient) Query

func (c *CounterClient) Query() *CounterQuery

Query returns a query builder for Counter.

func (*CounterClient) Update

func (c *CounterClient) Update() *CounterUpdate

Update returns an update builder for Counter.

func (*CounterClient) UpdateOne

func (c *CounterClient) UpdateOne(co *Counter) *CounterUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CounterClient) UpdateOneID

func (c *CounterClient) UpdateOneID(id int) *CounterUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CounterClient) Use

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

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

type CounterConnection

type CounterConnection struct {
	Edges      []*CounterEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

CounterConnection is the connection containing edges to Counter.

type CounterCreate

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

CounterCreate is the builder for creating a Counter entity.

func (*CounterCreate) Exec

func (cc *CounterCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CounterCreate) ExecX

func (cc *CounterCreate) ExecX(ctx context.Context)

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

func (*CounterCreate) Mutation

func (cc *CounterCreate) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterCreate) OnConflict

func (cc *CounterCreate) OnConflict(opts ...sql.ConflictOption) *CounterUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Counter.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CounterUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*CounterCreate) OnConflictColumns

func (cc *CounterCreate) OnConflictColumns(columns ...string) *CounterUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Counter.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CounterCreate) Save

func (cc *CounterCreate) Save(ctx context.Context) (*Counter, error)

Save creates the Counter in the database.

func (*CounterCreate) SaveX

func (cc *CounterCreate) SaveX(ctx context.Context) *Counter

SaveX calls Save and panics if Save returns an error.

func (*CounterCreate) SetName

func (cc *CounterCreate) SetName(s string) *CounterCreate

SetName sets the "Name" field.

func (*CounterCreate) SetValue

func (cc *CounterCreate) SetValue(f float64) *CounterCreate

SetValue sets the "Value" field.

type CounterCreateBulk

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

CounterCreateBulk is the builder for creating many Counter entities in bulk.

func (*CounterCreateBulk) Exec

func (ccb *CounterCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CounterCreateBulk) ExecX

func (ccb *CounterCreateBulk) ExecX(ctx context.Context)

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

func (*CounterCreateBulk) OnConflict

func (ccb *CounterCreateBulk) OnConflict(opts ...sql.ConflictOption) *CounterUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Counter.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CounterUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*CounterCreateBulk) OnConflictColumns

func (ccb *CounterCreateBulk) OnConflictColumns(columns ...string) *CounterUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Counter.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CounterCreateBulk) Save

func (ccb *CounterCreateBulk) Save(ctx context.Context) ([]*Counter, error)

Save creates the Counter entities in the database.

func (*CounterCreateBulk) SaveX

func (ccb *CounterCreateBulk) SaveX(ctx context.Context) []*Counter

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

type CounterDelete

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

CounterDelete is the builder for deleting a Counter entity.

func (*CounterDelete) Exec

func (cd *CounterDelete) Exec(ctx context.Context) (int, error)

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

func (*CounterDelete) ExecX

func (cd *CounterDelete) ExecX(ctx context.Context) int

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

func (*CounterDelete) Where

func (cd *CounterDelete) Where(ps ...predicate.Counter) *CounterDelete

Where appends a list predicates to the CounterDelete builder.

type CounterDeleteOne

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

CounterDeleteOne is the builder for deleting a single Counter entity.

func (*CounterDeleteOne) Exec

func (cdo *CounterDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CounterDeleteOne) ExecX

func (cdo *CounterDeleteOne) ExecX(ctx context.Context)

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

func (*CounterDeleteOne) Where added in v0.14.0

Where appends a list predicates to the CounterDelete builder.

type CounterEdge

type CounterEdge struct {
	Node   *Counter `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

CounterEdge is the edge representation of Counter.

type CounterGroupBy

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

CounterGroupBy is the group-by builder for Counter entities.

func (*CounterGroupBy) Aggregate

func (cgb *CounterGroupBy) Aggregate(fns ...AggregateFunc) *CounterGroupBy

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

func (*CounterGroupBy) Bool

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

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

func (*CounterGroupBy) BoolX

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

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

func (*CounterGroupBy) Bools

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

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

func (*CounterGroupBy) BoolsX

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

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

func (*CounterGroupBy) Float64

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

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

func (*CounterGroupBy) Float64X

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

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

func (*CounterGroupBy) Float64s

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

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

func (*CounterGroupBy) Float64sX

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

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

func (*CounterGroupBy) Int

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

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

func (*CounterGroupBy) IntX

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

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

func (*CounterGroupBy) Ints

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

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

func (*CounterGroupBy) IntsX

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

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

func (*CounterGroupBy) Scan

func (cgb *CounterGroupBy) Scan(ctx context.Context, v any) error

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

func (*CounterGroupBy) ScanX

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

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

func (*CounterGroupBy) String

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

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

func (*CounterGroupBy) StringX

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

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

func (*CounterGroupBy) Strings

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

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

func (*CounterGroupBy) StringsX

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

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

type CounterMutation

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

CounterMutation represents an operation that mutates the Counter nodes in the graph.

func (*CounterMutation) AddField

func (m *CounterMutation) 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 (*CounterMutation) AddValue added in v0.10.7

func (m *CounterMutation) AddValue(f float64)

AddValue adds f to the "Value" field.

func (*CounterMutation) AddedEdges

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

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

func (*CounterMutation) AddedField

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

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

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

func (*CounterMutation) AddedIDs

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

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

func (*CounterMutation) AddedValue added in v0.10.7

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

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

func (*CounterMutation) ClearEdge

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

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

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

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

func (*CounterMutation) ClearedFields

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

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

func (CounterMutation) Client

func (m CounterMutation) 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 (*CounterMutation) EdgeCleared

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

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

func (*CounterMutation) Field

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

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

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

func (*CounterMutation) Fields

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

func (m *CounterMutation) 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 (*CounterMutation) IDs

func (m *CounterMutation) 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 (*CounterMutation) Name

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

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

func (*CounterMutation) OldField

func (m *CounterMutation) 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 (*CounterMutation) OldName

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

OldName returns the old "Name" field's value of the Counter entity. If the Counter 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 (*CounterMutation) OldValue

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

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

func (m *CounterMutation) Op() Op

Op returns the operation name.

func (*CounterMutation) RemovedEdges

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

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

func (*CounterMutation) RemovedIDs

func (m *CounterMutation) 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 (*CounterMutation) ResetEdge

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

func (m *CounterMutation) 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 (*CounterMutation) ResetName

func (m *CounterMutation) ResetName()

ResetName resets all changes to the "Name" field.

func (*CounterMutation) ResetValue

func (m *CounterMutation) ResetValue()

ResetValue resets all changes to the "Value" field.

func (*CounterMutation) SetField

func (m *CounterMutation) 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 (*CounterMutation) SetName

func (m *CounterMutation) SetName(s string)

SetName sets the "Name" field.

func (*CounterMutation) SetOp added in v0.14.0

func (m *CounterMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CounterMutation) SetValue

func (m *CounterMutation) SetValue(f float64)

SetValue sets the "Value" field.

func (CounterMutation) Tx

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

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

func (*CounterMutation) Type

func (m *CounterMutation) Type() string

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

func (*CounterMutation) Value

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

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

func (*CounterMutation) Where

func (m *CounterMutation) Where(ps ...predicate.Counter)

Where appends a list predicates to the CounterMutation builder.

func (*CounterMutation) WhereP added in v0.14.0

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

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

type CounterOrder

type CounterOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *CounterOrderField `json:"field"`
}

CounterOrder defines the ordering of Counter.

type CounterOrderField

type CounterOrderField struct {
	// Value extracts the ordering value from the given Counter.
	Value func(*Counter) (ent.Value, error)
	// contains filtered or unexported fields
}

CounterOrderField defines the ordering field of Counter.

type CounterPaginateOption

type CounterPaginateOption func(*counterPager) error

CounterPaginateOption enables pagination customization.

func WithCounterFilter

func WithCounterFilter(filter func(*CounterQuery) (*CounterQuery, error)) CounterPaginateOption

WithCounterFilter configures pagination filter.

func WithCounterOrder

func WithCounterOrder(order *CounterOrder) CounterPaginateOption

WithCounterOrder configures pagination ordering.

type CounterQuery

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

CounterQuery is the builder for querying Counter entities.

func (*CounterQuery) Aggregate added in v0.12.0

func (cq *CounterQuery) Aggregate(fns ...AggregateFunc) *CounterSelect

Aggregate returns a CounterSelect configured with the given aggregations.

func (*CounterQuery) All

func (cq *CounterQuery) All(ctx context.Context) ([]*Counter, error)

All executes the query and returns a list of Counters.

func (*CounterQuery) AllX

func (cq *CounterQuery) AllX(ctx context.Context) []*Counter

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

func (*CounterQuery) Clone

func (cq *CounterQuery) Clone() *CounterQuery

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

func (*CounterQuery) CollectFields

func (c *CounterQuery) CollectFields(ctx context.Context, satisfies ...string) (*CounterQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*CounterQuery) Count

func (cq *CounterQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CounterQuery) CountX

func (cq *CounterQuery) CountX(ctx context.Context) int

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

func (*CounterQuery) Exist

func (cq *CounterQuery) Exist(ctx context.Context) (bool, error)

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

func (*CounterQuery) ExistX

func (cq *CounterQuery) ExistX(ctx context.Context) bool

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

func (*CounterQuery) First

func (cq *CounterQuery) First(ctx context.Context) (*Counter, error)

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

func (*CounterQuery) FirstID

func (cq *CounterQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CounterQuery) FirstIDX

func (cq *CounterQuery) FirstIDX(ctx context.Context) int

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

func (*CounterQuery) FirstX

func (cq *CounterQuery) FirstX(ctx context.Context) *Counter

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

func (*CounterQuery) GroupBy

func (cq *CounterQuery) GroupBy(field string, fields ...string) *CounterGroupBy

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,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Counter.Query().
	GroupBy(counter.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CounterQuery) IDs

func (cq *CounterQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*CounterQuery) IDsX

func (cq *CounterQuery) IDsX(ctx context.Context) []int

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

func (*CounterQuery) Limit

func (cq *CounterQuery) Limit(limit int) *CounterQuery

Limit the number of records to be returned by this query.

func (*CounterQuery) Offset

func (cq *CounterQuery) Offset(offset int) *CounterQuery

Offset to start from.

func (*CounterQuery) Only

func (cq *CounterQuery) Only(ctx context.Context) (*Counter, error)

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

func (*CounterQuery) OnlyID

func (cq *CounterQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CounterQuery) OnlyIDX

func (cq *CounterQuery) OnlyIDX(ctx context.Context) int

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

func (*CounterQuery) OnlyX

func (cq *CounterQuery) OnlyX(ctx context.Context) *Counter

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

func (*CounterQuery) Order

func (cq *CounterQuery) Order(o ...counter.OrderOption) *CounterQuery

Order specifies how the records should be ordered.

func (*CounterQuery) Paginate

func (c *CounterQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...CounterPaginateOption,
) (*CounterConnection, error)

Paginate executes the query and returns a relay based cursor connection to Counter.

func (*CounterQuery) Select

func (cq *CounterQuery) Select(fields ...string) *CounterSelect

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,omitempty"`
}

client.Counter.Query().
	Select(counter.FieldName).
	Scan(ctx, &v)

func (*CounterQuery) Unique

func (cq *CounterQuery) Unique(unique bool) *CounterQuery

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 (*CounterQuery) Where

func (cq *CounterQuery) Where(ps ...predicate.Counter) *CounterQuery

Where adds a new predicate for the CounterQuery builder.

type CounterSelect

type CounterSelect struct {
	*CounterQuery
	// contains filtered or unexported fields
}

CounterSelect is the builder for selecting fields of Counter entities.

func (*CounterSelect) Aggregate added in v0.12.0

func (cs *CounterSelect) Aggregate(fns ...AggregateFunc) *CounterSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CounterSelect) Bool

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

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

func (*CounterSelect) BoolX

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

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

func (*CounterSelect) Bools

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

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

func (*CounterSelect) BoolsX

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

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

func (*CounterSelect) Float64

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

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

func (*CounterSelect) Float64X

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

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

func (*CounterSelect) Float64s

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

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

func (*CounterSelect) Float64sX

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

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

func (*CounterSelect) Int

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

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

func (*CounterSelect) IntX

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

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

func (*CounterSelect) Ints

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

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

func (*CounterSelect) IntsX

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

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

func (*CounterSelect) Scan

func (cs *CounterSelect) Scan(ctx context.Context, v any) error

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

func (*CounterSelect) ScanX

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

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

func (*CounterSelect) String

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

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

func (*CounterSelect) StringX

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

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

func (*CounterSelect) Strings

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

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

func (*CounterSelect) StringsX

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

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

type CounterUpdate

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

CounterUpdate is the builder for updating Counter entities.

func (*CounterUpdate) AddValue added in v0.10.7

func (cu *CounterUpdate) AddValue(f float64) *CounterUpdate

AddValue adds f to the "Value" field.

func (*CounterUpdate) Exec

func (cu *CounterUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CounterUpdate) ExecX

func (cu *CounterUpdate) ExecX(ctx context.Context)

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

func (*CounterUpdate) Mutation

func (cu *CounterUpdate) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterUpdate) Save

func (cu *CounterUpdate) Save(ctx context.Context) (int, error)

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

func (*CounterUpdate) SaveX

func (cu *CounterUpdate) SaveX(ctx context.Context) int

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

func (*CounterUpdate) SetName

func (cu *CounterUpdate) SetName(s string) *CounterUpdate

SetName sets the "Name" field.

func (*CounterUpdate) SetValue

func (cu *CounterUpdate) SetValue(f float64) *CounterUpdate

SetValue sets the "Value" field.

func (*CounterUpdate) Where

func (cu *CounterUpdate) Where(ps ...predicate.Counter) *CounterUpdate

Where appends a list predicates to the CounterUpdate builder.

type CounterUpdateOne

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

CounterUpdateOne is the builder for updating a single Counter entity.

func (*CounterUpdateOne) AddValue added in v0.10.7

func (cuo *CounterUpdateOne) AddValue(f float64) *CounterUpdateOne

AddValue adds f to the "Value" field.

func (*CounterUpdateOne) Exec

func (cuo *CounterUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CounterUpdateOne) ExecX

func (cuo *CounterUpdateOne) ExecX(ctx context.Context)

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

func (*CounterUpdateOne) Mutation

func (cuo *CounterUpdateOne) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterUpdateOne) Save

func (cuo *CounterUpdateOne) Save(ctx context.Context) (*Counter, error)

Save executes the query and returns the updated Counter entity.

func (*CounterUpdateOne) SaveX

func (cuo *CounterUpdateOne) SaveX(ctx context.Context) *Counter

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

func (*CounterUpdateOne) Select

func (cuo *CounterUpdateOne) Select(field string, fields ...string) *CounterUpdateOne

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

func (*CounterUpdateOne) SetName

func (cuo *CounterUpdateOne) SetName(s string) *CounterUpdateOne

SetName sets the "Name" field.

func (*CounterUpdateOne) SetValue

func (cuo *CounterUpdateOne) SetValue(f float64) *CounterUpdateOne

SetValue sets the "Value" field.

func (*CounterUpdateOne) Where added in v0.14.0

Where appends a list predicates to the CounterUpdate builder.

type CounterUpsert

type CounterUpsert struct {
	*sql.UpdateSet
}

CounterUpsert is the "OnConflict" setter.

func (*CounterUpsert) AddValue added in v0.10.7

func (u *CounterUpsert) AddValue(v float64) *CounterUpsert

AddValue adds v to the "Value" field.

func (*CounterUpsert) SetName

func (u *CounterUpsert) SetName(v string) *CounterUpsert

SetName sets the "Name" field.

func (*CounterUpsert) SetValue

func (u *CounterUpsert) SetValue(v float64) *CounterUpsert

SetValue sets the "Value" field.

func (*CounterUpsert) UpdateName

func (u *CounterUpsert) UpdateName() *CounterUpsert

UpdateName sets the "Name" field to the value that was provided on create.

func (*CounterUpsert) UpdateValue

func (u *CounterUpsert) UpdateValue() *CounterUpsert

UpdateValue sets the "Value" field to the value that was provided on create.

type CounterUpsertBulk

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

CounterUpsertBulk is the builder for "upsert"-ing a bulk of Counter nodes.

func (*CounterUpsertBulk) AddValue added in v0.10.7

AddValue adds v to the "Value" field.

func (*CounterUpsertBulk) DoNothing

func (u *CounterUpsertBulk) DoNothing() *CounterUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CounterUpsertBulk) Exec

func (u *CounterUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CounterUpsertBulk) ExecX

func (u *CounterUpsertBulk) ExecX(ctx context.Context)

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

func (*CounterUpsertBulk) Ignore

func (u *CounterUpsertBulk) Ignore() *CounterUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Counter.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*CounterUpsertBulk) SetName

SetName sets the "Name" field.

func (*CounterUpsertBulk) SetValue

SetValue sets the "Value" field.

func (*CounterUpsertBulk) Update

func (u *CounterUpsertBulk) Update(set func(*CounterUpsert)) *CounterUpsertBulk

Update allows overriding fields `UPDATE` values. See the CounterCreateBulk.OnConflict documentation for more info.

func (*CounterUpsertBulk) UpdateName

func (u *CounterUpsertBulk) UpdateName() *CounterUpsertBulk

UpdateName sets the "Name" field to the value that was provided on create.

func (*CounterUpsertBulk) UpdateNewValues

func (u *CounterUpsertBulk) UpdateNewValues() *CounterUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Counter.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*CounterUpsertBulk) UpdateValue

func (u *CounterUpsertBulk) UpdateValue() *CounterUpsertBulk

UpdateValue sets the "Value" field to the value that was provided on create.

type CounterUpsertOne

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

CounterUpsertOne is the builder for "upsert"-ing

one Counter node.

func (*CounterUpsertOne) AddValue added in v0.10.7

func (u *CounterUpsertOne) AddValue(v float64) *CounterUpsertOne

AddValue adds v to the "Value" field.

func (*CounterUpsertOne) DoNothing

func (u *CounterUpsertOne) DoNothing() *CounterUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CounterUpsertOne) Exec

func (u *CounterUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*CounterUpsertOne) ExecX

func (u *CounterUpsertOne) ExecX(ctx context.Context)

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

func (*CounterUpsertOne) ID

func (u *CounterUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*CounterUpsertOne) IDX

func (u *CounterUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*CounterUpsertOne) Ignore

func (u *CounterUpsertOne) Ignore() *CounterUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Counter.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*CounterUpsertOne) SetName

func (u *CounterUpsertOne) SetName(v string) *CounterUpsertOne

SetName sets the "Name" field.

func (*CounterUpsertOne) SetValue

func (u *CounterUpsertOne) SetValue(v float64) *CounterUpsertOne

SetValue sets the "Value" field.

func (*CounterUpsertOne) Update

func (u *CounterUpsertOne) Update(set func(*CounterUpsert)) *CounterUpsertOne

Update allows overriding fields `UPDATE` values. See the CounterCreate.OnConflict documentation for more info.

func (*CounterUpsertOne) UpdateName

func (u *CounterUpsertOne) UpdateName() *CounterUpsertOne

UpdateName sets the "Name" field to the value that was provided on create.

func (*CounterUpsertOne) UpdateNewValues

func (u *CounterUpsertOne) UpdateNewValues() *CounterUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Counter.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*CounterUpsertOne) UpdateValue

func (u *CounterUpsertOne) UpdateValue() *CounterUpsertOne

UpdateValue sets the "Value" field to the value that was provided on create.

type Counters

type Counters []*Counter

Counters is a parsable slice of Counter.

type Cursor

type Cursor = entgql.Cursor[int]

Common entgql types.

type Failure

type Failure struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Error holds the value of the "Error" field.
	Error string `json:"Error,omitempty"`
	// Idx holds the value of the "Idx" field.
	Idx int `json:"Idx,omitempty"`
	// contains filtered or unexported fields
}

Failure is the model entity for the Failure schema.

func (*Failure) IsNode added in v0.14.0

func (n *Failure) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Failure) String

func (f *Failure) String() string

String implements the fmt.Stringer.

func (*Failure) ToEdge

func (f *Failure) ToEdge(order *FailureOrder) *FailureEdge

ToEdge converts Failure into FailureEdge.

func (*Failure) Unwrap

func (f *Failure) Unwrap() *Failure

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

func (f *Failure) Update() *FailureUpdateOne

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

func (*Failure) Value added in v0.14.0

func (f *Failure) Value(name string) (ent.Value, error)

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

type FailureClient

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

FailureClient is a client for the Failure schema.

func NewFailureClient

func NewFailureClient(c config) *FailureClient

NewFailureClient returns a client for the Failure from the given config.

func (*FailureClient) Create

func (c *FailureClient) Create() *FailureCreate

Create returns a builder for creating a Failure entity.

func (*FailureClient) CreateBulk

func (c *FailureClient) CreateBulk(builders ...*FailureCreate) *FailureCreateBulk

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

func (*FailureClient) Delete

func (c *FailureClient) Delete() *FailureDelete

Delete returns a delete builder for Failure.

func (*FailureClient) DeleteOne

func (c *FailureClient) DeleteOne(f *Failure) *FailureDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FailureClient) DeleteOneID

func (c *FailureClient) DeleteOneID(id int) *FailureDeleteOne

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

func (*FailureClient) Get

func (c *FailureClient) Get(ctx context.Context, id int) (*Failure, error)

Get returns a Failure entity by its id.

func (*FailureClient) GetX

func (c *FailureClient) GetX(ctx context.Context, id int) *Failure

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

func (*FailureClient) Hooks

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

Hooks returns the client hooks.

func (*FailureClient) Intercept added in v0.14.0

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

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

func (*FailureClient) Interceptors added in v0.14.0

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

Interceptors returns the client interceptors.

func (*FailureClient) Query

func (c *FailureClient) Query() *FailureQuery

Query returns a query builder for Failure.

func (*FailureClient) Update

func (c *FailureClient) Update() *FailureUpdate

Update returns an update builder for Failure.

func (*FailureClient) UpdateOne

func (c *FailureClient) UpdateOne(f *Failure) *FailureUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FailureClient) UpdateOneID

func (c *FailureClient) UpdateOneID(id int) *FailureUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FailureClient) Use

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

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

type FailureConnection

type FailureConnection struct {
	Edges      []*FailureEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

FailureConnection is the connection containing edges to Failure.

type FailureCreate

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

FailureCreate is the builder for creating a Failure entity.

func (*FailureCreate) Exec

func (fc *FailureCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FailureCreate) ExecX

func (fc *FailureCreate) ExecX(ctx context.Context)

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

func (*FailureCreate) Mutation

func (fc *FailureCreate) Mutation() *FailureMutation

Mutation returns the FailureMutation object of the builder.

func (*FailureCreate) OnConflict

func (fc *FailureCreate) OnConflict(opts ...sql.ConflictOption) *FailureUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Failure.Create().
	SetError(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FailureUpsert) {
		SetError(v+v).
	}).
	Exec(ctx)

func (*FailureCreate) OnConflictColumns

func (fc *FailureCreate) OnConflictColumns(columns ...string) *FailureUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Failure.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FailureCreate) Save

func (fc *FailureCreate) Save(ctx context.Context) (*Failure, error)

Save creates the Failure in the database.

func (*FailureCreate) SaveX

func (fc *FailureCreate) SaveX(ctx context.Context) *Failure

SaveX calls Save and panics if Save returns an error.

func (*FailureCreate) SetError

func (fc *FailureCreate) SetError(s string) *FailureCreate

SetError sets the "Error" field.

func (*FailureCreate) SetIdx

func (fc *FailureCreate) SetIdx(i int) *FailureCreate

SetIdx sets the "Idx" field.

type FailureCreateBulk

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

FailureCreateBulk is the builder for creating many Failure entities in bulk.

func (*FailureCreateBulk) Exec

func (fcb *FailureCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FailureCreateBulk) ExecX

func (fcb *FailureCreateBulk) ExecX(ctx context.Context)

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

func (*FailureCreateBulk) OnConflict

func (fcb *FailureCreateBulk) OnConflict(opts ...sql.ConflictOption) *FailureUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Failure.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FailureUpsert) {
		SetError(v+v).
	}).
	Exec(ctx)

func (*FailureCreateBulk) OnConflictColumns

func (fcb *FailureCreateBulk) OnConflictColumns(columns ...string) *FailureUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Failure.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FailureCreateBulk) Save

func (fcb *FailureCreateBulk) Save(ctx context.Context) ([]*Failure, error)

Save creates the Failure entities in the database.

func (*FailureCreateBulk) SaveX

func (fcb *FailureCreateBulk) SaveX(ctx context.Context) []*Failure

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

type FailureDelete

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

FailureDelete is the builder for deleting a Failure entity.

func (*FailureDelete) Exec

func (fd *FailureDelete) Exec(ctx context.Context) (int, error)

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

func (*FailureDelete) ExecX

func (fd *FailureDelete) ExecX(ctx context.Context) int

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

func (*FailureDelete) Where

func (fd *FailureDelete) Where(ps ...predicate.Failure) *FailureDelete

Where appends a list predicates to the FailureDelete builder.

type FailureDeleteOne

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

FailureDeleteOne is the builder for deleting a single Failure entity.

func (*FailureDeleteOne) Exec

func (fdo *FailureDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FailureDeleteOne) ExecX

func (fdo *FailureDeleteOne) ExecX(ctx context.Context)

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

func (*FailureDeleteOne) Where added in v0.14.0

Where appends a list predicates to the FailureDelete builder.

type FailureEdge

type FailureEdge struct {
	Node   *Failure `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

FailureEdge is the edge representation of Failure.

type FailureGroupBy

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

FailureGroupBy is the group-by builder for Failure entities.

func (*FailureGroupBy) Aggregate

func (fgb *FailureGroupBy) Aggregate(fns ...AggregateFunc) *FailureGroupBy

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

func (*FailureGroupBy) Bool

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

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

func (*FailureGroupBy) BoolX

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

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

func (*FailureGroupBy) Bools

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

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

func (*FailureGroupBy) BoolsX

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

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

func (*FailureGroupBy) Float64

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

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

func (*FailureGroupBy) Float64X

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

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

func (*FailureGroupBy) Float64s

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

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

func (*FailureGroupBy) Float64sX

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

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

func (*FailureGroupBy) Int

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

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

func (*FailureGroupBy) IntX

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

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

func (*FailureGroupBy) Ints

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

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

func (*FailureGroupBy) IntsX

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

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

func (*FailureGroupBy) Scan

func (fgb *FailureGroupBy) Scan(ctx context.Context, v any) error

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

func (*FailureGroupBy) ScanX

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

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

func (*FailureGroupBy) String

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

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

func (*FailureGroupBy) StringX

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

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

func (*FailureGroupBy) Strings

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

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

func (*FailureGroupBy) StringsX

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

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

type FailureMutation

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

FailureMutation represents an operation that mutates the Failure nodes in the graph.

func (*FailureMutation) AddField

func (m *FailureMutation) 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 (*FailureMutation) AddIdx

func (m *FailureMutation) AddIdx(i int)

AddIdx adds i to the "Idx" field.

func (*FailureMutation) AddedEdges

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

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

func (*FailureMutation) AddedField

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

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

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

func (*FailureMutation) AddedIDs

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

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

func (*FailureMutation) AddedIdx

func (m *FailureMutation) AddedIdx() (r int, exists bool)

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

func (*FailureMutation) ClearEdge

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

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

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

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

func (*FailureMutation) ClearedFields

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

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

func (FailureMutation) Client

func (m FailureMutation) 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 (*FailureMutation) EdgeCleared

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

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

func (*FailureMutation) Error

func (m *FailureMutation) Error() (r string, exists bool)

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

func (*FailureMutation) Field

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

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

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

func (*FailureMutation) Fields

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

func (m *FailureMutation) 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 (*FailureMutation) IDs

func (m *FailureMutation) 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 (*FailureMutation) Idx

func (m *FailureMutation) Idx() (r int, exists bool)

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

func (*FailureMutation) OldError

func (m *FailureMutation) OldError(ctx context.Context) (v string, err error)

OldError returns the old "Error" field's value of the Failure entity. If the Failure 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 (*FailureMutation) OldField

func (m *FailureMutation) 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 (*FailureMutation) OldIdx

func (m *FailureMutation) OldIdx(ctx context.Context) (v int, err error)

OldIdx returns the old "Idx" field's value of the Failure entity. If the Failure 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 (*FailureMutation) Op

func (m *FailureMutation) Op() Op

Op returns the operation name.

func (*FailureMutation) RemovedEdges

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

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

func (*FailureMutation) RemovedIDs

func (m *FailureMutation) 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 (*FailureMutation) ResetEdge

func (m *FailureMutation) 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 (*FailureMutation) ResetError

func (m *FailureMutation) ResetError()

ResetError resets all changes to the "Error" field.

func (*FailureMutation) ResetField

func (m *FailureMutation) 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 (*FailureMutation) ResetIdx

func (m *FailureMutation) ResetIdx()

ResetIdx resets all changes to the "Idx" field.

func (*FailureMutation) SetError

func (m *FailureMutation) SetError(s string)

SetError sets the "Error" field.

func (*FailureMutation) SetField

func (m *FailureMutation) 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 (*FailureMutation) SetIdx

func (m *FailureMutation) SetIdx(i int)

SetIdx sets the "Idx" field.

func (*FailureMutation) SetOp added in v0.14.0

func (m *FailureMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (FailureMutation) Tx

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

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

func (*FailureMutation) Type

func (m *FailureMutation) Type() string

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

func (*FailureMutation) Where

func (m *FailureMutation) Where(ps ...predicate.Failure)

Where appends a list predicates to the FailureMutation builder.

func (*FailureMutation) WhereP added in v0.14.0

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

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

type FailureOrder

type FailureOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *FailureOrderField `json:"field"`
}

FailureOrder defines the ordering of Failure.

type FailureOrderField

type FailureOrderField struct {
	// Value extracts the ordering value from the given Failure.
	Value func(*Failure) (ent.Value, error)
	// contains filtered or unexported fields
}

FailureOrderField defines the ordering field of Failure.

type FailurePaginateOption

type FailurePaginateOption func(*failurePager) error

FailurePaginateOption enables pagination customization.

func WithFailureFilter

func WithFailureFilter(filter func(*FailureQuery) (*FailureQuery, error)) FailurePaginateOption

WithFailureFilter configures pagination filter.

func WithFailureOrder

func WithFailureOrder(order *FailureOrder) FailurePaginateOption

WithFailureOrder configures pagination ordering.

type FailureQuery

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

FailureQuery is the builder for querying Failure entities.

func (*FailureQuery) Aggregate added in v0.12.0

func (fq *FailureQuery) Aggregate(fns ...AggregateFunc) *FailureSelect

Aggregate returns a FailureSelect configured with the given aggregations.

func (*FailureQuery) All

func (fq *FailureQuery) All(ctx context.Context) ([]*Failure, error)

All executes the query and returns a list of Failures.

func (*FailureQuery) AllX

func (fq *FailureQuery) AllX(ctx context.Context) []*Failure

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

func (*FailureQuery) Clone

func (fq *FailureQuery) Clone() *FailureQuery

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

func (*FailureQuery) CollectFields

func (f *FailureQuery) CollectFields(ctx context.Context, satisfies ...string) (*FailureQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*FailureQuery) Count

func (fq *FailureQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FailureQuery) CountX

func (fq *FailureQuery) CountX(ctx context.Context) int

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

func (*FailureQuery) Exist

func (fq *FailureQuery) Exist(ctx context.Context) (bool, error)

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

func (*FailureQuery) ExistX

func (fq *FailureQuery) ExistX(ctx context.Context) bool

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

func (*FailureQuery) First

func (fq *FailureQuery) First(ctx context.Context) (*Failure, error)

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

func (*FailureQuery) FirstID

func (fq *FailureQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FailureQuery) FirstIDX

func (fq *FailureQuery) FirstIDX(ctx context.Context) int

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

func (*FailureQuery) FirstX

func (fq *FailureQuery) FirstX(ctx context.Context) *Failure

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

func (*FailureQuery) GroupBy

func (fq *FailureQuery) GroupBy(field string, fields ...string) *FailureGroupBy

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 {
	Error string `json:"Error,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Failure.Query().
	GroupBy(failure.FieldError).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FailureQuery) IDs

func (fq *FailureQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*FailureQuery) IDsX

func (fq *FailureQuery) IDsX(ctx context.Context) []int

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

func (*FailureQuery) Limit

func (fq *FailureQuery) Limit(limit int) *FailureQuery

Limit the number of records to be returned by this query.

func (*FailureQuery) Offset

func (fq *FailureQuery) Offset(offset int) *FailureQuery

Offset to start from.

func (*FailureQuery) Only

func (fq *FailureQuery) Only(ctx context.Context) (*Failure, error)

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

func (*FailureQuery) OnlyID

func (fq *FailureQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FailureQuery) OnlyIDX

func (fq *FailureQuery) OnlyIDX(ctx context.Context) int

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

func (*FailureQuery) OnlyX

func (fq *FailureQuery) OnlyX(ctx context.Context) *Failure

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

func (*FailureQuery) Order

func (fq *FailureQuery) Order(o ...failure.OrderOption) *FailureQuery

Order specifies how the records should be ordered.

func (*FailureQuery) Paginate

func (f *FailureQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...FailurePaginateOption,
) (*FailureConnection, error)

Paginate executes the query and returns a relay based cursor connection to Failure.

func (*FailureQuery) Select

func (fq *FailureQuery) Select(fields ...string) *FailureSelect

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 {
	Error string `json:"Error,omitempty"`
}

client.Failure.Query().
	Select(failure.FieldError).
	Scan(ctx, &v)

func (*FailureQuery) Unique

func (fq *FailureQuery) Unique(unique bool) *FailureQuery

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 (*FailureQuery) Where

func (fq *FailureQuery) Where(ps ...predicate.Failure) *FailureQuery

Where adds a new predicate for the FailureQuery builder.

type FailureSelect

type FailureSelect struct {
	*FailureQuery
	// contains filtered or unexported fields
}

FailureSelect is the builder for selecting fields of Failure entities.

func (*FailureSelect) Aggregate added in v0.12.0

func (fs *FailureSelect) Aggregate(fns ...AggregateFunc) *FailureSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FailureSelect) Bool

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

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

func (*FailureSelect) BoolX

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

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

func (*FailureSelect) Bools

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

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

func (*FailureSelect) BoolsX

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

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

func (*FailureSelect) Float64

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

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

func (*FailureSelect) Float64X

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

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

func (*FailureSelect) Float64s

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

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

func (*FailureSelect) Float64sX

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

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

func (*FailureSelect) Int

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

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

func (*FailureSelect) IntX

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

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

func (*FailureSelect) Ints

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

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

func (*FailureSelect) IntsX

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

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

func (*FailureSelect) Scan

func (fs *FailureSelect) Scan(ctx context.Context, v any) error

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

func (*FailureSelect) ScanX

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

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

func (*FailureSelect) String

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

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

func (*FailureSelect) StringX

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

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

func (*FailureSelect) Strings

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

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

func (*FailureSelect) StringsX

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

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

type FailureUpdate

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

FailureUpdate is the builder for updating Failure entities.

func (*FailureUpdate) AddIdx

func (fu *FailureUpdate) AddIdx(i int) *FailureUpdate

AddIdx adds i to the "Idx" field.

func (*FailureUpdate) Exec

func (fu *FailureUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FailureUpdate) ExecX

func (fu *FailureUpdate) ExecX(ctx context.Context)

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

func (*FailureUpdate) Mutation

func (fu *FailureUpdate) Mutation() *FailureMutation

Mutation returns the FailureMutation object of the builder.

func (*FailureUpdate) Save

func (fu *FailureUpdate) Save(ctx context.Context) (int, error)

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

func (*FailureUpdate) SaveX

func (fu *FailureUpdate) SaveX(ctx context.Context) int

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

func (*FailureUpdate) SetError

func (fu *FailureUpdate) SetError(s string) *FailureUpdate

SetError sets the "Error" field.

func (*FailureUpdate) SetIdx

func (fu *FailureUpdate) SetIdx(i int) *FailureUpdate

SetIdx sets the "Idx" field.

func (*FailureUpdate) Where

func (fu *FailureUpdate) Where(ps ...predicate.Failure) *FailureUpdate

Where appends a list predicates to the FailureUpdate builder.

type FailureUpdateOne

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

FailureUpdateOne is the builder for updating a single Failure entity.

func (*FailureUpdateOne) AddIdx

func (fuo *FailureUpdateOne) AddIdx(i int) *FailureUpdateOne

AddIdx adds i to the "Idx" field.

func (*FailureUpdateOne) Exec

func (fuo *FailureUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FailureUpdateOne) ExecX

func (fuo *FailureUpdateOne) ExecX(ctx context.Context)

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

func (*FailureUpdateOne) Mutation

func (fuo *FailureUpdateOne) Mutation() *FailureMutation

Mutation returns the FailureMutation object of the builder.

func (*FailureUpdateOne) Save

func (fuo *FailureUpdateOne) Save(ctx context.Context) (*Failure, error)

Save executes the query and returns the updated Failure entity.

func (*FailureUpdateOne) SaveX

func (fuo *FailureUpdateOne) SaveX(ctx context.Context) *Failure

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

func (*FailureUpdateOne) Select

func (fuo *FailureUpdateOne) Select(field string, fields ...string) *FailureUpdateOne

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

func (*FailureUpdateOne) SetError

func (fuo *FailureUpdateOne) SetError(s string) *FailureUpdateOne

SetError sets the "Error" field.

func (*FailureUpdateOne) SetIdx

func (fuo *FailureUpdateOne) SetIdx(i int) *FailureUpdateOne

SetIdx sets the "Idx" field.

func (*FailureUpdateOne) Where added in v0.14.0

Where appends a list predicates to the FailureUpdate builder.

type FailureUpsert

type FailureUpsert struct {
	*sql.UpdateSet
}

FailureUpsert is the "OnConflict" setter.

func (*FailureUpsert) AddIdx

func (u *FailureUpsert) AddIdx(v int) *FailureUpsert

AddIdx adds v to the "Idx" field.

func (*FailureUpsert) SetError

func (u *FailureUpsert) SetError(v string) *FailureUpsert

SetError sets the "Error" field.

func (*FailureUpsert) SetIdx

func (u *FailureUpsert) SetIdx(v int) *FailureUpsert

SetIdx sets the "Idx" field.

func (*FailureUpsert) UpdateError

func (u *FailureUpsert) UpdateError() *FailureUpsert

UpdateError sets the "Error" field to the value that was provided on create.

func (*FailureUpsert) UpdateIdx

func (u *FailureUpsert) UpdateIdx() *FailureUpsert

UpdateIdx sets the "Idx" field to the value that was provided on create.

type FailureUpsertBulk

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

FailureUpsertBulk is the builder for "upsert"-ing a bulk of Failure nodes.

func (*FailureUpsertBulk) AddIdx

func (u *FailureUpsertBulk) AddIdx(v int) *FailureUpsertBulk

AddIdx adds v to the "Idx" field.

func (*FailureUpsertBulk) DoNothing

func (u *FailureUpsertBulk) DoNothing() *FailureUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FailureUpsertBulk) Exec

func (u *FailureUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FailureUpsertBulk) ExecX

func (u *FailureUpsertBulk) ExecX(ctx context.Context)

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

func (*FailureUpsertBulk) Ignore

func (u *FailureUpsertBulk) Ignore() *FailureUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Failure.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*FailureUpsertBulk) SetError

func (u *FailureUpsertBulk) SetError(v string) *FailureUpsertBulk

SetError sets the "Error" field.

func (*FailureUpsertBulk) SetIdx

func (u *FailureUpsertBulk) SetIdx(v int) *FailureUpsertBulk

SetIdx sets the "Idx" field.

func (*FailureUpsertBulk) Update

func (u *FailureUpsertBulk) Update(set func(*FailureUpsert)) *FailureUpsertBulk

Update allows overriding fields `UPDATE` values. See the FailureCreateBulk.OnConflict documentation for more info.

func (*FailureUpsertBulk) UpdateError

func (u *FailureUpsertBulk) UpdateError() *FailureUpsertBulk

UpdateError sets the "Error" field to the value that was provided on create.

func (*FailureUpsertBulk) UpdateIdx

func (u *FailureUpsertBulk) UpdateIdx() *FailureUpsertBulk

UpdateIdx sets the "Idx" field to the value that was provided on create.

func (*FailureUpsertBulk) UpdateNewValues

func (u *FailureUpsertBulk) UpdateNewValues() *FailureUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Failure.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type FailureUpsertOne

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

FailureUpsertOne is the builder for "upsert"-ing

one Failure node.

func (*FailureUpsertOne) AddIdx

func (u *FailureUpsertOne) AddIdx(v int) *FailureUpsertOne

AddIdx adds v to the "Idx" field.

func (*FailureUpsertOne) DoNothing

func (u *FailureUpsertOne) DoNothing() *FailureUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FailureUpsertOne) Exec

func (u *FailureUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*FailureUpsertOne) ExecX

func (u *FailureUpsertOne) ExecX(ctx context.Context)

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

func (*FailureUpsertOne) ID

func (u *FailureUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*FailureUpsertOne) IDX

func (u *FailureUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*FailureUpsertOne) Ignore

func (u *FailureUpsertOne) Ignore() *FailureUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Failure.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*FailureUpsertOne) SetError

func (u *FailureUpsertOne) SetError(v string) *FailureUpsertOne

SetError sets the "Error" field.

func (*FailureUpsertOne) SetIdx

func (u *FailureUpsertOne) SetIdx(v int) *FailureUpsertOne

SetIdx sets the "Idx" field.

func (*FailureUpsertOne) Update

func (u *FailureUpsertOne) Update(set func(*FailureUpsert)) *FailureUpsertOne

Update allows overriding fields `UPDATE` values. See the FailureCreate.OnConflict documentation for more info.

func (*FailureUpsertOne) UpdateError

func (u *FailureUpsertOne) UpdateError() *FailureUpsertOne

UpdateError sets the "Error" field to the value that was provided on create.

func (*FailureUpsertOne) UpdateIdx

func (u *FailureUpsertOne) UpdateIdx() *FailureUpsertOne

UpdateIdx sets the "Idx" field to the value that was provided on create.

func (*FailureUpsertOne) UpdateNewValues

func (u *FailureUpsertOne) UpdateNewValues() *FailureUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Failure.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type Failures

type Failures []*Failure

Failures is a parsable slice of Failure.

type File

type File struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "UUID" field.
	UUID uuid.UUID `json:"UUID,omitempty"`
	// Name holds the value of the "Name" field.
	Name string `json:"Name,omitempty"`
	// Type holds the value of the "Type" field.
	Type string `json:"Type,omitempty"`
	// Ext holds the value of the "Ext" field.
	Ext string `json:"Ext,omitempty"`
	// Size holds the value of the "Size" field.
	Size int `json:"Size,omitempty"`
	// Payload holds the value of the "payload" field.
	Payload []byte `json:"payload,omitempty"`
	// contains filtered or unexported fields
}

File is the model entity for the File schema.

func (*File) IsNode added in v0.14.0

func (n *File) IsNode()

IsNode implements the Node interface check for GQLGen.

func (File) MsgItem

func (f File) MsgItem() msg.FileMsgItem

MsgItem converts to msg.FileMsgItem

func (*File) String

func (f *File) String() string

String implements the fmt.Stringer.

func (*File) ToEdge

func (f *File) ToEdge(order *FileOrder) *FileEdge

ToEdge converts File into FileEdge.

func (*File) Unwrap

func (f *File) Unwrap() *File

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

func (f *File) Update() *FileUpdateOne

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

func (*File) Value added in v0.14.0

func (f *File) Value(name string) (ent.Value, error)

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

type FileClient

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

FileClient is a client for the File schema.

func NewFileClient

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create

func (c *FileClient) Create() *FileCreate

Create returns a builder for creating a File entity.

func (*FileClient) CreateBulk

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

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

func (*FileClient) Delete

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne

func (c *FileClient) DeleteOne(f *File) *FileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileClient) DeleteOneID

func (c *FileClient) DeleteOneID(id int) *FileDeleteOne

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

func (*FileClient) Get

func (c *FileClient) Get(ctx context.Context, id int) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX

func (c *FileClient) GetX(ctx context.Context, id int) *File

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

func (*FileClient) Hooks

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

Hooks returns the client hooks.

func (*FileClient) Intercept added in v0.14.0

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

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

func (*FileClient) Interceptors added in v0.14.0

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

Interceptors returns the client interceptors.

func (*FileClient) Query

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(f *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID

func (c *FileClient) UpdateOneID(id int) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use

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

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

type FileConnection

type FileConnection struct {
	Edges      []*FileEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

FileConnection is the connection containing edges to File.

type FileCreate

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

FileCreate is the builder for creating a File entity.

func (*FileCreate) Exec

func (fc *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecX

func (fc *FileCreate) ExecX(ctx context.Context)

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

func (*FileCreate) Mutation

func (fc *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) OnConflict

func (fc *FileCreate) OnConflict(opts ...sql.ConflictOption) *FileUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.File.Create().
	SetUUID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetUUID(v+v).
	}).
	Exec(ctx)

func (*FileCreate) OnConflictColumns

func (fc *FileCreate) OnConflictColumns(columns ...string) *FileUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FileCreate) Save

func (fc *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX

func (fc *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetExt

func (fc *FileCreate) SetExt(s string) *FileCreate

SetExt sets the "Ext" field.

func (*FileCreate) SetName

func (fc *FileCreate) SetName(s string) *FileCreate

SetName sets the "Name" field.

func (*FileCreate) SetPayload

func (fc *FileCreate) SetPayload(b []byte) *FileCreate

SetPayload sets the "payload" field.

func (*FileCreate) SetSize

func (fc *FileCreate) SetSize(i int) *FileCreate

SetSize sets the "Size" field.

func (*FileCreate) SetType

func (fc *FileCreate) SetType(s string) *FileCreate

SetType sets the "Type" field.

func (*FileCreate) SetUUID

func (fc *FileCreate) SetUUID(u uuid.UUID) *FileCreate

SetUUID sets the "UUID" field.

type FileCreateBulk

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

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec

func (fcb *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecX

func (fcb *FileCreateBulk) ExecX(ctx context.Context)

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

func (*FileCreateBulk) OnConflict

func (fcb *FileCreateBulk) OnConflict(opts ...sql.ConflictOption) *FileUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.File.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetUUID(v+v).
	}).
	Exec(ctx)

func (*FileCreateBulk) OnConflictColumns

func (fcb *FileCreateBulk) OnConflictColumns(columns ...string) *FileUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FileCreateBulk) Save

func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File

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

type FileDelete

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

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec

func (fd *FileDelete) Exec(ctx context.Context) (int, error)

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

func (*FileDelete) ExecX

func (fd *FileDelete) ExecX(ctx context.Context) int

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

func (*FileDelete) Where

func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne

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

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec

func (fdo *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

func (fdo *FileDeleteOne) ExecX(ctx context.Context)

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

func (*FileDeleteOne) Where added in v0.14.0

func (fdo *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne

Where appends a list predicates to the FileDelete builder.

type FileEdge

type FileEdge struct {
	Node   *File  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

FileEdge is the edge representation of File.

type FileGroupBy

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

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

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

func (*FileGroupBy) Bool

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

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

func (*FileGroupBy) BoolX

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

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

func (*FileGroupBy) Bools

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

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

func (*FileGroupBy) BoolsX

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

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

func (*FileGroupBy) Float64

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

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

func (*FileGroupBy) Float64X

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

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

func (*FileGroupBy) Float64s

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

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

func (*FileGroupBy) Float64sX

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

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

func (*FileGroupBy) Int

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

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

func (*FileGroupBy) IntX

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

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

func (*FileGroupBy) Ints

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

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

func (*FileGroupBy) IntsX

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

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

func (*FileGroupBy) Scan

func (fgb *FileGroupBy) Scan(ctx context.Context, v any) error

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

func (*FileGroupBy) ScanX

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

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

func (*FileGroupBy) String

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

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

func (*FileGroupBy) StringX

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

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

func (*FileGroupBy) Strings

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

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

func (*FileGroupBy) StringsX

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

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

type FileMutation

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

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddField

func (m *FileMutation) 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 (*FileMutation) AddSize

func (m *FileMutation) AddSize(i int)

AddSize adds i to the "Size" field.

func (*FileMutation) AddedEdges

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

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

func (*FileMutation) AddedField

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

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

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

func (*FileMutation) AddedIDs

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

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

func (*FileMutation) AddedSize

func (m *FileMutation) AddedSize() (r int, exists bool)

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

func (*FileMutation) ClearEdge

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

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

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

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

func (*FileMutation) ClearedFields

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

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

func (FileMutation) Client

func (m FileMutation) 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 (*FileMutation) EdgeCleared

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

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

func (*FileMutation) Ext

func (m *FileMutation) Ext() (r string, exists bool)

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

func (*FileMutation) Field

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

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

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

func (*FileMutation) Fields

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

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

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

func (*FileMutation) ID

func (m *FileMutation) 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 (*FileMutation) IDs

func (m *FileMutation) 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 (*FileMutation) Name

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

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

func (*FileMutation) OldExt

func (m *FileMutation) OldExt(ctx context.Context) (v string, err error)

OldExt returns the old "Ext" field's value of the File entity. If the File 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 (*FileMutation) OldField

func (m *FileMutation) 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 (*FileMutation) OldName

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

OldName returns the old "Name" field's value of the File entity. If the File 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 (*FileMutation) OldPayload

func (m *FileMutation) OldPayload(ctx context.Context) (v []byte, err error)

OldPayload returns the old "payload" field's value of the File entity. If the File 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 (*FileMutation) OldSize

func (m *FileMutation) OldSize(ctx context.Context) (v int, err error)

OldSize returns the old "Size" field's value of the File entity. If the File 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 (*FileMutation) OldType

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

OldType returns the old "Type" field's value of the File entity. If the File 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 (*FileMutation) OldUUID

func (m *FileMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "UUID" field's value of the File entity. If the File 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 (*FileMutation) Op

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) Payload

func (m *FileMutation) Payload() (r []byte, exists bool)

Payload returns the value of the "payload" field in the mutation.

func (*FileMutation) RemovedEdges

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

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

func (*FileMutation) RemovedIDs

func (m *FileMutation) 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 (*FileMutation) ResetEdge

func (m *FileMutation) 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 (*FileMutation) ResetExt

func (m *FileMutation) ResetExt()

ResetExt resets all changes to the "Ext" field.

func (*FileMutation) ResetField

func (m *FileMutation) 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 (*FileMutation) ResetName

func (m *FileMutation) ResetName()

ResetName resets all changes to the "Name" field.

func (*FileMutation) ResetPayload

func (m *FileMutation) ResetPayload()

ResetPayload resets all changes to the "payload" field.

func (*FileMutation) ResetSize

func (m *FileMutation) ResetSize()

ResetSize resets all changes to the "Size" field.

func (*FileMutation) ResetType

func (m *FileMutation) ResetType()

ResetType resets all changes to the "Type" field.

func (*FileMutation) ResetUUID

func (m *FileMutation) ResetUUID()

ResetUUID resets all changes to the "UUID" field.

func (*FileMutation) SetExt

func (m *FileMutation) SetExt(s string)

SetExt sets the "Ext" field.

func (*FileMutation) SetField

func (m *FileMutation) 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 (*FileMutation) SetName

func (m *FileMutation) SetName(s string)

SetName sets the "Name" field.

func (*FileMutation) SetOp added in v0.14.0

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileMutation) SetPayload

func (m *FileMutation) SetPayload(b []byte)

SetPayload sets the "payload" field.

func (*FileMutation) SetSize

func (m *FileMutation) SetSize(i int)

SetSize sets the "Size" field.

func (*FileMutation) SetType

func (m *FileMutation) SetType(s string)

SetType sets the "Type" field.

func (*FileMutation) SetUUID

func (m *FileMutation) SetUUID(u uuid.UUID)

SetUUID sets the "UUID" field.

func (*FileMutation) Size

func (m *FileMutation) Size() (r int, exists bool)

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

func (FileMutation) Tx

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

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

func (*FileMutation) Type

func (m *FileMutation) Type() string

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

func (*FileMutation) UUID

func (m *FileMutation) UUID() (r uuid.UUID, exists bool)

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

func (*FileMutation) Where

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

func (*FileMutation) WhereP added in v0.14.0

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

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

type FileOrder

type FileOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *FileOrderField `json:"field"`
}

FileOrder defines the ordering of File.

type FileOrderField

type FileOrderField struct {
	// Value extracts the ordering value from the given File.
	Value func(*File) (ent.Value, error)
	// contains filtered or unexported fields
}

FileOrderField defines the ordering field of File.

type FilePaginateOption

type FilePaginateOption func(*filePager) error

FilePaginateOption enables pagination customization.

func WithFileFilter

func WithFileFilter(filter func(*FileQuery) (*FileQuery, error)) FilePaginateOption

WithFileFilter configures pagination filter.

func WithFileOrder

func WithFileOrder(order *FileOrder) FilePaginateOption

WithFileOrder configures pagination ordering.

type FileQuery

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

FileQuery is the builder for querying File entities.

func (*FileQuery) Aggregate added in v0.12.0

func (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All

func (fq *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX

func (fq *FileQuery) AllX(ctx context.Context) []*File

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

func (*FileQuery) Clone

func (fq *FileQuery) Clone() *FileQuery

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

func (*FileQuery) CollectFields

func (f *FileQuery) CollectFields(ctx context.Context, satisfies ...string) (*FileQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*FileQuery) Count

func (fq *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

func (fq *FileQuery) CountX(ctx context.Context) int

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

func (*FileQuery) Exist

func (fq *FileQuery) Exist(ctx context.Context) (bool, error)

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

func (*FileQuery) ExistX

func (fq *FileQuery) ExistX(ctx context.Context) bool

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

func (*FileQuery) First

func (fq *FileQuery) First(ctx context.Context) (*File, error)

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

func (*FileQuery) FirstID

func (fq *FileQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FileQuery) FirstIDX

func (fq *FileQuery) FirstIDX(ctx context.Context) int

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

func (*FileQuery) FirstX

func (fq *FileQuery) FirstX(ctx context.Context) *File

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

func (*FileQuery) GroupBy

func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

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 {
	UUID uuid.UUID `json:"UUID,omitempty"`
	Count int `json:"count,omitempty"`
}

client.File.Query().
	GroupBy(file.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileQuery) IDs

func (fq *FileQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*FileQuery) IDsX

func (fq *FileQuery) IDsX(ctx context.Context) []int

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

func (*FileQuery) Limit

func (fq *FileQuery) Limit(limit int) *FileQuery

Limit the number of records to be returned by this query.

func (*FileQuery) Offset

func (fq *FileQuery) Offset(offset int) *FileQuery

Offset to start from.

func (*FileQuery) Only

func (fq *FileQuery) Only(ctx context.Context) (*File, error)

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

func (*FileQuery) OnlyID

func (fq *FileQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FileQuery) OnlyIDX

func (fq *FileQuery) OnlyIDX(ctx context.Context) int

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

func (*FileQuery) OnlyX

func (fq *FileQuery) OnlyX(ctx context.Context) *File

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

func (*FileQuery) Order

func (fq *FileQuery) Order(o ...file.OrderOption) *FileQuery

Order specifies how the records should be ordered.

func (*FileQuery) Paginate

func (f *FileQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...FilePaginateOption,
) (*FileConnection, error)

Paginate executes the query and returns a relay based cursor connection to File.

func (*FileQuery) Select

func (fq *FileQuery) Select(fields ...string) *FileSelect

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 {
	UUID uuid.UUID `json:"UUID,omitempty"`
}

client.File.Query().
	Select(file.FieldUUID).
	Scan(ctx, &v)

func (*FileQuery) Unique

func (fq *FileQuery) Unique(unique bool) *FileQuery

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 (*FileQuery) Where

func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

type FileSelect

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Aggregate added in v0.12.0

func (fs *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileSelect) Bool

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

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

func (*FileSelect) BoolX

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

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

func (*FileSelect) Bools

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

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

func (*FileSelect) BoolsX

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

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

func (*FileSelect) Float64

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

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

func (*FileSelect) Float64X

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

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

func (*FileSelect) Float64s

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

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

func (*FileSelect) Float64sX

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

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

func (*FileSelect) Int

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

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

func (*FileSelect) IntX

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

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

func (*FileSelect) Ints

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

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

func (*FileSelect) IntsX

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

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

func (*FileSelect) Scan

func (fs *FileSelect) Scan(ctx context.Context, v any) error

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

func (*FileSelect) ScanX

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

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

func (*FileSelect) String

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

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

func (*FileSelect) StringX

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

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

func (*FileSelect) Strings

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

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

func (*FileSelect) StringsX

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

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

type FileUpdate

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

FileUpdate is the builder for updating File entities.

func (*FileUpdate) AddSize

func (fu *FileUpdate) AddSize(i int) *FileUpdate

AddSize adds i to the "Size" field.

func (*FileUpdate) Exec

func (fu *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecX

func (fu *FileUpdate) ExecX(ctx context.Context)

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

func (*FileUpdate) Mutation

func (fu *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) Save

func (fu *FileUpdate) Save(ctx context.Context) (int, error)

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

func (*FileUpdate) SaveX

func (fu *FileUpdate) SaveX(ctx context.Context) int

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

func (*FileUpdate) SetExt

func (fu *FileUpdate) SetExt(s string) *FileUpdate

SetExt sets the "Ext" field.

func (*FileUpdate) SetName

func (fu *FileUpdate) SetName(s string) *FileUpdate

SetName sets the "Name" field.

func (*FileUpdate) SetPayload

func (fu *FileUpdate) SetPayload(b []byte) *FileUpdate

SetPayload sets the "payload" field.

func (*FileUpdate) SetSize

func (fu *FileUpdate) SetSize(i int) *FileUpdate

SetSize sets the "Size" field.

func (*FileUpdate) SetType

func (fu *FileUpdate) SetType(s string) *FileUpdate

SetType sets the "Type" field.

func (*FileUpdate) SetUUID

func (fu *FileUpdate) SetUUID(u uuid.UUID) *FileUpdate

SetUUID sets the "UUID" field.

func (*FileUpdate) Where

func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne

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

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) AddSize

func (fuo *FileUpdateOne) AddSize(i int) *FileUpdateOne

AddSize adds i to the "Size" field.

func (*FileUpdateOne) Exec

func (fuo *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecX

func (fuo *FileUpdateOne) ExecX(ctx context.Context)

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

func (*FileUpdateOne) Mutation

func (fuo *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) Save

func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File

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

func (*FileUpdateOne) Select

func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

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

func (*FileUpdateOne) SetExt

func (fuo *FileUpdateOne) SetExt(s string) *FileUpdateOne

SetExt sets the "Ext" field.

func (*FileUpdateOne) SetName

func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne

SetName sets the "Name" field.

func (*FileUpdateOne) SetPayload

func (fuo *FileUpdateOne) SetPayload(b []byte) *FileUpdateOne

SetPayload sets the "payload" field.

func (*FileUpdateOne) SetSize

func (fuo *FileUpdateOne) SetSize(i int) *FileUpdateOne

SetSize sets the "Size" field.

func (*FileUpdateOne) SetType

func (fuo *FileUpdateOne) SetType(s string) *FileUpdateOne

SetType sets the "Type" field.

func (*FileUpdateOne) SetUUID

func (fuo *FileUpdateOne) SetUUID(u uuid.UUID) *FileUpdateOne

SetUUID sets the "UUID" field.

func (*FileUpdateOne) Where added in v0.14.0

func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne

Where appends a list predicates to the FileUpdate builder.

type FileUpsert

type FileUpsert struct {
	*sql.UpdateSet
}

FileUpsert is the "OnConflict" setter.

func (*FileUpsert) AddSize

func (u *FileUpsert) AddSize(v int) *FileUpsert

AddSize adds v to the "Size" field.

func (*FileUpsert) SetExt

func (u *FileUpsert) SetExt(v string) *FileUpsert

SetExt sets the "Ext" field.

func (*FileUpsert) SetName

func (u *FileUpsert) SetName(v string) *FileUpsert

SetName sets the "Name" field.

func (*FileUpsert) SetPayload

func (u *FileUpsert) SetPayload(v []byte) *FileUpsert

SetPayload sets the "payload" field.

func (*FileUpsert) SetSize

func (u *FileUpsert) SetSize(v int) *FileUpsert

SetSize sets the "Size" field.

func (*FileUpsert) SetType

func (u *FileUpsert) SetType(v string) *FileUpsert

SetType sets the "Type" field.

func (*FileUpsert) SetUUID

func (u *FileUpsert) SetUUID(v uuid.UUID) *FileUpsert

SetUUID sets the "UUID" field.

func (*FileUpsert) UpdateExt

func (u *FileUpsert) UpdateExt() *FileUpsert

UpdateExt sets the "Ext" field to the value that was provided on create.

func (*FileUpsert) UpdateName

func (u *FileUpsert) UpdateName() *FileUpsert

UpdateName sets the "Name" field to the value that was provided on create.

func (*FileUpsert) UpdatePayload

func (u *FileUpsert) UpdatePayload() *FileUpsert

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*FileUpsert) UpdateSize

func (u *FileUpsert) UpdateSize() *FileUpsert

UpdateSize sets the "Size" field to the value that was provided on create.

func (*FileUpsert) UpdateType

func (u *FileUpsert) UpdateType() *FileUpsert

UpdateType sets the "Type" field to the value that was provided on create.

func (*FileUpsert) UpdateUUID

func (u *FileUpsert) UpdateUUID() *FileUpsert

UpdateUUID sets the "UUID" field to the value that was provided on create.

type FileUpsertBulk

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

FileUpsertBulk is the builder for "upsert"-ing a bulk of File nodes.

func (*FileUpsertBulk) AddSize

func (u *FileUpsertBulk) AddSize(v int) *FileUpsertBulk

AddSize adds v to the "Size" field.

func (*FileUpsertBulk) DoNothing

func (u *FileUpsertBulk) DoNothing() *FileUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FileUpsertBulk) Exec

func (u *FileUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpsertBulk) ExecX

func (u *FileUpsertBulk) ExecX(ctx context.Context)

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

func (*FileUpsertBulk) Ignore

func (u *FileUpsertBulk) Ignore() *FileUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*FileUpsertBulk) SetExt

func (u *FileUpsertBulk) SetExt(v string) *FileUpsertBulk

SetExt sets the "Ext" field.

func (*FileUpsertBulk) SetName

func (u *FileUpsertBulk) SetName(v string) *FileUpsertBulk

SetName sets the "Name" field.

func (*FileUpsertBulk) SetPayload

func (u *FileUpsertBulk) SetPayload(v []byte) *FileUpsertBulk

SetPayload sets the "payload" field.

func (*FileUpsertBulk) SetSize

func (u *FileUpsertBulk) SetSize(v int) *FileUpsertBulk

SetSize sets the "Size" field.

func (*FileUpsertBulk) SetType

func (u *FileUpsertBulk) SetType(v string) *FileUpsertBulk

SetType sets the "Type" field.

func (*FileUpsertBulk) SetUUID

func (u *FileUpsertBulk) SetUUID(v uuid.UUID) *FileUpsertBulk

SetUUID sets the "UUID" field.

func (*FileUpsertBulk) Update

func (u *FileUpsertBulk) Update(set func(*FileUpsert)) *FileUpsertBulk

Update allows overriding fields `UPDATE` values. See the FileCreateBulk.OnConflict documentation for more info.

func (*FileUpsertBulk) UpdateExt

func (u *FileUpsertBulk) UpdateExt() *FileUpsertBulk

UpdateExt sets the "Ext" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateName

func (u *FileUpsertBulk) UpdateName() *FileUpsertBulk

UpdateName sets the "Name" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateNewValues

func (u *FileUpsertBulk) UpdateNewValues() *FileUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.File.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*FileUpsertBulk) UpdatePayload

func (u *FileUpsertBulk) UpdatePayload() *FileUpsertBulk

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateSize

func (u *FileUpsertBulk) UpdateSize() *FileUpsertBulk

UpdateSize sets the "Size" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateType

func (u *FileUpsertBulk) UpdateType() *FileUpsertBulk

UpdateType sets the "Type" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateUUID

func (u *FileUpsertBulk) UpdateUUID() *FileUpsertBulk

UpdateUUID sets the "UUID" field to the value that was provided on create.

type FileUpsertOne

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

FileUpsertOne is the builder for "upsert"-ing

one File node.

func (*FileUpsertOne) AddSize

func (u *FileUpsertOne) AddSize(v int) *FileUpsertOne

AddSize adds v to the "Size" field.

func (*FileUpsertOne) DoNothing

func (u *FileUpsertOne) DoNothing() *FileUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FileUpsertOne) Exec

func (u *FileUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpsertOne) ExecX

func (u *FileUpsertOne) ExecX(ctx context.Context)

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

func (*FileUpsertOne) ID

func (u *FileUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*FileUpsertOne) IDX

func (u *FileUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*FileUpsertOne) Ignore

func (u *FileUpsertOne) Ignore() *FileUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.File.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*FileUpsertOne) SetExt

func (u *FileUpsertOne) SetExt(v string) *FileUpsertOne

SetExt sets the "Ext" field.

func (*FileUpsertOne) SetName

func (u *FileUpsertOne) SetName(v string) *FileUpsertOne

SetName sets the "Name" field.

func (*FileUpsertOne) SetPayload

func (u *FileUpsertOne) SetPayload(v []byte) *FileUpsertOne

SetPayload sets the "payload" field.

func (*FileUpsertOne) SetSize

func (u *FileUpsertOne) SetSize(v int) *FileUpsertOne

SetSize sets the "Size" field.

func (*FileUpsertOne) SetType

func (u *FileUpsertOne) SetType(v string) *FileUpsertOne

SetType sets the "Type" field.

func (*FileUpsertOne) SetUUID

func (u *FileUpsertOne) SetUUID(v uuid.UUID) *FileUpsertOne

SetUUID sets the "UUID" field.

func (*FileUpsertOne) Update

func (u *FileUpsertOne) Update(set func(*FileUpsert)) *FileUpsertOne

Update allows overriding fields `UPDATE` values. See the FileCreate.OnConflict documentation for more info.

func (*FileUpsertOne) UpdateExt

func (u *FileUpsertOne) UpdateExt() *FileUpsertOne

UpdateExt sets the "Ext" field to the value that was provided on create.

func (*FileUpsertOne) UpdateName

func (u *FileUpsertOne) UpdateName() *FileUpsertOne

UpdateName sets the "Name" field to the value that was provided on create.

func (*FileUpsertOne) UpdateNewValues

func (u *FileUpsertOne) UpdateNewValues() *FileUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.File.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*FileUpsertOne) UpdatePayload

func (u *FileUpsertOne) UpdatePayload() *FileUpsertOne

UpdatePayload sets the "payload" field to the value that was provided on create.

func (*FileUpsertOne) UpdateSize

func (u *FileUpsertOne) UpdateSize() *FileUpsertOne

UpdateSize sets the "Size" field to the value that was provided on create.

func (*FileUpsertOne) UpdateType

func (u *FileUpsertOne) UpdateType() *FileUpsertOne

UpdateType sets the "Type" field to the value that was provided on create.

func (*FileUpsertOne) UpdateUUID

func (u *FileUpsertOne) UpdateUUID() *FileUpsertOne

UpdateUUID sets the "UUID" field to the value that was provided on create.

type Files

type Files []*File

Files is a parsable slice of File.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Incident

type Incident struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "UUID" field.
	UUID uuid.UUID `json:"UUID,omitempty"`
	// IncidentID holds the value of the "IncidentID" field.
	IncidentID uuid.UUID `json:"IncidentID,omitempty"`
	// Name holds the value of the "Name" field.
	Name string `json:"Name,omitempty"`
	// Time holds the value of the "Time" field.
	Time time.Time `json:"Time,omitempty"`
	// IntLevel holds the value of the "IntLevel" field.
	IntLevel int `json:"IntLevel,omitempty"`
	// Username holds the value of the "Username" field.
	Username string `json:"Username,omitempty"`
	// Region holds the value of the "Region" field.
	Region string `json:"Region,omitempty"`
	// ProbeOS holds the value of the "ProbeOS" field.
	ProbeOS string `json:"ProbeOS,omitempty"`
	// ProbeHost holds the value of the "ProbeHost" field.
	ProbeHost string `json:"ProbeHost,omitempty"`
	// Error holds the value of the "Error" field.
	Error string `json:"Error,omitempty"`
	// Start holds the value of the "Start" field.
	Start time.Time `json:"Start,omitempty"`
	// End holds the value of the "End" field.
	End time.Time `json:"End,omitempty"`
	// State holds the value of the "State" field.
	State []byte `json:"State,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IncidentQuery when eager-loading is set.
	Edges IncidentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Incident is the model entity for the Incident schema.

func (*Incident) Counters

func (i *Incident) Counters(ctx context.Context) (result []*Counter, err error)

func (*Incident) Failures

func (i *Incident) Failures(ctx context.Context) (result []*Failure, err error)

func (*Incident) Files

func (i *Incident) Files(ctx context.Context) (result []*File, err error)

func (*Incident) IsNode added in v0.14.0

func (n *Incident) IsNode()

IsNode implements the Node interface check for GQLGen.

func (Incident) Level

func (i Incident) Level() status.Level

Level returns the level

func (*Incident) NamedCounters

func (i *Incident) NamedCounters(name string) ([]*Counter, error)

NamedCounters returns the Counters named value or an error if the edge was not loaded in eager-loading with this name.

func (*Incident) NamedFailures

func (i *Incident) NamedFailures(name string) ([]*Failure, error)

NamedFailures returns the Failures named value or an error if the edge was not loaded in eager-loading with this name.

func (*Incident) NamedFiles

func (i *Incident) NamedFiles(name string) ([]*File, error)

NamedFiles returns the Files named value or an error if the edge was not loaded in eager-loading with this name.

func (*Incident) NamedStati

func (i *Incident) NamedStati(name string) ([]*Status, error)

NamedStati returns the Stati named value or an error if the edge was not loaded in eager-loading with this name.

func (*Incident) QueryCounters

func (i *Incident) QueryCounters() *CounterQuery

QueryCounters queries the "Counters" edge of the Incident entity.

func (*Incident) QueryFailures

func (i *Incident) QueryFailures() *FailureQuery

QueryFailures queries the "Failures" edge of the Incident entity.

func (*Incident) QueryFiles

func (i *Incident) QueryFiles() *FileQuery

QueryFiles queries the "Files" edge of the Incident entity.

func (*Incident) QueryStati

func (i *Incident) QueryStati() *StatusQuery

QueryStati queries the "Stati" edge of the Incident entity.

func (*Incident) Stati

func (i *Incident) Stati(ctx context.Context) (result []*Status, err error)

func (*Incident) String

func (i *Incident) String() string

String implements the fmt.Stringer.

func (*Incident) ToEdge

func (i *Incident) ToEdge(order *IncidentOrder) *IncidentEdge

ToEdge converts Incident into IncidentEdge.

func (*Incident) Unwrap

func (i *Incident) Unwrap() *Incident

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

func (i *Incident) Update() *IncidentUpdateOne

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

func (*Incident) Value added in v0.14.0

func (i *Incident) Value(name string) (ent.Value, error)

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

type IncidentClient

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

IncidentClient is a client for the Incident schema.

func NewIncidentClient

func NewIncidentClient(c config) *IncidentClient

NewIncidentClient returns a client for the Incident from the given config.

func (*IncidentClient) Create

func (c *IncidentClient) Create() *IncidentCreate

Create returns a builder for creating a Incident entity.

func (*IncidentClient) CreateBulk

func (c *IncidentClient) CreateBulk(builders ...*IncidentCreate) *IncidentCreateBulk

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

func (*IncidentClient) Delete

func (c *IncidentClient) Delete() *IncidentDelete

Delete returns a delete builder for Incident.

func (*IncidentClient) DeleteOne

func (c *IncidentClient) DeleteOne(i *Incident) *IncidentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IncidentClient) DeleteOneID

func (c *IncidentClient) DeleteOneID(id int) *IncidentDeleteOne

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

func (*IncidentClient) Get

func (c *IncidentClient) Get(ctx context.Context, id int) (*Incident, error)

Get returns a Incident entity by its id.

func (*IncidentClient) GetX

func (c *IncidentClient) GetX(ctx context.Context, id int) *Incident

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

func (*IncidentClient) Hooks

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

Hooks returns the client hooks.

func (*IncidentClient) Intercept added in v0.14.0

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

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

func (*IncidentClient) Interceptors added in v0.14.0

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

Interceptors returns the client interceptors.

func (*IncidentClient) Query

func (c *IncidentClient) Query() *IncidentQuery

Query returns a query builder for Incident.

func (*IncidentClient) QueryCounters

func (c *IncidentClient) QueryCounters(i *Incident) *CounterQuery

QueryCounters queries the Counters edge of a Incident.

func (*IncidentClient) QueryFailures

func (c *IncidentClient) QueryFailures(i *Incident) *FailureQuery

QueryFailures queries the Failures edge of a Incident.

func (*IncidentClient) QueryFiles

func (c *IncidentClient) QueryFiles(i *Incident) *FileQuery

QueryFiles queries the Files edge of a Incident.

func (*IncidentClient) QueryStati

func (c *IncidentClient) QueryStati(i *Incident) *StatusQuery

QueryStati queries the Stati edge of a Incident.

func (*IncidentClient) Update

func (c *IncidentClient) Update() *IncidentUpdate

Update returns an update builder for Incident.

func (*IncidentClient) UpdateOne

func (c *IncidentClient) UpdateOne(i *Incident) *IncidentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IncidentClient) UpdateOneID

func (c *IncidentClient) UpdateOneID(id int) *IncidentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IncidentClient) Use

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

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

type IncidentConnection

type IncidentConnection struct {
	Edges      []*IncidentEdge `json:"edges"`
	PageInfo   PageInfo        `json:"pageInfo"`
	TotalCount int             `json:"totalCount"`
}

IncidentConnection is the connection containing edges to Incident.

type IncidentCreate

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

IncidentCreate is the builder for creating a Incident entity.

func (*IncidentCreate) AddCounterIDs

func (ic *IncidentCreate) AddCounterIDs(ids ...int) *IncidentCreate

AddCounterIDs adds the "Counters" edge to the Counter entity by IDs.

func (*IncidentCreate) AddCounters

func (ic *IncidentCreate) AddCounters(c ...*Counter) *IncidentCreate

AddCounters adds the "Counters" edges to the Counter entity.

func (*IncidentCreate) AddFailureIDs

func (ic *IncidentCreate) AddFailureIDs(ids ...int) *IncidentCreate

AddFailureIDs adds the "Failures" edge to the Failure entity by IDs.

func (*IncidentCreate) AddFailures

func (ic *IncidentCreate) AddFailures(f ...*Failure) *IncidentCreate

AddFailures adds the "Failures" edges to the Failure entity.

func (*IncidentCreate) AddFileIDs

func (ic *IncidentCreate) AddFileIDs(ids ...int) *IncidentCreate

AddFileIDs adds the "Files" edge to the File entity by IDs.

func (*IncidentCreate) AddFiles

func (ic *IncidentCreate) AddFiles(f ...*File) *IncidentCreate

AddFiles adds the "Files" edges to the File entity.

func (*IncidentCreate) AddStati

func (ic *IncidentCreate) AddStati(s ...*Status) *IncidentCreate

AddStati adds the "Stati" edges to the Status entity.

func (*IncidentCreate) AddStatiIDs

func (ic *IncidentCreate) AddStatiIDs(ids ...int) *IncidentCreate

AddStatiIDs adds the "Stati" edge to the Status entity by IDs.

func (*IncidentCreate) Exec

func (ic *IncidentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IncidentCreate) ExecX

func (ic *IncidentCreate) ExecX(ctx context.Context)

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

func (*IncidentCreate) Mutation

func (ic *IncidentCreate) Mutation() *IncidentMutation

Mutation returns the IncidentMutation object of the builder.

func (*IncidentCreate) OnConflict

func (ic *IncidentCreate) OnConflict(opts ...sql.ConflictOption) *IncidentUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Incident.Create().
	SetUUID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.IncidentUpsert) {
		SetUUID(v+v).
	}).
	Exec(ctx)

func (*IncidentCreate) OnConflictColumns

func (ic *IncidentCreate) OnConflictColumns(columns ...string) *IncidentUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Incident.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*IncidentCreate) Save

func (ic *IncidentCreate) Save(ctx context.Context) (*Incident, error)

Save creates the Incident in the database.

func (*IncidentCreate) SaveX

func (ic *IncidentCreate) SaveX(ctx context.Context) *Incident

SaveX calls Save and panics if Save returns an error.

func (*IncidentCreate) SetEnd

func (ic *IncidentCreate) SetEnd(t time.Time) *IncidentCreate

SetEnd sets the "End" field.

func (*IncidentCreate) SetError

func (ic *IncidentCreate) SetError(s string) *IncidentCreate

SetError sets the "Error" field.

func (*IncidentCreate) SetIncidentID

func (ic *IncidentCreate) SetIncidentID(u uuid.UUID) *IncidentCreate

SetIncidentID sets the "IncidentID" field.

func (*IncidentCreate) SetIntLevel

func (ic *IncidentCreate) SetIntLevel(i int) *IncidentCreate

SetIntLevel sets the "IntLevel" field.

func (*IncidentCreate) SetName

func (ic *IncidentCreate) SetName(s string) *IncidentCreate

SetName sets the "Name" field.

func (*IncidentCreate) SetNillableEnd added in v0.10.0

func (ic *IncidentCreate) SetNillableEnd(t *time.Time) *IncidentCreate

SetNillableEnd sets the "End" field if the given value is not nil.

func (*IncidentCreate) SetNillableError

func (ic *IncidentCreate) SetNillableError(s *string) *IncidentCreate

SetNillableError sets the "Error" field if the given value is not nil.

func (*IncidentCreate) SetNillableIncidentID

func (ic *IncidentCreate) SetNillableIncidentID(u *uuid.UUID) *IncidentCreate

SetNillableIncidentID sets the "IncidentID" field if the given value is not nil.

func (*IncidentCreate) SetProbeHost

func (ic *IncidentCreate) SetProbeHost(s string) *IncidentCreate

SetProbeHost sets the "ProbeHost" field.

func (*IncidentCreate) SetProbeOS

func (ic *IncidentCreate) SetProbeOS(s string) *IncidentCreate

SetProbeOS sets the "ProbeOS" field.

func (*IncidentCreate) SetRegion

func (ic *IncidentCreate) SetRegion(s string) *IncidentCreate

SetRegion sets the "Region" field.

func (*IncidentCreate) SetStart

func (ic *IncidentCreate) SetStart(t time.Time) *IncidentCreate

SetStart sets the "Start" field.

func (*IncidentCreate) SetState

func (ic *IncidentCreate) SetState(b []byte) *IncidentCreate

SetState sets the "State" field.

func (*IncidentCreate) SetTime

func (ic *IncidentCreate) SetTime(t time.Time) *IncidentCreate

SetTime sets the "Time" field.

func (*IncidentCreate) SetUUID

func (ic *IncidentCreate) SetUUID(u uuid.UUID) *IncidentCreate

SetUUID sets the "UUID" field.

func (*IncidentCreate) SetUsername

func (ic *IncidentCreate) SetUsername(s string) *IncidentCreate

SetUsername sets the "Username" field.

type IncidentCreateBulk

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

IncidentCreateBulk is the builder for creating many Incident entities in bulk.

func (*IncidentCreateBulk) Exec

func (icb *IncidentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IncidentCreateBulk) ExecX

func (icb *IncidentCreateBulk) ExecX(ctx context.Context)

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

func (*IncidentCreateBulk) OnConflict

func (icb *IncidentCreateBulk) OnConflict(opts ...sql.ConflictOption) *IncidentUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Incident.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.IncidentUpsert) {
		SetUUID(v+v).
	}).
	Exec(ctx)

func (*IncidentCreateBulk) OnConflictColumns

func (icb *IncidentCreateBulk) OnConflictColumns(columns ...string) *IncidentUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Incident.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*IncidentCreateBulk) Save

func (icb *IncidentCreateBulk) Save(ctx context.Context) ([]*Incident, error)

Save creates the Incident entities in the database.

func (*IncidentCreateBulk) SaveX

func (icb *IncidentCreateBulk) SaveX(ctx context.Context) []*Incident

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

type IncidentDelete

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

IncidentDelete is the builder for deleting a Incident entity.

func (*IncidentDelete) Exec

func (id *IncidentDelete) Exec(ctx context.Context) (int, error)

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

func (*IncidentDelete) ExecX

func (id *IncidentDelete) ExecX(ctx context.Context) int

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

func (*IncidentDelete) Where

func (id *IncidentDelete) Where(ps ...predicate.Incident) *IncidentDelete

Where appends a list predicates to the IncidentDelete builder.

type IncidentDeleteOne

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

IncidentDeleteOne is the builder for deleting a single Incident entity.

func (*IncidentDeleteOne) Exec

func (ido *IncidentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IncidentDeleteOne) ExecX

func (ido *IncidentDeleteOne) ExecX(ctx context.Context)

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

func (*IncidentDeleteOne) Where added in v0.14.0

Where appends a list predicates to the IncidentDelete builder.

type IncidentEdge

type IncidentEdge struct {
	Node   *Incident `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

IncidentEdge is the edge representation of Incident.

type IncidentEdges

type IncidentEdges struct {
	// Counters holds the value of the Counters edge.
	Counters []*Counter `json:"Counters,omitempty"`
	// Stati holds the value of the Stati edge.
	Stati []*Status `json:"Stati,omitempty"`
	// Failures holds the value of the Failures edge.
	Failures []*Failure `json:"Failures,omitempty"`
	// Files holds the value of the Files edge.
	Files []*File `json:"Files,omitempty"`
	// contains filtered or unexported fields
}

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

func (IncidentEdges) CountersOrErr

func (e IncidentEdges) CountersOrErr() ([]*Counter, error)

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

func (IncidentEdges) FailuresOrErr

func (e IncidentEdges) FailuresOrErr() ([]*Failure, error)

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

func (IncidentEdges) FilesOrErr

func (e IncidentEdges) FilesOrErr() ([]*File, error)

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

func (IncidentEdges) StatiOrErr

func (e IncidentEdges) StatiOrErr() ([]*Status, error)

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

type IncidentGroupBy

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

IncidentGroupBy is the group-by builder for Incident entities.

func (*IncidentGroupBy) Aggregate

func (igb *IncidentGroupBy) Aggregate(fns ...AggregateFunc) *IncidentGroupBy

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

func (*IncidentGroupBy) Bool

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

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

func (*IncidentGroupBy) BoolX

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

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

func (*IncidentGroupBy) Bools

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

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

func (*IncidentGroupBy) BoolsX

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

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

func (*IncidentGroupBy) Float64

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

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

func (*IncidentGroupBy) Float64X

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

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

func (*IncidentGroupBy) Float64s

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

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

func (*IncidentGroupBy) Float64sX

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

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

func (*IncidentGroupBy) Int

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

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

func (*IncidentGroupBy) IntX

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

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

func (*IncidentGroupBy) Ints

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

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

func (*IncidentGroupBy) IntsX

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

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

func (*IncidentGroupBy) Scan

func (igb *IncidentGroupBy) Scan(ctx context.Context, v any) error

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

func (*IncidentGroupBy) ScanX

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

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

func (*IncidentGroupBy) String

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

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

func (*IncidentGroupBy) StringX

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

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

func (*IncidentGroupBy) Strings

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

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

func (*IncidentGroupBy) StringsX

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

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

type IncidentMutation

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

IncidentMutation represents an operation that mutates the Incident nodes in the graph.

func (*IncidentMutation) AddCounterIDs

func (m *IncidentMutation) AddCounterIDs(ids ...int)

AddCounterIDs adds the "Counters" edge to the Counter entity by ids.

func (*IncidentMutation) AddFailureIDs

func (m *IncidentMutation) AddFailureIDs(ids ...int)

AddFailureIDs adds the "Failures" edge to the Failure entity by ids.

func (*IncidentMutation) AddField

func (m *IncidentMutation) 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 (*IncidentMutation) AddFileIDs

func (m *IncidentMutation) AddFileIDs(ids ...int)

AddFileIDs adds the "Files" edge to the File entity by ids.

func (*IncidentMutation) AddIntLevel

func (m *IncidentMutation) AddIntLevel(i int)

AddIntLevel adds i to the "IntLevel" field.

func (*IncidentMutation) AddStatiIDs

func (m *IncidentMutation) AddStatiIDs(ids ...int)

AddStatiIDs adds the "Stati" edge to the Status entity by ids.

func (*IncidentMutation) AddedEdges

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

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

func (*IncidentMutation) AddedField

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

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

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

func (*IncidentMutation) AddedIDs

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

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

func (*IncidentMutation) AddedIntLevel

func (m *IncidentMutation) AddedIntLevel() (r int, exists bool)

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

func (*IncidentMutation) ClearCounters

func (m *IncidentMutation) ClearCounters()

ClearCounters clears the "Counters" edge to the Counter entity.

func (*IncidentMutation) ClearEdge

func (m *IncidentMutation) 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 (*IncidentMutation) ClearEnd added in v0.10.0

func (m *IncidentMutation) ClearEnd()

ClearEnd clears the value of the "End" field.

func (*IncidentMutation) ClearError

func (m *IncidentMutation) ClearError()

ClearError clears the value of the "Error" field.

func (*IncidentMutation) ClearFailures

func (m *IncidentMutation) ClearFailures()

ClearFailures clears the "Failures" edge to the Failure entity.

func (*IncidentMutation) ClearField

func (m *IncidentMutation) 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 (*IncidentMutation) ClearFiles

func (m *IncidentMutation) ClearFiles()

ClearFiles clears the "Files" edge to the File entity.

func (*IncidentMutation) ClearIncidentID

func (m *IncidentMutation) ClearIncidentID()

ClearIncidentID clears the value of the "IncidentID" field.

func (*IncidentMutation) ClearStati

func (m *IncidentMutation) ClearStati()

ClearStati clears the "Stati" edge to the Status entity.

func (*IncidentMutation) ClearedEdges

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

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

func (*IncidentMutation) ClearedFields

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

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

func (IncidentMutation) Client

func (m IncidentMutation) 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 (*IncidentMutation) CountersCleared

func (m *IncidentMutation) CountersCleared() bool

CountersCleared reports if the "Counters" edge to the Counter entity was cleared.

func (*IncidentMutation) CountersIDs

func (m *IncidentMutation) CountersIDs() (ids []int)

CountersIDs returns the "Counters" edge IDs in the mutation.

func (*IncidentMutation) EdgeCleared

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

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

func (*IncidentMutation) End

func (m *IncidentMutation) End() (r time.Time, exists bool)

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

func (*IncidentMutation) EndCleared added in v0.10.0

func (m *IncidentMutation) EndCleared() bool

EndCleared returns if the "End" field was cleared in this mutation.

func (*IncidentMutation) Error

func (m *IncidentMutation) Error() (r string, exists bool)

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

func (*IncidentMutation) ErrorCleared

func (m *IncidentMutation) ErrorCleared() bool

ErrorCleared returns if the "Error" field was cleared in this mutation.

func (*IncidentMutation) FailuresCleared

func (m *IncidentMutation) FailuresCleared() bool

FailuresCleared reports if the "Failures" edge to the Failure entity was cleared.

func (*IncidentMutation) FailuresIDs

func (m *IncidentMutation) FailuresIDs() (ids []int)

FailuresIDs returns the "Failures" edge IDs in the mutation.

func (*IncidentMutation) Field

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

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

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

func (*IncidentMutation) Fields

func (m *IncidentMutation) 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 (*IncidentMutation) FilesCleared

func (m *IncidentMutation) FilesCleared() bool

FilesCleared reports if the "Files" edge to the File entity was cleared.

func (*IncidentMutation) FilesIDs

func (m *IncidentMutation) FilesIDs() (ids []int)

FilesIDs returns the "Files" edge IDs in the mutation.

func (*IncidentMutation) ID

func (m *IncidentMutation) 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 (*IncidentMutation) IDs

func (m *IncidentMutation) 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 (*IncidentMutation) IncidentID

func (m *IncidentMutation) IncidentID() (r uuid.UUID, exists bool)

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

func (*IncidentMutation) IncidentIDCleared

func (m *IncidentMutation) IncidentIDCleared() bool

IncidentIDCleared returns if the "IncidentID" field was cleared in this mutation.

func (*IncidentMutation) IntLevel

func (m *IncidentMutation) IntLevel() (r int, exists bool)

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

func (*IncidentMutation) Name

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

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

func (*IncidentMutation) OldEnd

func (m *IncidentMutation) OldEnd(ctx context.Context) (v time.Time, err error)

OldEnd returns the old "End" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldError

func (m *IncidentMutation) OldError(ctx context.Context) (v string, err error)

OldError returns the old "Error" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldField

func (m *IncidentMutation) 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 (*IncidentMutation) OldIncidentID

func (m *IncidentMutation) OldIncidentID(ctx context.Context) (v uuid.UUID, err error)

OldIncidentID returns the old "IncidentID" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldIntLevel

func (m *IncidentMutation) OldIntLevel(ctx context.Context) (v int, err error)

OldIntLevel returns the old "IntLevel" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldName

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

OldName returns the old "Name" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldProbeHost

func (m *IncidentMutation) OldProbeHost(ctx context.Context) (v string, err error)

OldProbeHost returns the old "ProbeHost" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldProbeOS

func (m *IncidentMutation) OldProbeOS(ctx context.Context) (v string, err error)

OldProbeOS returns the old "ProbeOS" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldRegion

func (m *IncidentMutation) OldRegion(ctx context.Context) (v string, err error)

OldRegion returns the old "Region" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldStart

func (m *IncidentMutation) OldStart(ctx context.Context) (v time.Time, err error)

OldStart returns the old "Start" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldState

func (m *IncidentMutation) OldState(ctx context.Context) (v []byte, err error)

OldState returns the old "State" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldTime

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

OldTime returns the old "Time" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldUUID

func (m *IncidentMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "UUID" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) OldUsername

func (m *IncidentMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "Username" field's value of the Incident entity. If the Incident 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 (*IncidentMutation) Op

func (m *IncidentMutation) Op() Op

Op returns the operation name.

func (*IncidentMutation) ProbeHost

func (m *IncidentMutation) ProbeHost() (r string, exists bool)

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

func (*IncidentMutation) ProbeOS

func (m *IncidentMutation) ProbeOS() (r string, exists bool)

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

func (*IncidentMutation) Region

func (m *IncidentMutation) Region() (r string, exists bool)

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

func (*IncidentMutation) RemoveCounterIDs

func (m *IncidentMutation) RemoveCounterIDs(ids ...int)

RemoveCounterIDs removes the "Counters" edge to the Counter entity by IDs.

func (*IncidentMutation) RemoveFailureIDs

func (m *IncidentMutation) RemoveFailureIDs(ids ...int)

RemoveFailureIDs removes the "Failures" edge to the Failure entity by IDs.

func (*IncidentMutation) RemoveFileIDs

func (m *IncidentMutation) RemoveFileIDs(ids ...int)

RemoveFileIDs removes the "Files" edge to the File entity by IDs.

func (*IncidentMutation) RemoveStatiIDs

func (m *IncidentMutation) RemoveStatiIDs(ids ...int)

RemoveStatiIDs removes the "Stati" edge to the Status entity by IDs.

func (*IncidentMutation) RemovedCountersIDs

func (m *IncidentMutation) RemovedCountersIDs() (ids []int)

RemovedCounters returns the removed IDs of the "Counters" edge to the Counter entity.

func (*IncidentMutation) RemovedEdges

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

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

func (*IncidentMutation) RemovedFailuresIDs

func (m *IncidentMutation) RemovedFailuresIDs() (ids []int)

RemovedFailures returns the removed IDs of the "Failures" edge to the Failure entity.

func (*IncidentMutation) RemovedFilesIDs

func (m *IncidentMutation) RemovedFilesIDs() (ids []int)

RemovedFiles returns the removed IDs of the "Files" edge to the File entity.

func (*IncidentMutation) RemovedIDs

func (m *IncidentMutation) 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 (*IncidentMutation) RemovedStatiIDs

func (m *IncidentMutation) RemovedStatiIDs() (ids []int)

RemovedStati returns the removed IDs of the "Stati" edge to the Status entity.

func (*IncidentMutation) ResetCounters

func (m *IncidentMutation) ResetCounters()

ResetCounters resets all changes to the "Counters" edge.

func (*IncidentMutation) ResetEdge

func (m *IncidentMutation) 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 (*IncidentMutation) ResetEnd

func (m *IncidentMutation) ResetEnd()

ResetEnd resets all changes to the "End" field.

func (*IncidentMutation) ResetError

func (m *IncidentMutation) ResetError()

ResetError resets all changes to the "Error" field.

func (*IncidentMutation) ResetFailures

func (m *IncidentMutation) ResetFailures()

ResetFailures resets all changes to the "Failures" edge.

func (*IncidentMutation) ResetField

func (m *IncidentMutation) 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 (*IncidentMutation) ResetFiles

func (m *IncidentMutation) ResetFiles()

ResetFiles resets all changes to the "Files" edge.

func (*IncidentMutation) ResetIncidentID

func (m *IncidentMutation) ResetIncidentID()

ResetIncidentID resets all changes to the "IncidentID" field.

func (*IncidentMutation) ResetIntLevel

func (m *IncidentMutation) ResetIntLevel()

ResetIntLevel resets all changes to the "IntLevel" field.

func (*IncidentMutation) ResetName

func (m *IncidentMutation) ResetName()

ResetName resets all changes to the "Name" field.

func (*IncidentMutation) ResetProbeHost

func (m *IncidentMutation) ResetProbeHost()

ResetProbeHost resets all changes to the "ProbeHost" field.

func (*IncidentMutation) ResetProbeOS

func (m *IncidentMutation) ResetProbeOS()

ResetProbeOS resets all changes to the "ProbeOS" field.

func (*IncidentMutation) ResetRegion

func (m *IncidentMutation) ResetRegion()

ResetRegion resets all changes to the "Region" field.

func (*IncidentMutation) ResetStart

func (m *IncidentMutation) ResetStart()

ResetStart resets all changes to the "Start" field.

func (*IncidentMutation) ResetState

func (m *IncidentMutation) ResetState()

ResetState resets all changes to the "State" field.

func (*IncidentMutation) ResetStati

func (m *IncidentMutation) ResetStati()

ResetStati resets all changes to the "Stati" edge.

func (*IncidentMutation) ResetTime

func (m *IncidentMutation) ResetTime()

ResetTime resets all changes to the "Time" field.

func (*IncidentMutation) ResetUUID

func (m *IncidentMutation) ResetUUID()

ResetUUID resets all changes to the "UUID" field.

func (*IncidentMutation) ResetUsername

func (m *IncidentMutation) ResetUsername()

ResetUsername resets all changes to the "Username" field.

func (*IncidentMutation) SetEnd

func (m *IncidentMutation) SetEnd(t time.Time)

SetEnd sets the "End" field.

func (*IncidentMutation) SetError

func (m *IncidentMutation) SetError(s string)

SetError sets the "Error" field.

func (*IncidentMutation) SetField

func (m *IncidentMutation) 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 (*IncidentMutation) SetIncidentID

func (m *IncidentMutation) SetIncidentID(u uuid.UUID)

SetIncidentID sets the "IncidentID" field.

func (*IncidentMutation) SetIntLevel

func (m *IncidentMutation) SetIntLevel(i int)

SetIntLevel sets the "IntLevel" field.

func (*IncidentMutation) SetName

func (m *IncidentMutation) SetName(s string)

SetName sets the "Name" field.

func (*IncidentMutation) SetOp added in v0.14.0

func (m *IncidentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IncidentMutation) SetProbeHost

func (m *IncidentMutation) SetProbeHost(s string)

SetProbeHost sets the "ProbeHost" field.

func (*IncidentMutation) SetProbeOS

func (m *IncidentMutation) SetProbeOS(s string)

SetProbeOS sets the "ProbeOS" field.

func (*IncidentMutation) SetRegion

func (m *IncidentMutation) SetRegion(s string)

SetRegion sets the "Region" field.

func (*IncidentMutation) SetStart

func (m *IncidentMutation) SetStart(t time.Time)

SetStart sets the "Start" field.

func (*IncidentMutation) SetState

func (m *IncidentMutation) SetState(b []byte)

SetState sets the "State" field.

func (*IncidentMutation) SetTime

func (m *IncidentMutation) SetTime(t time.Time)

SetTime sets the "Time" field.

func (*IncidentMutation) SetUUID

func (m *IncidentMutation) SetUUID(u uuid.UUID)

SetUUID sets the "UUID" field.

func (*IncidentMutation) SetUsername

func (m *IncidentMutation) SetUsername(s string)

SetUsername sets the "Username" field.

func (*IncidentMutation) Start

func (m *IncidentMutation) Start() (r time.Time, exists bool)

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

func (*IncidentMutation) State

func (m *IncidentMutation) State() (r []byte, exists bool)

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

func (*IncidentMutation) StatiCleared

func (m *IncidentMutation) StatiCleared() bool

StatiCleared reports if the "Stati" edge to the Status entity was cleared.

func (*IncidentMutation) StatiIDs

func (m *IncidentMutation) StatiIDs() (ids []int)

StatiIDs returns the "Stati" edge IDs in the mutation.

func (*IncidentMutation) Time

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

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

func (IncidentMutation) Tx

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

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

func (*IncidentMutation) Type

func (m *IncidentMutation) Type() string

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

func (*IncidentMutation) UUID

func (m *IncidentMutation) UUID() (r uuid.UUID, exists bool)

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

func (*IncidentMutation) Username

func (m *IncidentMutation) Username() (r string, exists bool)

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

func (*IncidentMutation) Where

func (m *IncidentMutation) Where(ps ...predicate.Incident)

Where appends a list predicates to the IncidentMutation builder.

func (*IncidentMutation) WhereP added in v0.14.0

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

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

type IncidentOrder

type IncidentOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *IncidentOrderField `json:"field"`
}

IncidentOrder defines the ordering of Incident.

type IncidentOrderField

type IncidentOrderField struct {
	// Value extracts the ordering value from the given Incident.
	Value func(*Incident) (ent.Value, error)
	// contains filtered or unexported fields
}

IncidentOrderField defines the ordering field of Incident.

type IncidentPaginateOption

type IncidentPaginateOption func(*incidentPager) error

IncidentPaginateOption enables pagination customization.

func WithIncidentFilter

func WithIncidentFilter(filter func(*IncidentQuery) (*IncidentQuery, error)) IncidentPaginateOption

WithIncidentFilter configures pagination filter.

func WithIncidentOrder

func WithIncidentOrder(order *IncidentOrder) IncidentPaginateOption

WithIncidentOrder configures pagination ordering.

type IncidentQuery

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

IncidentQuery is the builder for querying Incident entities.

func (*IncidentQuery) Aggregate added in v0.12.0

func (iq *IncidentQuery) Aggregate(fns ...AggregateFunc) *IncidentSelect

Aggregate returns a IncidentSelect configured with the given aggregations.

func (*IncidentQuery) All

func (iq *IncidentQuery) All(ctx context.Context) ([]*Incident, error)

All executes the query and returns a list of Incidents.

func (*IncidentQuery) AllX

func (iq *IncidentQuery) AllX(ctx context.Context) []*Incident

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

func (*IncidentQuery) Clone

func (iq *IncidentQuery) Clone() *IncidentQuery

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

func (*IncidentQuery) CollectFields

func (i *IncidentQuery) CollectFields(ctx context.Context, satisfies ...string) (*IncidentQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*IncidentQuery) Count

func (iq *IncidentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IncidentQuery) CountX

func (iq *IncidentQuery) CountX(ctx context.Context) int

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

func (*IncidentQuery) Exist

func (iq *IncidentQuery) Exist(ctx context.Context) (bool, error)

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

func (*IncidentQuery) ExistX

func (iq *IncidentQuery) ExistX(ctx context.Context) bool

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

func (*IncidentQuery) First

func (iq *IncidentQuery) First(ctx context.Context) (*Incident, error)

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

func (*IncidentQuery) FirstID

func (iq *IncidentQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*IncidentQuery) FirstIDX

func (iq *IncidentQuery) FirstIDX(ctx context.Context) int

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

func (*IncidentQuery) FirstX

func (iq *IncidentQuery) FirstX(ctx context.Context) *Incident

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

func (*IncidentQuery) GroupBy

func (iq *IncidentQuery) GroupBy(field string, fields ...string) *IncidentGroupBy

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 {
	UUID uuid.UUID `json:"UUID,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Incident.Query().
	GroupBy(incident.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IncidentQuery) IDs

func (iq *IncidentQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*IncidentQuery) IDsX

func (iq *IncidentQuery) IDsX(ctx context.Context) []int

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

func (*IncidentQuery) Limit

func (iq *IncidentQuery) Limit(limit int) *IncidentQuery

Limit the number of records to be returned by this query.

func (*IncidentQuery) Offset

func (iq *IncidentQuery) Offset(offset int) *IncidentQuery

Offset to start from.

func (*IncidentQuery) Only

func (iq *IncidentQuery) Only(ctx context.Context) (*Incident, error)

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

func (*IncidentQuery) OnlyID

func (iq *IncidentQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*IncidentQuery) OnlyIDX

func (iq *IncidentQuery) OnlyIDX(ctx context.Context) int

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

func (*IncidentQuery) OnlyX

func (iq *IncidentQuery) OnlyX(ctx context.Context) *Incident

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

func (*IncidentQuery) Order

Order specifies how the records should be ordered.

func (*IncidentQuery) Paginate

func (i *IncidentQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...IncidentPaginateOption,
) (*IncidentConnection, error)

Paginate executes the query and returns a relay based cursor connection to Incident.

func (*IncidentQuery) QueryCounters

func (iq *IncidentQuery) QueryCounters() *CounterQuery

QueryCounters chains the current query on the "Counters" edge.

func (*IncidentQuery) QueryFailures

func (iq *IncidentQuery) QueryFailures() *FailureQuery

QueryFailures chains the current query on the "Failures" edge.

func (*IncidentQuery) QueryFiles

func (iq *IncidentQuery) QueryFiles() *FileQuery

QueryFiles chains the current query on the "Files" edge.

func (*IncidentQuery) QueryStati

func (iq *IncidentQuery) QueryStati() *StatusQuery

QueryStati chains the current query on the "Stati" edge.

func (*IncidentQuery) Select

func (iq *IncidentQuery) Select(fields ...string) *IncidentSelect

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 {
	UUID uuid.UUID `json:"UUID,omitempty"`
}

client.Incident.Query().
	Select(incident.FieldUUID).
	Scan(ctx, &v)

func (*IncidentQuery) Unique

func (iq *IncidentQuery) Unique(unique bool) *IncidentQuery

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 (*IncidentQuery) Where

func (iq *IncidentQuery) Where(ps ...predicate.Incident) *IncidentQuery

Where adds a new predicate for the IncidentQuery builder.

func (*IncidentQuery) WithCounters

func (iq *IncidentQuery) WithCounters(opts ...func(*CounterQuery)) *IncidentQuery

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

func (*IncidentQuery) WithFailures

func (iq *IncidentQuery) WithFailures(opts ...func(*FailureQuery)) *IncidentQuery

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

func (*IncidentQuery) WithFiles

func (iq *IncidentQuery) WithFiles(opts ...func(*FileQuery)) *IncidentQuery

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

func (*IncidentQuery) WithNamedCounters

func (iq *IncidentQuery) WithNamedCounters(name string, opts ...func(*CounterQuery)) *IncidentQuery

WithNamedCounters tells the query-builder to eager-load the nodes that are connected to the "Counters" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*IncidentQuery) WithNamedFailures

func (iq *IncidentQuery) WithNamedFailures(name string, opts ...func(*FailureQuery)) *IncidentQuery

WithNamedFailures tells the query-builder to eager-load the nodes that are connected to the "Failures" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*IncidentQuery) WithNamedFiles

func (iq *IncidentQuery) WithNamedFiles(name string, opts ...func(*FileQuery)) *IncidentQuery

WithNamedFiles tells the query-builder to eager-load the nodes that are connected to the "Files" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*IncidentQuery) WithNamedStati

func (iq *IncidentQuery) WithNamedStati(name string, opts ...func(*StatusQuery)) *IncidentQuery

WithNamedStati tells the query-builder to eager-load the nodes that are connected to the "Stati" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*IncidentQuery) WithStati

func (iq *IncidentQuery) WithStati(opts ...func(*StatusQuery)) *IncidentQuery

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

type IncidentSelect

type IncidentSelect struct {
	*IncidentQuery
	// contains filtered or unexported fields
}

IncidentSelect is the builder for selecting fields of Incident entities.

func (*IncidentSelect) Aggregate added in v0.12.0

func (is *IncidentSelect) Aggregate(fns ...AggregateFunc) *IncidentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IncidentSelect) Bool

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

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

func (*IncidentSelect) BoolX

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

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

func (*IncidentSelect) Bools

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

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

func (*IncidentSelect) BoolsX

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

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

func (*IncidentSelect) Float64

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

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

func (*IncidentSelect) Float64X

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

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

func (*IncidentSelect) Float64s

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

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

func (*IncidentSelect) Float64sX

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

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

func (*IncidentSelect) Int

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

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

func (*IncidentSelect) IntX

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

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

func (*IncidentSelect) Ints

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

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

func (*IncidentSelect) IntsX

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

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

func (*IncidentSelect) Scan

func (is *IncidentSelect) Scan(ctx context.Context, v any) error

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

func (*IncidentSelect) ScanX

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

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

func (*IncidentSelect) String

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

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

func (*IncidentSelect) StringX

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

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

func (*IncidentSelect) Strings

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

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

func (*IncidentSelect) StringsX

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

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

type IncidentUpdate

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

IncidentUpdate is the builder for updating Incident entities.

func (*IncidentUpdate) AddCounterIDs

func (iu *IncidentUpdate) AddCounterIDs(ids ...int) *IncidentUpdate

AddCounterIDs adds the "Counters" edge to the Counter entity by IDs.

func (*IncidentUpdate) AddCounters

func (iu *IncidentUpdate) AddCounters(c ...*Counter) *IncidentUpdate

AddCounters adds the "Counters" edges to the Counter entity.

func (*IncidentUpdate) AddFailureIDs

func (iu *IncidentUpdate) AddFailureIDs(ids ...int) *IncidentUpdate

AddFailureIDs adds the "Failures" edge to the Failure entity by IDs.

func (*IncidentUpdate) AddFailures

func (iu *IncidentUpdate) AddFailures(f ...*Failure) *IncidentUpdate

AddFailures adds the "Failures" edges to the Failure entity.

func (*IncidentUpdate) AddFileIDs

func (iu *IncidentUpdate) AddFileIDs(ids ...int) *IncidentUpdate

AddFileIDs adds the "Files" edge to the File entity by IDs.

func (*IncidentUpdate) AddFiles

func (iu *IncidentUpdate) AddFiles(f ...*File) *IncidentUpdate

AddFiles adds the "Files" edges to the File entity.

func (*IncidentUpdate) AddIntLevel

func (iu *IncidentUpdate) AddIntLevel(i int) *IncidentUpdate

AddIntLevel adds i to the "IntLevel" field.

func (*IncidentUpdate) AddStati

func (iu *IncidentUpdate) AddStati(s ...*Status) *IncidentUpdate

AddStati adds the "Stati" edges to the Status entity.

func (*IncidentUpdate) AddStatiIDs

func (iu *IncidentUpdate) AddStatiIDs(ids ...int) *IncidentUpdate

AddStatiIDs adds the "Stati" edge to the Status entity by IDs.

func (*IncidentUpdate) ClearCounters

func (iu *IncidentUpdate) ClearCounters() *IncidentUpdate

ClearCounters clears all "Counters" edges to the Counter entity.

func (*IncidentUpdate) ClearEnd added in v0.10.0

func (iu *IncidentUpdate) ClearEnd() *IncidentUpdate

ClearEnd clears the value of the "End" field.

func (*IncidentUpdate) ClearError

func (iu *IncidentUpdate) ClearError() *IncidentUpdate

ClearError clears the value of the "Error" field.

func (*IncidentUpdate) ClearFailures

func (iu *IncidentUpdate) ClearFailures() *IncidentUpdate

ClearFailures clears all "Failures" edges to the Failure entity.

func (*IncidentUpdate) ClearFiles

func (iu *IncidentUpdate) ClearFiles() *IncidentUpdate

ClearFiles clears all "Files" edges to the File entity.

func (*IncidentUpdate) ClearIncidentID

func (iu *IncidentUpdate) ClearIncidentID() *IncidentUpdate

ClearIncidentID clears the value of the "IncidentID" field.

func (*IncidentUpdate) ClearStati

func (iu *IncidentUpdate) ClearStati() *IncidentUpdate

ClearStati clears all "Stati" edges to the Status entity.

func (*IncidentUpdate) Exec

func (iu *IncidentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IncidentUpdate) ExecX

func (iu *IncidentUpdate) ExecX(ctx context.Context)

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

func (*IncidentUpdate) Mutation

func (iu *IncidentUpdate) Mutation() *IncidentMutation

Mutation returns the IncidentMutation object of the builder.

func (*IncidentUpdate) RemoveCounterIDs

func (iu *IncidentUpdate) RemoveCounterIDs(ids ...int) *IncidentUpdate

RemoveCounterIDs removes the "Counters" edge to Counter entities by IDs.

func (*IncidentUpdate) RemoveCounters

func (iu *IncidentUpdate) RemoveCounters(c ...*Counter) *IncidentUpdate

RemoveCounters removes "Counters" edges to Counter entities.

func (*IncidentUpdate) RemoveFailureIDs

func (iu *IncidentUpdate) RemoveFailureIDs(ids ...int) *IncidentUpdate

RemoveFailureIDs removes the "Failures" edge to Failure entities by IDs.

func (*IncidentUpdate) RemoveFailures

func (iu *IncidentUpdate) RemoveFailures(f ...*Failure) *IncidentUpdate

RemoveFailures removes "Failures" edges to Failure entities.

func (*IncidentUpdate) RemoveFileIDs

func (iu *IncidentUpdate) RemoveFileIDs(ids ...int) *IncidentUpdate

RemoveFileIDs removes the "Files" edge to File entities by IDs.

func (*IncidentUpdate) RemoveFiles

func (iu *IncidentUpdate) RemoveFiles(f ...*File) *IncidentUpdate

RemoveFiles removes "Files" edges to File entities.

func (*IncidentUpdate) RemoveStati

func (iu *IncidentUpdate) RemoveStati(s ...*Status) *IncidentUpdate

RemoveStati removes "Stati" edges to Status entities.

func (*IncidentUpdate) RemoveStatiIDs

func (iu *IncidentUpdate) RemoveStatiIDs(ids ...int) *IncidentUpdate

RemoveStatiIDs removes the "Stati" edge to Status entities by IDs.

func (*IncidentUpdate) Save

func (iu *IncidentUpdate) Save(ctx context.Context) (int, error)

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

func (*IncidentUpdate) SaveX

func (iu *IncidentUpdate) SaveX(ctx context.Context) int

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

func (*IncidentUpdate) SetEnd

func (iu *IncidentUpdate) SetEnd(t time.Time) *IncidentUpdate

SetEnd sets the "End" field.

func (*IncidentUpdate) SetError

func (iu *IncidentUpdate) SetError(s string) *IncidentUpdate

SetError sets the "Error" field.

func (*IncidentUpdate) SetIncidentID

func (iu *IncidentUpdate) SetIncidentID(u uuid.UUID) *IncidentUpdate

SetIncidentID sets the "IncidentID" field.

func (*IncidentUpdate) SetIntLevel

func (iu *IncidentUpdate) SetIntLevel(i int) *IncidentUpdate

SetIntLevel sets the "IntLevel" field.

func (*IncidentUpdate) SetName

func (iu *IncidentUpdate) SetName(s string) *IncidentUpdate

SetName sets the "Name" field.

func (*IncidentUpdate) SetNillableEnd added in v0.10.0

func (iu *IncidentUpdate) SetNillableEnd(t *time.Time) *IncidentUpdate

SetNillableEnd sets the "End" field if the given value is not nil.

func (*IncidentUpdate) SetNillableError

func (iu *IncidentUpdate) SetNillableError(s *string) *IncidentUpdate

SetNillableError sets the "Error" field if the given value is not nil.

func (*IncidentUpdate) SetNillableIncidentID

func (iu *IncidentUpdate) SetNillableIncidentID(u *uuid.UUID) *IncidentUpdate

SetNillableIncidentID sets the "IncidentID" field if the given value is not nil.

func (*IncidentUpdate) SetProbeHost

func (iu *IncidentUpdate) SetProbeHost(s string) *IncidentUpdate

SetProbeHost sets the "ProbeHost" field.

func (*IncidentUpdate) SetProbeOS

func (iu *IncidentUpdate) SetProbeOS(s string) *IncidentUpdate

SetProbeOS sets the "ProbeOS" field.

func (*IncidentUpdate) SetRegion

func (iu *IncidentUpdate) SetRegion(s string) *IncidentUpdate

SetRegion sets the "Region" field.

func (*IncidentUpdate) SetStart

func (iu *IncidentUpdate) SetStart(t time.Time) *IncidentUpdate

SetStart sets the "Start" field.

func (*IncidentUpdate) SetState

func (iu *IncidentUpdate) SetState(b []byte) *IncidentUpdate

SetState sets the "State" field.

func (*IncidentUpdate) SetTime

func (iu *IncidentUpdate) SetTime(t time.Time) *IncidentUpdate

SetTime sets the "Time" field.

func (*IncidentUpdate) SetUUID

func (iu *IncidentUpdate) SetUUID(u uuid.UUID) *IncidentUpdate

SetUUID sets the "UUID" field.

func (*IncidentUpdate) SetUsername

func (iu *IncidentUpdate) SetUsername(s string) *IncidentUpdate

SetUsername sets the "Username" field.

func (*IncidentUpdate) Where

func (iu *IncidentUpdate) Where(ps ...predicate.Incident) *IncidentUpdate

Where appends a list predicates to the IncidentUpdate builder.

type IncidentUpdateOne

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

IncidentUpdateOne is the builder for updating a single Incident entity.

func (*IncidentUpdateOne) AddCounterIDs

func (iuo *IncidentUpdateOne) AddCounterIDs(ids ...int) *IncidentUpdateOne

AddCounterIDs adds the "Counters" edge to the Counter entity by IDs.

func (*IncidentUpdateOne) AddCounters

func (iuo *IncidentUpdateOne) AddCounters(c ...*Counter) *IncidentUpdateOne

AddCounters adds the "Counters" edges to the Counter entity.

func (*IncidentUpdateOne) AddFailureIDs

func (iuo *IncidentUpdateOne) AddFailureIDs(ids ...int) *IncidentUpdateOne

AddFailureIDs adds the "Failures" edge to the Failure entity by IDs.

func (*IncidentUpdateOne) AddFailures

func (iuo *IncidentUpdateOne) AddFailures(f ...*Failure) *IncidentUpdateOne

AddFailures adds the "Failures" edges to the Failure entity.

func (*IncidentUpdateOne) AddFileIDs

func (iuo *IncidentUpdateOne) AddFileIDs(ids ...int) *IncidentUpdateOne

AddFileIDs adds the "Files" edge to the File entity by IDs.

func (*IncidentUpdateOne) AddFiles

func (iuo *IncidentUpdateOne) AddFiles(f ...*File) *IncidentUpdateOne

AddFiles adds the "Files" edges to the File entity.

func (*IncidentUpdateOne) AddIntLevel

func (iuo *IncidentUpdateOne) AddIntLevel(i int) *IncidentUpdateOne

AddIntLevel adds i to the "IntLevel" field.

func (*IncidentUpdateOne) AddStati

func (iuo *IncidentUpdateOne) AddStati(s ...*Status) *IncidentUpdateOne

AddStati adds the "Stati" edges to the Status entity.

func (*IncidentUpdateOne) AddStatiIDs

func (iuo *IncidentUpdateOne) AddStatiIDs(ids ...int) *IncidentUpdateOne

AddStatiIDs adds the "Stati" edge to the Status entity by IDs.

func (*IncidentUpdateOne) ClearCounters

func (iuo *IncidentUpdateOne) ClearCounters() *IncidentUpdateOne

ClearCounters clears all "Counters" edges to the Counter entity.

func (*IncidentUpdateOne) ClearEnd added in v0.10.0

func (iuo *IncidentUpdateOne) ClearEnd() *IncidentUpdateOne

ClearEnd clears the value of the "End" field.

func (*IncidentUpdateOne) ClearError

func (iuo *IncidentUpdateOne) ClearError() *IncidentUpdateOne

ClearError clears the value of the "Error" field.

func (*IncidentUpdateOne) ClearFailures

func (iuo *IncidentUpdateOne) ClearFailures() *IncidentUpdateOne

ClearFailures clears all "Failures" edges to the Failure entity.

func (*IncidentUpdateOne) ClearFiles

func (iuo *IncidentUpdateOne) ClearFiles() *IncidentUpdateOne

ClearFiles clears all "Files" edges to the File entity.

func (*IncidentUpdateOne) ClearIncidentID

func (iuo *IncidentUpdateOne) ClearIncidentID() *IncidentUpdateOne

ClearIncidentID clears the value of the "IncidentID" field.

func (*IncidentUpdateOne) ClearStati

func (iuo *IncidentUpdateOne) ClearStati() *IncidentUpdateOne

ClearStati clears all "Stati" edges to the Status entity.

func (*IncidentUpdateOne) Exec

func (iuo *IncidentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IncidentUpdateOne) ExecX

func (iuo *IncidentUpdateOne) ExecX(ctx context.Context)

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

func (*IncidentUpdateOne) Mutation

func (iuo *IncidentUpdateOne) Mutation() *IncidentMutation

Mutation returns the IncidentMutation object of the builder.

func (*IncidentUpdateOne) RemoveCounterIDs

func (iuo *IncidentUpdateOne) RemoveCounterIDs(ids ...int) *IncidentUpdateOne

RemoveCounterIDs removes the "Counters" edge to Counter entities by IDs.

func (*IncidentUpdateOne) RemoveCounters

func (iuo *IncidentUpdateOne) RemoveCounters(c ...*Counter) *IncidentUpdateOne

RemoveCounters removes "Counters" edges to Counter entities.

func (*IncidentUpdateOne) RemoveFailureIDs

func (iuo *IncidentUpdateOne) RemoveFailureIDs(ids ...int) *IncidentUpdateOne

RemoveFailureIDs removes the "Failures" edge to Failure entities by IDs.

func (*IncidentUpdateOne) RemoveFailures

func (iuo *IncidentUpdateOne) RemoveFailures(f ...*Failure) *IncidentUpdateOne

RemoveFailures removes "Failures" edges to Failure entities.

func (*IncidentUpdateOne) RemoveFileIDs

func (iuo *IncidentUpdateOne) RemoveFileIDs(ids ...int) *IncidentUpdateOne

RemoveFileIDs removes the "Files" edge to File entities by IDs.

func (*IncidentUpdateOne) RemoveFiles

func (iuo *IncidentUpdateOne) RemoveFiles(f ...*File) *IncidentUpdateOne

RemoveFiles removes "Files" edges to File entities.

func (*IncidentUpdateOne) RemoveStati

func (iuo *IncidentUpdateOne) RemoveStati(s ...*Status) *IncidentUpdateOne

RemoveStati removes "Stati" edges to Status entities.

func (*IncidentUpdateOne) RemoveStatiIDs

func (iuo *IncidentUpdateOne) RemoveStatiIDs(ids ...int) *IncidentUpdateOne

RemoveStatiIDs removes the "Stati" edge to Status entities by IDs.

func (*IncidentUpdateOne) Save

func (iuo *IncidentUpdateOne) Save(ctx context.Context) (*Incident, error)

Save executes the query and returns the updated Incident entity.

func (*IncidentUpdateOne) SaveX

func (iuo *IncidentUpdateOne) SaveX(ctx context.Context) *Incident

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

func (*IncidentUpdateOne) Select

func (iuo *IncidentUpdateOne) Select(field string, fields ...string) *IncidentUpdateOne

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

func (*IncidentUpdateOne) SetEnd

func (iuo *IncidentUpdateOne) SetEnd(t time.Time) *IncidentUpdateOne

SetEnd sets the "End" field.

func (*IncidentUpdateOne) SetError

func (iuo *IncidentUpdateOne) SetError(s string) *IncidentUpdateOne

SetError sets the "Error" field.

func (*IncidentUpdateOne) SetIncidentID

func (iuo *IncidentUpdateOne) SetIncidentID(u uuid.UUID) *IncidentUpdateOne

SetIncidentID sets the "IncidentID" field.

func (*IncidentUpdateOne) SetIntLevel

func (iuo *IncidentUpdateOne) SetIntLevel(i int) *IncidentUpdateOne

SetIntLevel sets the "IntLevel" field.

func (*IncidentUpdateOne) SetName

func (iuo *IncidentUpdateOne) SetName(s string) *IncidentUpdateOne

SetName sets the "Name" field.

func (*IncidentUpdateOne) SetNillableEnd added in v0.10.0

func (iuo *IncidentUpdateOne) SetNillableEnd(t *time.Time) *IncidentUpdateOne

SetNillableEnd sets the "End" field if the given value is not nil.

func (*IncidentUpdateOne) SetNillableError

func (iuo *IncidentUpdateOne) SetNillableError(s *string) *IncidentUpdateOne

SetNillableError sets the "Error" field if the given value is not nil.

func (*IncidentUpdateOne) SetNillableIncidentID

func (iuo *IncidentUpdateOne) SetNillableIncidentID(u *uuid.UUID) *IncidentUpdateOne

SetNillableIncidentID sets the "IncidentID" field if the given value is not nil.

func (*IncidentUpdateOne) SetProbeHost

func (iuo *IncidentUpdateOne) SetProbeHost(s string) *IncidentUpdateOne

SetProbeHost sets the "ProbeHost" field.

func (*IncidentUpdateOne) SetProbeOS

func (iuo *IncidentUpdateOne) SetProbeOS(s string) *IncidentUpdateOne

SetProbeOS sets the "ProbeOS" field.

func (*IncidentUpdateOne) SetRegion

func (iuo *IncidentUpdateOne) SetRegion(s string) *IncidentUpdateOne

SetRegion sets the "Region" field.

func (*IncidentUpdateOne) SetStart

func (iuo *IncidentUpdateOne) SetStart(t time.Time) *IncidentUpdateOne

SetStart sets the "Start" field.

func (*IncidentUpdateOne) SetState

func (iuo *IncidentUpdateOne) SetState(b []byte) *IncidentUpdateOne

SetState sets the "State" field.

func (*IncidentUpdateOne) SetTime

func (iuo *IncidentUpdateOne) SetTime(t time.Time) *IncidentUpdateOne

SetTime sets the "Time" field.

func (*IncidentUpdateOne) SetUUID

func (iuo *IncidentUpdateOne) SetUUID(u uuid.UUID) *IncidentUpdateOne

SetUUID sets the "UUID" field.

func (*IncidentUpdateOne) SetUsername

func (iuo *IncidentUpdateOne) SetUsername(s string) *IncidentUpdateOne

SetUsername sets the "Username" field.

func (*IncidentUpdateOne) Where added in v0.14.0

Where appends a list predicates to the IncidentUpdate builder.

type IncidentUpsert

type IncidentUpsert struct {
	*sql.UpdateSet
}

IncidentUpsert is the "OnConflict" setter.

func (*IncidentUpsert) AddIntLevel

func (u *IncidentUpsert) AddIntLevel(v int) *IncidentUpsert

AddIntLevel adds v to the "IntLevel" field.

func (*IncidentUpsert) ClearEnd added in v0.10.0

func (u *IncidentUpsert) ClearEnd() *IncidentUpsert

ClearEnd clears the value of the "End" field.

func (*IncidentUpsert) ClearError

func (u *IncidentUpsert) ClearError() *IncidentUpsert

ClearError clears the value of the "Error" field.

func (*IncidentUpsert) ClearIncidentID

func (u *IncidentUpsert) ClearIncidentID() *IncidentUpsert

ClearIncidentID clears the value of the "IncidentID" field.

func (*IncidentUpsert) SetEnd

func (u *IncidentUpsert) SetEnd(v time.Time) *IncidentUpsert

SetEnd sets the "End" field.

func (*IncidentUpsert) SetError

func (u *IncidentUpsert) SetError(v string) *IncidentUpsert

SetError sets the "Error" field.

func (*IncidentUpsert) SetIncidentID

func (u *IncidentUpsert) SetIncidentID(v uuid.UUID) *IncidentUpsert

SetIncidentID sets the "IncidentID" field.

func (*IncidentUpsert) SetIntLevel

func (u *IncidentUpsert) SetIntLevel(v int) *IncidentUpsert

SetIntLevel sets the "IntLevel" field.

func (*IncidentUpsert) SetName

func (u *IncidentUpsert) SetName(v string) *IncidentUpsert

SetName sets the "Name" field.

func (*IncidentUpsert) SetProbeHost

func (u *IncidentUpsert) SetProbeHost(v string) *IncidentUpsert

SetProbeHost sets the "ProbeHost" field.

func (*IncidentUpsert) SetProbeOS

func (u *IncidentUpsert) SetProbeOS(v string) *IncidentUpsert

SetProbeOS sets the "ProbeOS" field.

func (*IncidentUpsert) SetRegion

func (u *IncidentUpsert) SetRegion(v string) *IncidentUpsert

SetRegion sets the "Region" field.

func (*IncidentUpsert) SetStart

func (u *IncidentUpsert) SetStart(v time.Time) *IncidentUpsert

SetStart sets the "Start" field.

func (*IncidentUpsert) SetState

func (u *IncidentUpsert) SetState(v []byte) *IncidentUpsert

SetState sets the "State" field.

func (*IncidentUpsert) SetTime

func (u *IncidentUpsert) SetTime(v time.Time) *IncidentUpsert

SetTime sets the "Time" field.

func (*IncidentUpsert) SetUUID

func (u *IncidentUpsert) SetUUID(v uuid.UUID) *IncidentUpsert

SetUUID sets the "UUID" field.

func (*IncidentUpsert) SetUsername

func (u *IncidentUpsert) SetUsername(v string) *IncidentUpsert

SetUsername sets the "Username" field.

func (*IncidentUpsert) UpdateEnd

func (u *IncidentUpsert) UpdateEnd() *IncidentUpsert

UpdateEnd sets the "End" field to the value that was provided on create.

func (*IncidentUpsert) UpdateError

func (u *IncidentUpsert) UpdateError() *IncidentUpsert

UpdateError sets the "Error" field to the value that was provided on create.

func (*IncidentUpsert) UpdateIncidentID

func (u *IncidentUpsert) UpdateIncidentID() *IncidentUpsert

UpdateIncidentID sets the "IncidentID" field to the value that was provided on create.

func (*IncidentUpsert) UpdateIntLevel

func (u *IncidentUpsert) UpdateIntLevel() *IncidentUpsert

UpdateIntLevel sets the "IntLevel" field to the value that was provided on create.

func (*IncidentUpsert) UpdateName

func (u *IncidentUpsert) UpdateName() *IncidentUpsert

UpdateName sets the "Name" field to the value that was provided on create.

func (*IncidentUpsert) UpdateProbeHost

func (u *IncidentUpsert) UpdateProbeHost() *IncidentUpsert

UpdateProbeHost sets the "ProbeHost" field to the value that was provided on create.

func (*IncidentUpsert) UpdateProbeOS

func (u *IncidentUpsert) UpdateProbeOS() *IncidentUpsert

UpdateProbeOS sets the "ProbeOS" field to the value that was provided on create.

func (*IncidentUpsert) UpdateRegion

func (u *IncidentUpsert) UpdateRegion() *IncidentUpsert

UpdateRegion sets the "Region" field to the value that was provided on create.

func (*IncidentUpsert) UpdateStart

func (u *IncidentUpsert) UpdateStart() *IncidentUpsert

UpdateStart sets the "Start" field to the value that was provided on create.

func (*IncidentUpsert) UpdateState

func (u *IncidentUpsert) UpdateState() *IncidentUpsert

UpdateState sets the "State" field to the value that was provided on create.

func (*IncidentUpsert) UpdateTime

func (u *IncidentUpsert) UpdateTime() *IncidentUpsert

UpdateTime sets the "Time" field to the value that was provided on create.

func (*IncidentUpsert) UpdateUUID

func (u *IncidentUpsert) UpdateUUID() *IncidentUpsert

UpdateUUID sets the "UUID" field to the value that was provided on create.

func (*IncidentUpsert) UpdateUsername

func (u *IncidentUpsert) UpdateUsername() *IncidentUpsert

UpdateUsername sets the "Username" field to the value that was provided on create.

type IncidentUpsertBulk

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

IncidentUpsertBulk is the builder for "upsert"-ing a bulk of Incident nodes.

func (*IncidentUpsertBulk) AddIntLevel

func (u *IncidentUpsertBulk) AddIntLevel(v int) *IncidentUpsertBulk

AddIntLevel adds v to the "IntLevel" field.

func (*IncidentUpsertBulk) ClearEnd added in v0.10.0

func (u *IncidentUpsertBulk) ClearEnd() *IncidentUpsertBulk

ClearEnd clears the value of the "End" field.

func (*IncidentUpsertBulk) ClearError

func (u *IncidentUpsertBulk) ClearError() *IncidentUpsertBulk

ClearError clears the value of the "Error" field.

func (*IncidentUpsertBulk) ClearIncidentID

func (u *IncidentUpsertBulk) ClearIncidentID() *IncidentUpsertBulk

ClearIncidentID clears the value of the "IncidentID" field.

func (*IncidentUpsertBulk) DoNothing

func (u *IncidentUpsertBulk) DoNothing() *IncidentUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IncidentUpsertBulk) Exec

func (u *IncidentUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IncidentUpsertBulk) ExecX

func (u *IncidentUpsertBulk) ExecX(ctx context.Context)

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

func (*IncidentUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Incident.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*IncidentUpsertBulk) SetEnd

SetEnd sets the "End" field.

func (*IncidentUpsertBulk) SetError

SetError sets the "Error" field.

func (*IncidentUpsertBulk) SetIncidentID

func (u *IncidentUpsertBulk) SetIncidentID(v uuid.UUID) *IncidentUpsertBulk

SetIncidentID sets the "IncidentID" field.

func (*IncidentUpsertBulk) SetIntLevel

func (u *IncidentUpsertBulk) SetIntLevel(v int) *IncidentUpsertBulk

SetIntLevel sets the "IntLevel" field.

func (*IncidentUpsertBulk) SetName

SetName sets the "Name" field.

func (*IncidentUpsertBulk) SetProbeHost

func (u *IncidentUpsertBulk) SetProbeHost(v string) *IncidentUpsertBulk

SetProbeHost sets the "ProbeHost" field.

func (*IncidentUpsertBulk) SetProbeOS

func (u *IncidentUpsertBulk) SetProbeOS(v string) *IncidentUpsertBulk

SetProbeOS sets the "ProbeOS" field.

func (*IncidentUpsertBulk) SetRegion

func (u *IncidentUpsertBulk) SetRegion(v string) *IncidentUpsertBulk

SetRegion sets the "Region" field.

func (*IncidentUpsertBulk) SetStart

SetStart sets the "Start" field.

func (*IncidentUpsertBulk) SetState

func (u *IncidentUpsertBulk) SetState(v []byte) *IncidentUpsertBulk

SetState sets the "State" field.

func (*IncidentUpsertBulk) SetTime

SetTime sets the "Time" field.

func (*IncidentUpsertBulk) SetUUID

SetUUID sets the "UUID" field.

func (*IncidentUpsertBulk) SetUsername

func (u *IncidentUpsertBulk) SetUsername(v string) *IncidentUpsertBulk

SetUsername sets the "Username" field.

func (*IncidentUpsertBulk) Update

func (u *IncidentUpsertBulk) Update(set func(*IncidentUpsert)) *IncidentUpsertBulk

Update allows overriding fields `UPDATE` values. See the IncidentCreateBulk.OnConflict documentation for more info.

func (*IncidentUpsertBulk) UpdateEnd

func (u *IncidentUpsertBulk) UpdateEnd() *IncidentUpsertBulk

UpdateEnd sets the "End" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateError

func (u *IncidentUpsertBulk) UpdateError() *IncidentUpsertBulk

UpdateError sets the "Error" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateIncidentID

func (u *IncidentUpsertBulk) UpdateIncidentID() *IncidentUpsertBulk

UpdateIncidentID sets the "IncidentID" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateIntLevel

func (u *IncidentUpsertBulk) UpdateIntLevel() *IncidentUpsertBulk

UpdateIntLevel sets the "IntLevel" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateName

func (u *IncidentUpsertBulk) UpdateName() *IncidentUpsertBulk

UpdateName sets the "Name" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateNewValues

func (u *IncidentUpsertBulk) UpdateNewValues() *IncidentUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Incident.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*IncidentUpsertBulk) UpdateProbeHost

func (u *IncidentUpsertBulk) UpdateProbeHost() *IncidentUpsertBulk

UpdateProbeHost sets the "ProbeHost" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateProbeOS

func (u *IncidentUpsertBulk) UpdateProbeOS() *IncidentUpsertBulk

UpdateProbeOS sets the "ProbeOS" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateRegion

func (u *IncidentUpsertBulk) UpdateRegion() *IncidentUpsertBulk

UpdateRegion sets the "Region" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateStart

func (u *IncidentUpsertBulk) UpdateStart() *IncidentUpsertBulk

UpdateStart sets the "Start" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateState

func (u *IncidentUpsertBulk) UpdateState() *IncidentUpsertBulk

UpdateState sets the "State" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateTime

func (u *IncidentUpsertBulk) UpdateTime() *IncidentUpsertBulk

UpdateTime sets the "Time" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateUUID

func (u *IncidentUpsertBulk) UpdateUUID() *IncidentUpsertBulk

UpdateUUID sets the "UUID" field to the value that was provided on create.

func (*IncidentUpsertBulk) UpdateUsername

func (u *IncidentUpsertBulk) UpdateUsername() *IncidentUpsertBulk

UpdateUsername sets the "Username" field to the value that was provided on create.

type IncidentUpsertOne

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

IncidentUpsertOne is the builder for "upsert"-ing

one Incident node.

func (*IncidentUpsertOne) AddIntLevel

func (u *IncidentUpsertOne) AddIntLevel(v int) *IncidentUpsertOne

AddIntLevel adds v to the "IntLevel" field.

func (*IncidentUpsertOne) ClearEnd added in v0.10.0

func (u *IncidentUpsertOne) ClearEnd() *IncidentUpsertOne

ClearEnd clears the value of the "End" field.

func (*IncidentUpsertOne) ClearError

func (u *IncidentUpsertOne) ClearError() *IncidentUpsertOne

ClearError clears the value of the "Error" field.

func (*IncidentUpsertOne) ClearIncidentID

func (u *IncidentUpsertOne) ClearIncidentID() *IncidentUpsertOne

ClearIncidentID clears the value of the "IncidentID" field.

func (*IncidentUpsertOne) DoNothing

func (u *IncidentUpsertOne) DoNothing() *IncidentUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IncidentUpsertOne) Exec

func (u *IncidentUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*IncidentUpsertOne) ExecX

func (u *IncidentUpsertOne) ExecX(ctx context.Context)

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

func (*IncidentUpsertOne) ID

func (u *IncidentUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*IncidentUpsertOne) IDX

func (u *IncidentUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*IncidentUpsertOne) Ignore

func (u *IncidentUpsertOne) Ignore() *IncidentUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Incident.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*IncidentUpsertOne) SetEnd

SetEnd sets the "End" field.

func (*IncidentUpsertOne) SetError

func (u *IncidentUpsertOne) SetError(v string) *IncidentUpsertOne

SetError sets the "Error" field.

func (*IncidentUpsertOne) SetIncidentID

func (u *IncidentUpsertOne) SetIncidentID(v uuid.UUID) *IncidentUpsertOne

SetIncidentID sets the "IncidentID" field.

func (*IncidentUpsertOne) SetIntLevel

func (u *IncidentUpsertOne) SetIntLevel(v int) *IncidentUpsertOne

SetIntLevel sets the "IntLevel" field.

func (*IncidentUpsertOne) SetName

SetName sets the "Name" field.

func (*IncidentUpsertOne) SetProbeHost

func (u *IncidentUpsertOne) SetProbeHost(v string) *IncidentUpsertOne

SetProbeHost sets the "ProbeHost" field.

func (*IncidentUpsertOne) SetProbeOS

func (u *IncidentUpsertOne) SetProbeOS(v string) *IncidentUpsertOne

SetProbeOS sets the "ProbeOS" field.

func (*IncidentUpsertOne) SetRegion

func (u *IncidentUpsertOne) SetRegion(v string) *IncidentUpsertOne

SetRegion sets the "Region" field.

func (*IncidentUpsertOne) SetStart

func (u *IncidentUpsertOne) SetStart(v time.Time) *IncidentUpsertOne

SetStart sets the "Start" field.

func (*IncidentUpsertOne) SetState

func (u *IncidentUpsertOne) SetState(v []byte) *IncidentUpsertOne

SetState sets the "State" field.

func (*IncidentUpsertOne) SetTime

SetTime sets the "Time" field.

func (*IncidentUpsertOne) SetUUID

SetUUID sets the "UUID" field.

func (*IncidentUpsertOne) SetUsername

func (u *IncidentUpsertOne) SetUsername(v string) *IncidentUpsertOne

SetUsername sets the "Username" field.

func (*IncidentUpsertOne) Update

func (u *IncidentUpsertOne) Update(set func(*IncidentUpsert)) *IncidentUpsertOne

Update allows overriding fields `UPDATE` values. See the IncidentCreate.OnConflict documentation for more info.

func (*IncidentUpsertOne) UpdateEnd

func (u *IncidentUpsertOne) UpdateEnd() *IncidentUpsertOne

UpdateEnd sets the "End" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateError

func (u *IncidentUpsertOne) UpdateError() *IncidentUpsertOne

UpdateError sets the "Error" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateIncidentID

func (u *IncidentUpsertOne) UpdateIncidentID() *IncidentUpsertOne

UpdateIncidentID sets the "IncidentID" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateIntLevel

func (u *IncidentUpsertOne) UpdateIntLevel() *IncidentUpsertOne

UpdateIntLevel sets the "IntLevel" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateName

func (u *IncidentUpsertOne) UpdateName() *IncidentUpsertOne

UpdateName sets the "Name" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateNewValues

func (u *IncidentUpsertOne) UpdateNewValues() *IncidentUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Incident.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*IncidentUpsertOne) UpdateProbeHost

func (u *IncidentUpsertOne) UpdateProbeHost() *IncidentUpsertOne

UpdateProbeHost sets the "ProbeHost" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateProbeOS

func (u *IncidentUpsertOne) UpdateProbeOS() *IncidentUpsertOne

UpdateProbeOS sets the "ProbeOS" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateRegion

func (u *IncidentUpsertOne) UpdateRegion() *IncidentUpsertOne

UpdateRegion sets the "Region" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateStart

func (u *IncidentUpsertOne) UpdateStart() *IncidentUpsertOne

UpdateStart sets the "Start" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateState

func (u *IncidentUpsertOne) UpdateState() *IncidentUpsertOne

UpdateState sets the "State" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateTime

func (u *IncidentUpsertOne) UpdateTime() *IncidentUpsertOne

UpdateTime sets the "Time" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateUUID

func (u *IncidentUpsertOne) UpdateUUID() *IncidentUpsertOne

UpdateUUID sets the "UUID" field to the value that was provided on create.

func (*IncidentUpsertOne) UpdateUsername

func (u *IncidentUpsertOne) UpdateUsername() *IncidentUpsertOne

UpdateUsername sets the "Username" field to the value that was provided on create.

type Incidents

type Incidents []*Incident

Incidents is a parsable slice of Incident.

type InterceptFunc added in v0.14.0

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor added in v0.14.0

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, int) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

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 OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

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 PageInfo

type PageInfo = entgql.PageInfo[int]

Common entgql types.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier added in v0.14.0

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc added in v0.14.0

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 v0.14.0

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 Status

type Status struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "Name" field.
	Name string `json:"Name,omitempty"`
	// Value holds the value of the "Value" field.
	Value string `json:"Value,omitempty"`
	// contains filtered or unexported fields
}

Status is the model entity for the Status schema.

func (*Status) GetValue added in v0.14.0

func (s *Status) GetValue(name string) (ent.Value, error)

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

func (*Status) IsNode added in v0.14.0

func (n *Status) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Status) String

func (s *Status) String() string

String implements the fmt.Stringer.

func (*Status) ToEdge

func (s *Status) ToEdge(order *StatusOrder) *StatusEdge

ToEdge converts Status into StatusEdge.

func (*Status) Unwrap

func (s *Status) Unwrap() *Status

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

func (s *Status) Update() *StatusUpdateOne

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

type StatusClient

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

StatusClient is a client for the Status schema.

func NewStatusClient

func NewStatusClient(c config) *StatusClient

NewStatusClient returns a client for the Status from the given config.

func (*StatusClient) Create

func (c *StatusClient) Create() *StatusCreate

Create returns a builder for creating a Status entity.

func (*StatusClient) CreateBulk

func (c *StatusClient) CreateBulk(builders ...*StatusCreate) *StatusCreateBulk

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

func (*StatusClient) Delete

func (c *StatusClient) Delete() *StatusDelete

Delete returns a delete builder for Status.

func (*StatusClient) DeleteOne

func (c *StatusClient) DeleteOne(s *Status) *StatusDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StatusClient) DeleteOneID

func (c *StatusClient) DeleteOneID(id int) *StatusDeleteOne

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

func (*StatusClient) Get

func (c *StatusClient) Get(ctx context.Context, id int) (*Status, error)

Get returns a Status entity by its id.

func (*StatusClient) GetX

func (c *StatusClient) GetX(ctx context.Context, id int) *Status

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

func (*StatusClient) Hooks

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

Hooks returns the client hooks.

func (*StatusClient) Intercept added in v0.14.0

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

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

func (*StatusClient) Interceptors added in v0.14.0

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

Interceptors returns the client interceptors.

func (*StatusClient) Query

func (c *StatusClient) Query() *StatusQuery

Query returns a query builder for Status.

func (*StatusClient) Update

func (c *StatusClient) Update() *StatusUpdate

Update returns an update builder for Status.

func (*StatusClient) UpdateOne

func (c *StatusClient) UpdateOne(s *Status) *StatusUpdateOne

UpdateOne returns an update builder for the given entity.

func (*StatusClient) UpdateOneID

func (c *StatusClient) UpdateOneID(id int) *StatusUpdateOne

UpdateOneID returns an update builder for the given id.

func (*StatusClient) Use

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

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

type StatusConnection

type StatusConnection struct {
	Edges      []*StatusEdge `json:"edges"`
	PageInfo   PageInfo      `json:"pageInfo"`
	TotalCount int           `json:"totalCount"`
}

StatusConnection is the connection containing edges to Status.

type StatusCreate

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

StatusCreate is the builder for creating a Status entity.

func (*StatusCreate) Exec

func (sc *StatusCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusCreate) ExecX

func (sc *StatusCreate) ExecX(ctx context.Context)

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

func (*StatusCreate) Mutation

func (sc *StatusCreate) Mutation() *StatusMutation

Mutation returns the StatusMutation object of the builder.

func (*StatusCreate) OnConflict

func (sc *StatusCreate) OnConflict(opts ...sql.ConflictOption) *StatusUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Status.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.StatusUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*StatusCreate) OnConflictColumns

func (sc *StatusCreate) OnConflictColumns(columns ...string) *StatusUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Status.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*StatusCreate) Save

func (sc *StatusCreate) Save(ctx context.Context) (*Status, error)

Save creates the Status in the database.

func (*StatusCreate) SaveX

func (sc *StatusCreate) SaveX(ctx context.Context) *Status

SaveX calls Save and panics if Save returns an error.

func (*StatusCreate) SetName

func (sc *StatusCreate) SetName(s string) *StatusCreate

SetName sets the "Name" field.

func (*StatusCreate) SetValue

func (sc *StatusCreate) SetValue(s string) *StatusCreate

SetValue sets the "Value" field.

type StatusCreateBulk

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

StatusCreateBulk is the builder for creating many Status entities in bulk.

func (*StatusCreateBulk) Exec

func (scb *StatusCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusCreateBulk) ExecX

func (scb *StatusCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusCreateBulk) OnConflict

func (scb *StatusCreateBulk) OnConflict(opts ...sql.ConflictOption) *StatusUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Status.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.StatusUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*StatusCreateBulk) OnConflictColumns

func (scb *StatusCreateBulk) OnConflictColumns(columns ...string) *StatusUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Status.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*StatusCreateBulk) Save

func (scb *StatusCreateBulk) Save(ctx context.Context) ([]*Status, error)

Save creates the Status entities in the database.

func (*StatusCreateBulk) SaveX

func (scb *StatusCreateBulk) SaveX(ctx context.Context) []*Status

SaveX is like Save, but panics if an error occurs.

type StatusDelete

type StatusDelete struct {
	// contains filtered or unexported fields
}

StatusDelete is the builder for deleting a Status entity.

func (*StatusDelete) Exec

func (sd *StatusDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StatusDelete) ExecX

func (sd *StatusDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StatusDelete) Where

func (sd *StatusDelete) Where(ps ...predicate.Status) *StatusDelete

Where appends a list predicates to the StatusDelete builder.

type StatusDeleteOne

type StatusDeleteOne struct {
	// contains filtered or unexported fields
}

StatusDeleteOne is the builder for deleting a single Status entity.

func (*StatusDeleteOne) Exec

func (sdo *StatusDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*StatusDeleteOne) ExecX

func (sdo *StatusDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusDeleteOne) Where added in v0.14.0

func (sdo *StatusDeleteOne) Where(ps ...predicate.Status) *StatusDeleteOne

Where appends a list predicates to the StatusDelete builder.

type StatusEdge

type StatusEdge struct {
	Node   *Status `json:"node"`
	Cursor Cursor  `json:"cursor"`
}

StatusEdge is the edge representation of Status.

type StatusGroupBy

type StatusGroupBy struct {
	// contains filtered or unexported fields
}

StatusGroupBy is the group-by builder for Status entities.

func (*StatusGroupBy) Aggregate

func (sgb *StatusGroupBy) Aggregate(fns ...AggregateFunc) *StatusGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*StatusGroupBy) Bool

func (s *StatusGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) BoolX

func (s *StatusGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StatusGroupBy) Bools

func (s *StatusGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) BoolsX

func (s *StatusGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StatusGroupBy) Float64

func (s *StatusGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) Float64X

func (s *StatusGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StatusGroupBy) Float64s

func (s *StatusGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) Float64sX

func (s *StatusGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StatusGroupBy) Int

func (s *StatusGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) IntX

func (s *StatusGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StatusGroupBy) Ints

func (s *StatusGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) IntsX

func (s *StatusGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StatusGroupBy) Scan

func (sgb *StatusGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StatusGroupBy) ScanX

func (s *StatusGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StatusGroupBy) String

func (s *StatusGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) StringX

func (s *StatusGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StatusGroupBy) Strings

func (s *StatusGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) StringsX

func (s *StatusGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StatusMutation

type StatusMutation struct {
	// contains filtered or unexported fields
}

StatusMutation represents an operation that mutates the Status nodes in the graph.

func (*StatusMutation) AddField

func (m *StatusMutation) 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 (*StatusMutation) AddedEdges

func (m *StatusMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*StatusMutation) AddedField

func (m *StatusMutation) 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 (*StatusMutation) AddedFields

func (m *StatusMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*StatusMutation) AddedIDs

func (m *StatusMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*StatusMutation) ClearEdge

func (m *StatusMutation) 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 (*StatusMutation) ClearField

func (m *StatusMutation) 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 (*StatusMutation) ClearedEdges

func (m *StatusMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*StatusMutation) ClearedFields

func (m *StatusMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (StatusMutation) Client

func (m StatusMutation) 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 (*StatusMutation) EdgeCleared

func (m *StatusMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*StatusMutation) Field

func (m *StatusMutation) 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 (*StatusMutation) FieldCleared

func (m *StatusMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*StatusMutation) Fields

func (m *StatusMutation) 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 (*StatusMutation) ID

func (m *StatusMutation) 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 (*StatusMutation) IDs

func (m *StatusMutation) 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 (*StatusMutation) Name

func (m *StatusMutation) Name() (r string, exists bool)

Name returns the value of the "Name" field in the mutation.

func (*StatusMutation) OldField

func (m *StatusMutation) 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 (*StatusMutation) OldName

func (m *StatusMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "Name" field's value of the Status entity. If the Status 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 (*StatusMutation) OldValue

func (m *StatusMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "Value" field's value of the Status entity. If the Status 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 (*StatusMutation) Op

func (m *StatusMutation) Op() Op

Op returns the operation name.

func (*StatusMutation) RemovedEdges

func (m *StatusMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*StatusMutation) RemovedIDs

func (m *StatusMutation) 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 (*StatusMutation) ResetEdge

func (m *StatusMutation) 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 (*StatusMutation) ResetField

func (m *StatusMutation) 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 (*StatusMutation) ResetName

func (m *StatusMutation) ResetName()

ResetName resets all changes to the "Name" field.

func (*StatusMutation) ResetValue

func (m *StatusMutation) ResetValue()

ResetValue resets all changes to the "Value" field.

func (*StatusMutation) SetField

func (m *StatusMutation) 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 (*StatusMutation) SetName

func (m *StatusMutation) SetName(s string)

SetName sets the "Name" field.

func (*StatusMutation) SetOp added in v0.14.0

func (m *StatusMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*StatusMutation) SetValue

func (m *StatusMutation) SetValue(s string)

SetValue sets the "Value" field.

func (StatusMutation) Tx

func (m StatusMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*StatusMutation) Type

func (m *StatusMutation) Type() string

Type returns the node type of this mutation (Status).

func (*StatusMutation) Value

func (m *StatusMutation) Value() (r string, exists bool)

Value returns the value of the "Value" field in the mutation.

func (*StatusMutation) Where

func (m *StatusMutation) Where(ps ...predicate.Status)

Where appends a list predicates to the StatusMutation builder.

func (*StatusMutation) WhereP added in v0.14.0

func (m *StatusMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the StatusMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type StatusOrder

type StatusOrder struct {
	Direction OrderDirection    `json:"direction"`
	Field     *StatusOrderField `json:"field"`
}

StatusOrder defines the ordering of Status.

type StatusOrderField

type StatusOrderField struct {
	// Value extracts the ordering value from the given Status.
	Value func(*Status) (ent.Value, error)
	// contains filtered or unexported fields
}

StatusOrderField defines the ordering field of Status.

type StatusPaginateOption

type StatusPaginateOption func(*statusPager) error

StatusPaginateOption enables pagination customization.

func WithStatusFilter

func WithStatusFilter(filter func(*StatusQuery) (*StatusQuery, error)) StatusPaginateOption

WithStatusFilter configures pagination filter.

func WithStatusOrder

func WithStatusOrder(order *StatusOrder) StatusPaginateOption

WithStatusOrder configures pagination ordering.

type StatusQuery

type StatusQuery struct {
	// contains filtered or unexported fields
}

StatusQuery is the builder for querying Status entities.

func (*StatusQuery) Aggregate added in v0.12.0

func (sq *StatusQuery) Aggregate(fns ...AggregateFunc) *StatusSelect

Aggregate returns a StatusSelect configured with the given aggregations.

func (*StatusQuery) All

func (sq *StatusQuery) All(ctx context.Context) ([]*Status, error)

All executes the query and returns a list of StatusSlice.

func (*StatusQuery) AllX

func (sq *StatusQuery) AllX(ctx context.Context) []*Status

AllX is like All, but panics if an error occurs.

func (*StatusQuery) Clone

func (sq *StatusQuery) Clone() *StatusQuery

Clone returns a duplicate of the StatusQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*StatusQuery) CollectFields

func (s *StatusQuery) CollectFields(ctx context.Context, satisfies ...string) (*StatusQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*StatusQuery) Count

func (sq *StatusQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StatusQuery) CountX

func (sq *StatusQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StatusQuery) Exist

func (sq *StatusQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StatusQuery) ExistX

func (sq *StatusQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StatusQuery) First

func (sq *StatusQuery) First(ctx context.Context) (*Status, error)

First returns the first Status entity from the query. Returns a *NotFoundError when no Status was found.

func (*StatusQuery) FirstID

func (sq *StatusQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Status ID from the query. Returns a *NotFoundError when no Status ID was found.

func (*StatusQuery) FirstIDX

func (sq *StatusQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*StatusQuery) FirstX

func (sq *StatusQuery) FirstX(ctx context.Context) *Status

FirstX is like First, but panics if an error occurs.

func (*StatusQuery) GroupBy

func (sq *StatusQuery) GroupBy(field string, fields ...string) *StatusGroupBy

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,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Status.Query().
	GroupBy(status.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*StatusQuery) IDs

func (sq *StatusQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Status IDs.

func (*StatusQuery) IDsX

func (sq *StatusQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*StatusQuery) Limit

func (sq *StatusQuery) Limit(limit int) *StatusQuery

Limit the number of records to be returned by this query.

func (*StatusQuery) Offset

func (sq *StatusQuery) Offset(offset int) *StatusQuery

Offset to start from.

func (*StatusQuery) Only

func (sq *StatusQuery) Only(ctx context.Context) (*Status, error)

Only returns a single Status entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Status entity is found. Returns a *NotFoundError when no Status entities are found.

func (*StatusQuery) OnlyID

func (sq *StatusQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Status ID in the query. Returns a *NotSingularError when more than one Status ID is found. Returns a *NotFoundError when no entities are found.

func (*StatusQuery) OnlyIDX

func (sq *StatusQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StatusQuery) OnlyX

func (sq *StatusQuery) OnlyX(ctx context.Context) *Status

OnlyX is like Only, but panics if an error occurs.

func (*StatusQuery) Order

func (sq *StatusQuery) Order(o ...status.OrderOption) *StatusQuery

Order specifies how the records should be ordered.

func (*StatusQuery) Paginate

func (s *StatusQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...StatusPaginateOption,
) (*StatusConnection, error)

Paginate executes the query and returns a relay based cursor connection to Status.

func (*StatusQuery) Select

func (sq *StatusQuery) Select(fields ...string) *StatusSelect

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,omitempty"`
}

client.Status.Query().
	Select(status.FieldName).
	Scan(ctx, &v)

func (*StatusQuery) Unique

func (sq *StatusQuery) Unique(unique bool) *StatusQuery

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 (*StatusQuery) Where

func (sq *StatusQuery) Where(ps ...predicate.Status) *StatusQuery

Where adds a new predicate for the StatusQuery builder.

type StatusSelect

type StatusSelect struct {
	*StatusQuery
	// contains filtered or unexported fields
}

StatusSelect is the builder for selecting fields of Status entities.

func (*StatusSelect) Aggregate added in v0.12.0

func (ss *StatusSelect) Aggregate(fns ...AggregateFunc) *StatusSelect

Aggregate adds the given aggregation functions to the selector query.

func (*StatusSelect) Bool

func (s *StatusSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StatusSelect) BoolX

func (s *StatusSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StatusSelect) Bools

func (s *StatusSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StatusSelect) BoolsX

func (s *StatusSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StatusSelect) Float64

func (s *StatusSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StatusSelect) Float64X

func (s *StatusSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StatusSelect) Float64s

func (s *StatusSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StatusSelect) Float64sX

func (s *StatusSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StatusSelect) Int

func (s *StatusSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StatusSelect) IntX

func (s *StatusSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StatusSelect) Ints

func (s *StatusSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StatusSelect) IntsX

func (s *StatusSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StatusSelect) Scan

func (ss *StatusSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StatusSelect) ScanX

func (s *StatusSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StatusSelect) String

func (s *StatusSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StatusSelect) StringX

func (s *StatusSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StatusSelect) Strings

func (s *StatusSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StatusSelect) StringsX

func (s *StatusSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StatusSlice

type StatusSlice []*Status

StatusSlice is a parsable slice of Status.

type StatusUpdate

type StatusUpdate struct {
	// contains filtered or unexported fields
}

StatusUpdate is the builder for updating Status entities.

func (*StatusUpdate) Exec

func (su *StatusUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusUpdate) ExecX

func (su *StatusUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusUpdate) Mutation

func (su *StatusUpdate) Mutation() *StatusMutation

Mutation returns the StatusMutation object of the builder.

func (*StatusUpdate) Save

func (su *StatusUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*StatusUpdate) SaveX

func (su *StatusUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StatusUpdate) SetName

func (su *StatusUpdate) SetName(s string) *StatusUpdate

SetName sets the "Name" field.

func (*StatusUpdate) SetValue

func (su *StatusUpdate) SetValue(s string) *StatusUpdate

SetValue sets the "Value" field.

func (*StatusUpdate) Where

func (su *StatusUpdate) Where(ps ...predicate.Status) *StatusUpdate

Where appends a list predicates to the StatusUpdate builder.

type StatusUpdateOne

type StatusUpdateOne struct {
	// contains filtered or unexported fields
}

StatusUpdateOne is the builder for updating a single Status entity.

func (*StatusUpdateOne) Exec

func (suo *StatusUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*StatusUpdateOne) ExecX

func (suo *StatusUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusUpdateOne) Mutation

func (suo *StatusUpdateOne) Mutation() *StatusMutation

Mutation returns the StatusMutation object of the builder.

func (*StatusUpdateOne) Save

func (suo *StatusUpdateOne) Save(ctx context.Context) (*Status, error)

Save executes the query and returns the updated Status entity.

func (*StatusUpdateOne) SaveX

func (suo *StatusUpdateOne) SaveX(ctx context.Context) *Status

SaveX is like Save, but panics if an error occurs.

func (*StatusUpdateOne) Select

func (suo *StatusUpdateOne) Select(field string, fields ...string) *StatusUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*StatusUpdateOne) SetName

func (suo *StatusUpdateOne) SetName(s string) *StatusUpdateOne

SetName sets the "Name" field.

func (*StatusUpdateOne) SetValue

func (suo *StatusUpdateOne) SetValue(s string) *StatusUpdateOne

SetValue sets the "Value" field.

func (*StatusUpdateOne) Where added in v0.14.0

func (suo *StatusUpdateOne) Where(ps ...predicate.Status) *StatusUpdateOne

Where appends a list predicates to the StatusUpdate builder.

type StatusUpsert

type StatusUpsert struct {
	*sql.UpdateSet
}

StatusUpsert is the "OnConflict" setter.

func (*StatusUpsert) SetName

func (u *StatusUpsert) SetName(v string) *StatusUpsert

SetName sets the "Name" field.

func (*StatusUpsert) SetValue

func (u *StatusUpsert) SetValue(v string) *StatusUpsert

SetValue sets the "Value" field.

func (*StatusUpsert) UpdateName

func (u *StatusUpsert) UpdateName() *StatusUpsert

UpdateName sets the "Name" field to the value that was provided on create.

func (*StatusUpsert) UpdateValue

func (u *StatusUpsert) UpdateValue() *StatusUpsert

UpdateValue sets the "Value" field to the value that was provided on create.

type StatusUpsertBulk

type StatusUpsertBulk struct {
	// contains filtered or unexported fields
}

StatusUpsertBulk is the builder for "upsert"-ing a bulk of Status nodes.

func (*StatusUpsertBulk) DoNothing

func (u *StatusUpsertBulk) DoNothing() *StatusUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*StatusUpsertBulk) Exec

func (u *StatusUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusUpsertBulk) ExecX

func (u *StatusUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusUpsertBulk) Ignore

func (u *StatusUpsertBulk) Ignore() *StatusUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Status.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*StatusUpsertBulk) SetName

func (u *StatusUpsertBulk) SetName(v string) *StatusUpsertBulk

SetName sets the "Name" field.

func (*StatusUpsertBulk) SetValue

func (u *StatusUpsertBulk) SetValue(v string) *StatusUpsertBulk

SetValue sets the "Value" field.

func (*StatusUpsertBulk) Update

func (u *StatusUpsertBulk) Update(set func(*StatusUpsert)) *StatusUpsertBulk

Update allows overriding fields `UPDATE` values. See the StatusCreateBulk.OnConflict documentation for more info.

func (*StatusUpsertBulk) UpdateName

func (u *StatusUpsertBulk) UpdateName() *StatusUpsertBulk

UpdateName sets the "Name" field to the value that was provided on create.

func (*StatusUpsertBulk) UpdateNewValues

func (u *StatusUpsertBulk) UpdateNewValues() *StatusUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Status.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*StatusUpsertBulk) UpdateValue

func (u *StatusUpsertBulk) UpdateValue() *StatusUpsertBulk

UpdateValue sets the "Value" field to the value that was provided on create.

type StatusUpsertOne

type StatusUpsertOne struct {
	// contains filtered or unexported fields
}

StatusUpsertOne is the builder for "upsert"-ing

one Status node.

func (*StatusUpsertOne) DoNothing

func (u *StatusUpsertOne) DoNothing() *StatusUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*StatusUpsertOne) Exec

func (u *StatusUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusUpsertOne) ExecX

func (u *StatusUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusUpsertOne) ID

func (u *StatusUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*StatusUpsertOne) IDX

func (u *StatusUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*StatusUpsertOne) Ignore

func (u *StatusUpsertOne) Ignore() *StatusUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Status.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*StatusUpsertOne) SetName

func (u *StatusUpsertOne) SetName(v string) *StatusUpsertOne

SetName sets the "Name" field.

func (*StatusUpsertOne) SetValue

func (u *StatusUpsertOne) SetValue(v string) *StatusUpsertOne

SetValue sets the "Value" field.

func (*StatusUpsertOne) Update

func (u *StatusUpsertOne) Update(set func(*StatusUpsert)) *StatusUpsertOne

Update allows overriding fields `UPDATE` values. See the StatusCreate.OnConflict documentation for more info.

func (*StatusUpsertOne) UpdateName

func (u *StatusUpsertOne) UpdateName() *StatusUpsertOne

UpdateName sets the "Name" field to the value that was provided on create.

func (*StatusUpsertOne) UpdateNewValues

func (u *StatusUpsertOne) UpdateNewValues() *StatusUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Status.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*StatusUpsertOne) UpdateValue

func (u *StatusUpsertOne) UpdateValue() *StatusUpsertOne

UpdateValue sets the "Value" field to the value that was provided on create.

type TraverseFunc added in v0.14.0

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser added in v0.14.0

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
	// Counter is the client for interacting with the Counter builders.
	Counter *CounterClient
	// Failure is the client for interacting with the Failure builders.
	Failure *FailureClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Incident is the client for interacting with the Incident builders.
	Incident *IncidentClient
	// Status is the client for interacting with the Status builders.
	Status *StatusClient
	// 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