ent

package
v0.0.0-...-483b314 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 24 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.
	TypeAlertChannel = "AlertChannel"
	TypeMonitor      = "Monitor"
	TypeSecret       = "Secret"
	TypeSink         = "Sink"
	TypeUser         = "User"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type AlertChannel

type AlertChannel struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// AlertChannelType holds the value of the "alert_channel_type" field.
	AlertChannelType string `json:"alert_channel_type,omitempty"`
	// Config holds the value of the "config" field.
	Config map[string]interface{} `json:"config,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AlertChannelQuery when eager-loading is set.
	Edges AlertChannelEdges `json:"edges"`
	// contains filtered or unexported fields
}

AlertChannel is the model entity for the AlertChannel schema.

func (*AlertChannel) QueryMonitors

func (ac *AlertChannel) QueryMonitors() *MonitorQuery

QueryMonitors queries the "monitors" edge of the AlertChannel entity.

func (*AlertChannel) String

func (ac *AlertChannel) String() string

String implements the fmt.Stringer.

func (*AlertChannel) Unwrap

func (ac *AlertChannel) Unwrap() *AlertChannel

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

func (ac *AlertChannel) Update() *AlertChannelUpdateOne

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

type AlertChannelClient

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

AlertChannelClient is a client for the AlertChannel schema.

func NewAlertChannelClient

func NewAlertChannelClient(c config) *AlertChannelClient

NewAlertChannelClient returns a client for the AlertChannel from the given config.

func (*AlertChannelClient) Create

Create returns a builder for creating a AlertChannel entity.

func (*AlertChannelClient) CreateBulk

func (c *AlertChannelClient) CreateBulk(builders ...*AlertChannelCreate) *AlertChannelCreateBulk

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

func (*AlertChannelClient) Delete

Delete returns a delete builder for AlertChannel.

func (*AlertChannelClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AlertChannelClient) DeleteOneID

func (c *AlertChannelClient) DeleteOneID(id string) *AlertChannelDeleteOne

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

func (*AlertChannelClient) Get

Get returns a AlertChannel entity by its id.

func (*AlertChannelClient) GetX

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

func (*AlertChannelClient) Hooks

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

Hooks returns the client hooks.

func (*AlertChannelClient) Query

Query returns a query builder for AlertChannel.

func (*AlertChannelClient) QueryMonitors

func (c *AlertChannelClient) QueryMonitors(ac *AlertChannel) *MonitorQuery

QueryMonitors queries the monitors edge of a AlertChannel.

func (*AlertChannelClient) Update

Update returns an update builder for AlertChannel.

func (*AlertChannelClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AlertChannelClient) UpdateOneID

func (c *AlertChannelClient) UpdateOneID(id string) *AlertChannelUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AlertChannelClient) Use

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

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

type AlertChannelCreate

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

AlertChannelCreate is the builder for creating a AlertChannel entity.

func (*AlertChannelCreate) AddMonitorIDs

func (acc *AlertChannelCreate) AddMonitorIDs(ids ...string) *AlertChannelCreate

AddMonitorIDs adds the "monitors" edge to the Monitor entity by IDs.

func (*AlertChannelCreate) AddMonitors

func (acc *AlertChannelCreate) AddMonitors(m ...*Monitor) *AlertChannelCreate

AddMonitors adds the "monitors" edges to the Monitor entity.

func (*AlertChannelCreate) Exec

func (acc *AlertChannelCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AlertChannelCreate) ExecX

func (acc *AlertChannelCreate) ExecX(ctx context.Context)

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

func (*AlertChannelCreate) Mutation

func (acc *AlertChannelCreate) Mutation() *AlertChannelMutation

Mutation returns the AlertChannelMutation object of the builder.

func (*AlertChannelCreate) Save

Save creates the AlertChannel in the database.

func (*AlertChannelCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AlertChannelCreate) SetAlertChannelType

func (acc *AlertChannelCreate) SetAlertChannelType(s string) *AlertChannelCreate

SetAlertChannelType sets the "alert_channel_type" field.

func (*AlertChannelCreate) SetConfig

func (acc *AlertChannelCreate) SetConfig(m map[string]interface{}) *AlertChannelCreate

SetConfig sets the "config" field.

func (*AlertChannelCreate) SetCreatedAt

func (acc *AlertChannelCreate) SetCreatedAt(t time.Time) *AlertChannelCreate

SetCreatedAt sets the "created_at" field.

func (*AlertChannelCreate) SetID

SetID sets the "id" field.

func (*AlertChannelCreate) SetNillableCreatedAt

func (acc *AlertChannelCreate) SetNillableCreatedAt(t *time.Time) *AlertChannelCreate

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

func (*AlertChannelCreate) SetNillableUpdatedAt

func (acc *AlertChannelCreate) SetNillableUpdatedAt(t *time.Time) *AlertChannelCreate

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

func (*AlertChannelCreate) SetUpdatedAt

func (acc *AlertChannelCreate) SetUpdatedAt(t time.Time) *AlertChannelCreate

SetUpdatedAt sets the "updated_at" field.

type AlertChannelCreateBulk

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

AlertChannelCreateBulk is the builder for creating many AlertChannel entities in bulk.

func (*AlertChannelCreateBulk) Exec

func (accb *AlertChannelCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AlertChannelCreateBulk) ExecX

func (accb *AlertChannelCreateBulk) ExecX(ctx context.Context)

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

func (*AlertChannelCreateBulk) Save

Save creates the AlertChannel entities in the database.

func (*AlertChannelCreateBulk) SaveX

func (accb *AlertChannelCreateBulk) SaveX(ctx context.Context) []*AlertChannel

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

type AlertChannelDelete

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

AlertChannelDelete is the builder for deleting a AlertChannel entity.

func (*AlertChannelDelete) Exec

func (acd *AlertChannelDelete) Exec(ctx context.Context) (int, error)

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

func (*AlertChannelDelete) ExecX

func (acd *AlertChannelDelete) ExecX(ctx context.Context) int

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

func (*AlertChannelDelete) Where

Where appends a list predicates to the AlertChannelDelete builder.

type AlertChannelDeleteOne

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

AlertChannelDeleteOne is the builder for deleting a single AlertChannel entity.

func (*AlertChannelDeleteOne) Exec

func (acdo *AlertChannelDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AlertChannelDeleteOne) ExecX

func (acdo *AlertChannelDeleteOne) ExecX(ctx context.Context)

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

type AlertChannelEdges

type AlertChannelEdges struct {
	// Monitors holds the value of the monitors edge.
	Monitors []*Monitor `json:"monitors,omitempty"`
	// contains filtered or unexported fields
}

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

func (AlertChannelEdges) MonitorsOrErr

func (e AlertChannelEdges) MonitorsOrErr() ([]*Monitor, error)

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

type AlertChannelGroupBy

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

AlertChannelGroupBy is the group-by builder for AlertChannel entities.

func (*AlertChannelGroupBy) Aggregate

func (acgb *AlertChannelGroupBy) Aggregate(fns ...AggregateFunc) *AlertChannelGroupBy

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

func (*AlertChannelGroupBy) Bool

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

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

func (*AlertChannelGroupBy) BoolX

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

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

func (*AlertChannelGroupBy) Bools

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

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

func (*AlertChannelGroupBy) BoolsX

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

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

func (*AlertChannelGroupBy) Float64

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

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

func (*AlertChannelGroupBy) Float64X

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

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

func (*AlertChannelGroupBy) Float64s

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

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

func (*AlertChannelGroupBy) Float64sX

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

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

func (*AlertChannelGroupBy) Int

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

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

func (*AlertChannelGroupBy) IntX

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

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

func (*AlertChannelGroupBy) Ints

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

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

func (*AlertChannelGroupBy) IntsX

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

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

func (*AlertChannelGroupBy) Scan

func (acgb *AlertChannelGroupBy) Scan(ctx context.Context, v any) error

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

func (*AlertChannelGroupBy) ScanX

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

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

func (*AlertChannelGroupBy) String

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

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

func (*AlertChannelGroupBy) StringX

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

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

func (*AlertChannelGroupBy) Strings

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

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

func (*AlertChannelGroupBy) StringsX

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

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

type AlertChannelMutation

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

AlertChannelMutation represents an operation that mutates the AlertChannel nodes in the graph.

func (*AlertChannelMutation) AddField

func (m *AlertChannelMutation) 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 (*AlertChannelMutation) AddMonitorIDs

func (m *AlertChannelMutation) AddMonitorIDs(ids ...string)

AddMonitorIDs adds the "monitors" edge to the Monitor entity by ids.

func (*AlertChannelMutation) AddedEdges

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

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

func (*AlertChannelMutation) AddedField

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

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

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

func (*AlertChannelMutation) AddedIDs

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

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

func (*AlertChannelMutation) AlertChannelType

func (m *AlertChannelMutation) AlertChannelType() (r string, exists bool)

AlertChannelType returns the value of the "alert_channel_type" field in the mutation.

func (*AlertChannelMutation) ClearEdge

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

func (m *AlertChannelMutation) 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 (*AlertChannelMutation) ClearMonitors

func (m *AlertChannelMutation) ClearMonitors()

ClearMonitors clears the "monitors" edge to the Monitor entity.

func (*AlertChannelMutation) ClearedEdges

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

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

func (*AlertChannelMutation) ClearedFields

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

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

func (AlertChannelMutation) Client

func (m AlertChannelMutation) 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 (*AlertChannelMutation) Config

func (m *AlertChannelMutation) Config() (r map[string]interface{}, exists bool)

Config returns the value of the "config" field in the mutation.

func (*AlertChannelMutation) CreatedAt

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

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

func (*AlertChannelMutation) EdgeCleared

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

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

func (*AlertChannelMutation) Field

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

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

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

func (*AlertChannelMutation) Fields

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

func (m *AlertChannelMutation) ID() (id string, 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 (*AlertChannelMutation) IDs

func (m *AlertChannelMutation) IDs(ctx context.Context) ([]string, 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 (*AlertChannelMutation) MonitorsCleared

func (m *AlertChannelMutation) MonitorsCleared() bool

MonitorsCleared reports if the "monitors" edge to the Monitor entity was cleared.

func (*AlertChannelMutation) MonitorsIDs

func (m *AlertChannelMutation) MonitorsIDs() (ids []string)

MonitorsIDs returns the "monitors" edge IDs in the mutation.

func (*AlertChannelMutation) OldAlertChannelType

func (m *AlertChannelMutation) OldAlertChannelType(ctx context.Context) (v string, err error)

OldAlertChannelType returns the old "alert_channel_type" field's value of the AlertChannel entity. If the AlertChannel object wasn'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 (*AlertChannelMutation) OldConfig

func (m *AlertChannelMutation) OldConfig(ctx context.Context) (v map[string]interface{}, err error)

OldConfig returns the old "config" field's value of the AlertChannel entity. If the AlertChannel object wasn'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 (*AlertChannelMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the AlertChannel entity. If the AlertChannel object wasn'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 (*AlertChannelMutation) OldField

func (m *AlertChannelMutation) 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 (*AlertChannelMutation) OldUpdatedAt

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

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

func (m *AlertChannelMutation) Op() Op

Op returns the operation name.

func (*AlertChannelMutation) RemoveMonitorIDs

func (m *AlertChannelMutation) RemoveMonitorIDs(ids ...string)

RemoveMonitorIDs removes the "monitors" edge to the Monitor entity by IDs.

func (*AlertChannelMutation) RemovedEdges

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

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

func (*AlertChannelMutation) RemovedIDs

func (m *AlertChannelMutation) 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 (*AlertChannelMutation) RemovedMonitorsIDs

func (m *AlertChannelMutation) RemovedMonitorsIDs() (ids []string)

RemovedMonitors returns the removed IDs of the "monitors" edge to the Monitor entity.

func (*AlertChannelMutation) ResetAlertChannelType

func (m *AlertChannelMutation) ResetAlertChannelType()

ResetAlertChannelType resets all changes to the "alert_channel_type" field.

func (*AlertChannelMutation) ResetConfig

func (m *AlertChannelMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*AlertChannelMutation) ResetCreatedAt

func (m *AlertChannelMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AlertChannelMutation) ResetEdge

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

func (m *AlertChannelMutation) 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 (*AlertChannelMutation) ResetMonitors

func (m *AlertChannelMutation) ResetMonitors()

ResetMonitors resets all changes to the "monitors" edge.

func (*AlertChannelMutation) ResetUpdatedAt

func (m *AlertChannelMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AlertChannelMutation) SetAlertChannelType

func (m *AlertChannelMutation) SetAlertChannelType(s string)

SetAlertChannelType sets the "alert_channel_type" field.

func (*AlertChannelMutation) SetConfig

func (m *AlertChannelMutation) SetConfig(value map[string]interface{})

SetConfig sets the "config" field.

func (*AlertChannelMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AlertChannelMutation) SetField

func (m *AlertChannelMutation) 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 (*AlertChannelMutation) SetID

func (m *AlertChannelMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of AlertChannel entities.

func (*AlertChannelMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (AlertChannelMutation) Tx

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

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

func (*AlertChannelMutation) Type

func (m *AlertChannelMutation) Type() string

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

func (*AlertChannelMutation) UpdatedAt

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

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

func (*AlertChannelMutation) Where

Where appends a list predicates to the AlertChannelMutation builder.

type AlertChannelQuery

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

AlertChannelQuery is the builder for querying AlertChannel entities.

func (*AlertChannelQuery) Aggregate

func (acq *AlertChannelQuery) Aggregate(fns ...AggregateFunc) *AlertChannelSelect

Aggregate returns a AlertChannelSelect configured with the given aggregations.

func (*AlertChannelQuery) All

func (acq *AlertChannelQuery) All(ctx context.Context) ([]*AlertChannel, error)

All executes the query and returns a list of AlertChannels.

func (*AlertChannelQuery) AllX

func (acq *AlertChannelQuery) AllX(ctx context.Context) []*AlertChannel

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

func (*AlertChannelQuery) Clone

func (acq *AlertChannelQuery) Clone() *AlertChannelQuery

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

func (*AlertChannelQuery) Count

func (acq *AlertChannelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AlertChannelQuery) CountX

func (acq *AlertChannelQuery) CountX(ctx context.Context) int

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

func (*AlertChannelQuery) Exist

func (acq *AlertChannelQuery) Exist(ctx context.Context) (bool, error)

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

func (*AlertChannelQuery) ExistX

func (acq *AlertChannelQuery) ExistX(ctx context.Context) bool

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

func (*AlertChannelQuery) First

func (acq *AlertChannelQuery) First(ctx context.Context) (*AlertChannel, error)

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

func (*AlertChannelQuery) FirstID

func (acq *AlertChannelQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*AlertChannelQuery) FirstIDX

func (acq *AlertChannelQuery) FirstIDX(ctx context.Context) string

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

func (*AlertChannelQuery) FirstX

func (acq *AlertChannelQuery) FirstX(ctx context.Context) *AlertChannel

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

func (*AlertChannelQuery) GroupBy

func (acq *AlertChannelQuery) GroupBy(field string, fields ...string) *AlertChannelGroupBy

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

client.AlertChannel.Query().
	GroupBy(alertchannel.FieldAlertChannelType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AlertChannelQuery) IDs

func (acq *AlertChannelQuery) IDs(ctx context.Context) ([]string, error)

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

func (*AlertChannelQuery) IDsX

func (acq *AlertChannelQuery) IDsX(ctx context.Context) []string

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

func (*AlertChannelQuery) Limit

func (acq *AlertChannelQuery) Limit(limit int) *AlertChannelQuery

Limit adds a limit step to the query.

func (*AlertChannelQuery) Offset

func (acq *AlertChannelQuery) Offset(offset int) *AlertChannelQuery

Offset adds an offset step to the query.

func (*AlertChannelQuery) Only

func (acq *AlertChannelQuery) Only(ctx context.Context) (*AlertChannel, error)

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

func (*AlertChannelQuery) OnlyID

func (acq *AlertChannelQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*AlertChannelQuery) OnlyIDX

func (acq *AlertChannelQuery) OnlyIDX(ctx context.Context) string

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

func (*AlertChannelQuery) OnlyX

func (acq *AlertChannelQuery) OnlyX(ctx context.Context) *AlertChannel

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

func (*AlertChannelQuery) Order

func (acq *AlertChannelQuery) Order(o ...OrderFunc) *AlertChannelQuery

Order adds an order step to the query.

func (*AlertChannelQuery) QueryMonitors

func (acq *AlertChannelQuery) QueryMonitors() *MonitorQuery

QueryMonitors chains the current query on the "monitors" edge.

func (*AlertChannelQuery) Select

func (acq *AlertChannelQuery) Select(fields ...string) *AlertChannelSelect

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 {
	AlertChannelType string `json:"alert_channel_type,omitempty"`
}

client.AlertChannel.Query().
	Select(alertchannel.FieldAlertChannelType).
	Scan(ctx, &v)

func (*AlertChannelQuery) Unique

func (acq *AlertChannelQuery) Unique(unique bool) *AlertChannelQuery

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

Where adds a new predicate for the AlertChannelQuery builder.

func (*AlertChannelQuery) WithMonitors

func (acq *AlertChannelQuery) WithMonitors(opts ...func(*MonitorQuery)) *AlertChannelQuery

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

type AlertChannelSelect

type AlertChannelSelect struct {
	*AlertChannelQuery
	// contains filtered or unexported fields
}

AlertChannelSelect is the builder for selecting fields of AlertChannel entities.

func (*AlertChannelSelect) Aggregate

func (acs *AlertChannelSelect) Aggregate(fns ...AggregateFunc) *AlertChannelSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AlertChannelSelect) Bool

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

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

func (*AlertChannelSelect) BoolX

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

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

func (*AlertChannelSelect) Bools

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

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

func (*AlertChannelSelect) BoolsX

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

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

func (*AlertChannelSelect) Float64

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

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

func (*AlertChannelSelect) Float64X

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

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

func (*AlertChannelSelect) Float64s

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

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

func (*AlertChannelSelect) Float64sX

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

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

func (*AlertChannelSelect) Int

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

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

func (*AlertChannelSelect) IntX

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

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

func (*AlertChannelSelect) Ints

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

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

func (*AlertChannelSelect) IntsX

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

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

func (*AlertChannelSelect) Scan

func (acs *AlertChannelSelect) Scan(ctx context.Context, v any) error

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

func (*AlertChannelSelect) ScanX

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

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

func (*AlertChannelSelect) String

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

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

func (*AlertChannelSelect) StringX

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

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

func (*AlertChannelSelect) Strings

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

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

func (*AlertChannelSelect) StringsX

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

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

type AlertChannelUpdate

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

AlertChannelUpdate is the builder for updating AlertChannel entities.

func (*AlertChannelUpdate) AddMonitorIDs

func (acu *AlertChannelUpdate) AddMonitorIDs(ids ...string) *AlertChannelUpdate

AddMonitorIDs adds the "monitors" edge to the Monitor entity by IDs.

func (*AlertChannelUpdate) AddMonitors

func (acu *AlertChannelUpdate) AddMonitors(m ...*Monitor) *AlertChannelUpdate

AddMonitors adds the "monitors" edges to the Monitor entity.

func (*AlertChannelUpdate) ClearMonitors

func (acu *AlertChannelUpdate) ClearMonitors() *AlertChannelUpdate

ClearMonitors clears all "monitors" edges to the Monitor entity.

func (*AlertChannelUpdate) Exec

func (acu *AlertChannelUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AlertChannelUpdate) ExecX

func (acu *AlertChannelUpdate) ExecX(ctx context.Context)

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

func (*AlertChannelUpdate) Mutation

func (acu *AlertChannelUpdate) Mutation() *AlertChannelMutation

Mutation returns the AlertChannelMutation object of the builder.

func (*AlertChannelUpdate) RemoveMonitorIDs

func (acu *AlertChannelUpdate) RemoveMonitorIDs(ids ...string) *AlertChannelUpdate

RemoveMonitorIDs removes the "monitors" edge to Monitor entities by IDs.

func (*AlertChannelUpdate) RemoveMonitors

func (acu *AlertChannelUpdate) RemoveMonitors(m ...*Monitor) *AlertChannelUpdate

RemoveMonitors removes "monitors" edges to Monitor entities.

func (*AlertChannelUpdate) Save

func (acu *AlertChannelUpdate) Save(ctx context.Context) (int, error)

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

func (*AlertChannelUpdate) SaveX

func (acu *AlertChannelUpdate) SaveX(ctx context.Context) int

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

func (*AlertChannelUpdate) SetConfig

func (acu *AlertChannelUpdate) SetConfig(m map[string]interface{}) *AlertChannelUpdate

SetConfig sets the "config" field.

func (*AlertChannelUpdate) SetCreatedAt

func (acu *AlertChannelUpdate) SetCreatedAt(t time.Time) *AlertChannelUpdate

SetCreatedAt sets the "created_at" field.

func (*AlertChannelUpdate) SetNillableCreatedAt

func (acu *AlertChannelUpdate) SetNillableCreatedAt(t *time.Time) *AlertChannelUpdate

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

func (*AlertChannelUpdate) SetUpdatedAt

func (acu *AlertChannelUpdate) SetUpdatedAt(t time.Time) *AlertChannelUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AlertChannelUpdate) Where

Where appends a list predicates to the AlertChannelUpdate builder.

type AlertChannelUpdateOne

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

AlertChannelUpdateOne is the builder for updating a single AlertChannel entity.

func (*AlertChannelUpdateOne) AddMonitorIDs

func (acuo *AlertChannelUpdateOne) AddMonitorIDs(ids ...string) *AlertChannelUpdateOne

AddMonitorIDs adds the "monitors" edge to the Monitor entity by IDs.

func (*AlertChannelUpdateOne) AddMonitors

func (acuo *AlertChannelUpdateOne) AddMonitors(m ...*Monitor) *AlertChannelUpdateOne

AddMonitors adds the "monitors" edges to the Monitor entity.

func (*AlertChannelUpdateOne) ClearMonitors

func (acuo *AlertChannelUpdateOne) ClearMonitors() *AlertChannelUpdateOne

ClearMonitors clears all "monitors" edges to the Monitor entity.

func (*AlertChannelUpdateOne) Exec

func (acuo *AlertChannelUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AlertChannelUpdateOne) ExecX

func (acuo *AlertChannelUpdateOne) ExecX(ctx context.Context)

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

func (*AlertChannelUpdateOne) Mutation

func (acuo *AlertChannelUpdateOne) Mutation() *AlertChannelMutation

Mutation returns the AlertChannelMutation object of the builder.

func (*AlertChannelUpdateOne) RemoveMonitorIDs

func (acuo *AlertChannelUpdateOne) RemoveMonitorIDs(ids ...string) *AlertChannelUpdateOne

RemoveMonitorIDs removes the "monitors" edge to Monitor entities by IDs.

func (*AlertChannelUpdateOne) RemoveMonitors

func (acuo *AlertChannelUpdateOne) RemoveMonitors(m ...*Monitor) *AlertChannelUpdateOne

RemoveMonitors removes "monitors" edges to Monitor entities.

func (*AlertChannelUpdateOne) Save

Save executes the query and returns the updated AlertChannel entity.

func (*AlertChannelUpdateOne) SaveX

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

func (*AlertChannelUpdateOne) Select

func (acuo *AlertChannelUpdateOne) Select(field string, fields ...string) *AlertChannelUpdateOne

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

func (*AlertChannelUpdateOne) SetConfig

func (acuo *AlertChannelUpdateOne) SetConfig(m map[string]interface{}) *AlertChannelUpdateOne

SetConfig sets the "config" field.

func (*AlertChannelUpdateOne) SetCreatedAt

func (acuo *AlertChannelUpdateOne) SetCreatedAt(t time.Time) *AlertChannelUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AlertChannelUpdateOne) SetNillableCreatedAt

func (acuo *AlertChannelUpdateOne) SetNillableCreatedAt(t *time.Time) *AlertChannelUpdateOne

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

func (*AlertChannelUpdateOne) SetUpdatedAt

func (acuo *AlertChannelUpdateOne) SetUpdatedAt(t time.Time) *AlertChannelUpdateOne

SetUpdatedAt sets the "updated_at" field.

type AlertChannels

type AlertChannels []*AlertChannel

AlertChannels is a parsable slice of AlertChannel.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AlertChannel is the client for interacting with the AlertChannel builders.
	AlertChannel *AlertChannelClient
	// Monitor is the client for interacting with the Monitor builders.
	Monitor *MonitorClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// Sink is the client for interacting with the Sink builders.
	Sink *SinkClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	AlertChannel.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Monitor

type Monitor struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// CurrentDownReason holds the value of the "current_down_reason" field.
	CurrentDownReason string `json:"current_down_reason,omitempty"`
	// Status holds the value of the "status" field.
	Status string `json:"status,omitempty"`
	// LastCheckedAt holds the value of the "last_checked_at" field.
	LastCheckedAt *time.Time `json:"last_checked_at,omitempty"`
	// StatusLastChangedAt holds the value of the "status_last_changed_at" field.
	StatusLastChangedAt time.Time `json:"status_last_changed_at,omitempty"`
	// MonitorType holds the value of the "monitor_type" field.
	MonitorType string `json:"monitor_type,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Config holds the value of the "config" field.
	Config map[string]interface{} `json:"config,omitempty"`
	// IntervalSeconds holds the value of the "interval_seconds" field.
	IntervalSeconds int `json:"interval_seconds,omitempty"`
	// Paused holds the value of the "paused" field.
	Paused bool `json:"paused,omitempty"`
	// FailureCount holds the value of the "failure_count" field.
	FailureCount int `json:"failure_count,omitempty"`
	// SuccessCount holds the value of the "success_count" field.
	SuccessCount int `json:"success_count,omitempty"`
	// SuccessThreshold holds the value of the "success_threshold" field.
	SuccessThreshold int `json:"success_threshold,omitempty"`
	// FailureThreshold holds the value of the "failure_threshold" field.
	FailureThreshold int `json:"failure_threshold,omitempty"`
	// Tags holds the value of the "tags" field.
	Tags []string `json:"tags,omitempty"`
	// Silenced holds the value of the "silenced" field.
	Silenced bool `json:"silenced,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MonitorQuery when eager-loading is set.
	Edges MonitorEdges `json:"edges"`
	// contains filtered or unexported fields
}

Monitor is the model entity for the Monitor schema.

func (*Monitor) QueryAlertChannels

func (m *Monitor) QueryAlertChannels() *AlertChannelQuery

QueryAlertChannels queries the "alert_channels" edge of the Monitor entity.

func (*Monitor) String

func (m *Monitor) String() string

String implements the fmt.Stringer.

func (*Monitor) Unwrap

func (m *Monitor) Unwrap() *Monitor

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

func (m *Monitor) Update() *MonitorUpdateOne

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

type MonitorClient

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

MonitorClient is a client for the Monitor schema.

func NewMonitorClient

func NewMonitorClient(c config) *MonitorClient

NewMonitorClient returns a client for the Monitor from the given config.

func (*MonitorClient) Create

func (c *MonitorClient) Create() *MonitorCreate

Create returns a builder for creating a Monitor entity.

func (*MonitorClient) CreateBulk

func (c *MonitorClient) CreateBulk(builders ...*MonitorCreate) *MonitorCreateBulk

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

func (*MonitorClient) Delete

func (c *MonitorClient) Delete() *MonitorDelete

Delete returns a delete builder for Monitor.

func (*MonitorClient) DeleteOne

func (c *MonitorClient) DeleteOne(m *Monitor) *MonitorDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MonitorClient) DeleteOneID

func (c *MonitorClient) DeleteOneID(id string) *MonitorDeleteOne

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

func (*MonitorClient) Get

func (c *MonitorClient) Get(ctx context.Context, id string) (*Monitor, error)

Get returns a Monitor entity by its id.

func (*MonitorClient) GetX

func (c *MonitorClient) GetX(ctx context.Context, id string) *Monitor

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

func (*MonitorClient) Hooks

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

Hooks returns the client hooks.

func (*MonitorClient) Query

func (c *MonitorClient) Query() *MonitorQuery

Query returns a query builder for Monitor.

func (*MonitorClient) QueryAlertChannels

func (c *MonitorClient) QueryAlertChannels(m *Monitor) *AlertChannelQuery

QueryAlertChannels queries the alert_channels edge of a Monitor.

func (*MonitorClient) Update

func (c *MonitorClient) Update() *MonitorUpdate

Update returns an update builder for Monitor.

func (*MonitorClient) UpdateOne

func (c *MonitorClient) UpdateOne(m *Monitor) *MonitorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MonitorClient) UpdateOneID

func (c *MonitorClient) UpdateOneID(id string) *MonitorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MonitorClient) Use

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

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

type MonitorCreate

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

MonitorCreate is the builder for creating a Monitor entity.

func (*MonitorCreate) AddAlertChannelIDs

func (mc *MonitorCreate) AddAlertChannelIDs(ids ...string) *MonitorCreate

AddAlertChannelIDs adds the "alert_channels" edge to the AlertChannel entity by IDs.

func (*MonitorCreate) AddAlertChannels

func (mc *MonitorCreate) AddAlertChannels(a ...*AlertChannel) *MonitorCreate

AddAlertChannels adds the "alert_channels" edges to the AlertChannel entity.

func (*MonitorCreate) Exec

func (mc *MonitorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MonitorCreate) ExecX

func (mc *MonitorCreate) ExecX(ctx context.Context)

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

func (*MonitorCreate) Mutation

func (mc *MonitorCreate) Mutation() *MonitorMutation

Mutation returns the MonitorMutation object of the builder.

func (*MonitorCreate) Save

func (mc *MonitorCreate) Save(ctx context.Context) (*Monitor, error)

Save creates the Monitor in the database.

func (*MonitorCreate) SaveX

func (mc *MonitorCreate) SaveX(ctx context.Context) *Monitor

SaveX calls Save and panics if Save returns an error.

func (*MonitorCreate) SetConfig

func (mc *MonitorCreate) SetConfig(m map[string]interface{}) *MonitorCreate

SetConfig sets the "config" field.

func (*MonitorCreate) SetCreatedAt

func (mc *MonitorCreate) SetCreatedAt(t time.Time) *MonitorCreate

SetCreatedAt sets the "created_at" field.

func (*MonitorCreate) SetCurrentDownReason

func (mc *MonitorCreate) SetCurrentDownReason(s string) *MonitorCreate

SetCurrentDownReason sets the "current_down_reason" field.

func (*MonitorCreate) SetDescription

func (mc *MonitorCreate) SetDescription(s string) *MonitorCreate

SetDescription sets the "description" field.

func (*MonitorCreate) SetFailureCount

func (mc *MonitorCreate) SetFailureCount(i int) *MonitorCreate

SetFailureCount sets the "failure_count" field.

func (*MonitorCreate) SetFailureThreshold

func (mc *MonitorCreate) SetFailureThreshold(i int) *MonitorCreate

SetFailureThreshold sets the "failure_threshold" field.

func (*MonitorCreate) SetID

func (mc *MonitorCreate) SetID(s string) *MonitorCreate

SetID sets the "id" field.

func (*MonitorCreate) SetIntervalSeconds

func (mc *MonitorCreate) SetIntervalSeconds(i int) *MonitorCreate

SetIntervalSeconds sets the "interval_seconds" field.

func (*MonitorCreate) SetLastCheckedAt

func (mc *MonitorCreate) SetLastCheckedAt(t time.Time) *MonitorCreate

SetLastCheckedAt sets the "last_checked_at" field.

func (*MonitorCreate) SetMonitorType

func (mc *MonitorCreate) SetMonitorType(s string) *MonitorCreate

SetMonitorType sets the "monitor_type" field.

func (*MonitorCreate) SetNillableCreatedAt

func (mc *MonitorCreate) SetNillableCreatedAt(t *time.Time) *MonitorCreate

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

func (*MonitorCreate) SetNillableCurrentDownReason

func (mc *MonitorCreate) SetNillableCurrentDownReason(s *string) *MonitorCreate

SetNillableCurrentDownReason sets the "current_down_reason" field if the given value is not nil.

func (*MonitorCreate) SetNillableDescription

func (mc *MonitorCreate) SetNillableDescription(s *string) *MonitorCreate

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

func (*MonitorCreate) SetNillableFailureCount

func (mc *MonitorCreate) SetNillableFailureCount(i *int) *MonitorCreate

SetNillableFailureCount sets the "failure_count" field if the given value is not nil.

func (*MonitorCreate) SetNillableFailureThreshold

func (mc *MonitorCreate) SetNillableFailureThreshold(i *int) *MonitorCreate

SetNillableFailureThreshold sets the "failure_threshold" field if the given value is not nil.

func (*MonitorCreate) SetNillableIntervalSeconds

func (mc *MonitorCreate) SetNillableIntervalSeconds(i *int) *MonitorCreate

SetNillableIntervalSeconds sets the "interval_seconds" field if the given value is not nil.

func (*MonitorCreate) SetNillableLastCheckedAt

func (mc *MonitorCreate) SetNillableLastCheckedAt(t *time.Time) *MonitorCreate

SetNillableLastCheckedAt sets the "last_checked_at" field if the given value is not nil.

func (*MonitorCreate) SetNillablePaused

func (mc *MonitorCreate) SetNillablePaused(b *bool) *MonitorCreate

SetNillablePaused sets the "paused" field if the given value is not nil.

func (*MonitorCreate) SetNillableSilenced

func (mc *MonitorCreate) SetNillableSilenced(b *bool) *MonitorCreate

SetNillableSilenced sets the "silenced" field if the given value is not nil.

func (*MonitorCreate) SetNillableStatusLastChangedAt

func (mc *MonitorCreate) SetNillableStatusLastChangedAt(t *time.Time) *MonitorCreate

SetNillableStatusLastChangedAt sets the "status_last_changed_at" field if the given value is not nil.

func (*MonitorCreate) SetNillableSuccessCount

func (mc *MonitorCreate) SetNillableSuccessCount(i *int) *MonitorCreate

SetNillableSuccessCount sets the "success_count" field if the given value is not nil.

func (*MonitorCreate) SetNillableSuccessThreshold

func (mc *MonitorCreate) SetNillableSuccessThreshold(i *int) *MonitorCreate

SetNillableSuccessThreshold sets the "success_threshold" field if the given value is not nil.

func (*MonitorCreate) SetNillableUpdatedAt

func (mc *MonitorCreate) SetNillableUpdatedAt(t *time.Time) *MonitorCreate

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

func (*MonitorCreate) SetPaused

func (mc *MonitorCreate) SetPaused(b bool) *MonitorCreate

SetPaused sets the "paused" field.

func (*MonitorCreate) SetSilenced

func (mc *MonitorCreate) SetSilenced(b bool) *MonitorCreate

SetSilenced sets the "silenced" field.

func (*MonitorCreate) SetStatus

func (mc *MonitorCreate) SetStatus(s string) *MonitorCreate

SetStatus sets the "status" field.

func (*MonitorCreate) SetStatusLastChangedAt

func (mc *MonitorCreate) SetStatusLastChangedAt(t time.Time) *MonitorCreate

SetStatusLastChangedAt sets the "status_last_changed_at" field.

func (*MonitorCreate) SetSuccessCount

func (mc *MonitorCreate) SetSuccessCount(i int) *MonitorCreate

SetSuccessCount sets the "success_count" field.

func (*MonitorCreate) SetSuccessThreshold

func (mc *MonitorCreate) SetSuccessThreshold(i int) *MonitorCreate

SetSuccessThreshold sets the "success_threshold" field.

func (*MonitorCreate) SetTags

func (mc *MonitorCreate) SetTags(s []string) *MonitorCreate

SetTags sets the "tags" field.

func (*MonitorCreate) SetUpdatedAt

func (mc *MonitorCreate) SetUpdatedAt(t time.Time) *MonitorCreate

SetUpdatedAt sets the "updated_at" field.

type MonitorCreateBulk

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

MonitorCreateBulk is the builder for creating many Monitor entities in bulk.

func (*MonitorCreateBulk) Exec

func (mcb *MonitorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MonitorCreateBulk) ExecX

func (mcb *MonitorCreateBulk) ExecX(ctx context.Context)

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

func (*MonitorCreateBulk) Save

func (mcb *MonitorCreateBulk) Save(ctx context.Context) ([]*Monitor, error)

Save creates the Monitor entities in the database.

func (*MonitorCreateBulk) SaveX

func (mcb *MonitorCreateBulk) SaveX(ctx context.Context) []*Monitor

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

type MonitorDelete

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

MonitorDelete is the builder for deleting a Monitor entity.

func (*MonitorDelete) Exec

func (md *MonitorDelete) Exec(ctx context.Context) (int, error)

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

func (*MonitorDelete) ExecX

func (md *MonitorDelete) ExecX(ctx context.Context) int

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

func (*MonitorDelete) Where

func (md *MonitorDelete) Where(ps ...predicate.Monitor) *MonitorDelete

Where appends a list predicates to the MonitorDelete builder.

type MonitorDeleteOne

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

MonitorDeleteOne is the builder for deleting a single Monitor entity.

func (*MonitorDeleteOne) Exec

func (mdo *MonitorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MonitorDeleteOne) ExecX

func (mdo *MonitorDeleteOne) ExecX(ctx context.Context)

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

type MonitorEdges

type MonitorEdges struct {
	// AlertChannels holds the value of the alert_channels edge.
	AlertChannels []*AlertChannel `json:"alert_channels,omitempty"`
	// contains filtered or unexported fields
}

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

func (MonitorEdges) AlertChannelsOrErr

func (e MonitorEdges) AlertChannelsOrErr() ([]*AlertChannel, error)

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

type MonitorGroupBy

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

MonitorGroupBy is the group-by builder for Monitor entities.

func (*MonitorGroupBy) Aggregate

func (mgb *MonitorGroupBy) Aggregate(fns ...AggregateFunc) *MonitorGroupBy

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

func (*MonitorGroupBy) Bool

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

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

func (*MonitorGroupBy) BoolX

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

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

func (*MonitorGroupBy) Bools

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

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

func (*MonitorGroupBy) BoolsX

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

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

func (*MonitorGroupBy) Float64

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

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

func (*MonitorGroupBy) Float64X

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

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

func (*MonitorGroupBy) Float64s

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

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

func (*MonitorGroupBy) Float64sX

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

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

func (*MonitorGroupBy) Int

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

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

func (*MonitorGroupBy) IntX

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

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

func (*MonitorGroupBy) Ints

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

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

func (*MonitorGroupBy) IntsX

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

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

func (*MonitorGroupBy) Scan

func (mgb *MonitorGroupBy) Scan(ctx context.Context, v any) error

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

func (*MonitorGroupBy) ScanX

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

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

func (*MonitorGroupBy) String

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

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

func (*MonitorGroupBy) StringX

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

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

func (*MonitorGroupBy) Strings

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

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

func (*MonitorGroupBy) StringsX

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

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

type MonitorMutation

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

MonitorMutation represents an operation that mutates the Monitor nodes in the graph.

func (*MonitorMutation) AddAlertChannelIDs

func (m *MonitorMutation) AddAlertChannelIDs(ids ...string)

AddAlertChannelIDs adds the "alert_channels" edge to the AlertChannel entity by ids.

func (*MonitorMutation) AddFailureCount

func (m *MonitorMutation) AddFailureCount(i int)

AddFailureCount adds i to the "failure_count" field.

func (*MonitorMutation) AddFailureThreshold

func (m *MonitorMutation) AddFailureThreshold(i int)

AddFailureThreshold adds i to the "failure_threshold" field.

func (*MonitorMutation) AddField

func (m *MonitorMutation) 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 (*MonitorMutation) AddIntervalSeconds

func (m *MonitorMutation) AddIntervalSeconds(i int)

AddIntervalSeconds adds i to the "interval_seconds" field.

func (*MonitorMutation) AddSuccessCount

func (m *MonitorMutation) AddSuccessCount(i int)

AddSuccessCount adds i to the "success_count" field.

func (*MonitorMutation) AddSuccessThreshold

func (m *MonitorMutation) AddSuccessThreshold(i int)

AddSuccessThreshold adds i to the "success_threshold" field.

func (*MonitorMutation) AddedEdges

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

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

func (*MonitorMutation) AddedFailureCount

func (m *MonitorMutation) AddedFailureCount() (r int, exists bool)

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

func (*MonitorMutation) AddedFailureThreshold

func (m *MonitorMutation) AddedFailureThreshold() (r int, exists bool)

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

func (*MonitorMutation) AddedField

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

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

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

func (*MonitorMutation) AddedIDs

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

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

func (*MonitorMutation) AddedIntervalSeconds

func (m *MonitorMutation) AddedIntervalSeconds() (r int, exists bool)

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

func (*MonitorMutation) AddedSuccessCount

func (m *MonitorMutation) AddedSuccessCount() (r int, exists bool)

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

func (*MonitorMutation) AddedSuccessThreshold

func (m *MonitorMutation) AddedSuccessThreshold() (r int, exists bool)

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

func (*MonitorMutation) AlertChannelsCleared

func (m *MonitorMutation) AlertChannelsCleared() bool

AlertChannelsCleared reports if the "alert_channels" edge to the AlertChannel entity was cleared.

func (*MonitorMutation) AlertChannelsIDs

func (m *MonitorMutation) AlertChannelsIDs() (ids []string)

AlertChannelsIDs returns the "alert_channels" edge IDs in the mutation.

func (*MonitorMutation) AppendTags

func (m *MonitorMutation) AppendTags(s []string)

AppendTags adds s to the "tags" field.

func (*MonitorMutation) AppendedTags

func (m *MonitorMutation) AppendedTags() ([]string, bool)

AppendedTags returns the list of values that were appended to the "tags" field in this mutation.

func (*MonitorMutation) ClearAlertChannels

func (m *MonitorMutation) ClearAlertChannels()

ClearAlertChannels clears the "alert_channels" edge to the AlertChannel entity.

func (*MonitorMutation) ClearEdge

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

func (m *MonitorMutation) 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 (*MonitorMutation) ClearLastCheckedAt

func (m *MonitorMutation) ClearLastCheckedAt()

ClearLastCheckedAt clears the value of the "last_checked_at" field.

func (*MonitorMutation) ClearTags

func (m *MonitorMutation) ClearTags()

ClearTags clears the value of the "tags" field.

func (*MonitorMutation) ClearedEdges

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

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

func (*MonitorMutation) ClearedFields

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

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

func (MonitorMutation) Client

func (m MonitorMutation) 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 (*MonitorMutation) Config

func (m *MonitorMutation) Config() (r map[string]interface{}, exists bool)

Config returns the value of the "config" field in the mutation.

func (*MonitorMutation) CreatedAt

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

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

func (*MonitorMutation) CurrentDownReason

func (m *MonitorMutation) CurrentDownReason() (r string, exists bool)

CurrentDownReason returns the value of the "current_down_reason" field in the mutation.

func (*MonitorMutation) Description

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

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

func (*MonitorMutation) EdgeCleared

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

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

func (*MonitorMutation) FailureCount

func (m *MonitorMutation) FailureCount() (r int, exists bool)

FailureCount returns the value of the "failure_count" field in the mutation.

func (*MonitorMutation) FailureThreshold

func (m *MonitorMutation) FailureThreshold() (r int, exists bool)

FailureThreshold returns the value of the "failure_threshold" field in the mutation.

func (*MonitorMutation) Field

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

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

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

func (*MonitorMutation) Fields

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

func (m *MonitorMutation) ID() (id string, 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 (*MonitorMutation) IDs

func (m *MonitorMutation) IDs(ctx context.Context) ([]string, 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 (*MonitorMutation) IntervalSeconds

func (m *MonitorMutation) IntervalSeconds() (r int, exists bool)

IntervalSeconds returns the value of the "interval_seconds" field in the mutation.

func (*MonitorMutation) LastCheckedAt

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

LastCheckedAt returns the value of the "last_checked_at" field in the mutation.

func (*MonitorMutation) LastCheckedAtCleared

func (m *MonitorMutation) LastCheckedAtCleared() bool

LastCheckedAtCleared returns if the "last_checked_at" field was cleared in this mutation.

func (*MonitorMutation) MonitorType

func (m *MonitorMutation) MonitorType() (r string, exists bool)

MonitorType returns the value of the "monitor_type" field in the mutation.

func (*MonitorMutation) OldConfig

func (m *MonitorMutation) OldConfig(ctx context.Context) (v map[string]interface{}, err error)

OldConfig returns the old "config" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldCurrentDownReason

func (m *MonitorMutation) OldCurrentDownReason(ctx context.Context) (v string, err error)

OldCurrentDownReason returns the old "current_down_reason" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldDescription

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

OldDescription returns the old "description" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldFailureCount

func (m *MonitorMutation) OldFailureCount(ctx context.Context) (v int, err error)

OldFailureCount returns the old "failure_count" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldFailureThreshold

func (m *MonitorMutation) OldFailureThreshold(ctx context.Context) (v int, err error)

OldFailureThreshold returns the old "failure_threshold" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldField

func (m *MonitorMutation) 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 (*MonitorMutation) OldIntervalSeconds

func (m *MonitorMutation) OldIntervalSeconds(ctx context.Context) (v int, err error)

OldIntervalSeconds returns the old "interval_seconds" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldLastCheckedAt

func (m *MonitorMutation) OldLastCheckedAt(ctx context.Context) (v *time.Time, err error)

OldLastCheckedAt returns the old "last_checked_at" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldMonitorType

func (m *MonitorMutation) OldMonitorType(ctx context.Context) (v string, err error)

OldMonitorType returns the old "monitor_type" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldPaused

func (m *MonitorMutation) OldPaused(ctx context.Context) (v bool, err error)

OldPaused returns the old "paused" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldSilenced

func (m *MonitorMutation) OldSilenced(ctx context.Context) (v bool, err error)

OldSilenced returns the old "silenced" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldStatus

func (m *MonitorMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old "status" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldStatusLastChangedAt

func (m *MonitorMutation) OldStatusLastChangedAt(ctx context.Context) (v time.Time, err error)

OldStatusLastChangedAt returns the old "status_last_changed_at" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldSuccessCount

func (m *MonitorMutation) OldSuccessCount(ctx context.Context) (v int, err error)

OldSuccessCount returns the old "success_count" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldSuccessThreshold

func (m *MonitorMutation) OldSuccessThreshold(ctx context.Context) (v int, err error)

OldSuccessThreshold returns the old "success_threshold" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldTags

func (m *MonitorMutation) OldTags(ctx context.Context) (v []string, err error)

OldTags returns the old "tags" field's value of the Monitor entity. If the Monitor object wasn'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 (*MonitorMutation) OldUpdatedAt

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

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

func (m *MonitorMutation) Op() Op

Op returns the operation name.

func (*MonitorMutation) Paused

func (m *MonitorMutation) Paused() (r bool, exists bool)

Paused returns the value of the "paused" field in the mutation.

func (*MonitorMutation) RemoveAlertChannelIDs

func (m *MonitorMutation) RemoveAlertChannelIDs(ids ...string)

RemoveAlertChannelIDs removes the "alert_channels" edge to the AlertChannel entity by IDs.

func (*MonitorMutation) RemovedAlertChannelsIDs

func (m *MonitorMutation) RemovedAlertChannelsIDs() (ids []string)

RemovedAlertChannels returns the removed IDs of the "alert_channels" edge to the AlertChannel entity.

func (*MonitorMutation) RemovedEdges

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

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

func (*MonitorMutation) RemovedIDs

func (m *MonitorMutation) 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 (*MonitorMutation) ResetAlertChannels

func (m *MonitorMutation) ResetAlertChannels()

ResetAlertChannels resets all changes to the "alert_channels" edge.

func (*MonitorMutation) ResetConfig

func (m *MonitorMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*MonitorMutation) ResetCreatedAt

func (m *MonitorMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MonitorMutation) ResetCurrentDownReason

func (m *MonitorMutation) ResetCurrentDownReason()

ResetCurrentDownReason resets all changes to the "current_down_reason" field.

func (*MonitorMutation) ResetDescription

func (m *MonitorMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MonitorMutation) ResetEdge

func (m *MonitorMutation) 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 (*MonitorMutation) ResetFailureCount

func (m *MonitorMutation) ResetFailureCount()

ResetFailureCount resets all changes to the "failure_count" field.

func (*MonitorMutation) ResetFailureThreshold

func (m *MonitorMutation) ResetFailureThreshold()

ResetFailureThreshold resets all changes to the "failure_threshold" field.

func (*MonitorMutation) ResetField

func (m *MonitorMutation) 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 (*MonitorMutation) ResetIntervalSeconds

func (m *MonitorMutation) ResetIntervalSeconds()

ResetIntervalSeconds resets all changes to the "interval_seconds" field.

func (*MonitorMutation) ResetLastCheckedAt

func (m *MonitorMutation) ResetLastCheckedAt()

ResetLastCheckedAt resets all changes to the "last_checked_at" field.

func (*MonitorMutation) ResetMonitorType

func (m *MonitorMutation) ResetMonitorType()

ResetMonitorType resets all changes to the "monitor_type" field.

func (*MonitorMutation) ResetPaused

func (m *MonitorMutation) ResetPaused()

ResetPaused resets all changes to the "paused" field.

func (*MonitorMutation) ResetSilenced

func (m *MonitorMutation) ResetSilenced()

ResetSilenced resets all changes to the "silenced" field.

func (*MonitorMutation) ResetStatus

func (m *MonitorMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*MonitorMutation) ResetStatusLastChangedAt

func (m *MonitorMutation) ResetStatusLastChangedAt()

ResetStatusLastChangedAt resets all changes to the "status_last_changed_at" field.

func (*MonitorMutation) ResetSuccessCount

func (m *MonitorMutation) ResetSuccessCount()

ResetSuccessCount resets all changes to the "success_count" field.

func (*MonitorMutation) ResetSuccessThreshold

func (m *MonitorMutation) ResetSuccessThreshold()

ResetSuccessThreshold resets all changes to the "success_threshold" field.

func (*MonitorMutation) ResetTags

func (m *MonitorMutation) ResetTags()

ResetTags resets all changes to the "tags" field.

func (*MonitorMutation) ResetUpdatedAt

func (m *MonitorMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MonitorMutation) SetConfig

func (m *MonitorMutation) SetConfig(value map[string]interface{})

SetConfig sets the "config" field.

func (*MonitorMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MonitorMutation) SetCurrentDownReason

func (m *MonitorMutation) SetCurrentDownReason(s string)

SetCurrentDownReason sets the "current_down_reason" field.

func (*MonitorMutation) SetDescription

func (m *MonitorMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MonitorMutation) SetFailureCount

func (m *MonitorMutation) SetFailureCount(i int)

SetFailureCount sets the "failure_count" field.

func (*MonitorMutation) SetFailureThreshold

func (m *MonitorMutation) SetFailureThreshold(i int)

SetFailureThreshold sets the "failure_threshold" field.

func (*MonitorMutation) SetField

func (m *MonitorMutation) 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 (*MonitorMutation) SetID

func (m *MonitorMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Monitor entities.

func (*MonitorMutation) SetIntervalSeconds

func (m *MonitorMutation) SetIntervalSeconds(i int)

SetIntervalSeconds sets the "interval_seconds" field.

func (*MonitorMutation) SetLastCheckedAt

func (m *MonitorMutation) SetLastCheckedAt(t time.Time)

SetLastCheckedAt sets the "last_checked_at" field.

func (*MonitorMutation) SetMonitorType

func (m *MonitorMutation) SetMonitorType(s string)

SetMonitorType sets the "monitor_type" field.

func (*MonitorMutation) SetPaused

func (m *MonitorMutation) SetPaused(b bool)

SetPaused sets the "paused" field.

func (*MonitorMutation) SetSilenced

func (m *MonitorMutation) SetSilenced(b bool)

SetSilenced sets the "silenced" field.

func (*MonitorMutation) SetStatus

func (m *MonitorMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*MonitorMutation) SetStatusLastChangedAt

func (m *MonitorMutation) SetStatusLastChangedAt(t time.Time)

SetStatusLastChangedAt sets the "status_last_changed_at" field.

func (*MonitorMutation) SetSuccessCount

func (m *MonitorMutation) SetSuccessCount(i int)

SetSuccessCount sets the "success_count" field.

func (*MonitorMutation) SetSuccessThreshold

func (m *MonitorMutation) SetSuccessThreshold(i int)

SetSuccessThreshold sets the "success_threshold" field.

func (*MonitorMutation) SetTags

func (m *MonitorMutation) SetTags(s []string)

SetTags sets the "tags" field.

func (*MonitorMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*MonitorMutation) Silenced

func (m *MonitorMutation) Silenced() (r bool, exists bool)

Silenced returns the value of the "silenced" field in the mutation.

func (*MonitorMutation) Status

func (m *MonitorMutation) Status() (r string, exists bool)

Status returns the value of the "status" field in the mutation.

func (*MonitorMutation) StatusLastChangedAt

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

StatusLastChangedAt returns the value of the "status_last_changed_at" field in the mutation.

func (*MonitorMutation) SuccessCount

func (m *MonitorMutation) SuccessCount() (r int, exists bool)

SuccessCount returns the value of the "success_count" field in the mutation.

func (*MonitorMutation) SuccessThreshold

func (m *MonitorMutation) SuccessThreshold() (r int, exists bool)

SuccessThreshold returns the value of the "success_threshold" field in the mutation.

func (*MonitorMutation) Tags

func (m *MonitorMutation) Tags() (r []string, exists bool)

Tags returns the value of the "tags" field in the mutation.

func (*MonitorMutation) TagsCleared

func (m *MonitorMutation) TagsCleared() bool

TagsCleared returns if the "tags" field was cleared in this mutation.

func (MonitorMutation) Tx

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

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

func (*MonitorMutation) Type

func (m *MonitorMutation) Type() string

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

func (*MonitorMutation) UpdatedAt

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

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

func (*MonitorMutation) Where

func (m *MonitorMutation) Where(ps ...predicate.Monitor)

Where appends a list predicates to the MonitorMutation builder.

type MonitorQuery

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

MonitorQuery is the builder for querying Monitor entities.

func (*MonitorQuery) Aggregate

func (mq *MonitorQuery) Aggregate(fns ...AggregateFunc) *MonitorSelect

Aggregate returns a MonitorSelect configured with the given aggregations.

func (*MonitorQuery) All

func (mq *MonitorQuery) All(ctx context.Context) ([]*Monitor, error)

All executes the query and returns a list of Monitors.

func (*MonitorQuery) AllX

func (mq *MonitorQuery) AllX(ctx context.Context) []*Monitor

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

func (*MonitorQuery) Clone

func (mq *MonitorQuery) Clone() *MonitorQuery

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

func (*MonitorQuery) Count

func (mq *MonitorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MonitorQuery) CountX

func (mq *MonitorQuery) CountX(ctx context.Context) int

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

func (*MonitorQuery) Exist

func (mq *MonitorQuery) Exist(ctx context.Context) (bool, error)

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

func (*MonitorQuery) ExistX

func (mq *MonitorQuery) ExistX(ctx context.Context) bool

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

func (*MonitorQuery) First

func (mq *MonitorQuery) First(ctx context.Context) (*Monitor, error)

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

func (*MonitorQuery) FirstID

func (mq *MonitorQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*MonitorQuery) FirstIDX

func (mq *MonitorQuery) FirstIDX(ctx context.Context) string

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

func (*MonitorQuery) FirstX

func (mq *MonitorQuery) FirstX(ctx context.Context) *Monitor

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

func (*MonitorQuery) GroupBy

func (mq *MonitorQuery) GroupBy(field string, fields ...string) *MonitorGroupBy

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

client.Monitor.Query().
	GroupBy(monitor.FieldDescription).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MonitorQuery) IDs

func (mq *MonitorQuery) IDs(ctx context.Context) ([]string, error)

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

func (*MonitorQuery) IDsX

func (mq *MonitorQuery) IDsX(ctx context.Context) []string

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

func (*MonitorQuery) Limit

func (mq *MonitorQuery) Limit(limit int) *MonitorQuery

Limit adds a limit step to the query.

func (*MonitorQuery) Offset

func (mq *MonitorQuery) Offset(offset int) *MonitorQuery

Offset adds an offset step to the query.

func (*MonitorQuery) Only

func (mq *MonitorQuery) Only(ctx context.Context) (*Monitor, error)

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

func (*MonitorQuery) OnlyID

func (mq *MonitorQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*MonitorQuery) OnlyIDX

func (mq *MonitorQuery) OnlyIDX(ctx context.Context) string

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

func (*MonitorQuery) OnlyX

func (mq *MonitorQuery) OnlyX(ctx context.Context) *Monitor

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

func (*MonitorQuery) Order

func (mq *MonitorQuery) Order(o ...OrderFunc) *MonitorQuery

Order adds an order step to the query.

func (*MonitorQuery) QueryAlertChannels

func (mq *MonitorQuery) QueryAlertChannels() *AlertChannelQuery

QueryAlertChannels chains the current query on the "alert_channels" edge.

func (*MonitorQuery) Select

func (mq *MonitorQuery) Select(fields ...string) *MonitorSelect

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 {
	Description string `json:"description,omitempty"`
}

client.Monitor.Query().
	Select(monitor.FieldDescription).
	Scan(ctx, &v)

func (*MonitorQuery) Unique

func (mq *MonitorQuery) Unique(unique bool) *MonitorQuery

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

func (mq *MonitorQuery) Where(ps ...predicate.Monitor) *MonitorQuery

Where adds a new predicate for the MonitorQuery builder.

func (*MonitorQuery) WithAlertChannels

func (mq *MonitorQuery) WithAlertChannels(opts ...func(*AlertChannelQuery)) *MonitorQuery

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

type MonitorSelect

type MonitorSelect struct {
	*MonitorQuery
	// contains filtered or unexported fields
}

MonitorSelect is the builder for selecting fields of Monitor entities.

func (*MonitorSelect) Aggregate

func (ms *MonitorSelect) Aggregate(fns ...AggregateFunc) *MonitorSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MonitorSelect) Bool

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

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

func (*MonitorSelect) BoolX

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

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

func (*MonitorSelect) Bools

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

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

func (*MonitorSelect) BoolsX

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

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

func (*MonitorSelect) Float64

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

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

func (*MonitorSelect) Float64X

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

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

func (*MonitorSelect) Float64s

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

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

func (*MonitorSelect) Float64sX

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

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

func (*MonitorSelect) Int

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

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

func (*MonitorSelect) IntX

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

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

func (*MonitorSelect) Ints

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

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

func (*MonitorSelect) IntsX

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

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

func (*MonitorSelect) Scan

func (ms *MonitorSelect) Scan(ctx context.Context, v any) error

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

func (*MonitorSelect) ScanX

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

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

func (*MonitorSelect) String

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

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

func (*MonitorSelect) StringX

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

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

func (*MonitorSelect) Strings

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

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

func (*MonitorSelect) StringsX

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

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

type MonitorUpdate

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

MonitorUpdate is the builder for updating Monitor entities.

func (*MonitorUpdate) AddAlertChannelIDs

func (mu *MonitorUpdate) AddAlertChannelIDs(ids ...string) *MonitorUpdate

AddAlertChannelIDs adds the "alert_channels" edge to the AlertChannel entity by IDs.

func (*MonitorUpdate) AddAlertChannels

func (mu *MonitorUpdate) AddAlertChannels(a ...*AlertChannel) *MonitorUpdate

AddAlertChannels adds the "alert_channels" edges to the AlertChannel entity.

func (*MonitorUpdate) AddFailureCount

func (mu *MonitorUpdate) AddFailureCount(i int) *MonitorUpdate

AddFailureCount adds i to the "failure_count" field.

func (*MonitorUpdate) AddFailureThreshold

func (mu *MonitorUpdate) AddFailureThreshold(i int) *MonitorUpdate

AddFailureThreshold adds i to the "failure_threshold" field.

func (*MonitorUpdate) AddIntervalSeconds

func (mu *MonitorUpdate) AddIntervalSeconds(i int) *MonitorUpdate

AddIntervalSeconds adds i to the "interval_seconds" field.

func (*MonitorUpdate) AddSuccessCount

func (mu *MonitorUpdate) AddSuccessCount(i int) *MonitorUpdate

AddSuccessCount adds i to the "success_count" field.

func (*MonitorUpdate) AddSuccessThreshold

func (mu *MonitorUpdate) AddSuccessThreshold(i int) *MonitorUpdate

AddSuccessThreshold adds i to the "success_threshold" field.

func (*MonitorUpdate) AppendTags

func (mu *MonitorUpdate) AppendTags(s []string) *MonitorUpdate

AppendTags appends s to the "tags" field.

func (*MonitorUpdate) ClearAlertChannels

func (mu *MonitorUpdate) ClearAlertChannels() *MonitorUpdate

ClearAlertChannels clears all "alert_channels" edges to the AlertChannel entity.

func (*MonitorUpdate) ClearLastCheckedAt

func (mu *MonitorUpdate) ClearLastCheckedAt() *MonitorUpdate

ClearLastCheckedAt clears the value of the "last_checked_at" field.

func (*MonitorUpdate) ClearTags

func (mu *MonitorUpdate) ClearTags() *MonitorUpdate

ClearTags clears the value of the "tags" field.

func (*MonitorUpdate) Exec

func (mu *MonitorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MonitorUpdate) ExecX

func (mu *MonitorUpdate) ExecX(ctx context.Context)

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

func (*MonitorUpdate) Mutation

func (mu *MonitorUpdate) Mutation() *MonitorMutation

Mutation returns the MonitorMutation object of the builder.

func (*MonitorUpdate) RemoveAlertChannelIDs

func (mu *MonitorUpdate) RemoveAlertChannelIDs(ids ...string) *MonitorUpdate

RemoveAlertChannelIDs removes the "alert_channels" edge to AlertChannel entities by IDs.

func (*MonitorUpdate) RemoveAlertChannels

func (mu *MonitorUpdate) RemoveAlertChannels(a ...*AlertChannel) *MonitorUpdate

RemoveAlertChannels removes "alert_channels" edges to AlertChannel entities.

func (*MonitorUpdate) Save

func (mu *MonitorUpdate) Save(ctx context.Context) (int, error)

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

func (*MonitorUpdate) SaveX

func (mu *MonitorUpdate) SaveX(ctx context.Context) int

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

func (*MonitorUpdate) SetConfig

func (mu *MonitorUpdate) SetConfig(m map[string]interface{}) *MonitorUpdate

SetConfig sets the "config" field.

func (*MonitorUpdate) SetCreatedAt

func (mu *MonitorUpdate) SetCreatedAt(t time.Time) *MonitorUpdate

SetCreatedAt sets the "created_at" field.

func (*MonitorUpdate) SetCurrentDownReason

func (mu *MonitorUpdate) SetCurrentDownReason(s string) *MonitorUpdate

SetCurrentDownReason sets the "current_down_reason" field.

func (*MonitorUpdate) SetDescription

func (mu *MonitorUpdate) SetDescription(s string) *MonitorUpdate

SetDescription sets the "description" field.

func (*MonitorUpdate) SetFailureCount

func (mu *MonitorUpdate) SetFailureCount(i int) *MonitorUpdate

SetFailureCount sets the "failure_count" field.

func (*MonitorUpdate) SetFailureThreshold

func (mu *MonitorUpdate) SetFailureThreshold(i int) *MonitorUpdate

SetFailureThreshold sets the "failure_threshold" field.

func (*MonitorUpdate) SetIntervalSeconds

func (mu *MonitorUpdate) SetIntervalSeconds(i int) *MonitorUpdate

SetIntervalSeconds sets the "interval_seconds" field.

func (*MonitorUpdate) SetLastCheckedAt

func (mu *MonitorUpdate) SetLastCheckedAt(t time.Time) *MonitorUpdate

SetLastCheckedAt sets the "last_checked_at" field.

func (*MonitorUpdate) SetNillableCreatedAt

func (mu *MonitorUpdate) SetNillableCreatedAt(t *time.Time) *MonitorUpdate

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

func (*MonitorUpdate) SetNillableCurrentDownReason

func (mu *MonitorUpdate) SetNillableCurrentDownReason(s *string) *MonitorUpdate

SetNillableCurrentDownReason sets the "current_down_reason" field if the given value is not nil.

func (*MonitorUpdate) SetNillableDescription

func (mu *MonitorUpdate) SetNillableDescription(s *string) *MonitorUpdate

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

func (*MonitorUpdate) SetNillableFailureCount

func (mu *MonitorUpdate) SetNillableFailureCount(i *int) *MonitorUpdate

SetNillableFailureCount sets the "failure_count" field if the given value is not nil.

func (*MonitorUpdate) SetNillableFailureThreshold

func (mu *MonitorUpdate) SetNillableFailureThreshold(i *int) *MonitorUpdate

SetNillableFailureThreshold sets the "failure_threshold" field if the given value is not nil.

func (*MonitorUpdate) SetNillableIntervalSeconds

func (mu *MonitorUpdate) SetNillableIntervalSeconds(i *int) *MonitorUpdate

SetNillableIntervalSeconds sets the "interval_seconds" field if the given value is not nil.

func (*MonitorUpdate) SetNillableLastCheckedAt

func (mu *MonitorUpdate) SetNillableLastCheckedAt(t *time.Time) *MonitorUpdate

SetNillableLastCheckedAt sets the "last_checked_at" field if the given value is not nil.

func (*MonitorUpdate) SetNillablePaused

func (mu *MonitorUpdate) SetNillablePaused(b *bool) *MonitorUpdate

SetNillablePaused sets the "paused" field if the given value is not nil.

func (*MonitorUpdate) SetNillableSilenced

func (mu *MonitorUpdate) SetNillableSilenced(b *bool) *MonitorUpdate

SetNillableSilenced sets the "silenced" field if the given value is not nil.

func (*MonitorUpdate) SetNillableStatusLastChangedAt

func (mu *MonitorUpdate) SetNillableStatusLastChangedAt(t *time.Time) *MonitorUpdate

SetNillableStatusLastChangedAt sets the "status_last_changed_at" field if the given value is not nil.

func (*MonitorUpdate) SetNillableSuccessCount

func (mu *MonitorUpdate) SetNillableSuccessCount(i *int) *MonitorUpdate

SetNillableSuccessCount sets the "success_count" field if the given value is not nil.

func (*MonitorUpdate) SetNillableSuccessThreshold

func (mu *MonitorUpdate) SetNillableSuccessThreshold(i *int) *MonitorUpdate

SetNillableSuccessThreshold sets the "success_threshold" field if the given value is not nil.

func (*MonitorUpdate) SetPaused

func (mu *MonitorUpdate) SetPaused(b bool) *MonitorUpdate

SetPaused sets the "paused" field.

func (*MonitorUpdate) SetSilenced

func (mu *MonitorUpdate) SetSilenced(b bool) *MonitorUpdate

SetSilenced sets the "silenced" field.

func (*MonitorUpdate) SetStatus

func (mu *MonitorUpdate) SetStatus(s string) *MonitorUpdate

SetStatus sets the "status" field.

func (*MonitorUpdate) SetStatusLastChangedAt

func (mu *MonitorUpdate) SetStatusLastChangedAt(t time.Time) *MonitorUpdate

SetStatusLastChangedAt sets the "status_last_changed_at" field.

func (*MonitorUpdate) SetSuccessCount

func (mu *MonitorUpdate) SetSuccessCount(i int) *MonitorUpdate

SetSuccessCount sets the "success_count" field.

func (*MonitorUpdate) SetSuccessThreshold

func (mu *MonitorUpdate) SetSuccessThreshold(i int) *MonitorUpdate

SetSuccessThreshold sets the "success_threshold" field.

func (*MonitorUpdate) SetTags

func (mu *MonitorUpdate) SetTags(s []string) *MonitorUpdate

SetTags sets the "tags" field.

func (*MonitorUpdate) SetUpdatedAt

func (mu *MonitorUpdate) SetUpdatedAt(t time.Time) *MonitorUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MonitorUpdate) Where

func (mu *MonitorUpdate) Where(ps ...predicate.Monitor) *MonitorUpdate

Where appends a list predicates to the MonitorUpdate builder.

type MonitorUpdateOne

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

MonitorUpdateOne is the builder for updating a single Monitor entity.

func (*MonitorUpdateOne) AddAlertChannelIDs

func (muo *MonitorUpdateOne) AddAlertChannelIDs(ids ...string) *MonitorUpdateOne

AddAlertChannelIDs adds the "alert_channels" edge to the AlertChannel entity by IDs.

func (*MonitorUpdateOne) AddAlertChannels

func (muo *MonitorUpdateOne) AddAlertChannels(a ...*AlertChannel) *MonitorUpdateOne

AddAlertChannels adds the "alert_channels" edges to the AlertChannel entity.

func (*MonitorUpdateOne) AddFailureCount

func (muo *MonitorUpdateOne) AddFailureCount(i int) *MonitorUpdateOne

AddFailureCount adds i to the "failure_count" field.

func (*MonitorUpdateOne) AddFailureThreshold

func (muo *MonitorUpdateOne) AddFailureThreshold(i int) *MonitorUpdateOne

AddFailureThreshold adds i to the "failure_threshold" field.

func (*MonitorUpdateOne) AddIntervalSeconds

func (muo *MonitorUpdateOne) AddIntervalSeconds(i int) *MonitorUpdateOne

AddIntervalSeconds adds i to the "interval_seconds" field.

func (*MonitorUpdateOne) AddSuccessCount

func (muo *MonitorUpdateOne) AddSuccessCount(i int) *MonitorUpdateOne

AddSuccessCount adds i to the "success_count" field.

func (*MonitorUpdateOne) AddSuccessThreshold

func (muo *MonitorUpdateOne) AddSuccessThreshold(i int) *MonitorUpdateOne

AddSuccessThreshold adds i to the "success_threshold" field.

func (*MonitorUpdateOne) AppendTags

func (muo *MonitorUpdateOne) AppendTags(s []string) *MonitorUpdateOne

AppendTags appends s to the "tags" field.

func (*MonitorUpdateOne) ClearAlertChannels

func (muo *MonitorUpdateOne) ClearAlertChannels() *MonitorUpdateOne

ClearAlertChannels clears all "alert_channels" edges to the AlertChannel entity.

func (*MonitorUpdateOne) ClearLastCheckedAt

func (muo *MonitorUpdateOne) ClearLastCheckedAt() *MonitorUpdateOne

ClearLastCheckedAt clears the value of the "last_checked_at" field.

func (*MonitorUpdateOne) ClearTags

func (muo *MonitorUpdateOne) ClearTags() *MonitorUpdateOne

ClearTags clears the value of the "tags" field.

func (*MonitorUpdateOne) Exec

func (muo *MonitorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MonitorUpdateOne) ExecX

func (muo *MonitorUpdateOne) ExecX(ctx context.Context)

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

func (*MonitorUpdateOne) Mutation

func (muo *MonitorUpdateOne) Mutation() *MonitorMutation

Mutation returns the MonitorMutation object of the builder.

func (*MonitorUpdateOne) RemoveAlertChannelIDs

func (muo *MonitorUpdateOne) RemoveAlertChannelIDs(ids ...string) *MonitorUpdateOne

RemoveAlertChannelIDs removes the "alert_channels" edge to AlertChannel entities by IDs.

func (*MonitorUpdateOne) RemoveAlertChannels

func (muo *MonitorUpdateOne) RemoveAlertChannels(a ...*AlertChannel) *MonitorUpdateOne

RemoveAlertChannels removes "alert_channels" edges to AlertChannel entities.

func (*MonitorUpdateOne) Save

func (muo *MonitorUpdateOne) Save(ctx context.Context) (*Monitor, error)

Save executes the query and returns the updated Monitor entity.

func (*MonitorUpdateOne) SaveX

func (muo *MonitorUpdateOne) SaveX(ctx context.Context) *Monitor

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

func (*MonitorUpdateOne) Select

func (muo *MonitorUpdateOne) Select(field string, fields ...string) *MonitorUpdateOne

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

func (*MonitorUpdateOne) SetConfig

func (muo *MonitorUpdateOne) SetConfig(m map[string]interface{}) *MonitorUpdateOne

SetConfig sets the "config" field.

func (*MonitorUpdateOne) SetCreatedAt

func (muo *MonitorUpdateOne) SetCreatedAt(t time.Time) *MonitorUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MonitorUpdateOne) SetCurrentDownReason

func (muo *MonitorUpdateOne) SetCurrentDownReason(s string) *MonitorUpdateOne

SetCurrentDownReason sets the "current_down_reason" field.

func (*MonitorUpdateOne) SetDescription

func (muo *MonitorUpdateOne) SetDescription(s string) *MonitorUpdateOne

SetDescription sets the "description" field.

func (*MonitorUpdateOne) SetFailureCount

func (muo *MonitorUpdateOne) SetFailureCount(i int) *MonitorUpdateOne

SetFailureCount sets the "failure_count" field.

func (*MonitorUpdateOne) SetFailureThreshold

func (muo *MonitorUpdateOne) SetFailureThreshold(i int) *MonitorUpdateOne

SetFailureThreshold sets the "failure_threshold" field.

func (*MonitorUpdateOne) SetIntervalSeconds

func (muo *MonitorUpdateOne) SetIntervalSeconds(i int) *MonitorUpdateOne

SetIntervalSeconds sets the "interval_seconds" field.

func (*MonitorUpdateOne) SetLastCheckedAt

func (muo *MonitorUpdateOne) SetLastCheckedAt(t time.Time) *MonitorUpdateOne

SetLastCheckedAt sets the "last_checked_at" field.

func (*MonitorUpdateOne) SetNillableCreatedAt

func (muo *MonitorUpdateOne) SetNillableCreatedAt(t *time.Time) *MonitorUpdateOne

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

func (*MonitorUpdateOne) SetNillableCurrentDownReason

func (muo *MonitorUpdateOne) SetNillableCurrentDownReason(s *string) *MonitorUpdateOne

SetNillableCurrentDownReason sets the "current_down_reason" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableDescription

func (muo *MonitorUpdateOne) SetNillableDescription(s *string) *MonitorUpdateOne

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

func (*MonitorUpdateOne) SetNillableFailureCount

func (muo *MonitorUpdateOne) SetNillableFailureCount(i *int) *MonitorUpdateOne

SetNillableFailureCount sets the "failure_count" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableFailureThreshold

func (muo *MonitorUpdateOne) SetNillableFailureThreshold(i *int) *MonitorUpdateOne

SetNillableFailureThreshold sets the "failure_threshold" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableIntervalSeconds

func (muo *MonitorUpdateOne) SetNillableIntervalSeconds(i *int) *MonitorUpdateOne

SetNillableIntervalSeconds sets the "interval_seconds" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableLastCheckedAt

func (muo *MonitorUpdateOne) SetNillableLastCheckedAt(t *time.Time) *MonitorUpdateOne

SetNillableLastCheckedAt sets the "last_checked_at" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillablePaused

func (muo *MonitorUpdateOne) SetNillablePaused(b *bool) *MonitorUpdateOne

SetNillablePaused sets the "paused" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableSilenced

func (muo *MonitorUpdateOne) SetNillableSilenced(b *bool) *MonitorUpdateOne

SetNillableSilenced sets the "silenced" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableStatusLastChangedAt

func (muo *MonitorUpdateOne) SetNillableStatusLastChangedAt(t *time.Time) *MonitorUpdateOne

SetNillableStatusLastChangedAt sets the "status_last_changed_at" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableSuccessCount

func (muo *MonitorUpdateOne) SetNillableSuccessCount(i *int) *MonitorUpdateOne

SetNillableSuccessCount sets the "success_count" field if the given value is not nil.

func (*MonitorUpdateOne) SetNillableSuccessThreshold

func (muo *MonitorUpdateOne) SetNillableSuccessThreshold(i *int) *MonitorUpdateOne

SetNillableSuccessThreshold sets the "success_threshold" field if the given value is not nil.

func (*MonitorUpdateOne) SetPaused

func (muo *MonitorUpdateOne) SetPaused(b bool) *MonitorUpdateOne

SetPaused sets the "paused" field.

func (*MonitorUpdateOne) SetSilenced

func (muo *MonitorUpdateOne) SetSilenced(b bool) *MonitorUpdateOne

SetSilenced sets the "silenced" field.

func (*MonitorUpdateOne) SetStatus

func (muo *MonitorUpdateOne) SetStatus(s string) *MonitorUpdateOne

SetStatus sets the "status" field.

func (*MonitorUpdateOne) SetStatusLastChangedAt

func (muo *MonitorUpdateOne) SetStatusLastChangedAt(t time.Time) *MonitorUpdateOne

SetStatusLastChangedAt sets the "status_last_changed_at" field.

func (*MonitorUpdateOne) SetSuccessCount

func (muo *MonitorUpdateOne) SetSuccessCount(i int) *MonitorUpdateOne

SetSuccessCount sets the "success_count" field.

func (*MonitorUpdateOne) SetSuccessThreshold

func (muo *MonitorUpdateOne) SetSuccessThreshold(i int) *MonitorUpdateOne

SetSuccessThreshold sets the "success_threshold" field.

func (*MonitorUpdateOne) SetTags

func (muo *MonitorUpdateOne) SetTags(s []string) *MonitorUpdateOne

SetTags sets the "tags" field.

func (*MonitorUpdateOne) SetUpdatedAt

func (muo *MonitorUpdateOne) SetUpdatedAt(t time.Time) *MonitorUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Monitors

type Monitors []*Monitor

Monitors is a parsable slice of Monitor.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Secret

type Secret struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy string `json:"created_by,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// contains filtered or unexported fields
}

Secret is the model entity for the Secret schema.

func (*Secret) String

func (s *Secret) String() string

String implements the fmt.Stringer.

func (*Secret) Unwrap

func (s *Secret) Unwrap() *Secret

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

func (s *Secret) Update() *SecretUpdateOne

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

type SecretClient

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

SecretClient is a client for the Secret schema.

func NewSecretClient

func NewSecretClient(c config) *SecretClient

NewSecretClient returns a client for the Secret from the given config.

func (*SecretClient) Create

func (c *SecretClient) Create() *SecretCreate

Create returns a builder for creating a Secret entity.

func (*SecretClient) CreateBulk

func (c *SecretClient) CreateBulk(builders ...*SecretCreate) *SecretCreateBulk

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

func (*SecretClient) Delete

func (c *SecretClient) Delete() *SecretDelete

Delete returns a delete builder for Secret.

func (*SecretClient) DeleteOne

func (c *SecretClient) DeleteOne(s *Secret) *SecretDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SecretClient) DeleteOneID

func (c *SecretClient) DeleteOneID(id string) *SecretDeleteOne

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

func (*SecretClient) Get

func (c *SecretClient) Get(ctx context.Context, id string) (*Secret, error)

Get returns a Secret entity by its id.

func (*SecretClient) GetX

func (c *SecretClient) GetX(ctx context.Context, id string) *Secret

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

func (*SecretClient) Hooks

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

Hooks returns the client hooks.

func (*SecretClient) Query

func (c *SecretClient) Query() *SecretQuery

Query returns a query builder for Secret.

func (*SecretClient) Update

func (c *SecretClient) Update() *SecretUpdate

Update returns an update builder for Secret.

func (*SecretClient) UpdateOne

func (c *SecretClient) UpdateOne(s *Secret) *SecretUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SecretClient) UpdateOneID

func (c *SecretClient) UpdateOneID(id string) *SecretUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SecretClient) Use

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

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

type SecretCreate

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

SecretCreate is the builder for creating a Secret entity.

func (*SecretCreate) Exec

func (sc *SecretCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretCreate) ExecX

func (sc *SecretCreate) ExecX(ctx context.Context)

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

func (*SecretCreate) Mutation

func (sc *SecretCreate) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretCreate) Save

func (sc *SecretCreate) Save(ctx context.Context) (*Secret, error)

Save creates the Secret in the database.

func (*SecretCreate) SaveX

func (sc *SecretCreate) SaveX(ctx context.Context) *Secret

SaveX calls Save and panics if Save returns an error.

func (*SecretCreate) SetCreatedAt

func (sc *SecretCreate) SetCreatedAt(t time.Time) *SecretCreate

SetCreatedAt sets the "created_at" field.

func (*SecretCreate) SetCreatedBy

func (sc *SecretCreate) SetCreatedBy(s string) *SecretCreate

SetCreatedBy sets the "created_by" field.

func (*SecretCreate) SetID

func (sc *SecretCreate) SetID(s string) *SecretCreate

SetID sets the "id" field.

func (*SecretCreate) SetNillableCreatedAt

func (sc *SecretCreate) SetNillableCreatedAt(t *time.Time) *SecretCreate

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

func (*SecretCreate) SetNillableCreatedBy

func (sc *SecretCreate) SetNillableCreatedBy(s *string) *SecretCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SecretCreate) SetNillableUpdatedAt

func (sc *SecretCreate) SetNillableUpdatedAt(t *time.Time) *SecretCreate

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

func (*SecretCreate) SetUpdatedAt

func (sc *SecretCreate) SetUpdatedAt(t time.Time) *SecretCreate

SetUpdatedAt sets the "updated_at" field.

func (*SecretCreate) SetValue

func (sc *SecretCreate) SetValue(s string) *SecretCreate

SetValue sets the "value" field.

type SecretCreateBulk

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

SecretCreateBulk is the builder for creating many Secret entities in bulk.

func (*SecretCreateBulk) Exec

func (scb *SecretCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretCreateBulk) ExecX

func (scb *SecretCreateBulk) ExecX(ctx context.Context)

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

func (*SecretCreateBulk) Save

func (scb *SecretCreateBulk) Save(ctx context.Context) ([]*Secret, error)

Save creates the Secret entities in the database.

func (*SecretCreateBulk) SaveX

func (scb *SecretCreateBulk) SaveX(ctx context.Context) []*Secret

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

type SecretDelete

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

SecretDelete is the builder for deleting a Secret entity.

func (*SecretDelete) Exec

func (sd *SecretDelete) Exec(ctx context.Context) (int, error)

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

func (*SecretDelete) ExecX

func (sd *SecretDelete) ExecX(ctx context.Context) int

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

func (*SecretDelete) Where

func (sd *SecretDelete) Where(ps ...predicate.Secret) *SecretDelete

Where appends a list predicates to the SecretDelete builder.

type SecretDeleteOne

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

SecretDeleteOne is the builder for deleting a single Secret entity.

func (*SecretDeleteOne) Exec

func (sdo *SecretDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SecretDeleteOne) ExecX

func (sdo *SecretDeleteOne) ExecX(ctx context.Context)

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

type SecretGroupBy

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

SecretGroupBy is the group-by builder for Secret entities.

func (*SecretGroupBy) Aggregate

func (sgb *SecretGroupBy) Aggregate(fns ...AggregateFunc) *SecretGroupBy

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

func (*SecretGroupBy) Bool

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

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

func (*SecretGroupBy) BoolX

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

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

func (*SecretGroupBy) Bools

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

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

func (*SecretGroupBy) BoolsX

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

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

func (*SecretGroupBy) Float64

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

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

func (*SecretGroupBy) Float64X

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

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

func (*SecretGroupBy) Float64s

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

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

func (*SecretGroupBy) Float64sX

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

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

func (*SecretGroupBy) Int

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

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

func (*SecretGroupBy) IntX

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

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

func (*SecretGroupBy) Ints

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

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

func (*SecretGroupBy) IntsX

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

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

func (*SecretGroupBy) Scan

func (sgb *SecretGroupBy) Scan(ctx context.Context, v any) error

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

func (*SecretGroupBy) ScanX

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

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

func (*SecretGroupBy) String

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

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

func (*SecretGroupBy) StringX

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

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

func (*SecretGroupBy) Strings

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

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

func (*SecretGroupBy) StringsX

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

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

type SecretMutation

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

SecretMutation represents an operation that mutates the Secret nodes in the graph.

func (*SecretMutation) AddField

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

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

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

func (*SecretMutation) AddedField

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

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

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

func (*SecretMutation) AddedIDs

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

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

func (*SecretMutation) ClearEdge

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

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

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

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

func (*SecretMutation) ClearedFields

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

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

func (SecretMutation) Client

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

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

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

func (*SecretMutation) CreatedBy

func (m *SecretMutation) CreatedBy() (r string, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*SecretMutation) EdgeCleared

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

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

func (*SecretMutation) Field

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

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

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

func (*SecretMutation) Fields

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

func (m *SecretMutation) ID() (id string, 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 (*SecretMutation) IDs

func (m *SecretMutation) IDs(ctx context.Context) ([]string, 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 (*SecretMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Secret entity. If the Secret object wasn'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 (*SecretMutation) OldCreatedBy

func (m *SecretMutation) OldCreatedBy(ctx context.Context) (v string, err error)

OldCreatedBy returns the old "created_by" field's value of the Secret entity. If the Secret object wasn'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 (*SecretMutation) OldField

func (m *SecretMutation) 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 (*SecretMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Secret entity. If the Secret object wasn'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 (*SecretMutation) OldValue

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

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

func (m *SecretMutation) Op() Op

Op returns the operation name.

func (*SecretMutation) RemovedEdges

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

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

func (*SecretMutation) RemovedIDs

func (m *SecretMutation) 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 (*SecretMutation) ResetCreatedAt

func (m *SecretMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SecretMutation) ResetCreatedBy

func (m *SecretMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*SecretMutation) ResetEdge

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

func (m *SecretMutation) 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 (*SecretMutation) ResetUpdatedAt

func (m *SecretMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SecretMutation) ResetValue

func (m *SecretMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*SecretMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SecretMutation) SetCreatedBy

func (m *SecretMutation) SetCreatedBy(s string)

SetCreatedBy sets the "created_by" field.

func (*SecretMutation) SetField

func (m *SecretMutation) 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 (*SecretMutation) SetID

func (m *SecretMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Secret entities.

func (*SecretMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*SecretMutation) SetValue

func (m *SecretMutation) SetValue(s string)

SetValue sets the "value" field.

func (SecretMutation) Tx

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

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

func (*SecretMutation) Type

func (m *SecretMutation) Type() string

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

func (*SecretMutation) UpdatedAt

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

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

func (*SecretMutation) Value

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

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

func (*SecretMutation) Where

func (m *SecretMutation) Where(ps ...predicate.Secret)

Where appends a list predicates to the SecretMutation builder.

type SecretQuery

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

SecretQuery is the builder for querying Secret entities.

func (*SecretQuery) Aggregate

func (sq *SecretQuery) Aggregate(fns ...AggregateFunc) *SecretSelect

Aggregate returns a SecretSelect configured with the given aggregations.

func (*SecretQuery) All

func (sq *SecretQuery) All(ctx context.Context) ([]*Secret, error)

All executes the query and returns a list of Secrets.

func (*SecretQuery) AllX

func (sq *SecretQuery) AllX(ctx context.Context) []*Secret

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

func (*SecretQuery) Clone

func (sq *SecretQuery) Clone() *SecretQuery

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

func (*SecretQuery) Count

func (sq *SecretQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SecretQuery) CountX

func (sq *SecretQuery) CountX(ctx context.Context) int

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

func (*SecretQuery) Exist

func (sq *SecretQuery) Exist(ctx context.Context) (bool, error)

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

func (*SecretQuery) ExistX

func (sq *SecretQuery) ExistX(ctx context.Context) bool

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

func (*SecretQuery) First

func (sq *SecretQuery) First(ctx context.Context) (*Secret, error)

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

func (*SecretQuery) FirstID

func (sq *SecretQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*SecretQuery) FirstIDX

func (sq *SecretQuery) FirstIDX(ctx context.Context) string

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

func (*SecretQuery) FirstX

func (sq *SecretQuery) FirstX(ctx context.Context) *Secret

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

func (*SecretQuery) GroupBy

func (sq *SecretQuery) GroupBy(field string, fields ...string) *SecretGroupBy

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

Example:

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

client.Secret.Query().
	GroupBy(secret.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SecretQuery) IDs

func (sq *SecretQuery) IDs(ctx context.Context) ([]string, error)

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

func (*SecretQuery) IDsX

func (sq *SecretQuery) IDsX(ctx context.Context) []string

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

func (*SecretQuery) Limit

func (sq *SecretQuery) Limit(limit int) *SecretQuery

Limit adds a limit step to the query.

func (*SecretQuery) Offset

func (sq *SecretQuery) Offset(offset int) *SecretQuery

Offset adds an offset step to the query.

func (*SecretQuery) Only

func (sq *SecretQuery) Only(ctx context.Context) (*Secret, error)

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

func (*SecretQuery) OnlyID

func (sq *SecretQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*SecretQuery) OnlyIDX

func (sq *SecretQuery) OnlyIDX(ctx context.Context) string

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

func (*SecretQuery) OnlyX

func (sq *SecretQuery) OnlyX(ctx context.Context) *Secret

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

func (*SecretQuery) Order

func (sq *SecretQuery) Order(o ...OrderFunc) *SecretQuery

Order adds an order step to the query.

func (*SecretQuery) Select

func (sq *SecretQuery) Select(fields ...string) *SecretSelect

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

Example:

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

client.Secret.Query().
	Select(secret.FieldCreatedAt).
	Scan(ctx, &v)

func (*SecretQuery) Unique

func (sq *SecretQuery) Unique(unique bool) *SecretQuery

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

func (sq *SecretQuery) Where(ps ...predicate.Secret) *SecretQuery

Where adds a new predicate for the SecretQuery builder.

type SecretSelect

type SecretSelect struct {
	*SecretQuery
	// contains filtered or unexported fields
}

SecretSelect is the builder for selecting fields of Secret entities.

func (*SecretSelect) Aggregate

func (ss *SecretSelect) Aggregate(fns ...AggregateFunc) *SecretSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SecretSelect) Bool

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

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

func (*SecretSelect) BoolX

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

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

func (*SecretSelect) Bools

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

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

func (*SecretSelect) BoolsX

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

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

func (*SecretSelect) Float64

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

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

func (*SecretSelect) Float64X

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

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

func (*SecretSelect) Float64s

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

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

func (*SecretSelect) Float64sX

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

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

func (*SecretSelect) Int

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

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

func (*SecretSelect) IntX

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

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

func (*SecretSelect) Ints

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

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

func (*SecretSelect) IntsX

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

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

func (*SecretSelect) Scan

func (ss *SecretSelect) Scan(ctx context.Context, v any) error

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

func (*SecretSelect) ScanX

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

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

func (*SecretSelect) String

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

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

func (*SecretSelect) StringX

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

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

func (*SecretSelect) Strings

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

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

func (*SecretSelect) StringsX

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

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

type SecretUpdate

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

SecretUpdate is the builder for updating Secret entities.

func (*SecretUpdate) Exec

func (su *SecretUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SecretUpdate) ExecX

func (su *SecretUpdate) ExecX(ctx context.Context)

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

func (*SecretUpdate) Mutation

func (su *SecretUpdate) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretUpdate) Save

func (su *SecretUpdate) Save(ctx context.Context) (int, error)

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

func (*SecretUpdate) SaveX

func (su *SecretUpdate) SaveX(ctx context.Context) int

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

func (*SecretUpdate) SetCreatedAt

func (su *SecretUpdate) SetCreatedAt(t time.Time) *SecretUpdate

SetCreatedAt sets the "created_at" field.

func (*SecretUpdate) SetCreatedBy

func (su *SecretUpdate) SetCreatedBy(s string) *SecretUpdate

SetCreatedBy sets the "created_by" field.

func (*SecretUpdate) SetNillableCreatedAt

func (su *SecretUpdate) SetNillableCreatedAt(t *time.Time) *SecretUpdate

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

func (*SecretUpdate) SetNillableCreatedBy

func (su *SecretUpdate) SetNillableCreatedBy(s *string) *SecretUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SecretUpdate) SetUpdatedAt

func (su *SecretUpdate) SetUpdatedAt(t time.Time) *SecretUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpdate) SetValue

func (su *SecretUpdate) SetValue(s string) *SecretUpdate

SetValue sets the "value" field.

func (*SecretUpdate) Where

func (su *SecretUpdate) Where(ps ...predicate.Secret) *SecretUpdate

Where appends a list predicates to the SecretUpdate builder.

type SecretUpdateOne

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

SecretUpdateOne is the builder for updating a single Secret entity.

func (*SecretUpdateOne) Exec

func (suo *SecretUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SecretUpdateOne) ExecX

func (suo *SecretUpdateOne) ExecX(ctx context.Context)

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

func (*SecretUpdateOne) Mutation

func (suo *SecretUpdateOne) Mutation() *SecretMutation

Mutation returns the SecretMutation object of the builder.

func (*SecretUpdateOne) Save

func (suo *SecretUpdateOne) Save(ctx context.Context) (*Secret, error)

Save executes the query and returns the updated Secret entity.

func (*SecretUpdateOne) SaveX

func (suo *SecretUpdateOne) SaveX(ctx context.Context) *Secret

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

func (*SecretUpdateOne) Select

func (suo *SecretUpdateOne) Select(field string, fields ...string) *SecretUpdateOne

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

func (*SecretUpdateOne) SetCreatedAt

func (suo *SecretUpdateOne) SetCreatedAt(t time.Time) *SecretUpdateOne

SetCreatedAt sets the "created_at" field.

func (*SecretUpdateOne) SetCreatedBy

func (suo *SecretUpdateOne) SetCreatedBy(s string) *SecretUpdateOne

SetCreatedBy sets the "created_by" field.

func (*SecretUpdateOne) SetNillableCreatedAt

func (suo *SecretUpdateOne) SetNillableCreatedAt(t *time.Time) *SecretUpdateOne

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

func (*SecretUpdateOne) SetNillableCreatedBy

func (suo *SecretUpdateOne) SetNillableCreatedBy(s *string) *SecretUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SecretUpdateOne) SetUpdatedAt

func (suo *SecretUpdateOne) SetUpdatedAt(t time.Time) *SecretUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SecretUpdateOne) SetValue

func (suo *SecretUpdateOne) SetValue(s string) *SecretUpdateOne

SetValue sets the "value" field.

type Secrets

type Secrets []*Secret

Secrets is a parsable slice of Secret.

type Sink

type Sink struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// SinkType holds the value of the "sink_type" field.
	SinkType string `json:"sink_type,omitempty"`
	// Config holds the value of the "config" field.
	Config map[string]interface{} `json:"config,omitempty"`
	// contains filtered or unexported fields
}

Sink is the model entity for the Sink schema.

func (*Sink) String

func (s *Sink) String() string

String implements the fmt.Stringer.

func (*Sink) Unwrap

func (s *Sink) Unwrap() *Sink

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

func (s *Sink) Update() *SinkUpdateOne

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

type SinkClient

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

SinkClient is a client for the Sink schema.

func NewSinkClient

func NewSinkClient(c config) *SinkClient

NewSinkClient returns a client for the Sink from the given config.

func (*SinkClient) Create

func (c *SinkClient) Create() *SinkCreate

Create returns a builder for creating a Sink entity.

func (*SinkClient) CreateBulk

func (c *SinkClient) CreateBulk(builders ...*SinkCreate) *SinkCreateBulk

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

func (*SinkClient) Delete

func (c *SinkClient) Delete() *SinkDelete

Delete returns a delete builder for Sink.

func (*SinkClient) DeleteOne

func (c *SinkClient) DeleteOne(s *Sink) *SinkDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SinkClient) DeleteOneID

func (c *SinkClient) DeleteOneID(id string) *SinkDeleteOne

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

func (*SinkClient) Get

func (c *SinkClient) Get(ctx context.Context, id string) (*Sink, error)

Get returns a Sink entity by its id.

func (*SinkClient) GetX

func (c *SinkClient) GetX(ctx context.Context, id string) *Sink

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

func (*SinkClient) Hooks

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

Hooks returns the client hooks.

func (*SinkClient) Query

func (c *SinkClient) Query() *SinkQuery

Query returns a query builder for Sink.

func (*SinkClient) Update

func (c *SinkClient) Update() *SinkUpdate

Update returns an update builder for Sink.

func (*SinkClient) UpdateOne

func (c *SinkClient) UpdateOne(s *Sink) *SinkUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SinkClient) UpdateOneID

func (c *SinkClient) UpdateOneID(id string) *SinkUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SinkClient) Use

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

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

type SinkCreate

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

SinkCreate is the builder for creating a Sink entity.

func (*SinkCreate) Exec

func (sc *SinkCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SinkCreate) ExecX

func (sc *SinkCreate) ExecX(ctx context.Context)

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

func (*SinkCreate) Mutation

func (sc *SinkCreate) Mutation() *SinkMutation

Mutation returns the SinkMutation object of the builder.

func (*SinkCreate) Save

func (sc *SinkCreate) Save(ctx context.Context) (*Sink, error)

Save creates the Sink in the database.

func (*SinkCreate) SaveX

func (sc *SinkCreate) SaveX(ctx context.Context) *Sink

SaveX calls Save and panics if Save returns an error.

func (*SinkCreate) SetConfig

func (sc *SinkCreate) SetConfig(m map[string]interface{}) *SinkCreate

SetConfig sets the "config" field.

func (*SinkCreate) SetCreatedAt

func (sc *SinkCreate) SetCreatedAt(t time.Time) *SinkCreate

SetCreatedAt sets the "created_at" field.

func (*SinkCreate) SetID

func (sc *SinkCreate) SetID(s string) *SinkCreate

SetID sets the "id" field.

func (*SinkCreate) SetNillableCreatedAt

func (sc *SinkCreate) SetNillableCreatedAt(t *time.Time) *SinkCreate

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

func (*SinkCreate) SetNillableUpdatedAt

func (sc *SinkCreate) SetNillableUpdatedAt(t *time.Time) *SinkCreate

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

func (*SinkCreate) SetSinkType

func (sc *SinkCreate) SetSinkType(s string) *SinkCreate

SetSinkType sets the "sink_type" field.

func (*SinkCreate) SetUpdatedAt

func (sc *SinkCreate) SetUpdatedAt(t time.Time) *SinkCreate

SetUpdatedAt sets the "updated_at" field.

type SinkCreateBulk

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

SinkCreateBulk is the builder for creating many Sink entities in bulk.

func (*SinkCreateBulk) Exec

func (scb *SinkCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SinkCreateBulk) ExecX

func (scb *SinkCreateBulk) ExecX(ctx context.Context)

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

func (*SinkCreateBulk) Save

func (scb *SinkCreateBulk) Save(ctx context.Context) ([]*Sink, error)

Save creates the Sink entities in the database.

func (*SinkCreateBulk) SaveX

func (scb *SinkCreateBulk) SaveX(ctx context.Context) []*Sink

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

type SinkDelete

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

SinkDelete is the builder for deleting a Sink entity.

func (*SinkDelete) Exec

func (sd *SinkDelete) Exec(ctx context.Context) (int, error)

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

func (*SinkDelete) ExecX

func (sd *SinkDelete) ExecX(ctx context.Context) int

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

func (*SinkDelete) Where

func (sd *SinkDelete) Where(ps ...predicate.Sink) *SinkDelete

Where appends a list predicates to the SinkDelete builder.

type SinkDeleteOne

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

SinkDeleteOne is the builder for deleting a single Sink entity.

func (*SinkDeleteOne) Exec

func (sdo *SinkDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SinkDeleteOne) ExecX

func (sdo *SinkDeleteOne) ExecX(ctx context.Context)

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

type SinkGroupBy

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

SinkGroupBy is the group-by builder for Sink entities.

func (*SinkGroupBy) Aggregate

func (sgb *SinkGroupBy) Aggregate(fns ...AggregateFunc) *SinkGroupBy

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

func (*SinkGroupBy) Bool

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

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

func (*SinkGroupBy) BoolX

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

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

func (*SinkGroupBy) Bools

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

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

func (*SinkGroupBy) BoolsX

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

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

func (*SinkGroupBy) Float64

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

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

func (*SinkGroupBy) Float64X

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

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

func (*SinkGroupBy) Float64s

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

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

func (*SinkGroupBy) Float64sX

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

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

func (*SinkGroupBy) Int

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

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

func (*SinkGroupBy) IntX

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

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

func (*SinkGroupBy) Ints

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

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

func (*SinkGroupBy) IntsX

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

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

func (*SinkGroupBy) Scan

func (sgb *SinkGroupBy) Scan(ctx context.Context, v any) error

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

func (*SinkGroupBy) ScanX

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

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

func (*SinkGroupBy) String

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

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

func (*SinkGroupBy) StringX

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

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

func (*SinkGroupBy) Strings

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

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

func (*SinkGroupBy) StringsX

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

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

type SinkMutation

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

SinkMutation represents an operation that mutates the Sink nodes in the graph.

func (*SinkMutation) AddField

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

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

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

func (*SinkMutation) AddedField

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

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

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

func (*SinkMutation) AddedIDs

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

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

func (*SinkMutation) ClearEdge

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

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

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

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

func (*SinkMutation) ClearedFields

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

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

func (SinkMutation) Client

func (m SinkMutation) 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 (*SinkMutation) Config

func (m *SinkMutation) Config() (r map[string]interface{}, exists bool)

Config returns the value of the "config" field in the mutation.

func (*SinkMutation) CreatedAt

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

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

func (*SinkMutation) EdgeCleared

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

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

func (*SinkMutation) Field

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

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

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

func (*SinkMutation) Fields

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

func (m *SinkMutation) ID() (id string, 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 (*SinkMutation) IDs

func (m *SinkMutation) IDs(ctx context.Context) ([]string, 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 (*SinkMutation) OldConfig

func (m *SinkMutation) OldConfig(ctx context.Context) (v map[string]interface{}, err error)

OldConfig returns the old "config" field's value of the Sink entity. If the Sink object wasn'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 (*SinkMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Sink entity. If the Sink object wasn'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 (*SinkMutation) OldField

func (m *SinkMutation) 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 (*SinkMutation) OldSinkType

func (m *SinkMutation) OldSinkType(ctx context.Context) (v string, err error)

OldSinkType returns the old "sink_type" field's value of the Sink entity. If the Sink object wasn'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 (*SinkMutation) OldUpdatedAt

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

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

func (m *SinkMutation) Op() Op

Op returns the operation name.

func (*SinkMutation) RemovedEdges

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

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

func (*SinkMutation) RemovedIDs

func (m *SinkMutation) 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 (*SinkMutation) ResetConfig

func (m *SinkMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*SinkMutation) ResetCreatedAt

func (m *SinkMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SinkMutation) ResetEdge

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

func (m *SinkMutation) 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 (*SinkMutation) ResetSinkType

func (m *SinkMutation) ResetSinkType()

ResetSinkType resets all changes to the "sink_type" field.

func (*SinkMutation) ResetUpdatedAt

func (m *SinkMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SinkMutation) SetConfig

func (m *SinkMutation) SetConfig(value map[string]interface{})

SetConfig sets the "config" field.

func (*SinkMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SinkMutation) SetField

func (m *SinkMutation) 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 (*SinkMutation) SetID

func (m *SinkMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Sink entities.

func (*SinkMutation) SetSinkType

func (m *SinkMutation) SetSinkType(s string)

SetSinkType sets the "sink_type" field.

func (*SinkMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*SinkMutation) SinkType

func (m *SinkMutation) SinkType() (r string, exists bool)

SinkType returns the value of the "sink_type" field in the mutation.

func (SinkMutation) Tx

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

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

func (*SinkMutation) Type

func (m *SinkMutation) Type() string

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

func (*SinkMutation) UpdatedAt

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

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

func (*SinkMutation) Where

func (m *SinkMutation) Where(ps ...predicate.Sink)

Where appends a list predicates to the SinkMutation builder.

type SinkQuery

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

SinkQuery is the builder for querying Sink entities.

func (*SinkQuery) Aggregate

func (sq *SinkQuery) Aggregate(fns ...AggregateFunc) *SinkSelect

Aggregate returns a SinkSelect configured with the given aggregations.

func (*SinkQuery) All

func (sq *SinkQuery) All(ctx context.Context) ([]*Sink, error)

All executes the query and returns a list of Sinks.

func (*SinkQuery) AllX

func (sq *SinkQuery) AllX(ctx context.Context) []*Sink

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

func (*SinkQuery) Clone

func (sq *SinkQuery) Clone() *SinkQuery

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

func (*SinkQuery) Count

func (sq *SinkQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SinkQuery) CountX

func (sq *SinkQuery) CountX(ctx context.Context) int

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

func (*SinkQuery) Exist

func (sq *SinkQuery) Exist(ctx context.Context) (bool, error)

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

func (*SinkQuery) ExistX

func (sq *SinkQuery) ExistX(ctx context.Context) bool

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

func (*SinkQuery) First

func (sq *SinkQuery) First(ctx context.Context) (*Sink, error)

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

func (*SinkQuery) FirstID

func (sq *SinkQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*SinkQuery) FirstIDX

func (sq *SinkQuery) FirstIDX(ctx context.Context) string

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

func (*SinkQuery) FirstX

func (sq *SinkQuery) FirstX(ctx context.Context) *Sink

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

func (*SinkQuery) GroupBy

func (sq *SinkQuery) GroupBy(field string, fields ...string) *SinkGroupBy

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

Example:

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

client.Sink.Query().
	GroupBy(sink.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SinkQuery) IDs

func (sq *SinkQuery) IDs(ctx context.Context) ([]string, error)

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

func (*SinkQuery) IDsX

func (sq *SinkQuery) IDsX(ctx context.Context) []string

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

func (*SinkQuery) Limit

func (sq *SinkQuery) Limit(limit int) *SinkQuery

Limit adds a limit step to the query.

func (*SinkQuery) Offset

func (sq *SinkQuery) Offset(offset int) *SinkQuery

Offset adds an offset step to the query.

func (*SinkQuery) Only

func (sq *SinkQuery) Only(ctx context.Context) (*Sink, error)

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

func (*SinkQuery) OnlyID

func (sq *SinkQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*SinkQuery) OnlyIDX

func (sq *SinkQuery) OnlyIDX(ctx context.Context) string

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

func (*SinkQuery) OnlyX

func (sq *SinkQuery) OnlyX(ctx context.Context) *Sink

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

func (*SinkQuery) Order

func (sq *SinkQuery) Order(o ...OrderFunc) *SinkQuery

Order adds an order step to the query.

func (*SinkQuery) Select

func (sq *SinkQuery) Select(fields ...string) *SinkSelect

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

Example:

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

client.Sink.Query().
	Select(sink.FieldCreatedAt).
	Scan(ctx, &v)

func (*SinkQuery) Unique

func (sq *SinkQuery) Unique(unique bool) *SinkQuery

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

func (sq *SinkQuery) Where(ps ...predicate.Sink) *SinkQuery

Where adds a new predicate for the SinkQuery builder.

type SinkSelect

type SinkSelect struct {
	*SinkQuery
	// contains filtered or unexported fields
}

SinkSelect is the builder for selecting fields of Sink entities.

func (*SinkSelect) Aggregate

func (ss *SinkSelect) Aggregate(fns ...AggregateFunc) *SinkSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SinkSelect) Bool

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

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

func (*SinkSelect) BoolX

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

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

func (*SinkSelect) Bools

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

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

func (*SinkSelect) BoolsX

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

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

func (*SinkSelect) Float64

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

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

func (*SinkSelect) Float64X

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

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

func (*SinkSelect) Float64s

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

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

func (*SinkSelect) Float64sX

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

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

func (*SinkSelect) Int

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

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

func (*SinkSelect) IntX

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

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

func (*SinkSelect) Ints

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

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

func (*SinkSelect) IntsX

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

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

func (*SinkSelect) Scan

func (ss *SinkSelect) Scan(ctx context.Context, v any) error

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

func (*SinkSelect) ScanX

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

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

func (*SinkSelect) String

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

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

func (*SinkSelect) StringX

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

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

func (*SinkSelect) Strings

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

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

func (*SinkSelect) StringsX

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

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

type SinkUpdate

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

SinkUpdate is the builder for updating Sink entities.

func (*SinkUpdate) Exec

func (su *SinkUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SinkUpdate) ExecX

func (su *SinkUpdate) ExecX(ctx context.Context)

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

func (*SinkUpdate) Mutation

func (su *SinkUpdate) Mutation() *SinkMutation

Mutation returns the SinkMutation object of the builder.

func (*SinkUpdate) Save

func (su *SinkUpdate) Save(ctx context.Context) (int, error)

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

func (*SinkUpdate) SaveX

func (su *SinkUpdate) SaveX(ctx context.Context) int

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

func (*SinkUpdate) SetConfig

func (su *SinkUpdate) SetConfig(m map[string]interface{}) *SinkUpdate

SetConfig sets the "config" field.

func (*SinkUpdate) SetCreatedAt

func (su *SinkUpdate) SetCreatedAt(t time.Time) *SinkUpdate

SetCreatedAt sets the "created_at" field.

func (*SinkUpdate) SetNillableCreatedAt

func (su *SinkUpdate) SetNillableCreatedAt(t *time.Time) *SinkUpdate

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

func (*SinkUpdate) SetSinkType

func (su *SinkUpdate) SetSinkType(s string) *SinkUpdate

SetSinkType sets the "sink_type" field.

func (*SinkUpdate) SetUpdatedAt

func (su *SinkUpdate) SetUpdatedAt(t time.Time) *SinkUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SinkUpdate) Where

func (su *SinkUpdate) Where(ps ...predicate.Sink) *SinkUpdate

Where appends a list predicates to the SinkUpdate builder.

type SinkUpdateOne

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

SinkUpdateOne is the builder for updating a single Sink entity.

func (*SinkUpdateOne) Exec

func (suo *SinkUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SinkUpdateOne) ExecX

func (suo *SinkUpdateOne) ExecX(ctx context.Context)

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

func (*SinkUpdateOne) Mutation

func (suo *SinkUpdateOne) Mutation() *SinkMutation

Mutation returns the SinkMutation object of the builder.

func (*SinkUpdateOne) Save

func (suo *SinkUpdateOne) Save(ctx context.Context) (*Sink, error)

Save executes the query and returns the updated Sink entity.

func (*SinkUpdateOne) SaveX

func (suo *SinkUpdateOne) SaveX(ctx context.Context) *Sink

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

func (*SinkUpdateOne) Select

func (suo *SinkUpdateOne) Select(field string, fields ...string) *SinkUpdateOne

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

func (*SinkUpdateOne) SetConfig

func (suo *SinkUpdateOne) SetConfig(m map[string]interface{}) *SinkUpdateOne

SetConfig sets the "config" field.

func (*SinkUpdateOne) SetCreatedAt

func (suo *SinkUpdateOne) SetCreatedAt(t time.Time) *SinkUpdateOne

SetCreatedAt sets the "created_at" field.

func (*SinkUpdateOne) SetNillableCreatedAt

func (suo *SinkUpdateOne) SetNillableCreatedAt(t *time.Time) *SinkUpdateOne

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

func (*SinkUpdateOne) SetSinkType

func (suo *SinkUpdateOne) SetSinkType(s string) *SinkUpdateOne

SetSinkType sets the "sink_type" field.

func (*SinkUpdateOne) SetUpdatedAt

func (suo *SinkUpdateOne) SetUpdatedAt(t time.Time) *SinkUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Sinks

type Sinks []*Sink

Sinks is a parsable slice of Sink.

type Tx

type Tx struct {

	// AlertChannel is the client for interacting with the AlertChannel builders.
	AlertChannel *AlertChannelClient
	// Monitor is the client for interacting with the Monitor builders.
	Monitor *MonitorClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// Sink is the client for interacting with the Sink builders.
	Sink *SinkClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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 User

type User struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// APIKey holds the value of the "api_key" field.
	APIKey string `json:"api_key,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Role holds the value of the "role" field.
	Role string `json:"role,omitempty"`
	// Locked holds the value of the "locked" field.
	Locked bool `json:"locked,omitempty"`
	// LockedUntil holds the value of the "locked_until" field.
	LockedUntil *time.Time `json:"locked_until,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id string) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id string) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id string) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id string) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAPIKey

func (uc *UserCreate) SetAPIKey(s string) *UserCreate

SetAPIKey sets the "api_key" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(s string) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetLocked

func (uc *UserCreate) SetLocked(b bool) *UserCreate

SetLocked sets the "locked" field.

func (*UserCreate) SetLockedUntil

func (uc *UserCreate) SetLockedUntil(t time.Time) *UserCreate

SetLockedUntil sets the "locked_until" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetNillableLocked

func (uc *UserCreate) SetNillableLocked(b *bool) *UserCreate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*UserCreate) SetNillableLockedUntil

func (uc *UserCreate) SetNillableLockedUntil(t *time.Time) *UserCreate

SetNillableLockedUntil sets the "locked_until" field if the given value is not nil.

func (*UserCreate) SetNillableRole

func (uc *UserCreate) SetNillableRole(s *string) *UserCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetRole

func (uc *UserCreate) SetRole(s string) *UserCreate

SetRole sets the "role" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

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

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) APIKey

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

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

func (*UserMutation) AddField

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

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

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

func (*UserMutation) AddedField

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

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) ClearEdge

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

func (m *UserMutation) 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 (*UserMutation) ClearLockedUntil

func (m *UserMutation) ClearLockedUntil()

ClearLockedUntil clears the value of the "locked_until" field.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

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

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

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

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Field

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

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

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

func (*UserMutation) Fields

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

func (m *UserMutation) ID() (id string, 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 (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]string, 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 (*UserMutation) Locked

func (m *UserMutation) Locked() (r bool, exists bool)

Locked returns the value of the "locked" field in the mutation.

func (*UserMutation) LockedUntil

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

LockedUntil returns the value of the "locked_until" field in the mutation.

func (*UserMutation) LockedUntilCleared

func (m *UserMutation) LockedUntilCleared() bool

LockedUntilCleared returns if the "locked_until" field was cleared in this mutation.

func (*UserMutation) OldAPIKey

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

OldAPIKey returns the old "api_key" field's value of the User entity. If the User object wasn'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 (*UserMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn'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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldLocked

func (m *UserMutation) OldLocked(ctx context.Context) (v bool, err error)

OldLocked returns the old "locked" field's value of the User entity. If the User object wasn'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 (*UserMutation) OldLockedUntil

func (m *UserMutation) OldLockedUntil(ctx context.Context) (v *time.Time, err error)

OldLockedUntil returns the old "locked_until" field's value of the User entity. If the User object wasn'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 (*UserMutation) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v string, err error)

OldRole returns the old "role" field's value of the User entity. If the User object wasn'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 (*UserMutation) OldUpdatedAt

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

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

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) ResetAPIKey

func (m *UserMutation) ResetAPIKey()

ResetAPIKey resets all changes to the "api_key" field.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

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

func (m *UserMutation) 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 (*UserMutation) ResetLocked

func (m *UserMutation) ResetLocked()

ResetLocked resets all changes to the "locked" field.

func (*UserMutation) ResetLockedUntil

func (m *UserMutation) ResetLockedUntil()

ResetLockedUntil resets all changes to the "locked_until" field.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) Role

func (m *UserMutation) Role() (r string, exists bool)

Role returns the value of the "role" field in the mutation.

func (*UserMutation) SetAPIKey

func (m *UserMutation) SetAPIKey(s string)

SetAPIKey sets the "api_key" field.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetID

func (m *UserMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetLocked

func (m *UserMutation) SetLocked(b bool)

SetLocked sets the "locked" field.

func (*UserMutation) SetLockedUntil

func (m *UserMutation) SetLockedUntil(t time.Time)

SetLockedUntil sets the "locked_until" field.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(s string)

SetRole sets the "role" field.

func (*UserMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) UpdatedAt

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

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

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) string

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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

client.User.Query().
	GroupBy(user.FieldAPIKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]string, error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []string

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) string

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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 {
	APIKey string `json:"api_key,omitempty"`
}

client.User.Query().
	Select(user.FieldAPIKey).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) ClearLockedUntil

func (uu *UserUpdate) ClearLockedUntil() *UserUpdate

ClearLockedUntil clears the value of the "locked_until" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAPIKey

func (uu *UserUpdate) SetAPIKey(s string) *UserUpdate

SetAPIKey sets the "api_key" field.

func (*UserUpdate) SetLocked

func (uu *UserUpdate) SetLocked(b bool) *UserUpdate

SetLocked sets the "locked" field.

func (*UserUpdate) SetLockedUntil

func (uu *UserUpdate) SetLockedUntil(t time.Time) *UserUpdate

SetLockedUntil sets the "locked_until" field.

func (*UserUpdate) SetNillableLocked

func (uu *UserUpdate) SetNillableLocked(b *bool) *UserUpdate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*UserUpdate) SetNillableLockedUntil

func (uu *UserUpdate) SetNillableLockedUntil(t *time.Time) *UserUpdate

SetNillableLockedUntil sets the "locked_until" field if the given value is not nil.

func (*UserUpdate) SetNillableRole

func (uu *UserUpdate) SetNillableRole(s *string) *UserUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdate) SetRole

func (uu *UserUpdate) SetRole(s string) *UserUpdate

SetRole sets the "role" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) ClearLockedUntil

func (uuo *UserUpdateOne) ClearLockedUntil() *UserUpdateOne

ClearLockedUntil clears the value of the "locked_until" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAPIKey

func (uuo *UserUpdateOne) SetAPIKey(s string) *UserUpdateOne

SetAPIKey sets the "api_key" field.

func (*UserUpdateOne) SetLocked

func (uuo *UserUpdateOne) SetLocked(b bool) *UserUpdateOne

SetLocked sets the "locked" field.

func (*UserUpdateOne) SetLockedUntil

func (uuo *UserUpdateOne) SetLockedUntil(t time.Time) *UserUpdateOne

SetLockedUntil sets the "locked_until" field.

func (*UserUpdateOne) SetNillableLocked

func (uuo *UserUpdateOne) SetNillableLocked(b *bool) *UserUpdateOne

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLockedUntil

func (uuo *UserUpdateOne) SetNillableLockedUntil(t *time.Time) *UserUpdateOne

SetNillableLockedUntil sets the "locked_until" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRole

func (uuo *UserUpdateOne) SetNillableRole(s *string) *UserUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdateOne) SetRole

func (uuo *UserUpdateOne) SetRole(s string) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Users

type Users []*User

Users is a parsable slice of User.

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