ent

package
v0.0.0-...-83e02d6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 27 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.
	TypeAccess              = "Access"
	TypeHistory             = "History"
	TypeNotificationChannel = "NotificationChannel"
	TypeProject             = "Project"
	TypeScript              = "Script"
	TypeScriptStats         = "ScriptStats"
	TypeSecret              = "Secret"
	TypeUser                = "User"
)

Variables

This section is empty.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Access

type Access struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// ProjectID holds the value of the "project_id" field.
	ProjectID int `json:"project_id,omitempty"`
	// Role holds the value of the "role" field.
	Role access.Role `json:"role,omitempty"`
	// contains filtered or unexported fields
}

Access is the model entity for the Access schema.

func (*Access) String

func (a *Access) String() string

String implements the fmt.Stringer.

func (*Access) Unwrap

func (a *Access) Unwrap() *Access

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

func (a *Access) Update() *AccessUpdateOne

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

func (*Access) Value

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

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

type AccessClient

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

AccessClient is a client for the Access schema.

func NewAccessClient

func NewAccessClient(c config) *AccessClient

NewAccessClient returns a client for the Access from the given config.

func (*AccessClient) Create

func (c *AccessClient) Create() *AccessCreate

Create returns a builder for creating a Access entity.

func (*AccessClient) CreateBulk

func (c *AccessClient) CreateBulk(builders ...*AccessCreate) *AccessCreateBulk

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

func (*AccessClient) Delete

func (c *AccessClient) Delete() *AccessDelete

Delete returns a delete builder for Access.

func (*AccessClient) DeleteOne

func (c *AccessClient) DeleteOne(a *Access) *AccessDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AccessClient) DeleteOneID

func (c *AccessClient) DeleteOneID(id int) *AccessDeleteOne

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

func (*AccessClient) Get

func (c *AccessClient) Get(ctx context.Context, id int) (*Access, error)

Get returns a Access entity by its id.

func (*AccessClient) GetX

func (c *AccessClient) GetX(ctx context.Context, id int) *Access

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

func (*AccessClient) Hooks

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

Hooks returns the client hooks.

func (*AccessClient) Intercept

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

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

func (*AccessClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AccessClient) Query

func (c *AccessClient) Query() *AccessQuery

Query returns a query builder for Access.

func (*AccessClient) Update

func (c *AccessClient) Update() *AccessUpdate

Update returns an update builder for Access.

func (*AccessClient) UpdateOne

func (c *AccessClient) UpdateOne(a *Access) *AccessUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AccessClient) UpdateOneID

func (c *AccessClient) UpdateOneID(id int) *AccessUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AccessClient) Use

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

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

type AccessCreate

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

AccessCreate is the builder for creating a Access entity.

func (*AccessCreate) Exec

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

Exec executes the query.

func (*AccessCreate) ExecX

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

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

func (*AccessCreate) Mutation

func (ac *AccessCreate) Mutation() *AccessMutation

Mutation returns the AccessMutation object of the builder.

func (*AccessCreate) Save

func (ac *AccessCreate) Save(ctx context.Context) (*Access, error)

Save creates the Access in the database.

func (*AccessCreate) SaveX

func (ac *AccessCreate) SaveX(ctx context.Context) *Access

SaveX calls Save and panics if Save returns an error.

func (*AccessCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AccessCreate) SetNillableCreatedAt

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

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

func (*AccessCreate) SetNillableRole

func (ac *AccessCreate) SetNillableRole(a *access.Role) *AccessCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*AccessCreate) SetNillableUpdatedAt

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

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

func (*AccessCreate) SetProjectID

func (ac *AccessCreate) SetProjectID(i int) *AccessCreate

SetProjectID sets the "project_id" field.

func (*AccessCreate) SetRole

func (ac *AccessCreate) SetRole(a access.Role) *AccessCreate

SetRole sets the "role" field.

func (*AccessCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AccessCreate) SetUserID

func (ac *AccessCreate) SetUserID(i int) *AccessCreate

SetUserID sets the "user_id" field.

type AccessCreateBulk

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

AccessCreateBulk is the builder for creating many Access entities in bulk.

func (*AccessCreateBulk) Exec

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

Exec executes the query.

func (*AccessCreateBulk) ExecX

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

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

func (*AccessCreateBulk) Save

func (acb *AccessCreateBulk) Save(ctx context.Context) ([]*Access, error)

Save creates the Access entities in the database.

func (*AccessCreateBulk) SaveX

func (acb *AccessCreateBulk) SaveX(ctx context.Context) []*Access

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

type AccessDelete

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

AccessDelete is the builder for deleting a Access entity.

func (*AccessDelete) Exec

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

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

func (*AccessDelete) ExecX

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

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

func (*AccessDelete) Where

func (ad *AccessDelete) Where(ps ...predicate.Access) *AccessDelete

Where appends a list predicates to the AccessDelete builder.

type AccessDeleteOne

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

AccessDeleteOne is the builder for deleting a single Access entity.

func (*AccessDeleteOne) Exec

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

Exec executes the deletion query.

func (*AccessDeleteOne) ExecX

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

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

func (*AccessDeleteOne) Where

func (ado *AccessDeleteOne) Where(ps ...predicate.Access) *AccessDeleteOne

Where appends a list predicates to the AccessDelete builder.

type AccessGroupBy

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

AccessGroupBy is the group-by builder for Access entities.

func (*AccessGroupBy) Aggregate

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

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

func (*AccessGroupBy) Bool

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

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

func (*AccessGroupBy) BoolX

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

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

func (*AccessGroupBy) Bools

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

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

func (*AccessGroupBy) BoolsX

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

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

func (*AccessGroupBy) Float64

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

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

func (*AccessGroupBy) Float64X

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

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

func (*AccessGroupBy) Float64s

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

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

func (*AccessGroupBy) Float64sX

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

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

func (*AccessGroupBy) Int

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

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

func (*AccessGroupBy) IntX

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

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

func (*AccessGroupBy) Ints

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

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

func (*AccessGroupBy) IntsX

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

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

func (*AccessGroupBy) Scan

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

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

func (*AccessGroupBy) ScanX

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

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

func (*AccessGroupBy) String

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

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

func (*AccessGroupBy) StringX

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

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

func (*AccessGroupBy) Strings

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

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

func (*AccessGroupBy) StringsX

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

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

type AccessMutation

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

AccessMutation represents an operation that mutates the Access nodes in the graph.

func (*AccessMutation) AddField

func (m *AccessMutation) 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 (*AccessMutation) AddProjectID

func (m *AccessMutation) AddProjectID(i int)

AddProjectID adds i to the "project_id" field.

func (*AccessMutation) AddUserID

func (m *AccessMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*AccessMutation) AddedEdges

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

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

func (*AccessMutation) AddedField

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

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

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

func (*AccessMutation) AddedIDs

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

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

func (*AccessMutation) AddedProjectID

func (m *AccessMutation) AddedProjectID() (r int, exists bool)

AddedProjectID returns the value that was added to the "project_id" field in this mutation.

func (*AccessMutation) AddedUserID

func (m *AccessMutation) AddedUserID() (r int, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*AccessMutation) ClearEdge

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

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

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

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

func (*AccessMutation) ClearedFields

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

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

func (AccessMutation) Client

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

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

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

func (*AccessMutation) EdgeCleared

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

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

func (*AccessMutation) Field

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

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

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

func (*AccessMutation) Fields

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

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

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

func (*AccessMutation) IDs

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

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

func (*AccessMutation) OldCreatedAt

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

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

func (m *AccessMutation) 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 (*AccessMutation) OldProjectID

func (m *AccessMutation) OldProjectID(ctx context.Context) (v int, err error)

OldProjectID returns the old "project_id" field's value of the Access entity. If the Access object wasn'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 (*AccessMutation) OldRole

func (m *AccessMutation) OldRole(ctx context.Context) (v access.Role, err error)

OldRole returns the old "role" field's value of the Access entity. If the Access object wasn'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 (*AccessMutation) OldUpdatedAt

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

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

func (m *AccessMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the Access entity. If the Access object wasn'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 (*AccessMutation) Op

func (m *AccessMutation) Op() Op

Op returns the operation name.

func (*AccessMutation) ProjectID

func (m *AccessMutation) ProjectID() (r int, exists bool)

ProjectID returns the value of the "project_id" field in the mutation.

func (*AccessMutation) RemovedEdges

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

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

func (*AccessMutation) RemovedIDs

func (m *AccessMutation) 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 (*AccessMutation) ResetCreatedAt

func (m *AccessMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AccessMutation) ResetEdge

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

func (m *AccessMutation) 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 (*AccessMutation) ResetProjectID

func (m *AccessMutation) ResetProjectID()

ResetProjectID resets all changes to the "project_id" field.

func (*AccessMutation) ResetRole

func (m *AccessMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*AccessMutation) ResetUpdatedAt

func (m *AccessMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AccessMutation) ResetUserID

func (m *AccessMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*AccessMutation) Role

func (m *AccessMutation) Role() (r access.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*AccessMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AccessMutation) SetField

func (m *AccessMutation) 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 (*AccessMutation) SetOp

func (m *AccessMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AccessMutation) SetProjectID

func (m *AccessMutation) SetProjectID(i int)

SetProjectID sets the "project_id" field.

func (*AccessMutation) SetRole

func (m *AccessMutation) SetRole(a access.Role)

SetRole sets the "role" field.

func (*AccessMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AccessMutation) SetUserID

func (m *AccessMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (AccessMutation) Tx

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

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

func (*AccessMutation) Type

func (m *AccessMutation) Type() string

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

func (*AccessMutation) UpdatedAt

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

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

func (*AccessMutation) UserID

func (m *AccessMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*AccessMutation) Where

func (m *AccessMutation) Where(ps ...predicate.Access)

Where appends a list predicates to the AccessMutation builder.

func (*AccessMutation) WhereP

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

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

type AccessQuery

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

AccessQuery is the builder for querying Access entities.

func (*AccessQuery) Aggregate

func (aq *AccessQuery) Aggregate(fns ...AggregateFunc) *AccessSelect

Aggregate returns a AccessSelect configured with the given aggregations.

func (*AccessQuery) All

func (aq *AccessQuery) All(ctx context.Context) ([]*Access, error)

All executes the query and returns a list of Accesses.

func (*AccessQuery) AllX

func (aq *AccessQuery) AllX(ctx context.Context) []*Access

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

func (*AccessQuery) Clone

func (aq *AccessQuery) Clone() *AccessQuery

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

func (*AccessQuery) Count

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

Count returns the count of the given query.

func (*AccessQuery) CountX

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

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

func (*AccessQuery) Exist

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

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

func (*AccessQuery) ExistX

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

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

func (*AccessQuery) First

func (aq *AccessQuery) First(ctx context.Context) (*Access, error)

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

func (*AccessQuery) FirstID

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

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

func (*AccessQuery) FirstIDX

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

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

func (*AccessQuery) FirstX

func (aq *AccessQuery) FirstX(ctx context.Context) *Access

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

func (*AccessQuery) GroupBy

func (aq *AccessQuery) GroupBy(field string, fields ...string) *AccessGroupBy

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.Access.Query().
	GroupBy(access.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AccessQuery) IDs

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

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

func (*AccessQuery) IDsX

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

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

func (*AccessQuery) Limit

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

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

func (*AccessQuery) Offset

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

Offset to start from.

func (*AccessQuery) Only

func (aq *AccessQuery) Only(ctx context.Context) (*Access, error)

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

func (*AccessQuery) OnlyID

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

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

func (*AccessQuery) OnlyIDX

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

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

func (*AccessQuery) OnlyX

func (aq *AccessQuery) OnlyX(ctx context.Context) *Access

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

func (*AccessQuery) Order

func (aq *AccessQuery) Order(o ...access.OrderOption) *AccessQuery

Order specifies how the records should be ordered.

func (*AccessQuery) Select

func (aq *AccessQuery) Select(fields ...string) *AccessSelect

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.Access.Query().
	Select(access.FieldCreatedAt).
	Scan(ctx, &v)

func (*AccessQuery) Unique

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

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

func (aq *AccessQuery) Where(ps ...predicate.Access) *AccessQuery

Where adds a new predicate for the AccessQuery builder.

type AccessSelect

type AccessSelect struct {
	*AccessQuery
	// contains filtered or unexported fields
}

AccessSelect is the builder for selecting fields of Access entities.

func (*AccessSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AccessSelect) Bool

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

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

func (*AccessSelect) BoolX

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

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

func (*AccessSelect) Bools

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

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

func (*AccessSelect) BoolsX

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

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

func (*AccessSelect) Float64

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

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

func (*AccessSelect) Float64X

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

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

func (*AccessSelect) Float64s

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

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

func (*AccessSelect) Float64sX

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

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

func (*AccessSelect) Int

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

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

func (*AccessSelect) IntX

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

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

func (*AccessSelect) Ints

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

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

func (*AccessSelect) IntsX

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

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

func (*AccessSelect) Scan

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

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

func (*AccessSelect) ScanX

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

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

func (*AccessSelect) String

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

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

func (*AccessSelect) StringX

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

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

func (*AccessSelect) Strings

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

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

func (*AccessSelect) StringsX

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

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

type AccessUpdate

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

AccessUpdate is the builder for updating Access entities.

func (*AccessUpdate) AddProjectID

func (au *AccessUpdate) AddProjectID(i int) *AccessUpdate

AddProjectID adds i to the "project_id" field.

func (*AccessUpdate) AddUserID

func (au *AccessUpdate) AddUserID(i int) *AccessUpdate

AddUserID adds i to the "user_id" field.

func (*AccessUpdate) Exec

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

Exec executes the query.

func (*AccessUpdate) ExecX

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

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

func (*AccessUpdate) Mutation

func (au *AccessUpdate) Mutation() *AccessMutation

Mutation returns the AccessMutation object of the builder.

func (*AccessUpdate) Save

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

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

func (*AccessUpdate) SaveX

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

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

func (*AccessUpdate) SetNillableRole

func (au *AccessUpdate) SetNillableRole(a *access.Role) *AccessUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*AccessUpdate) SetProjectID

func (au *AccessUpdate) SetProjectID(i int) *AccessUpdate

SetProjectID sets the "project_id" field.

func (*AccessUpdate) SetRole

func (au *AccessUpdate) SetRole(a access.Role) *AccessUpdate

SetRole sets the "role" field.

func (*AccessUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AccessUpdate) SetUserID

func (au *AccessUpdate) SetUserID(i int) *AccessUpdate

SetUserID sets the "user_id" field.

func (*AccessUpdate) Where

func (au *AccessUpdate) Where(ps ...predicate.Access) *AccessUpdate

Where appends a list predicates to the AccessUpdate builder.

type AccessUpdateOne

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

AccessUpdateOne is the builder for updating a single Access entity.

func (*AccessUpdateOne) AddProjectID

func (auo *AccessUpdateOne) AddProjectID(i int) *AccessUpdateOne

AddProjectID adds i to the "project_id" field.

func (*AccessUpdateOne) AddUserID

func (auo *AccessUpdateOne) AddUserID(i int) *AccessUpdateOne

AddUserID adds i to the "user_id" field.

func (*AccessUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AccessUpdateOne) ExecX

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

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

func (*AccessUpdateOne) Mutation

func (auo *AccessUpdateOne) Mutation() *AccessMutation

Mutation returns the AccessMutation object of the builder.

func (*AccessUpdateOne) Save

func (auo *AccessUpdateOne) Save(ctx context.Context) (*Access, error)

Save executes the query and returns the updated Access entity.

func (*AccessUpdateOne) SaveX

func (auo *AccessUpdateOne) SaveX(ctx context.Context) *Access

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

func (*AccessUpdateOne) Select

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

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

func (*AccessUpdateOne) SetNillableRole

func (auo *AccessUpdateOne) SetNillableRole(a *access.Role) *AccessUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*AccessUpdateOne) SetProjectID

func (auo *AccessUpdateOne) SetProjectID(i int) *AccessUpdateOne

SetProjectID sets the "project_id" field.

func (*AccessUpdateOne) SetRole

func (auo *AccessUpdateOne) SetRole(a access.Role) *AccessUpdateOne

SetRole sets the "role" field.

func (*AccessUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AccessUpdateOne) SetUserID

func (auo *AccessUpdateOne) SetUserID(i int) *AccessUpdateOne

SetUserID sets the "user_id" field.

func (*AccessUpdateOne) Where

func (auo *AccessUpdateOne) Where(ps ...predicate.Access) *AccessUpdateOne

Where appends a list predicates to the AccessUpdate builder.

type Accesses

type Accesses []*Access

Accesses is a parsable slice of Access.

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 Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Access is the client for interacting with the Access builders.
	Access *AccessClient
	// History is the client for interacting with the History builders.
	History *HistoryClient
	// NotificationChannel is the client for interacting with the NotificationChannel builders.
	NotificationChannel *NotificationChannelClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Script is the client for interacting with the Script builders.
	Script *ScriptClient
	// ScriptStats is the client for interacting with the ScriptStats builders.
	ScriptStats *ScriptStatsClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// 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().
	Access.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

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

type Histories []*History

Histories is a parsable slice of History.

type History

type History struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// RunID holds the value of the "run_id" field.
	RunID string `json:"run_id,omitempty"`
	// Success holds the value of the "success" field.
	Success bool `json:"success,omitempty"`
	// ExitCode holds the value of the "exit_code" field.
	ExitCode int `json:"exit_code,omitempty"`
	// Duration holds the value of the "duration" field.
	Duration int `json:"duration,omitempty"`
	// Trigger holds the value of the "trigger" field.
	Trigger string `json:"trigger,omitempty"`
	// Output holds the value of the "output" field.
	Output string `json:"output,omitempty"`
	// TriggeredBy holds the value of the "triggered_by" field.
	TriggeredBy string `json:"triggered_by,omitempty"`
	// ScriptID holds the value of the "script_id" field.
	ScriptID int `json:"script_id,omitempty"`
	// Arguments holds the value of the "arguments" field.
	Arguments map[string]string `json:"arguments,omitempty"`
	// Status holds the value of the "status" field.
	Status string `json:"status,omitempty"`
	// contains filtered or unexported fields
}

History is the model entity for the History schema.

func (*History) String

func (h *History) String() string

String implements the fmt.Stringer.

func (*History) Unwrap

func (h *History) Unwrap() *History

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

func (h *History) Update() *HistoryUpdateOne

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

func (*History) Value

func (h *History) Value(name string) (ent.Value, error)

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

type HistoryClient

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

HistoryClient is a client for the History schema.

func NewHistoryClient

func NewHistoryClient(c config) *HistoryClient

NewHistoryClient returns a client for the History from the given config.

func (*HistoryClient) Create

func (c *HistoryClient) Create() *HistoryCreate

Create returns a builder for creating a History entity.

func (*HistoryClient) CreateBulk

func (c *HistoryClient) CreateBulk(builders ...*HistoryCreate) *HistoryCreateBulk

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

func (*HistoryClient) Delete

func (c *HistoryClient) Delete() *HistoryDelete

Delete returns a delete builder for History.

func (*HistoryClient) DeleteOne

func (c *HistoryClient) DeleteOne(h *History) *HistoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*HistoryClient) DeleteOneID

func (c *HistoryClient) DeleteOneID(id int) *HistoryDeleteOne

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

func (*HistoryClient) Get

func (c *HistoryClient) Get(ctx context.Context, id int) (*History, error)

Get returns a History entity by its id.

func (*HistoryClient) GetX

func (c *HistoryClient) GetX(ctx context.Context, id int) *History

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

func (*HistoryClient) Hooks

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

Hooks returns the client hooks.

func (*HistoryClient) Intercept

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

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

func (*HistoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*HistoryClient) Query

func (c *HistoryClient) Query() *HistoryQuery

Query returns a query builder for History.

func (*HistoryClient) Update

func (c *HistoryClient) Update() *HistoryUpdate

Update returns an update builder for History.

func (*HistoryClient) UpdateOne

func (c *HistoryClient) UpdateOne(h *History) *HistoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*HistoryClient) UpdateOneID

func (c *HistoryClient) UpdateOneID(id int) *HistoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HistoryClient) Use

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

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

type HistoryCreate

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

HistoryCreate is the builder for creating a History entity.

func (*HistoryCreate) Exec

func (hc *HistoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*HistoryCreate) ExecX

func (hc *HistoryCreate) ExecX(ctx context.Context)

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

func (*HistoryCreate) Mutation

func (hc *HistoryCreate) Mutation() *HistoryMutation

Mutation returns the HistoryMutation object of the builder.

func (*HistoryCreate) Save

func (hc *HistoryCreate) Save(ctx context.Context) (*History, error)

Save creates the History in the database.

func (*HistoryCreate) SaveX

func (hc *HistoryCreate) SaveX(ctx context.Context) *History

SaveX calls Save and panics if Save returns an error.

func (*HistoryCreate) SetArguments

func (hc *HistoryCreate) SetArguments(m map[string]string) *HistoryCreate

SetArguments sets the "arguments" field.

func (*HistoryCreate) SetCreatedAt

func (hc *HistoryCreate) SetCreatedAt(t time.Time) *HistoryCreate

SetCreatedAt sets the "created_at" field.

func (*HistoryCreate) SetDuration

func (hc *HistoryCreate) SetDuration(i int) *HistoryCreate

SetDuration sets the "duration" field.

func (*HistoryCreate) SetExitCode

func (hc *HistoryCreate) SetExitCode(i int) *HistoryCreate

SetExitCode sets the "exit_code" field.

func (*HistoryCreate) SetNillableCreatedAt

func (hc *HistoryCreate) SetNillableCreatedAt(t *time.Time) *HistoryCreate

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

func (*HistoryCreate) SetNillableStatus

func (hc *HistoryCreate) SetNillableStatus(s *string) *HistoryCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*HistoryCreate) SetNillableUpdatedAt

func (hc *HistoryCreate) SetNillableUpdatedAt(t *time.Time) *HistoryCreate

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

func (*HistoryCreate) SetOutput

func (hc *HistoryCreate) SetOutput(s string) *HistoryCreate

SetOutput sets the "output" field.

func (*HistoryCreate) SetRunID

func (hc *HistoryCreate) SetRunID(s string) *HistoryCreate

SetRunID sets the "run_id" field.

func (*HistoryCreate) SetScriptID

func (hc *HistoryCreate) SetScriptID(i int) *HistoryCreate

SetScriptID sets the "script_id" field.

func (*HistoryCreate) SetStatus

func (hc *HistoryCreate) SetStatus(s string) *HistoryCreate

SetStatus sets the "status" field.

func (*HistoryCreate) SetSuccess

func (hc *HistoryCreate) SetSuccess(b bool) *HistoryCreate

SetSuccess sets the "success" field.

func (*HistoryCreate) SetTrigger

func (hc *HistoryCreate) SetTrigger(s string) *HistoryCreate

SetTrigger sets the "trigger" field.

func (*HistoryCreate) SetTriggeredBy

func (hc *HistoryCreate) SetTriggeredBy(s string) *HistoryCreate

SetTriggeredBy sets the "triggered_by" field.

func (*HistoryCreate) SetUpdatedAt

func (hc *HistoryCreate) SetUpdatedAt(t time.Time) *HistoryCreate

SetUpdatedAt sets the "updated_at" field.

type HistoryCreateBulk

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

HistoryCreateBulk is the builder for creating many History entities in bulk.

func (*HistoryCreateBulk) Exec

func (hcb *HistoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*HistoryCreateBulk) ExecX

func (hcb *HistoryCreateBulk) ExecX(ctx context.Context)

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

func (*HistoryCreateBulk) Save

func (hcb *HistoryCreateBulk) Save(ctx context.Context) ([]*History, error)

Save creates the History entities in the database.

func (*HistoryCreateBulk) SaveX

func (hcb *HistoryCreateBulk) SaveX(ctx context.Context) []*History

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

type HistoryDelete

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

HistoryDelete is the builder for deleting a History entity.

func (*HistoryDelete) Exec

func (hd *HistoryDelete) Exec(ctx context.Context) (int, error)

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

func (*HistoryDelete) ExecX

func (hd *HistoryDelete) ExecX(ctx context.Context) int

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

func (*HistoryDelete) Where

func (hd *HistoryDelete) Where(ps ...predicate.History) *HistoryDelete

Where appends a list predicates to the HistoryDelete builder.

type HistoryDeleteOne

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

HistoryDeleteOne is the builder for deleting a single History entity.

func (*HistoryDeleteOne) Exec

func (hdo *HistoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*HistoryDeleteOne) ExecX

func (hdo *HistoryDeleteOne) ExecX(ctx context.Context)

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

func (*HistoryDeleteOne) Where

Where appends a list predicates to the HistoryDelete builder.

type HistoryGroupBy

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

HistoryGroupBy is the group-by builder for History entities.

func (*HistoryGroupBy) Aggregate

func (hgb *HistoryGroupBy) Aggregate(fns ...AggregateFunc) *HistoryGroupBy

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

func (*HistoryGroupBy) Bool

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

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

func (*HistoryGroupBy) BoolX

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

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

func (*HistoryGroupBy) Bools

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

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

func (*HistoryGroupBy) BoolsX

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

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

func (*HistoryGroupBy) Float64

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

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

func (*HistoryGroupBy) Float64X

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

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

func (*HistoryGroupBy) Float64s

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

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

func (*HistoryGroupBy) Float64sX

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

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

func (*HistoryGroupBy) Int

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

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

func (*HistoryGroupBy) IntX

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

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

func (*HistoryGroupBy) Ints

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

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

func (*HistoryGroupBy) IntsX

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

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

func (*HistoryGroupBy) Scan

func (hgb *HistoryGroupBy) Scan(ctx context.Context, v any) error

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

func (*HistoryGroupBy) ScanX

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

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

func (*HistoryGroupBy) String

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

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

func (*HistoryGroupBy) StringX

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

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

func (*HistoryGroupBy) Strings

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

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

func (*HistoryGroupBy) StringsX

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

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

type HistoryMutation

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

HistoryMutation represents an operation that mutates the History nodes in the graph.

func (*HistoryMutation) AddDuration

func (m *HistoryMutation) AddDuration(i int)

AddDuration adds i to the "duration" field.

func (*HistoryMutation) AddExitCode

func (m *HistoryMutation) AddExitCode(i int)

AddExitCode adds i to the "exit_code" field.

func (*HistoryMutation) AddField

func (m *HistoryMutation) 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 (*HistoryMutation) AddScriptID

func (m *HistoryMutation) AddScriptID(i int)

AddScriptID adds i to the "script_id" field.

func (*HistoryMutation) AddedDuration

func (m *HistoryMutation) AddedDuration() (r int, exists bool)

AddedDuration returns the value that was added to the "duration" field in this mutation.

func (*HistoryMutation) AddedEdges

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

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

func (*HistoryMutation) AddedExitCode

func (m *HistoryMutation) AddedExitCode() (r int, exists bool)

AddedExitCode returns the value that was added to the "exit_code" field in this mutation.

func (*HistoryMutation) AddedField

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

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

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

func (*HistoryMutation) AddedIDs

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

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

func (*HistoryMutation) AddedScriptID

func (m *HistoryMutation) AddedScriptID() (r int, exists bool)

AddedScriptID returns the value that was added to the "script_id" field in this mutation.

func (*HistoryMutation) Arguments

func (m *HistoryMutation) Arguments() (r map[string]string, exists bool)

Arguments returns the value of the "arguments" field in the mutation.

func (*HistoryMutation) ClearEdge

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

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

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

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

func (*HistoryMutation) ClearedFields

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

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

func (HistoryMutation) Client

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

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

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

func (*HistoryMutation) Duration

func (m *HistoryMutation) Duration() (r int, exists bool)

Duration returns the value of the "duration" field in the mutation.

func (*HistoryMutation) EdgeCleared

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

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

func (*HistoryMutation) ExitCode

func (m *HistoryMutation) ExitCode() (r int, exists bool)

ExitCode returns the value of the "exit_code" field in the mutation.

func (*HistoryMutation) Field

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

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

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

func (*HistoryMutation) Fields

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

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

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

func (*HistoryMutation) IDs

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

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

func (*HistoryMutation) OldArguments

func (m *HistoryMutation) OldArguments(ctx context.Context) (v map[string]string, err error)

OldArguments returns the old "arguments" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldCreatedAt

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

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

func (m *HistoryMutation) OldDuration(ctx context.Context) (v int, err error)

OldDuration returns the old "duration" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldExitCode

func (m *HistoryMutation) OldExitCode(ctx context.Context) (v int, err error)

OldExitCode returns the old "exit_code" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldField

func (m *HistoryMutation) 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 (*HistoryMutation) OldOutput

func (m *HistoryMutation) OldOutput(ctx context.Context) (v string, err error)

OldOutput returns the old "output" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldRunID

func (m *HistoryMutation) OldRunID(ctx context.Context) (v string, err error)

OldRunID returns the old "run_id" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldScriptID

func (m *HistoryMutation) OldScriptID(ctx context.Context) (v int, err error)

OldScriptID returns the old "script_id" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldStatus

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

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

func (m *HistoryMutation) OldSuccess(ctx context.Context) (v bool, err error)

OldSuccess returns the old "success" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldTrigger

func (m *HistoryMutation) OldTrigger(ctx context.Context) (v string, err error)

OldTrigger returns the old "trigger" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldTriggeredBy

func (m *HistoryMutation) OldTriggeredBy(ctx context.Context) (v string, err error)

OldTriggeredBy returns the old "triggered_by" field's value of the History entity. If the History object wasn'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 (*HistoryMutation) OldUpdatedAt

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

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

func (m *HistoryMutation) Op() Op

Op returns the operation name.

func (*HistoryMutation) Output

func (m *HistoryMutation) Output() (r string, exists bool)

Output returns the value of the "output" field in the mutation.

func (*HistoryMutation) RemovedEdges

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

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

func (*HistoryMutation) RemovedIDs

func (m *HistoryMutation) 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 (*HistoryMutation) ResetArguments

func (m *HistoryMutation) ResetArguments()

ResetArguments resets all changes to the "arguments" field.

func (*HistoryMutation) ResetCreatedAt

func (m *HistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*HistoryMutation) ResetDuration

func (m *HistoryMutation) ResetDuration()

ResetDuration resets all changes to the "duration" field.

func (*HistoryMutation) ResetEdge

func (m *HistoryMutation) 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 (*HistoryMutation) ResetExitCode

func (m *HistoryMutation) ResetExitCode()

ResetExitCode resets all changes to the "exit_code" field.

func (*HistoryMutation) ResetField

func (m *HistoryMutation) 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 (*HistoryMutation) ResetOutput

func (m *HistoryMutation) ResetOutput()

ResetOutput resets all changes to the "output" field.

func (*HistoryMutation) ResetRunID

func (m *HistoryMutation) ResetRunID()

ResetRunID resets all changes to the "run_id" field.

func (*HistoryMutation) ResetScriptID

func (m *HistoryMutation) ResetScriptID()

ResetScriptID resets all changes to the "script_id" field.

func (*HistoryMutation) ResetStatus

func (m *HistoryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*HistoryMutation) ResetSuccess

func (m *HistoryMutation) ResetSuccess()

ResetSuccess resets all changes to the "success" field.

func (*HistoryMutation) ResetTrigger

func (m *HistoryMutation) ResetTrigger()

ResetTrigger resets all changes to the "trigger" field.

func (*HistoryMutation) ResetTriggeredBy

func (m *HistoryMutation) ResetTriggeredBy()

ResetTriggeredBy resets all changes to the "triggered_by" field.

func (*HistoryMutation) ResetUpdatedAt

func (m *HistoryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*HistoryMutation) RunID

func (m *HistoryMutation) RunID() (r string, exists bool)

RunID returns the value of the "run_id" field in the mutation.

func (*HistoryMutation) ScriptID

func (m *HistoryMutation) ScriptID() (r int, exists bool)

ScriptID returns the value of the "script_id" field in the mutation.

func (*HistoryMutation) SetArguments

func (m *HistoryMutation) SetArguments(value map[string]string)

SetArguments sets the "arguments" field.

func (*HistoryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*HistoryMutation) SetDuration

func (m *HistoryMutation) SetDuration(i int)

SetDuration sets the "duration" field.

func (*HistoryMutation) SetExitCode

func (m *HistoryMutation) SetExitCode(i int)

SetExitCode sets the "exit_code" field.

func (*HistoryMutation) SetField

func (m *HistoryMutation) 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 (*HistoryMutation) SetOp

func (m *HistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*HistoryMutation) SetOutput

func (m *HistoryMutation) SetOutput(s string)

SetOutput sets the "output" field.

func (*HistoryMutation) SetRunID

func (m *HistoryMutation) SetRunID(s string)

SetRunID sets the "run_id" field.

func (*HistoryMutation) SetScriptID

func (m *HistoryMutation) SetScriptID(i int)

SetScriptID sets the "script_id" field.

func (*HistoryMutation) SetStatus

func (m *HistoryMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*HistoryMutation) SetSuccess

func (m *HistoryMutation) SetSuccess(b bool)

SetSuccess sets the "success" field.

func (*HistoryMutation) SetTrigger

func (m *HistoryMutation) SetTrigger(s string)

SetTrigger sets the "trigger" field.

func (*HistoryMutation) SetTriggeredBy

func (m *HistoryMutation) SetTriggeredBy(s string)

SetTriggeredBy sets the "triggered_by" field.

func (*HistoryMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*HistoryMutation) Status

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

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

func (*HistoryMutation) Success

func (m *HistoryMutation) Success() (r bool, exists bool)

Success returns the value of the "success" field in the mutation.

func (*HistoryMutation) Trigger

func (m *HistoryMutation) Trigger() (r string, exists bool)

Trigger returns the value of the "trigger" field in the mutation.

func (*HistoryMutation) TriggeredBy

func (m *HistoryMutation) TriggeredBy() (r string, exists bool)

TriggeredBy returns the value of the "triggered_by" field in the mutation.

func (HistoryMutation) Tx

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

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

func (*HistoryMutation) Type

func (m *HistoryMutation) Type() string

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

func (*HistoryMutation) UpdatedAt

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

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

func (*HistoryMutation) Where

func (m *HistoryMutation) Where(ps ...predicate.History)

Where appends a list predicates to the HistoryMutation builder.

func (*HistoryMutation) WhereP

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

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

type HistoryQuery

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

HistoryQuery is the builder for querying History entities.

func (*HistoryQuery) Aggregate

func (hq *HistoryQuery) Aggregate(fns ...AggregateFunc) *HistorySelect

Aggregate returns a HistorySelect configured with the given aggregations.

func (*HistoryQuery) All

func (hq *HistoryQuery) All(ctx context.Context) ([]*History, error)

All executes the query and returns a list of Histories.

func (*HistoryQuery) AllX

func (hq *HistoryQuery) AllX(ctx context.Context) []*History

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

func (*HistoryQuery) Clone

func (hq *HistoryQuery) Clone() *HistoryQuery

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

func (*HistoryQuery) Count

func (hq *HistoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*HistoryQuery) CountX

func (hq *HistoryQuery) CountX(ctx context.Context) int

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

func (*HistoryQuery) Exist

func (hq *HistoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*HistoryQuery) ExistX

func (hq *HistoryQuery) ExistX(ctx context.Context) bool

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

func (*HistoryQuery) First

func (hq *HistoryQuery) First(ctx context.Context) (*History, error)

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

func (*HistoryQuery) FirstID

func (hq *HistoryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*HistoryQuery) FirstIDX

func (hq *HistoryQuery) FirstIDX(ctx context.Context) int

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

func (*HistoryQuery) FirstX

func (hq *HistoryQuery) FirstX(ctx context.Context) *History

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

func (*HistoryQuery) GroupBy

func (hq *HistoryQuery) GroupBy(field string, fields ...string) *HistoryGroupBy

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.History.Query().
	GroupBy(history.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*HistoryQuery) IDs

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

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

func (*HistoryQuery) IDsX

func (hq *HistoryQuery) IDsX(ctx context.Context) []int

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

func (*HistoryQuery) Limit

func (hq *HistoryQuery) Limit(limit int) *HistoryQuery

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

func (*HistoryQuery) Offset

func (hq *HistoryQuery) Offset(offset int) *HistoryQuery

Offset to start from.

func (*HistoryQuery) Only

func (hq *HistoryQuery) Only(ctx context.Context) (*History, error)

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

func (*HistoryQuery) OnlyID

func (hq *HistoryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*HistoryQuery) OnlyIDX

func (hq *HistoryQuery) OnlyIDX(ctx context.Context) int

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

func (*HistoryQuery) OnlyX

func (hq *HistoryQuery) OnlyX(ctx context.Context) *History

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

func (*HistoryQuery) Order

func (hq *HistoryQuery) Order(o ...history.OrderOption) *HistoryQuery

Order specifies how the records should be ordered.

func (*HistoryQuery) Select

func (hq *HistoryQuery) Select(fields ...string) *HistorySelect

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.History.Query().
	Select(history.FieldCreatedAt).
	Scan(ctx, &v)

func (*HistoryQuery) Unique

func (hq *HistoryQuery) Unique(unique bool) *HistoryQuery

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

func (hq *HistoryQuery) Where(ps ...predicate.History) *HistoryQuery

Where adds a new predicate for the HistoryQuery builder.

type HistorySelect

type HistorySelect struct {
	*HistoryQuery
	// contains filtered or unexported fields
}

HistorySelect is the builder for selecting fields of History entities.

func (*HistorySelect) Aggregate

func (hs *HistorySelect) Aggregate(fns ...AggregateFunc) *HistorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*HistorySelect) Bool

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

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

func (*HistorySelect) BoolX

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

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

func (*HistorySelect) Bools

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

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

func (*HistorySelect) BoolsX

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

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

func (*HistorySelect) Float64

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

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

func (*HistorySelect) Float64X

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

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

func (*HistorySelect) Float64s

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

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

func (*HistorySelect) Float64sX

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

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

func (*HistorySelect) Int

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

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

func (*HistorySelect) IntX

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

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

func (*HistorySelect) Ints

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

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

func (*HistorySelect) IntsX

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

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

func (*HistorySelect) Scan

func (hs *HistorySelect) Scan(ctx context.Context, v any) error

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

func (*HistorySelect) ScanX

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

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

func (*HistorySelect) String

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

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

func (*HistorySelect) StringX

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

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

func (*HistorySelect) Strings

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

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

func (*HistorySelect) StringsX

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

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

type HistoryUpdate

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

HistoryUpdate is the builder for updating History entities.

func (*HistoryUpdate) AddDuration

func (hu *HistoryUpdate) AddDuration(i int) *HistoryUpdate

AddDuration adds i to the "duration" field.

func (*HistoryUpdate) AddExitCode

func (hu *HistoryUpdate) AddExitCode(i int) *HistoryUpdate

AddExitCode adds i to the "exit_code" field.

func (*HistoryUpdate) AddScriptID

func (hu *HistoryUpdate) AddScriptID(i int) *HistoryUpdate

AddScriptID adds i to the "script_id" field.

func (*HistoryUpdate) Exec

func (hu *HistoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*HistoryUpdate) ExecX

func (hu *HistoryUpdate) ExecX(ctx context.Context)

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

func (*HistoryUpdate) Mutation

func (hu *HistoryUpdate) Mutation() *HistoryMutation

Mutation returns the HistoryMutation object of the builder.

func (*HistoryUpdate) Save

func (hu *HistoryUpdate) Save(ctx context.Context) (int, error)

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

func (*HistoryUpdate) SaveX

func (hu *HistoryUpdate) SaveX(ctx context.Context) int

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

func (*HistoryUpdate) SetArguments

func (hu *HistoryUpdate) SetArguments(m map[string]string) *HistoryUpdate

SetArguments sets the "arguments" field.

func (*HistoryUpdate) SetDuration

func (hu *HistoryUpdate) SetDuration(i int) *HistoryUpdate

SetDuration sets the "duration" field.

func (*HistoryUpdate) SetExitCode

func (hu *HistoryUpdate) SetExitCode(i int) *HistoryUpdate

SetExitCode sets the "exit_code" field.

func (*HistoryUpdate) SetNillableStatus

func (hu *HistoryUpdate) SetNillableStatus(s *string) *HistoryUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*HistoryUpdate) SetOutput

func (hu *HistoryUpdate) SetOutput(s string) *HistoryUpdate

SetOutput sets the "output" field.

func (*HistoryUpdate) SetRunID

func (hu *HistoryUpdate) SetRunID(s string) *HistoryUpdate

SetRunID sets the "run_id" field.

func (*HistoryUpdate) SetScriptID

func (hu *HistoryUpdate) SetScriptID(i int) *HistoryUpdate

SetScriptID sets the "script_id" field.

func (*HistoryUpdate) SetStatus

func (hu *HistoryUpdate) SetStatus(s string) *HistoryUpdate

SetStatus sets the "status" field.

func (*HistoryUpdate) SetSuccess

func (hu *HistoryUpdate) SetSuccess(b bool) *HistoryUpdate

SetSuccess sets the "success" field.

func (*HistoryUpdate) SetTrigger

func (hu *HistoryUpdate) SetTrigger(s string) *HistoryUpdate

SetTrigger sets the "trigger" field.

func (*HistoryUpdate) SetTriggeredBy

func (hu *HistoryUpdate) SetTriggeredBy(s string) *HistoryUpdate

SetTriggeredBy sets the "triggered_by" field.

func (*HistoryUpdate) SetUpdatedAt

func (hu *HistoryUpdate) SetUpdatedAt(t time.Time) *HistoryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*HistoryUpdate) Where

func (hu *HistoryUpdate) Where(ps ...predicate.History) *HistoryUpdate

Where appends a list predicates to the HistoryUpdate builder.

type HistoryUpdateOne

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

HistoryUpdateOne is the builder for updating a single History entity.

func (*HistoryUpdateOne) AddDuration

func (huo *HistoryUpdateOne) AddDuration(i int) *HistoryUpdateOne

AddDuration adds i to the "duration" field.

func (*HistoryUpdateOne) AddExitCode

func (huo *HistoryUpdateOne) AddExitCode(i int) *HistoryUpdateOne

AddExitCode adds i to the "exit_code" field.

func (*HistoryUpdateOne) AddScriptID

func (huo *HistoryUpdateOne) AddScriptID(i int) *HistoryUpdateOne

AddScriptID adds i to the "script_id" field.

func (*HistoryUpdateOne) Exec

func (huo *HistoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*HistoryUpdateOne) ExecX

func (huo *HistoryUpdateOne) ExecX(ctx context.Context)

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

func (*HistoryUpdateOne) Mutation

func (huo *HistoryUpdateOne) Mutation() *HistoryMutation

Mutation returns the HistoryMutation object of the builder.

func (*HistoryUpdateOne) Save

func (huo *HistoryUpdateOne) Save(ctx context.Context) (*History, error)

Save executes the query and returns the updated History entity.

func (*HistoryUpdateOne) SaveX

func (huo *HistoryUpdateOne) SaveX(ctx context.Context) *History

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

func (*HistoryUpdateOne) Select

func (huo *HistoryUpdateOne) Select(field string, fields ...string) *HistoryUpdateOne

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

func (*HistoryUpdateOne) SetArguments

func (huo *HistoryUpdateOne) SetArguments(m map[string]string) *HistoryUpdateOne

SetArguments sets the "arguments" field.

func (*HistoryUpdateOne) SetDuration

func (huo *HistoryUpdateOne) SetDuration(i int) *HistoryUpdateOne

SetDuration sets the "duration" field.

func (*HistoryUpdateOne) SetExitCode

func (huo *HistoryUpdateOne) SetExitCode(i int) *HistoryUpdateOne

SetExitCode sets the "exit_code" field.

func (*HistoryUpdateOne) SetNillableStatus

func (huo *HistoryUpdateOne) SetNillableStatus(s *string) *HistoryUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*HistoryUpdateOne) SetOutput

func (huo *HistoryUpdateOne) SetOutput(s string) *HistoryUpdateOne

SetOutput sets the "output" field.

func (*HistoryUpdateOne) SetRunID

func (huo *HistoryUpdateOne) SetRunID(s string) *HistoryUpdateOne

SetRunID sets the "run_id" field.

func (*HistoryUpdateOne) SetScriptID

func (huo *HistoryUpdateOne) SetScriptID(i int) *HistoryUpdateOne

SetScriptID sets the "script_id" field.

func (*HistoryUpdateOne) SetStatus

func (huo *HistoryUpdateOne) SetStatus(s string) *HistoryUpdateOne

SetStatus sets the "status" field.

func (*HistoryUpdateOne) SetSuccess

func (huo *HistoryUpdateOne) SetSuccess(b bool) *HistoryUpdateOne

SetSuccess sets the "success" field.

func (*HistoryUpdateOne) SetTrigger

func (huo *HistoryUpdateOne) SetTrigger(s string) *HistoryUpdateOne

SetTrigger sets the "trigger" field.

func (*HistoryUpdateOne) SetTriggeredBy

func (huo *HistoryUpdateOne) SetTriggeredBy(s string) *HistoryUpdateOne

SetTriggeredBy sets the "triggered_by" field.

func (*HistoryUpdateOne) SetUpdatedAt

func (huo *HistoryUpdateOne) SetUpdatedAt(t time.Time) *HistoryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*HistoryUpdateOne) Where

Where appends a list predicates to the HistoryUpdate builder.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

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

type NotificationChannel struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// SlackConfig holds the value of the "slack_config" field.
	SlackConfig schema.SlackConfig `json:"slack_config,omitempty"`
	// EmailConfig holds the value of the "email_config" field.
	EmailConfig schema.EmailConfig `json:"email_config,omitempty"`
	// WebhookConfig holds the value of the "webhook_config" field.
	WebhookConfig schema.WebhookConfig `json:"webhook_config,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// LastUsed holds the value of the "last_used" field.
	LastUsed *time.Time `json:"last_used,omitempty"`
	// LastUsedSuccess holds the value of the "last_used_success" field.
	LastUsedSuccess *bool `json:"last_used_success,omitempty"`
	// contains filtered or unexported fields
}

NotificationChannel is the model entity for the NotificationChannel schema.

func (*NotificationChannel) String

func (nc *NotificationChannel) String() string

String implements the fmt.Stringer.

func (*NotificationChannel) Unwrap

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

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

func (*NotificationChannel) Value

func (nc *NotificationChannel) Value(name string) (ent.Value, error)

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

type NotificationChannelClient

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

NotificationChannelClient is a client for the NotificationChannel schema.

func NewNotificationChannelClient

func NewNotificationChannelClient(c config) *NotificationChannelClient

NewNotificationChannelClient returns a client for the NotificationChannel from the given config.

func (*NotificationChannelClient) Create

Create returns a builder for creating a NotificationChannel entity.

func (*NotificationChannelClient) CreateBulk

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

func (*NotificationChannelClient) Delete

Delete returns a delete builder for NotificationChannel.

func (*NotificationChannelClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotificationChannelClient) DeleteOneID

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

func (*NotificationChannelClient) Get

Get returns a NotificationChannel entity by its id.

func (*NotificationChannelClient) GetX

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

func (*NotificationChannelClient) Hooks

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

Hooks returns the client hooks.

func (*NotificationChannelClient) Intercept

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

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

func (*NotificationChannelClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NotificationChannelClient) Query

Query returns a query builder for NotificationChannel.

func (*NotificationChannelClient) Update

Update returns an update builder for NotificationChannel.

func (*NotificationChannelClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotificationChannelClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NotificationChannelClient) Use

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

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

type NotificationChannelCreate

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

NotificationChannelCreate is the builder for creating a NotificationChannel entity.

func (*NotificationChannelCreate) Exec

Exec executes the query.

func (*NotificationChannelCreate) ExecX

func (ncc *NotificationChannelCreate) ExecX(ctx context.Context)

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

func (*NotificationChannelCreate) Mutation

Mutation returns the NotificationChannelMutation object of the builder.

func (*NotificationChannelCreate) Save

Save creates the NotificationChannel in the database.

func (*NotificationChannelCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NotificationChannelCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*NotificationChannelCreate) SetEmailConfig

SetEmailConfig sets the "email_config" field.

func (*NotificationChannelCreate) SetEnabled

SetEnabled sets the "enabled" field.

func (*NotificationChannelCreate) SetLastUsed

SetLastUsed sets the "last_used" field.

func (*NotificationChannelCreate) SetLastUsedSuccess

func (ncc *NotificationChannelCreate) SetLastUsedSuccess(b bool) *NotificationChannelCreate

SetLastUsedSuccess sets the "last_used_success" field.

func (*NotificationChannelCreate) SetName

SetName sets the "name" field.

func (*NotificationChannelCreate) SetNillableCreatedAt

func (ncc *NotificationChannelCreate) SetNillableCreatedAt(t *time.Time) *NotificationChannelCreate

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

func (*NotificationChannelCreate) SetNillableEmailConfig

func (ncc *NotificationChannelCreate) SetNillableEmailConfig(sc *schema.EmailConfig) *NotificationChannelCreate

SetNillableEmailConfig sets the "email_config" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableEnabled

func (ncc *NotificationChannelCreate) SetNillableEnabled(b *bool) *NotificationChannelCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableLastUsed

func (ncc *NotificationChannelCreate) SetNillableLastUsed(t *time.Time) *NotificationChannelCreate

SetNillableLastUsed sets the "last_used" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableLastUsedSuccess

func (ncc *NotificationChannelCreate) SetNillableLastUsedSuccess(b *bool) *NotificationChannelCreate

SetNillableLastUsedSuccess sets the "last_used_success" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableSlackConfig

func (ncc *NotificationChannelCreate) SetNillableSlackConfig(sc *schema.SlackConfig) *NotificationChannelCreate

SetNillableSlackConfig sets the "slack_config" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableUpdatedAt

func (ncc *NotificationChannelCreate) SetNillableUpdatedAt(t *time.Time) *NotificationChannelCreate

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

func (*NotificationChannelCreate) SetNillableWebhookConfig

func (ncc *NotificationChannelCreate) SetNillableWebhookConfig(sc *schema.WebhookConfig) *NotificationChannelCreate

SetNillableWebhookConfig sets the "webhook_config" field if the given value is not nil.

func (*NotificationChannelCreate) SetSlackConfig

SetSlackConfig sets the "slack_config" field.

func (*NotificationChannelCreate) SetType

SetType sets the "type" field.

func (*NotificationChannelCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelCreate) SetWebhookConfig

SetWebhookConfig sets the "webhook_config" field.

type NotificationChannelCreateBulk

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

NotificationChannelCreateBulk is the builder for creating many NotificationChannel entities in bulk.

func (*NotificationChannelCreateBulk) Exec

Exec executes the query.

func (*NotificationChannelCreateBulk) ExecX

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

func (*NotificationChannelCreateBulk) Save

Save creates the NotificationChannel entities in the database.

func (*NotificationChannelCreateBulk) SaveX

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

type NotificationChannelDelete

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

NotificationChannelDelete is the builder for deleting a NotificationChannel entity.

func (*NotificationChannelDelete) Exec

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

func (*NotificationChannelDelete) ExecX

func (ncd *NotificationChannelDelete) ExecX(ctx context.Context) int

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

func (*NotificationChannelDelete) Where

Where appends a list predicates to the NotificationChannelDelete builder.

type NotificationChannelDeleteOne

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

NotificationChannelDeleteOne is the builder for deleting a single NotificationChannel entity.

func (*NotificationChannelDeleteOne) Exec

Exec executes the deletion query.

func (*NotificationChannelDeleteOne) ExecX

func (ncdo *NotificationChannelDeleteOne) ExecX(ctx context.Context)

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

func (*NotificationChannelDeleteOne) Where

Where appends a list predicates to the NotificationChannelDelete builder.

type NotificationChannelGroupBy

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

NotificationChannelGroupBy is the group-by builder for NotificationChannel entities.

func (*NotificationChannelGroupBy) Aggregate

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

func (*NotificationChannelGroupBy) Bool

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

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

func (*NotificationChannelGroupBy) BoolX

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

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

func (*NotificationChannelGroupBy) Bools

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

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

func (*NotificationChannelGroupBy) BoolsX

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

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

func (*NotificationChannelGroupBy) Float64

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

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

func (*NotificationChannelGroupBy) Float64X

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

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

func (*NotificationChannelGroupBy) Float64s

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

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

func (*NotificationChannelGroupBy) Float64sX

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

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

func (*NotificationChannelGroupBy) Int

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

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

func (*NotificationChannelGroupBy) IntX

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

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

func (*NotificationChannelGroupBy) Ints

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

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

func (*NotificationChannelGroupBy) IntsX

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

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

func (*NotificationChannelGroupBy) Scan

func (ncgb *NotificationChannelGroupBy) Scan(ctx context.Context, v any) error

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

func (*NotificationChannelGroupBy) ScanX

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

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

func (*NotificationChannelGroupBy) String

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

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

func (*NotificationChannelGroupBy) StringX

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

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

func (*NotificationChannelGroupBy) Strings

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

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

func (*NotificationChannelGroupBy) StringsX

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

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

type NotificationChannelMutation

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

NotificationChannelMutation represents an operation that mutates the NotificationChannel nodes in the graph.

func (*NotificationChannelMutation) AddField

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

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

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

func (*NotificationChannelMutation) AddedField

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

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

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

func (*NotificationChannelMutation) AddedIDs

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

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

func (*NotificationChannelMutation) ClearEdge

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ClearEmailConfig

func (m *NotificationChannelMutation) ClearEmailConfig()

ClearEmailConfig clears the value of the "email_config" field.

func (*NotificationChannelMutation) ClearField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ClearLastUsed

func (m *NotificationChannelMutation) ClearLastUsed()

ClearLastUsed clears the value of the "last_used" field.

func (*NotificationChannelMutation) ClearLastUsedSuccess

func (m *NotificationChannelMutation) ClearLastUsedSuccess()

ClearLastUsedSuccess clears the value of the "last_used_success" field.

func (*NotificationChannelMutation) ClearSlackConfig

func (m *NotificationChannelMutation) ClearSlackConfig()

ClearSlackConfig clears the value of the "slack_config" field.

func (*NotificationChannelMutation) ClearWebhookConfig

func (m *NotificationChannelMutation) ClearWebhookConfig()

ClearWebhookConfig clears the value of the "webhook_config" field.

func (*NotificationChannelMutation) ClearedEdges

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

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

func (*NotificationChannelMutation) ClearedFields

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

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

func (NotificationChannelMutation) Client

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

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

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

func (*NotificationChannelMutation) EdgeCleared

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

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

func (*NotificationChannelMutation) EmailConfig

func (m *NotificationChannelMutation) EmailConfig() (r schema.EmailConfig, exists bool)

EmailConfig returns the value of the "email_config" field in the mutation.

func (*NotificationChannelMutation) EmailConfigCleared

func (m *NotificationChannelMutation) EmailConfigCleared() bool

EmailConfigCleared returns if the "email_config" field was cleared in this mutation.

func (*NotificationChannelMutation) Enabled

func (m *NotificationChannelMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*NotificationChannelMutation) Field

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

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

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

func (*NotificationChannelMutation) Fields

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) GetType

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

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

func (*NotificationChannelMutation) ID

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

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

func (*NotificationChannelMutation) IDs

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 (*NotificationChannelMutation) LastUsed

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

LastUsed returns the value of the "last_used" field in the mutation.

func (*NotificationChannelMutation) LastUsedCleared

func (m *NotificationChannelMutation) LastUsedCleared() bool

LastUsedCleared returns if the "last_used" field was cleared in this mutation.

func (*NotificationChannelMutation) LastUsedSuccess

func (m *NotificationChannelMutation) LastUsedSuccess() (r bool, exists bool)

LastUsedSuccess returns the value of the "last_used_success" field in the mutation.

func (*NotificationChannelMutation) LastUsedSuccessCleared

func (m *NotificationChannelMutation) LastUsedSuccessCleared() bool

LastUsedSuccessCleared returns if the "last_used_success" field was cleared in this mutation.

func (*NotificationChannelMutation) Name

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

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

func (*NotificationChannelMutation) OldCreatedAt

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

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

func (m *NotificationChannelMutation) OldEmailConfig(ctx context.Context) (v schema.EmailConfig, err error)

OldEmailConfig returns the old "email_config" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) OldEnabled

func (m *NotificationChannelMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) OldField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) OldLastUsed

func (m *NotificationChannelMutation) OldLastUsed(ctx context.Context) (v *time.Time, err error)

OldLastUsed returns the old "last_used" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) OldLastUsedSuccess

func (m *NotificationChannelMutation) OldLastUsedSuccess(ctx context.Context) (v *bool, err error)

OldLastUsedSuccess returns the old "last_used_success" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) OldName

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

OldName returns the old "name" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) OldSlackConfig

func (m *NotificationChannelMutation) OldSlackConfig(ctx context.Context) (v schema.SlackConfig, err error)

OldSlackConfig returns the old "slack_config" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) OldType

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

OldType returns the old "type" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) OldUpdatedAt

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

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

func (m *NotificationChannelMutation) OldWebhookConfig(ctx context.Context) (v schema.WebhookConfig, err error)

OldWebhookConfig returns the old "webhook_config" field's value of the NotificationChannel entity. If the NotificationChannel object wasn'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 (*NotificationChannelMutation) Op

Op returns the operation name.

func (*NotificationChannelMutation) RemovedEdges

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

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

func (*NotificationChannelMutation) RemovedIDs

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ResetCreatedAt

func (m *NotificationChannelMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NotificationChannelMutation) ResetEdge

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ResetEmailConfig

func (m *NotificationChannelMutation) ResetEmailConfig()

ResetEmailConfig resets all changes to the "email_config" field.

func (*NotificationChannelMutation) ResetEnabled

func (m *NotificationChannelMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*NotificationChannelMutation) ResetField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ResetLastUsed

func (m *NotificationChannelMutation) ResetLastUsed()

ResetLastUsed resets all changes to the "last_used" field.

func (*NotificationChannelMutation) ResetLastUsedSuccess

func (m *NotificationChannelMutation) ResetLastUsedSuccess()

ResetLastUsedSuccess resets all changes to the "last_used_success" field.

func (*NotificationChannelMutation) ResetName

func (m *NotificationChannelMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NotificationChannelMutation) ResetSlackConfig

func (m *NotificationChannelMutation) ResetSlackConfig()

ResetSlackConfig resets all changes to the "slack_config" field.

func (*NotificationChannelMutation) ResetType

func (m *NotificationChannelMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*NotificationChannelMutation) ResetUpdatedAt

func (m *NotificationChannelMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NotificationChannelMutation) ResetWebhookConfig

func (m *NotificationChannelMutation) ResetWebhookConfig()

ResetWebhookConfig resets all changes to the "webhook_config" field.

func (*NotificationChannelMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*NotificationChannelMutation) SetEmailConfig

func (m *NotificationChannelMutation) SetEmailConfig(sc schema.EmailConfig)

SetEmailConfig sets the "email_config" field.

func (*NotificationChannelMutation) SetEnabled

func (m *NotificationChannelMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*NotificationChannelMutation) SetField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) SetLastUsed

func (m *NotificationChannelMutation) SetLastUsed(t time.Time)

SetLastUsed sets the "last_used" field.

func (*NotificationChannelMutation) SetLastUsedSuccess

func (m *NotificationChannelMutation) SetLastUsedSuccess(b bool)

SetLastUsedSuccess sets the "last_used_success" field.

func (*NotificationChannelMutation) SetName

func (m *NotificationChannelMutation) SetName(s string)

SetName sets the "name" field.

func (*NotificationChannelMutation) SetOp

func (m *NotificationChannelMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotificationChannelMutation) SetSlackConfig

func (m *NotificationChannelMutation) SetSlackConfig(sc schema.SlackConfig)

SetSlackConfig sets the "slack_config" field.

func (*NotificationChannelMutation) SetType

func (m *NotificationChannelMutation) SetType(s string)

SetType sets the "type" field.

func (*NotificationChannelMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelMutation) SetWebhookConfig

func (m *NotificationChannelMutation) SetWebhookConfig(sc schema.WebhookConfig)

SetWebhookConfig sets the "webhook_config" field.

func (*NotificationChannelMutation) SlackConfig

func (m *NotificationChannelMutation) SlackConfig() (r schema.SlackConfig, exists bool)

SlackConfig returns the value of the "slack_config" field in the mutation.

func (*NotificationChannelMutation) SlackConfigCleared

func (m *NotificationChannelMutation) SlackConfigCleared() bool

SlackConfigCleared returns if the "slack_config" field was cleared in this mutation.

func (NotificationChannelMutation) Tx

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

func (*NotificationChannelMutation) Type

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

func (*NotificationChannelMutation) UpdatedAt

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

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

func (*NotificationChannelMutation) WebhookConfig

func (m *NotificationChannelMutation) WebhookConfig() (r schema.WebhookConfig, exists bool)

WebhookConfig returns the value of the "webhook_config" field in the mutation.

func (*NotificationChannelMutation) WebhookConfigCleared

func (m *NotificationChannelMutation) WebhookConfigCleared() bool

WebhookConfigCleared returns if the "webhook_config" field was cleared in this mutation.

func (*NotificationChannelMutation) Where

Where appends a list predicates to the NotificationChannelMutation builder.

func (*NotificationChannelMutation) WhereP

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

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

type NotificationChannelQuery

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

NotificationChannelQuery is the builder for querying NotificationChannel entities.

func (*NotificationChannelQuery) Aggregate

Aggregate returns a NotificationChannelSelect configured with the given aggregations.

func (*NotificationChannelQuery) All

All executes the query and returns a list of NotificationChannels.

func (*NotificationChannelQuery) AllX

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

func (*NotificationChannelQuery) Clone

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

func (*NotificationChannelQuery) Count

func (ncq *NotificationChannelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NotificationChannelQuery) CountX

func (ncq *NotificationChannelQuery) CountX(ctx context.Context) int

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

func (*NotificationChannelQuery) Exist

func (ncq *NotificationChannelQuery) Exist(ctx context.Context) (bool, error)

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

func (*NotificationChannelQuery) ExistX

func (ncq *NotificationChannelQuery) ExistX(ctx context.Context) bool

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

func (*NotificationChannelQuery) First

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

func (*NotificationChannelQuery) FirstID

func (ncq *NotificationChannelQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NotificationChannelQuery) FirstIDX

func (ncq *NotificationChannelQuery) FirstIDX(ctx context.Context) int

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

func (*NotificationChannelQuery) FirstX

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

func (*NotificationChannelQuery) GroupBy

func (ncq *NotificationChannelQuery) GroupBy(field string, fields ...string) *NotificationChannelGroupBy

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.NotificationChannel.Query().
	GroupBy(notificationchannel.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NotificationChannelQuery) IDs

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

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

func (*NotificationChannelQuery) IDsX

func (ncq *NotificationChannelQuery) IDsX(ctx context.Context) []int

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

func (*NotificationChannelQuery) Limit

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

func (*NotificationChannelQuery) Offset

Offset to start from.

func (*NotificationChannelQuery) Only

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

func (*NotificationChannelQuery) OnlyID

func (ncq *NotificationChannelQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NotificationChannelQuery) OnlyIDX

func (ncq *NotificationChannelQuery) OnlyIDX(ctx context.Context) int

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

func (*NotificationChannelQuery) OnlyX

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

func (*NotificationChannelQuery) Order

Order specifies how the records should be ordered.

func (*NotificationChannelQuery) Select

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.NotificationChannel.Query().
	Select(notificationchannel.FieldCreatedAt).
	Scan(ctx, &v)

func (*NotificationChannelQuery) Unique

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

Where adds a new predicate for the NotificationChannelQuery builder.

type NotificationChannelSelect

type NotificationChannelSelect struct {
	*NotificationChannelQuery
	// contains filtered or unexported fields
}

NotificationChannelSelect is the builder for selecting fields of NotificationChannel entities.

func (*NotificationChannelSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*NotificationChannelSelect) Bool

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

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

func (*NotificationChannelSelect) BoolX

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

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

func (*NotificationChannelSelect) Bools

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

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

func (*NotificationChannelSelect) BoolsX

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

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

func (*NotificationChannelSelect) Float64

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

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

func (*NotificationChannelSelect) Float64X

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

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

func (*NotificationChannelSelect) Float64s

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

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

func (*NotificationChannelSelect) Float64sX

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

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

func (*NotificationChannelSelect) Int

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

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

func (*NotificationChannelSelect) IntX

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

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

func (*NotificationChannelSelect) Ints

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

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

func (*NotificationChannelSelect) IntsX

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

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

func (*NotificationChannelSelect) Scan

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

func (*NotificationChannelSelect) ScanX

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

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

func (*NotificationChannelSelect) String

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

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

func (*NotificationChannelSelect) StringX

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

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

func (*NotificationChannelSelect) Strings

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

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

func (*NotificationChannelSelect) StringsX

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

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

type NotificationChannelUpdate

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

NotificationChannelUpdate is the builder for updating NotificationChannel entities.

func (*NotificationChannelUpdate) ClearEmailConfig

func (ncu *NotificationChannelUpdate) ClearEmailConfig() *NotificationChannelUpdate

ClearEmailConfig clears the value of the "email_config" field.

func (*NotificationChannelUpdate) ClearLastUsed

ClearLastUsed clears the value of the "last_used" field.

func (*NotificationChannelUpdate) ClearLastUsedSuccess

func (ncu *NotificationChannelUpdate) ClearLastUsedSuccess() *NotificationChannelUpdate

ClearLastUsedSuccess clears the value of the "last_used_success" field.

func (*NotificationChannelUpdate) ClearSlackConfig

func (ncu *NotificationChannelUpdate) ClearSlackConfig() *NotificationChannelUpdate

ClearSlackConfig clears the value of the "slack_config" field.

func (*NotificationChannelUpdate) ClearWebhookConfig

func (ncu *NotificationChannelUpdate) ClearWebhookConfig() *NotificationChannelUpdate

ClearWebhookConfig clears the value of the "webhook_config" field.

func (*NotificationChannelUpdate) Exec

Exec executes the query.

func (*NotificationChannelUpdate) ExecX

func (ncu *NotificationChannelUpdate) ExecX(ctx context.Context)

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

func (*NotificationChannelUpdate) Mutation

Mutation returns the NotificationChannelMutation object of the builder.

func (*NotificationChannelUpdate) Save

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

func (*NotificationChannelUpdate) SaveX

func (ncu *NotificationChannelUpdate) SaveX(ctx context.Context) int

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

func (*NotificationChannelUpdate) SetEmailConfig

SetEmailConfig sets the "email_config" field.

func (*NotificationChannelUpdate) SetEnabled

SetEnabled sets the "enabled" field.

func (*NotificationChannelUpdate) SetLastUsed

SetLastUsed sets the "last_used" field.

func (*NotificationChannelUpdate) SetLastUsedSuccess

func (ncu *NotificationChannelUpdate) SetLastUsedSuccess(b bool) *NotificationChannelUpdate

SetLastUsedSuccess sets the "last_used_success" field.

func (*NotificationChannelUpdate) SetName

SetName sets the "name" field.

func (*NotificationChannelUpdate) SetNillableEmailConfig

func (ncu *NotificationChannelUpdate) SetNillableEmailConfig(sc *schema.EmailConfig) *NotificationChannelUpdate

SetNillableEmailConfig sets the "email_config" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableEnabled

func (ncu *NotificationChannelUpdate) SetNillableEnabled(b *bool) *NotificationChannelUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableLastUsed

func (ncu *NotificationChannelUpdate) SetNillableLastUsed(t *time.Time) *NotificationChannelUpdate

SetNillableLastUsed sets the "last_used" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableLastUsedSuccess

func (ncu *NotificationChannelUpdate) SetNillableLastUsedSuccess(b *bool) *NotificationChannelUpdate

SetNillableLastUsedSuccess sets the "last_used_success" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableSlackConfig

func (ncu *NotificationChannelUpdate) SetNillableSlackConfig(sc *schema.SlackConfig) *NotificationChannelUpdate

SetNillableSlackConfig sets the "slack_config" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableWebhookConfig

func (ncu *NotificationChannelUpdate) SetNillableWebhookConfig(sc *schema.WebhookConfig) *NotificationChannelUpdate

SetNillableWebhookConfig sets the "webhook_config" field if the given value is not nil.

func (*NotificationChannelUpdate) SetSlackConfig

SetSlackConfig sets the "slack_config" field.

func (*NotificationChannelUpdate) SetType

SetType sets the "type" field.

func (*NotificationChannelUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelUpdate) SetWebhookConfig

SetWebhookConfig sets the "webhook_config" field.

func (*NotificationChannelUpdate) Where

Where appends a list predicates to the NotificationChannelUpdate builder.

type NotificationChannelUpdateOne

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

NotificationChannelUpdateOne is the builder for updating a single NotificationChannel entity.

func (*NotificationChannelUpdateOne) ClearEmailConfig

ClearEmailConfig clears the value of the "email_config" field.

func (*NotificationChannelUpdateOne) ClearLastUsed

ClearLastUsed clears the value of the "last_used" field.

func (*NotificationChannelUpdateOne) ClearLastUsedSuccess

func (ncuo *NotificationChannelUpdateOne) ClearLastUsedSuccess() *NotificationChannelUpdateOne

ClearLastUsedSuccess clears the value of the "last_used_success" field.

func (*NotificationChannelUpdateOne) ClearSlackConfig

ClearSlackConfig clears the value of the "slack_config" field.

func (*NotificationChannelUpdateOne) ClearWebhookConfig

func (ncuo *NotificationChannelUpdateOne) ClearWebhookConfig() *NotificationChannelUpdateOne

ClearWebhookConfig clears the value of the "webhook_config" field.

func (*NotificationChannelUpdateOne) Exec

Exec executes the query on the entity.

func (*NotificationChannelUpdateOne) ExecX

func (ncuo *NotificationChannelUpdateOne) ExecX(ctx context.Context)

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

func (*NotificationChannelUpdateOne) Mutation

Mutation returns the NotificationChannelMutation object of the builder.

func (*NotificationChannelUpdateOne) Save

Save executes the query and returns the updated NotificationChannel entity.

func (*NotificationChannelUpdateOne) SaveX

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

func (*NotificationChannelUpdateOne) Select

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

func (*NotificationChannelUpdateOne) SetEmailConfig

SetEmailConfig sets the "email_config" field.

func (*NotificationChannelUpdateOne) SetEnabled

SetEnabled sets the "enabled" field.

func (*NotificationChannelUpdateOne) SetLastUsed

SetLastUsed sets the "last_used" field.

func (*NotificationChannelUpdateOne) SetLastUsedSuccess

func (ncuo *NotificationChannelUpdateOne) SetLastUsedSuccess(b bool) *NotificationChannelUpdateOne

SetLastUsedSuccess sets the "last_used_success" field.

func (*NotificationChannelUpdateOne) SetName

SetName sets the "name" field.

func (*NotificationChannelUpdateOne) SetNillableEmailConfig

SetNillableEmailConfig sets the "email_config" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableEnabled

func (ncuo *NotificationChannelUpdateOne) SetNillableEnabled(b *bool) *NotificationChannelUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableLastUsed

func (ncuo *NotificationChannelUpdateOne) SetNillableLastUsed(t *time.Time) *NotificationChannelUpdateOne

SetNillableLastUsed sets the "last_used" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableLastUsedSuccess

func (ncuo *NotificationChannelUpdateOne) SetNillableLastUsedSuccess(b *bool) *NotificationChannelUpdateOne

SetNillableLastUsedSuccess sets the "last_used_success" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableSlackConfig

SetNillableSlackConfig sets the "slack_config" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableWebhookConfig

SetNillableWebhookConfig sets the "webhook_config" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetSlackConfig

SetSlackConfig sets the "slack_config" field.

func (*NotificationChannelUpdateOne) SetType

SetType sets the "type" field.

func (*NotificationChannelUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelUpdateOne) SetWebhookConfig

SetWebhookConfig sets the "webhook_config" field.

func (*NotificationChannelUpdateOne) Where

Where appends a list predicates to the NotificationChannelUpdate builder.

type NotificationChannels

type NotificationChannels []*NotificationChannel

NotificationChannels is a parsable slice of NotificationChannel.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

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

type Project

type Project struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

Project is the model entity for the Project schema.

func (*Project) String

func (pr *Project) String() string

String implements the fmt.Stringer.

func (*Project) Unwrap

func (pr *Project) Unwrap() *Project

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

func (pr *Project) Update() *ProjectUpdateOne

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

func (*Project) Value

func (pr *Project) Value(name string) (ent.Value, error)

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

type ProjectClient

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

ProjectClient is a client for the Project schema.

func NewProjectClient

func NewProjectClient(c config) *ProjectClient

NewProjectClient returns a client for the Project from the given config.

func (*ProjectClient) Create

func (c *ProjectClient) Create() *ProjectCreate

Create returns a builder for creating a Project entity.

func (*ProjectClient) CreateBulk

func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk

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

func (*ProjectClient) Delete

func (c *ProjectClient) Delete() *ProjectDelete

Delete returns a delete builder for Project.

func (*ProjectClient) DeleteOne

func (c *ProjectClient) DeleteOne(pr *Project) *ProjectDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProjectClient) DeleteOneID

func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne

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

func (*ProjectClient) Get

func (c *ProjectClient) Get(ctx context.Context, id int) (*Project, error)

Get returns a Project entity by its id.

func (*ProjectClient) GetX

func (c *ProjectClient) GetX(ctx context.Context, id int) *Project

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

func (*ProjectClient) Hooks

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

Hooks returns the client hooks.

func (*ProjectClient) Intercept

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

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

func (*ProjectClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ProjectClient) Query

func (c *ProjectClient) Query() *ProjectQuery

Query returns a query builder for Project.

func (*ProjectClient) Update

func (c *ProjectClient) Update() *ProjectUpdate

Update returns an update builder for Project.

func (*ProjectClient) UpdateOne

func (c *ProjectClient) UpdateOne(pr *Project) *ProjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProjectClient) UpdateOneID

func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProjectClient) Use

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

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

type ProjectCreate

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

ProjectCreate is the builder for creating a Project entity.

func (*ProjectCreate) Exec

func (pc *ProjectCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreate) ExecX

func (pc *ProjectCreate) ExecX(ctx context.Context)

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

func (*ProjectCreate) Mutation

func (pc *ProjectCreate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectCreate) Save

func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error)

Save creates the Project in the database.

func (*ProjectCreate) SaveX

func (pc *ProjectCreate) SaveX(ctx context.Context) *Project

SaveX calls Save and panics if Save returns an error.

func (*ProjectCreate) SetCreatedAt

func (pc *ProjectCreate) SetCreatedAt(t time.Time) *ProjectCreate

SetCreatedAt sets the "created_at" field.

func (*ProjectCreate) SetDescription

func (pc *ProjectCreate) SetDescription(s string) *ProjectCreate

SetDescription sets the "description" field.

func (*ProjectCreate) SetName

func (pc *ProjectCreate) SetName(s string) *ProjectCreate

SetName sets the "name" field.

func (*ProjectCreate) SetNillableCreatedAt

func (pc *ProjectCreate) SetNillableCreatedAt(t *time.Time) *ProjectCreate

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

func (*ProjectCreate) SetNillableDescription

func (pc *ProjectCreate) SetNillableDescription(s *string) *ProjectCreate

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

func (*ProjectCreate) SetNillableUpdatedAt

func (pc *ProjectCreate) SetNillableUpdatedAt(t *time.Time) *ProjectCreate

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

func (*ProjectCreate) SetUpdatedAt

func (pc *ProjectCreate) SetUpdatedAt(t time.Time) *ProjectCreate

SetUpdatedAt sets the "updated_at" field.

type ProjectCreateBulk

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

ProjectCreateBulk is the builder for creating many Project entities in bulk.

func (*ProjectCreateBulk) Exec

func (pcb *ProjectCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreateBulk) ExecX

func (pcb *ProjectCreateBulk) ExecX(ctx context.Context)

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

func (*ProjectCreateBulk) Save

func (pcb *ProjectCreateBulk) Save(ctx context.Context) ([]*Project, error)

Save creates the Project entities in the database.

func (*ProjectCreateBulk) SaveX

func (pcb *ProjectCreateBulk) SaveX(ctx context.Context) []*Project

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

type ProjectDelete

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

ProjectDelete is the builder for deleting a Project entity.

func (*ProjectDelete) Exec

func (pd *ProjectDelete) Exec(ctx context.Context) (int, error)

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

func (*ProjectDelete) ExecX

func (pd *ProjectDelete) ExecX(ctx context.Context) int

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

func (*ProjectDelete) Where

func (pd *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete

Where appends a list predicates to the ProjectDelete builder.

type ProjectDeleteOne

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

ProjectDeleteOne is the builder for deleting a single Project entity.

func (*ProjectDeleteOne) Exec

func (pdo *ProjectDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProjectDeleteOne) ExecX

func (pdo *ProjectDeleteOne) ExecX(ctx context.Context)

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

func (*ProjectDeleteOne) Where

Where appends a list predicates to the ProjectDelete builder.

type ProjectGroupBy

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

ProjectGroupBy is the group-by builder for Project entities.

func (*ProjectGroupBy) Aggregate

func (pgb *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy

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

func (*ProjectGroupBy) Bool

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

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

func (*ProjectGroupBy) BoolX

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

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

func (*ProjectGroupBy) Bools

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

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

func (*ProjectGroupBy) BoolsX

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

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

func (*ProjectGroupBy) Float64

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

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

func (*ProjectGroupBy) Float64X

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

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

func (*ProjectGroupBy) Float64s

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

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

func (*ProjectGroupBy) Float64sX

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

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

func (*ProjectGroupBy) Int

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

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

func (*ProjectGroupBy) IntX

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

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

func (*ProjectGroupBy) Ints

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

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

func (*ProjectGroupBy) IntsX

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

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

func (*ProjectGroupBy) Scan

func (pgb *ProjectGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProjectGroupBy) ScanX

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

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

func (*ProjectGroupBy) String

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

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

func (*ProjectGroupBy) StringX

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

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

func (*ProjectGroupBy) Strings

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

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

func (*ProjectGroupBy) StringsX

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

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

type ProjectMutation

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

ProjectMutation represents an operation that mutates the Project nodes in the graph.

func (*ProjectMutation) AddField

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

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

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

func (*ProjectMutation) AddedField

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

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

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

func (*ProjectMutation) AddedIDs

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

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

func (*ProjectMutation) ClearDescription

func (m *ProjectMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ProjectMutation) ClearEdge

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

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

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

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

func (*ProjectMutation) ClearedFields

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

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

func (ProjectMutation) Client

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

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

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

func (*ProjectMutation) Description

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

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

func (*ProjectMutation) DescriptionCleared

func (m *ProjectMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ProjectMutation) EdgeCleared

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

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

func (*ProjectMutation) Field

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

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

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

func (*ProjectMutation) Fields

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

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

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

func (*ProjectMutation) IDs

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

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

func (*ProjectMutation) Name

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

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

func (*ProjectMutation) OldCreatedAt

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

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

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

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

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

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

OldName returns the old "name" field's value of the Project entity. If the Project object wasn'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 (*ProjectMutation) OldUpdatedAt

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

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

func (m *ProjectMutation) Op() Op

Op returns the operation name.

func (*ProjectMutation) RemovedEdges

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

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

func (*ProjectMutation) RemovedIDs

func (m *ProjectMutation) 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 (*ProjectMutation) ResetCreatedAt

func (m *ProjectMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProjectMutation) ResetDescription

func (m *ProjectMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ProjectMutation) ResetEdge

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

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

func (m *ProjectMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProjectMutation) ResetUpdatedAt

func (m *ProjectMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProjectMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ProjectMutation) SetDescription

func (m *ProjectMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ProjectMutation) SetField

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

func (m *ProjectMutation) SetName(s string)

SetName sets the "name" field.

func (*ProjectMutation) SetOp

func (m *ProjectMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProjectMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (ProjectMutation) Tx

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

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

func (*ProjectMutation) Type

func (m *ProjectMutation) Type() string

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

func (*ProjectMutation) UpdatedAt

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

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

func (*ProjectMutation) Where

func (m *ProjectMutation) Where(ps ...predicate.Project)

Where appends a list predicates to the ProjectMutation builder.

func (*ProjectMutation) WhereP

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

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

type ProjectQuery

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

ProjectQuery is the builder for querying Project entities.

func (*ProjectQuery) Aggregate

func (pq *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate returns a ProjectSelect configured with the given aggregations.

func (*ProjectQuery) All

func (pq *ProjectQuery) All(ctx context.Context) ([]*Project, error)

All executes the query and returns a list of Projects.

func (*ProjectQuery) AllX

func (pq *ProjectQuery) AllX(ctx context.Context) []*Project

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

func (*ProjectQuery) Clone

func (pq *ProjectQuery) Clone() *ProjectQuery

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

func (*ProjectQuery) Count

func (pq *ProjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProjectQuery) CountX

func (pq *ProjectQuery) CountX(ctx context.Context) int

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

func (*ProjectQuery) Exist

func (pq *ProjectQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProjectQuery) ExistX

func (pq *ProjectQuery) ExistX(ctx context.Context) bool

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

func (*ProjectQuery) First

func (pq *ProjectQuery) First(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) FirstID

func (pq *ProjectQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) FirstIDX

func (pq *ProjectQuery) FirstIDX(ctx context.Context) int

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

func (*ProjectQuery) FirstX

func (pq *ProjectQuery) FirstX(ctx context.Context) *Project

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

func (*ProjectQuery) GroupBy

func (pq *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy

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.Project.Query().
	GroupBy(project.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProjectQuery) IDs

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

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

func (*ProjectQuery) IDsX

func (pq *ProjectQuery) IDsX(ctx context.Context) []int

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

func (*ProjectQuery) Limit

func (pq *ProjectQuery) Limit(limit int) *ProjectQuery

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

func (*ProjectQuery) Offset

func (pq *ProjectQuery) Offset(offset int) *ProjectQuery

Offset to start from.

func (*ProjectQuery) Only

func (pq *ProjectQuery) Only(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) OnlyID

func (pq *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) OnlyIDX

func (pq *ProjectQuery) OnlyIDX(ctx context.Context) int

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

func (*ProjectQuery) OnlyX

func (pq *ProjectQuery) OnlyX(ctx context.Context) *Project

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

func (*ProjectQuery) Order

func (pq *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery

Order specifies how the records should be ordered.

func (*ProjectQuery) Select

func (pq *ProjectQuery) Select(fields ...string) *ProjectSelect

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.Project.Query().
	Select(project.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProjectQuery) Unique

func (pq *ProjectQuery) Unique(unique bool) *ProjectQuery

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

func (pq *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery

Where adds a new predicate for the ProjectQuery builder.

type ProjectSelect

type ProjectSelect struct {
	*ProjectQuery
	// contains filtered or unexported fields
}

ProjectSelect is the builder for selecting fields of Project entities.

func (*ProjectSelect) Aggregate

func (ps *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProjectSelect) Bool

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

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

func (*ProjectSelect) BoolX

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

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

func (*ProjectSelect) Bools

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

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

func (*ProjectSelect) BoolsX

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

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

func (*ProjectSelect) Float64

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

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

func (*ProjectSelect) Float64X

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

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

func (*ProjectSelect) Float64s

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

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

func (*ProjectSelect) Float64sX

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

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

func (*ProjectSelect) Int

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

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

func (*ProjectSelect) IntX

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

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

func (*ProjectSelect) Ints

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

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

func (*ProjectSelect) IntsX

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

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

func (*ProjectSelect) Scan

func (ps *ProjectSelect) Scan(ctx context.Context, v any) error

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

func (*ProjectSelect) ScanX

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

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

func (*ProjectSelect) String

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

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

func (*ProjectSelect) StringX

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

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

func (*ProjectSelect) Strings

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

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

func (*ProjectSelect) StringsX

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

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

type ProjectUpdate

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

ProjectUpdate is the builder for updating Project entities.

func (*ProjectUpdate) ClearDescription

func (pu *ProjectUpdate) ClearDescription() *ProjectUpdate

ClearDescription clears the value of the "description" field.

func (*ProjectUpdate) Exec

func (pu *ProjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectUpdate) ExecX

func (pu *ProjectUpdate) ExecX(ctx context.Context)

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

func (*ProjectUpdate) Mutation

func (pu *ProjectUpdate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdate) Save

func (pu *ProjectUpdate) Save(ctx context.Context) (int, error)

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

func (*ProjectUpdate) SaveX

func (pu *ProjectUpdate) SaveX(ctx context.Context) int

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

func (*ProjectUpdate) SetDescription

func (pu *ProjectUpdate) SetDescription(s string) *ProjectUpdate

SetDescription sets the "description" field.

func (*ProjectUpdate) SetName

func (pu *ProjectUpdate) SetName(s string) *ProjectUpdate

SetName sets the "name" field.

func (*ProjectUpdate) SetNillableDescription

func (pu *ProjectUpdate) SetNillableDescription(s *string) *ProjectUpdate

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

func (*ProjectUpdate) SetUpdatedAt

func (pu *ProjectUpdate) SetUpdatedAt(t time.Time) *ProjectUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProjectUpdate) Where

func (pu *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate

Where appends a list predicates to the ProjectUpdate builder.

type ProjectUpdateOne

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

ProjectUpdateOne is the builder for updating a single Project entity.

func (*ProjectUpdateOne) ClearDescription

func (puo *ProjectUpdateOne) ClearDescription() *ProjectUpdateOne

ClearDescription clears the value of the "description" field.

func (*ProjectUpdateOne) Exec

func (puo *ProjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProjectUpdateOne) ExecX

func (puo *ProjectUpdateOne) ExecX(ctx context.Context)

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

func (*ProjectUpdateOne) Mutation

func (puo *ProjectUpdateOne) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdateOne) Save

func (puo *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)

Save executes the query and returns the updated Project entity.

func (*ProjectUpdateOne) SaveX

func (puo *ProjectUpdateOne) SaveX(ctx context.Context) *Project

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

func (*ProjectUpdateOne) Select

func (puo *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetDescription

func (puo *ProjectUpdateOne) SetDescription(s string) *ProjectUpdateOne

SetDescription sets the "description" field.

func (*ProjectUpdateOne) SetName

func (puo *ProjectUpdateOne) SetName(s string) *ProjectUpdateOne

SetName sets the "name" field.

func (*ProjectUpdateOne) SetNillableDescription

func (puo *ProjectUpdateOne) SetNillableDescription(s *string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetUpdatedAt

func (puo *ProjectUpdateOne) SetUpdatedAt(t time.Time) *ProjectUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProjectUpdateOne) Where

Where appends a list predicates to the ProjectUpdate builder.

type Projects

type Projects []*Project

Projects is a parsable slice of Project.

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Script

type Script struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Script holds the value of the "script" field.
	Script string `json:"script,omitempty"`
	// TimeoutSeconds holds the value of the "timeout_seconds" field.
	TimeoutSeconds int `json:"timeout_seconds,omitempty"`
	// ProjectID holds the value of the "project_id" field.
	ProjectID int `json:"project_id,omitempty"`
	// Parameters holds the value of the "parameters" field.
	Parameters []schema.ScriptInputOptions `json:"parameters,omitempty"`
	// ScheduleEnabled holds the value of the "schedule_enabled" field.
	ScheduleEnabled bool `json:"schedule_enabled,omitempty"`
	// ScheduleCron holds the value of the "schedule_cron" field.
	ScheduleCron string `json:"schedule_cron,omitempty"`
	// SuccessNotificationChannelID holds the value of the "success_notification_channel_id" field.
	SuccessNotificationChannelID *int `json:"success_notification_channel_id,omitempty"`
	// FailureNotificationChannelID holds the value of the "failure_notification_channel_id" field.
	FailureNotificationChannelID *int `json:"failure_notification_channel_id,omitempty"`
	// contains filtered or unexported fields
}

Script is the model entity for the Script schema.

func (*Script) String

func (s *Script) String() string

String implements the fmt.Stringer.

func (*Script) Unwrap

func (s *Script) Unwrap() *Script

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

func (s *Script) Update() *ScriptUpdateOne

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

func (*Script) Value

func (s *Script) Value(name string) (ent.Value, error)

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

type ScriptClient

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

ScriptClient is a client for the Script schema.

func NewScriptClient

func NewScriptClient(c config) *ScriptClient

NewScriptClient returns a client for the Script from the given config.

func (*ScriptClient) Create

func (c *ScriptClient) Create() *ScriptCreate

Create returns a builder for creating a Script entity.

func (*ScriptClient) CreateBulk

func (c *ScriptClient) CreateBulk(builders ...*ScriptCreate) *ScriptCreateBulk

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

func (*ScriptClient) Delete

func (c *ScriptClient) Delete() *ScriptDelete

Delete returns a delete builder for Script.

func (*ScriptClient) DeleteOne

func (c *ScriptClient) DeleteOne(s *Script) *ScriptDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ScriptClient) DeleteOneID

func (c *ScriptClient) DeleteOneID(id int) *ScriptDeleteOne

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

func (*ScriptClient) Get

func (c *ScriptClient) Get(ctx context.Context, id int) (*Script, error)

Get returns a Script entity by its id.

func (*ScriptClient) GetX

func (c *ScriptClient) GetX(ctx context.Context, id int) *Script

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

func (*ScriptClient) Hooks

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

Hooks returns the client hooks.

func (*ScriptClient) Intercept

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

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

func (*ScriptClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ScriptClient) Query

func (c *ScriptClient) Query() *ScriptQuery

Query returns a query builder for Script.

func (*ScriptClient) Update

func (c *ScriptClient) Update() *ScriptUpdate

Update returns an update builder for Script.

func (*ScriptClient) UpdateOne

func (c *ScriptClient) UpdateOne(s *Script) *ScriptUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScriptClient) UpdateOneID

func (c *ScriptClient) UpdateOneID(id int) *ScriptUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ScriptClient) Use

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

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

type ScriptCreate

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

ScriptCreate is the builder for creating a Script entity.

func (*ScriptCreate) Exec

func (sc *ScriptCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptCreate) ExecX

func (sc *ScriptCreate) ExecX(ctx context.Context)

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

func (*ScriptCreate) Mutation

func (sc *ScriptCreate) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptCreate) Save

func (sc *ScriptCreate) Save(ctx context.Context) (*Script, error)

Save creates the Script in the database.

func (*ScriptCreate) SaveX

func (sc *ScriptCreate) SaveX(ctx context.Context) *Script

SaveX calls Save and panics if Save returns an error.

func (*ScriptCreate) SetCreatedAt

func (sc *ScriptCreate) SetCreatedAt(t time.Time) *ScriptCreate

SetCreatedAt sets the "created_at" field.

func (*ScriptCreate) SetDescription

func (sc *ScriptCreate) SetDescription(s string) *ScriptCreate

SetDescription sets the "description" field.

func (*ScriptCreate) SetFailureNotificationChannelID

func (sc *ScriptCreate) SetFailureNotificationChannelID(i int) *ScriptCreate

SetFailureNotificationChannelID sets the "failure_notification_channel_id" field.

func (*ScriptCreate) SetName

func (sc *ScriptCreate) SetName(s string) *ScriptCreate

SetName sets the "name" field.

func (*ScriptCreate) SetNillableCreatedAt

func (sc *ScriptCreate) SetNillableCreatedAt(t *time.Time) *ScriptCreate

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

func (*ScriptCreate) SetNillableDescription

func (sc *ScriptCreate) SetNillableDescription(s *string) *ScriptCreate

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

func (*ScriptCreate) SetNillableFailureNotificationChannelID

func (sc *ScriptCreate) SetNillableFailureNotificationChannelID(i *int) *ScriptCreate

SetNillableFailureNotificationChannelID sets the "failure_notification_channel_id" field if the given value is not nil.

func (*ScriptCreate) SetNillableScheduleCron

func (sc *ScriptCreate) SetNillableScheduleCron(s *string) *ScriptCreate

SetNillableScheduleCron sets the "schedule_cron" field if the given value is not nil.

func (*ScriptCreate) SetNillableScheduleEnabled

func (sc *ScriptCreate) SetNillableScheduleEnabled(b *bool) *ScriptCreate

SetNillableScheduleEnabled sets the "schedule_enabled" field if the given value is not nil.

func (*ScriptCreate) SetNillableSuccessNotificationChannelID

func (sc *ScriptCreate) SetNillableSuccessNotificationChannelID(i *int) *ScriptCreate

SetNillableSuccessNotificationChannelID sets the "success_notification_channel_id" field if the given value is not nil.

func (*ScriptCreate) SetNillableTimeoutSeconds

func (sc *ScriptCreate) SetNillableTimeoutSeconds(i *int) *ScriptCreate

SetNillableTimeoutSeconds sets the "timeout_seconds" field if the given value is not nil.

func (*ScriptCreate) SetNillableUpdatedAt

func (sc *ScriptCreate) SetNillableUpdatedAt(t *time.Time) *ScriptCreate

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

func (*ScriptCreate) SetParameters

func (sc *ScriptCreate) SetParameters(sio []schema.ScriptInputOptions) *ScriptCreate

SetParameters sets the "parameters" field.

func (*ScriptCreate) SetProjectID

func (sc *ScriptCreate) SetProjectID(i int) *ScriptCreate

SetProjectID sets the "project_id" field.

func (*ScriptCreate) SetScheduleCron

func (sc *ScriptCreate) SetScheduleCron(s string) *ScriptCreate

SetScheduleCron sets the "schedule_cron" field.

func (*ScriptCreate) SetScheduleEnabled

func (sc *ScriptCreate) SetScheduleEnabled(b bool) *ScriptCreate

SetScheduleEnabled sets the "schedule_enabled" field.

func (*ScriptCreate) SetScript

func (sc *ScriptCreate) SetScript(s string) *ScriptCreate

SetScript sets the "script" field.

func (*ScriptCreate) SetSuccessNotificationChannelID

func (sc *ScriptCreate) SetSuccessNotificationChannelID(i int) *ScriptCreate

SetSuccessNotificationChannelID sets the "success_notification_channel_id" field.

func (*ScriptCreate) SetTimeoutSeconds

func (sc *ScriptCreate) SetTimeoutSeconds(i int) *ScriptCreate

SetTimeoutSeconds sets the "timeout_seconds" field.

func (*ScriptCreate) SetUpdatedAt

func (sc *ScriptCreate) SetUpdatedAt(t time.Time) *ScriptCreate

SetUpdatedAt sets the "updated_at" field.

type ScriptCreateBulk

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

ScriptCreateBulk is the builder for creating many Script entities in bulk.

func (*ScriptCreateBulk) Exec

func (scb *ScriptCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptCreateBulk) ExecX

func (scb *ScriptCreateBulk) ExecX(ctx context.Context)

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

func (*ScriptCreateBulk) Save

func (scb *ScriptCreateBulk) Save(ctx context.Context) ([]*Script, error)

Save creates the Script entities in the database.

func (*ScriptCreateBulk) SaveX

func (scb *ScriptCreateBulk) SaveX(ctx context.Context) []*Script

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

type ScriptDelete

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

ScriptDelete is the builder for deleting a Script entity.

func (*ScriptDelete) Exec

func (sd *ScriptDelete) Exec(ctx context.Context) (int, error)

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

func (*ScriptDelete) ExecX

func (sd *ScriptDelete) ExecX(ctx context.Context) int

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

func (*ScriptDelete) Where

func (sd *ScriptDelete) Where(ps ...predicate.Script) *ScriptDelete

Where appends a list predicates to the ScriptDelete builder.

type ScriptDeleteOne

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

ScriptDeleteOne is the builder for deleting a single Script entity.

func (*ScriptDeleteOne) Exec

func (sdo *ScriptDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ScriptDeleteOne) ExecX

func (sdo *ScriptDeleteOne) ExecX(ctx context.Context)

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

func (*ScriptDeleteOne) Where

func (sdo *ScriptDeleteOne) Where(ps ...predicate.Script) *ScriptDeleteOne

Where appends a list predicates to the ScriptDelete builder.

type ScriptGroupBy

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

ScriptGroupBy is the group-by builder for Script entities.

func (*ScriptGroupBy) Aggregate

func (sgb *ScriptGroupBy) Aggregate(fns ...AggregateFunc) *ScriptGroupBy

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

func (*ScriptGroupBy) Bool

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

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

func (*ScriptGroupBy) BoolX

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

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

func (*ScriptGroupBy) Bools

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

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

func (*ScriptGroupBy) BoolsX

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

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

func (*ScriptGroupBy) Float64

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

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) Float64X

func (s *ScriptGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptGroupBy) Float64s

func (s *ScriptGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) Float64sX

func (s *ScriptGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptGroupBy) Int

func (s *ScriptGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) IntX

func (s *ScriptGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptGroupBy) Ints

func (s *ScriptGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) IntsX

func (s *ScriptGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptGroupBy) Scan

func (sgb *ScriptGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptGroupBy) ScanX

func (s *ScriptGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptGroupBy) String

func (s *ScriptGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) StringX

func (s *ScriptGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptGroupBy) Strings

func (s *ScriptGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptGroupBy) StringsX

func (s *ScriptGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptMutation

type ScriptMutation struct {
	// contains filtered or unexported fields
}

ScriptMutation represents an operation that mutates the Script nodes in the graph.

func (*ScriptMutation) AddFailureNotificationChannelID

func (m *ScriptMutation) AddFailureNotificationChannelID(i int)

AddFailureNotificationChannelID adds i to the "failure_notification_channel_id" field.

func (*ScriptMutation) AddField

func (m *ScriptMutation) 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 (*ScriptMutation) AddProjectID

func (m *ScriptMutation) AddProjectID(i int)

AddProjectID adds i to the "project_id" field.

func (*ScriptMutation) AddSuccessNotificationChannelID

func (m *ScriptMutation) AddSuccessNotificationChannelID(i int)

AddSuccessNotificationChannelID adds i to the "success_notification_channel_id" field.

func (*ScriptMutation) AddTimeoutSeconds

func (m *ScriptMutation) AddTimeoutSeconds(i int)

AddTimeoutSeconds adds i to the "timeout_seconds" field.

func (*ScriptMutation) AddedEdges

func (m *ScriptMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScriptMutation) AddedFailureNotificationChannelID

func (m *ScriptMutation) AddedFailureNotificationChannelID() (r int, exists bool)

AddedFailureNotificationChannelID returns the value that was added to the "failure_notification_channel_id" field in this mutation.

func (*ScriptMutation) AddedField

func (m *ScriptMutation) 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 (*ScriptMutation) AddedFields

func (m *ScriptMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScriptMutation) AddedIDs

func (m *ScriptMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ScriptMutation) AddedProjectID

func (m *ScriptMutation) AddedProjectID() (r int, exists bool)

AddedProjectID returns the value that was added to the "project_id" field in this mutation.

func (*ScriptMutation) AddedSuccessNotificationChannelID

func (m *ScriptMutation) AddedSuccessNotificationChannelID() (r int, exists bool)

AddedSuccessNotificationChannelID returns the value that was added to the "success_notification_channel_id" field in this mutation.

func (*ScriptMutation) AddedTimeoutSeconds

func (m *ScriptMutation) AddedTimeoutSeconds() (r int, exists bool)

AddedTimeoutSeconds returns the value that was added to the "timeout_seconds" field in this mutation.

func (*ScriptMutation) AppendParameters

func (m *ScriptMutation) AppendParameters(sio []schema.ScriptInputOptions)

AppendParameters adds sio to the "parameters" field.

func (*ScriptMutation) AppendedParameters

func (m *ScriptMutation) AppendedParameters() ([]schema.ScriptInputOptions, bool)

AppendedParameters returns the list of values that were appended to the "parameters" field in this mutation.

func (*ScriptMutation) ClearDescription

func (m *ScriptMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ScriptMutation) ClearEdge

func (m *ScriptMutation) 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 (*ScriptMutation) ClearFailureNotificationChannelID

func (m *ScriptMutation) ClearFailureNotificationChannelID()

ClearFailureNotificationChannelID clears the value of the "failure_notification_channel_id" field.

func (*ScriptMutation) ClearField

func (m *ScriptMutation) 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 (*ScriptMutation) ClearParameters

func (m *ScriptMutation) ClearParameters()

ClearParameters clears the value of the "parameters" field.

func (*ScriptMutation) ClearScheduleCron

func (m *ScriptMutation) ClearScheduleCron()

ClearScheduleCron clears the value of the "schedule_cron" field.

func (*ScriptMutation) ClearSuccessNotificationChannelID

func (m *ScriptMutation) ClearSuccessNotificationChannelID()

ClearSuccessNotificationChannelID clears the value of the "success_notification_channel_id" field.

func (*ScriptMutation) ClearedEdges

func (m *ScriptMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScriptMutation) ClearedFields

func (m *ScriptMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScriptMutation) Client

func (m ScriptMutation) 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 (*ScriptMutation) CreatedAt

func (m *ScriptMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ScriptMutation) Description

func (m *ScriptMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ScriptMutation) DescriptionCleared

func (m *ScriptMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ScriptMutation) EdgeCleared

func (m *ScriptMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ScriptMutation) FailureNotificationChannelID

func (m *ScriptMutation) FailureNotificationChannelID() (r int, exists bool)

FailureNotificationChannelID returns the value of the "failure_notification_channel_id" field in the mutation.

func (*ScriptMutation) FailureNotificationChannelIDCleared

func (m *ScriptMutation) FailureNotificationChannelIDCleared() bool

FailureNotificationChannelIDCleared returns if the "failure_notification_channel_id" field was cleared in this mutation.

func (*ScriptMutation) Field

func (m *ScriptMutation) 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 (*ScriptMutation) FieldCleared

func (m *ScriptMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ScriptMutation) Fields

func (m *ScriptMutation) 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 (*ScriptMutation) ID

func (m *ScriptMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ScriptMutation) IDs

func (m *ScriptMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ScriptMutation) Name

func (m *ScriptMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ScriptMutation) OldCreatedAt

func (m *ScriptMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldDescription

func (m *ScriptMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldFailureNotificationChannelID

func (m *ScriptMutation) OldFailureNotificationChannelID(ctx context.Context) (v *int, err error)

OldFailureNotificationChannelID returns the old "failure_notification_channel_id" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldField

func (m *ScriptMutation) 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 (*ScriptMutation) OldName

func (m *ScriptMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldParameters

func (m *ScriptMutation) OldParameters(ctx context.Context) (v []schema.ScriptInputOptions, err error)

OldParameters returns the old "parameters" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldProjectID

func (m *ScriptMutation) OldProjectID(ctx context.Context) (v int, err error)

OldProjectID returns the old "project_id" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldScheduleCron

func (m *ScriptMutation) OldScheduleCron(ctx context.Context) (v string, err error)

OldScheduleCron returns the old "schedule_cron" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldScheduleEnabled

func (m *ScriptMutation) OldScheduleEnabled(ctx context.Context) (v bool, err error)

OldScheduleEnabled returns the old "schedule_enabled" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldScript

func (m *ScriptMutation) OldScript(ctx context.Context) (v string, err error)

OldScript returns the old "script" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldSuccessNotificationChannelID

func (m *ScriptMutation) OldSuccessNotificationChannelID(ctx context.Context) (v *int, err error)

OldSuccessNotificationChannelID returns the old "success_notification_channel_id" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldTimeoutSeconds

func (m *ScriptMutation) OldTimeoutSeconds(ctx context.Context) (v int, err error)

OldTimeoutSeconds returns the old "timeout_seconds" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) OldUpdatedAt

func (m *ScriptMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Script entity. If the Script object wasn'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 (*ScriptMutation) Op

func (m *ScriptMutation) Op() Op

Op returns the operation name.

func (*ScriptMutation) Parameters

func (m *ScriptMutation) Parameters() (r []schema.ScriptInputOptions, exists bool)

Parameters returns the value of the "parameters" field in the mutation.

func (*ScriptMutation) ParametersCleared

func (m *ScriptMutation) ParametersCleared() bool

ParametersCleared returns if the "parameters" field was cleared in this mutation.

func (*ScriptMutation) ProjectID

func (m *ScriptMutation) ProjectID() (r int, exists bool)

ProjectID returns the value of the "project_id" field in the mutation.

func (*ScriptMutation) RemovedEdges

func (m *ScriptMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScriptMutation) RemovedIDs

func (m *ScriptMutation) 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 (*ScriptMutation) ResetCreatedAt

func (m *ScriptMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ScriptMutation) ResetDescription

func (m *ScriptMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ScriptMutation) ResetEdge

func (m *ScriptMutation) 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 (*ScriptMutation) ResetFailureNotificationChannelID

func (m *ScriptMutation) ResetFailureNotificationChannelID()

ResetFailureNotificationChannelID resets all changes to the "failure_notification_channel_id" field.

func (*ScriptMutation) ResetField

func (m *ScriptMutation) 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 (*ScriptMutation) ResetName

func (m *ScriptMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ScriptMutation) ResetParameters

func (m *ScriptMutation) ResetParameters()

ResetParameters resets all changes to the "parameters" field.

func (*ScriptMutation) ResetProjectID

func (m *ScriptMutation) ResetProjectID()

ResetProjectID resets all changes to the "project_id" field.

func (*ScriptMutation) ResetScheduleCron

func (m *ScriptMutation) ResetScheduleCron()

ResetScheduleCron resets all changes to the "schedule_cron" field.

func (*ScriptMutation) ResetScheduleEnabled

func (m *ScriptMutation) ResetScheduleEnabled()

ResetScheduleEnabled resets all changes to the "schedule_enabled" field.

func (*ScriptMutation) ResetScript

func (m *ScriptMutation) ResetScript()

ResetScript resets all changes to the "script" field.

func (*ScriptMutation) ResetSuccessNotificationChannelID

func (m *ScriptMutation) ResetSuccessNotificationChannelID()

ResetSuccessNotificationChannelID resets all changes to the "success_notification_channel_id" field.

func (*ScriptMutation) ResetTimeoutSeconds

func (m *ScriptMutation) ResetTimeoutSeconds()

ResetTimeoutSeconds resets all changes to the "timeout_seconds" field.

func (*ScriptMutation) ResetUpdatedAt

func (m *ScriptMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ScriptMutation) ScheduleCron

func (m *ScriptMutation) ScheduleCron() (r string, exists bool)

ScheduleCron returns the value of the "schedule_cron" field in the mutation.

func (*ScriptMutation) ScheduleCronCleared

func (m *ScriptMutation) ScheduleCronCleared() bool

ScheduleCronCleared returns if the "schedule_cron" field was cleared in this mutation.

func (*ScriptMutation) ScheduleEnabled

func (m *ScriptMutation) ScheduleEnabled() (r bool, exists bool)

ScheduleEnabled returns the value of the "schedule_enabled" field in the mutation.

func (*ScriptMutation) Script

func (m *ScriptMutation) Script() (r string, exists bool)

Script returns the value of the "script" field in the mutation.

func (*ScriptMutation) SetCreatedAt

func (m *ScriptMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ScriptMutation) SetDescription

func (m *ScriptMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ScriptMutation) SetFailureNotificationChannelID

func (m *ScriptMutation) SetFailureNotificationChannelID(i int)

SetFailureNotificationChannelID sets the "failure_notification_channel_id" field.

func (*ScriptMutation) SetField

func (m *ScriptMutation) 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 (*ScriptMutation) SetName

func (m *ScriptMutation) SetName(s string)

SetName sets the "name" field.

func (*ScriptMutation) SetOp

func (m *ScriptMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ScriptMutation) SetParameters

func (m *ScriptMutation) SetParameters(sio []schema.ScriptInputOptions)

SetParameters sets the "parameters" field.

func (*ScriptMutation) SetProjectID

func (m *ScriptMutation) SetProjectID(i int)

SetProjectID sets the "project_id" field.

func (*ScriptMutation) SetScheduleCron

func (m *ScriptMutation) SetScheduleCron(s string)

SetScheduleCron sets the "schedule_cron" field.

func (*ScriptMutation) SetScheduleEnabled

func (m *ScriptMutation) SetScheduleEnabled(b bool)

SetScheduleEnabled sets the "schedule_enabled" field.

func (*ScriptMutation) SetScript

func (m *ScriptMutation) SetScript(s string)

SetScript sets the "script" field.

func (*ScriptMutation) SetSuccessNotificationChannelID

func (m *ScriptMutation) SetSuccessNotificationChannelID(i int)

SetSuccessNotificationChannelID sets the "success_notification_channel_id" field.

func (*ScriptMutation) SetTimeoutSeconds

func (m *ScriptMutation) SetTimeoutSeconds(i int)

SetTimeoutSeconds sets the "timeout_seconds" field.

func (*ScriptMutation) SetUpdatedAt

func (m *ScriptMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ScriptMutation) SuccessNotificationChannelID

func (m *ScriptMutation) SuccessNotificationChannelID() (r int, exists bool)

SuccessNotificationChannelID returns the value of the "success_notification_channel_id" field in the mutation.

func (*ScriptMutation) SuccessNotificationChannelIDCleared

func (m *ScriptMutation) SuccessNotificationChannelIDCleared() bool

SuccessNotificationChannelIDCleared returns if the "success_notification_channel_id" field was cleared in this mutation.

func (*ScriptMutation) TimeoutSeconds

func (m *ScriptMutation) TimeoutSeconds() (r int, exists bool)

TimeoutSeconds returns the value of the "timeout_seconds" field in the mutation.

func (ScriptMutation) Tx

func (m ScriptMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScriptMutation) Type

func (m *ScriptMutation) Type() string

Type returns the node type of this mutation (Script).

func (*ScriptMutation) UpdatedAt

func (m *ScriptMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ScriptMutation) Where

func (m *ScriptMutation) Where(ps ...predicate.Script)

Where appends a list predicates to the ScriptMutation builder.

func (*ScriptMutation) WhereP

func (m *ScriptMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ScriptMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ScriptQuery

type ScriptQuery struct {
	// contains filtered or unexported fields
}

ScriptQuery is the builder for querying Script entities.

func (*ScriptQuery) Aggregate

func (sq *ScriptQuery) Aggregate(fns ...AggregateFunc) *ScriptSelect

Aggregate returns a ScriptSelect configured with the given aggregations.

func (*ScriptQuery) All

func (sq *ScriptQuery) All(ctx context.Context) ([]*Script, error)

All executes the query and returns a list of Scripts.

func (*ScriptQuery) AllX

func (sq *ScriptQuery) AllX(ctx context.Context) []*Script

AllX is like All, but panics if an error occurs.

func (*ScriptQuery) Clone

func (sq *ScriptQuery) Clone() *ScriptQuery

Clone returns a duplicate of the ScriptQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ScriptQuery) Count

func (sq *ScriptQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScriptQuery) CountX

func (sq *ScriptQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScriptQuery) Exist

func (sq *ScriptQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScriptQuery) ExistX

func (sq *ScriptQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScriptQuery) First

func (sq *ScriptQuery) First(ctx context.Context) (*Script, error)

First returns the first Script entity from the query. Returns a *NotFoundError when no Script was found.

func (*ScriptQuery) FirstID

func (sq *ScriptQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Script ID from the query. Returns a *NotFoundError when no Script ID was found.

func (*ScriptQuery) FirstIDX

func (sq *ScriptQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScriptQuery) FirstX

func (sq *ScriptQuery) FirstX(ctx context.Context) *Script

FirstX is like First, but panics if an error occurs.

func (*ScriptQuery) GroupBy

func (sq *ScriptQuery) GroupBy(field string, fields ...string) *ScriptGroupBy

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.Script.Query().
	GroupBy(script.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ScriptQuery) IDs

func (sq *ScriptQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Script IDs.

func (*ScriptQuery) IDsX

func (sq *ScriptQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ScriptQuery) Limit

func (sq *ScriptQuery) Limit(limit int) *ScriptQuery

Limit the number of records to be returned by this query.

func (*ScriptQuery) Offset

func (sq *ScriptQuery) Offset(offset int) *ScriptQuery

Offset to start from.

func (*ScriptQuery) Only

func (sq *ScriptQuery) Only(ctx context.Context) (*Script, error)

Only returns a single Script entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Script entity is found. Returns a *NotFoundError when no Script entities are found.

func (*ScriptQuery) OnlyID

func (sq *ScriptQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Script ID in the query. Returns a *NotSingularError when more than one Script ID is found. Returns a *NotFoundError when no entities are found.

func (*ScriptQuery) OnlyIDX

func (sq *ScriptQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScriptQuery) OnlyX

func (sq *ScriptQuery) OnlyX(ctx context.Context) *Script

OnlyX is like Only, but panics if an error occurs.

func (*ScriptQuery) Order

func (sq *ScriptQuery) Order(o ...script.OrderOption) *ScriptQuery

Order specifies how the records should be ordered.

func (*ScriptQuery) Select

func (sq *ScriptQuery) Select(fields ...string) *ScriptSelect

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.Script.Query().
	Select(script.FieldCreatedAt).
	Scan(ctx, &v)

func (*ScriptQuery) Unique

func (sq *ScriptQuery) Unique(unique bool) *ScriptQuery

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 (*ScriptQuery) Where

func (sq *ScriptQuery) Where(ps ...predicate.Script) *ScriptQuery

Where adds a new predicate for the ScriptQuery builder.

type ScriptSelect

type ScriptSelect struct {
	*ScriptQuery
	// contains filtered or unexported fields
}

ScriptSelect is the builder for selecting fields of Script entities.

func (*ScriptSelect) Aggregate

func (ss *ScriptSelect) Aggregate(fns ...AggregateFunc) *ScriptSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ScriptSelect) Bool

func (s *ScriptSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) BoolX

func (s *ScriptSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptSelect) Bools

func (s *ScriptSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) BoolsX

func (s *ScriptSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptSelect) Float64

func (s *ScriptSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) Float64X

func (s *ScriptSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptSelect) Float64s

func (s *ScriptSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) Float64sX

func (s *ScriptSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptSelect) Int

func (s *ScriptSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) IntX

func (s *ScriptSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptSelect) Ints

func (s *ScriptSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) IntsX

func (s *ScriptSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptSelect) Scan

func (ss *ScriptSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptSelect) ScanX

func (s *ScriptSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptSelect) String

func (s *ScriptSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) StringX

func (s *ScriptSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptSelect) Strings

func (s *ScriptSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptSelect) StringsX

func (s *ScriptSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptStats

type ScriptStats struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ScriptID holds the value of the "script_id" field.
	ScriptID int `json:"script_id,omitempty"`
	// ProjectID holds the value of the "project_id" field.
	ProjectID int `json:"project_id,omitempty"`
	// TotalRuns holds the value of the "total_runs" field.
	TotalRuns int `json:"total_runs,omitempty"`
	// TotalErrors holds the value of the "total_errors" field.
	TotalErrors int `json:"total_errors,omitempty"`
	// TotalSuccess holds the value of the "total_success" field.
	TotalSuccess int `json:"total_success,omitempty"`
	// AverageRuntime holds the value of the "average_runtime" field.
	AverageRuntime int `json:"average_runtime,omitempty"`
	// MinRuntime holds the value of the "min_runtime" field.
	MinRuntime int `json:"min_runtime,omitempty"`
	// MaxRuntime holds the value of the "max_runtime" field.
	MaxRuntime int `json:"max_runtime,omitempty"`
	// LastRun holds the value of the "last_run" field.
	LastRun time.Time `json:"last_run,omitempty"`
	// TotalRuntime holds the value of the "total_runtime" field.
	TotalRuntime int `json:"total_runtime,omitempty"`
	// SuccessRate holds the value of the "success_rate" field.
	SuccessRate int `json:"success_rate,omitempty"`
	// contains filtered or unexported fields
}

ScriptStats is the model entity for the ScriptStats schema.

func (*ScriptStats) String

func (ss *ScriptStats) String() string

String implements the fmt.Stringer.

func (*ScriptStats) Unwrap

func (ss *ScriptStats) Unwrap() *ScriptStats

Unwrap unwraps the ScriptStats 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 (*ScriptStats) Update

func (ss *ScriptStats) Update() *ScriptStatsUpdateOne

Update returns a builder for updating this ScriptStats. Note that you need to call ScriptStats.Unwrap() before calling this method if this ScriptStats was returned from a transaction, and the transaction was committed or rolled back.

func (*ScriptStats) Value

func (ss *ScriptStats) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ScriptStats. This includes values selected through modifiers, order, etc.

type ScriptStatsClient

type ScriptStatsClient struct {
	// contains filtered or unexported fields
}

ScriptStatsClient is a client for the ScriptStats schema.

func NewScriptStatsClient

func NewScriptStatsClient(c config) *ScriptStatsClient

NewScriptStatsClient returns a client for the ScriptStats from the given config.

func (*ScriptStatsClient) Create

func (c *ScriptStatsClient) Create() *ScriptStatsCreate

Create returns a builder for creating a ScriptStats entity.

func (*ScriptStatsClient) CreateBulk

func (c *ScriptStatsClient) CreateBulk(builders ...*ScriptStatsCreate) *ScriptStatsCreateBulk

CreateBulk returns a builder for creating a bulk of ScriptStats entities.

func (*ScriptStatsClient) Delete

func (c *ScriptStatsClient) Delete() *ScriptStatsDelete

Delete returns a delete builder for ScriptStats.

func (*ScriptStatsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ScriptStatsClient) DeleteOneID

func (c *ScriptStatsClient) DeleteOneID(id int) *ScriptStatsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ScriptStatsClient) Get

func (c *ScriptStatsClient) Get(ctx context.Context, id int) (*ScriptStats, error)

Get returns a ScriptStats entity by its id.

func (*ScriptStatsClient) GetX

func (c *ScriptStatsClient) GetX(ctx context.Context, id int) *ScriptStats

GetX is like Get, but panics if an error occurs.

func (*ScriptStatsClient) Hooks

func (c *ScriptStatsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScriptStatsClient) Intercept

func (c *ScriptStatsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `scriptstats.Intercept(f(g(h())))`.

func (*ScriptStatsClient) Interceptors

func (c *ScriptStatsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ScriptStatsClient) Query

func (c *ScriptStatsClient) Query() *ScriptStatsQuery

Query returns a query builder for ScriptStats.

func (*ScriptStatsClient) Update

func (c *ScriptStatsClient) Update() *ScriptStatsUpdate

Update returns an update builder for ScriptStats.

func (*ScriptStatsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScriptStatsClient) UpdateOneID

func (c *ScriptStatsClient) UpdateOneID(id int) *ScriptStatsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ScriptStatsClient) Use

func (c *ScriptStatsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `scriptstats.Hooks(f(g(h())))`.

type ScriptStatsCreate

type ScriptStatsCreate struct {
	// contains filtered or unexported fields
}

ScriptStatsCreate is the builder for creating a ScriptStats entity.

func (*ScriptStatsCreate) Exec

func (ssc *ScriptStatsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptStatsCreate) ExecX

func (ssc *ScriptStatsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptStatsCreate) Mutation

func (ssc *ScriptStatsCreate) Mutation() *ScriptStatsMutation

Mutation returns the ScriptStatsMutation object of the builder.

func (*ScriptStatsCreate) Save

func (ssc *ScriptStatsCreate) Save(ctx context.Context) (*ScriptStats, error)

Save creates the ScriptStats in the database.

func (*ScriptStatsCreate) SaveX

func (ssc *ScriptStatsCreate) SaveX(ctx context.Context) *ScriptStats

SaveX calls Save and panics if Save returns an error.

func (*ScriptStatsCreate) SetAverageRuntime

func (ssc *ScriptStatsCreate) SetAverageRuntime(i int) *ScriptStatsCreate

SetAverageRuntime sets the "average_runtime" field.

func (*ScriptStatsCreate) SetLastRun

func (ssc *ScriptStatsCreate) SetLastRun(t time.Time) *ScriptStatsCreate

SetLastRun sets the "last_run" field.

func (*ScriptStatsCreate) SetMaxRuntime

func (ssc *ScriptStatsCreate) SetMaxRuntime(i int) *ScriptStatsCreate

SetMaxRuntime sets the "max_runtime" field.

func (*ScriptStatsCreate) SetMinRuntime

func (ssc *ScriptStatsCreate) SetMinRuntime(i int) *ScriptStatsCreate

SetMinRuntime sets the "min_runtime" field.

func (*ScriptStatsCreate) SetProjectID

func (ssc *ScriptStatsCreate) SetProjectID(i int) *ScriptStatsCreate

SetProjectID sets the "project_id" field.

func (*ScriptStatsCreate) SetScriptID

func (ssc *ScriptStatsCreate) SetScriptID(i int) *ScriptStatsCreate

SetScriptID sets the "script_id" field.

func (*ScriptStatsCreate) SetSuccessRate

func (ssc *ScriptStatsCreate) SetSuccessRate(i int) *ScriptStatsCreate

SetSuccessRate sets the "success_rate" field.

func (*ScriptStatsCreate) SetTotalErrors

func (ssc *ScriptStatsCreate) SetTotalErrors(i int) *ScriptStatsCreate

SetTotalErrors sets the "total_errors" field.

func (*ScriptStatsCreate) SetTotalRuns

func (ssc *ScriptStatsCreate) SetTotalRuns(i int) *ScriptStatsCreate

SetTotalRuns sets the "total_runs" field.

func (*ScriptStatsCreate) SetTotalRuntime

func (ssc *ScriptStatsCreate) SetTotalRuntime(i int) *ScriptStatsCreate

SetTotalRuntime sets the "total_runtime" field.

func (*ScriptStatsCreate) SetTotalSuccess

func (ssc *ScriptStatsCreate) SetTotalSuccess(i int) *ScriptStatsCreate

SetTotalSuccess sets the "total_success" field.

type ScriptStatsCreateBulk

type ScriptStatsCreateBulk struct {
	// contains filtered or unexported fields
}

ScriptStatsCreateBulk is the builder for creating many ScriptStats entities in bulk.

func (*ScriptStatsCreateBulk) Exec

func (sscb *ScriptStatsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptStatsCreateBulk) ExecX

func (sscb *ScriptStatsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptStatsCreateBulk) Save

func (sscb *ScriptStatsCreateBulk) Save(ctx context.Context) ([]*ScriptStats, error)

Save creates the ScriptStats entities in the database.

func (*ScriptStatsCreateBulk) SaveX

func (sscb *ScriptStatsCreateBulk) SaveX(ctx context.Context) []*ScriptStats

SaveX is like Save, but panics if an error occurs.

type ScriptStatsDelete

type ScriptStatsDelete struct {
	// contains filtered or unexported fields
}

ScriptStatsDelete is the builder for deleting a ScriptStats entity.

func (*ScriptStatsDelete) Exec

func (ssd *ScriptStatsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScriptStatsDelete) ExecX

func (ssd *ScriptStatsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ScriptStatsDelete) Where

Where appends a list predicates to the ScriptStatsDelete builder.

type ScriptStatsDeleteOne

type ScriptStatsDeleteOne struct {
	// contains filtered or unexported fields
}

ScriptStatsDeleteOne is the builder for deleting a single ScriptStats entity.

func (*ScriptStatsDeleteOne) Exec

func (ssdo *ScriptStatsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ScriptStatsDeleteOne) ExecX

func (ssdo *ScriptStatsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptStatsDeleteOne) Where

Where appends a list predicates to the ScriptStatsDelete builder.

type ScriptStatsGroupBy

type ScriptStatsGroupBy struct {
	// contains filtered or unexported fields
}

ScriptStatsGroupBy is the group-by builder for ScriptStats entities.

func (*ScriptStatsGroupBy) Aggregate

func (ssgb *ScriptStatsGroupBy) Aggregate(fns ...AggregateFunc) *ScriptStatsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ScriptStatsGroupBy) Bool

func (s *ScriptStatsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) BoolX

func (s *ScriptStatsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptStatsGroupBy) Bools

func (s *ScriptStatsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) BoolsX

func (s *ScriptStatsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptStatsGroupBy) Float64

func (s *ScriptStatsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) Float64X

func (s *ScriptStatsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptStatsGroupBy) Float64s

func (s *ScriptStatsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) Float64sX

func (s *ScriptStatsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptStatsGroupBy) Int

func (s *ScriptStatsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) IntX

func (s *ScriptStatsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptStatsGroupBy) Ints

func (s *ScriptStatsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) IntsX

func (s *ScriptStatsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptStatsGroupBy) Scan

func (ssgb *ScriptStatsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptStatsGroupBy) ScanX

func (s *ScriptStatsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptStatsGroupBy) String

func (s *ScriptStatsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) StringX

func (s *ScriptStatsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptStatsGroupBy) Strings

func (s *ScriptStatsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptStatsGroupBy) StringsX

func (s *ScriptStatsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptStatsMutation

type ScriptStatsMutation struct {
	// contains filtered or unexported fields
}

ScriptStatsMutation represents an operation that mutates the ScriptStats nodes in the graph.

func (*ScriptStatsMutation) AddAverageRuntime

func (m *ScriptStatsMutation) AddAverageRuntime(i int)

AddAverageRuntime adds i to the "average_runtime" field.

func (*ScriptStatsMutation) AddField

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) AddMaxRuntime

func (m *ScriptStatsMutation) AddMaxRuntime(i int)

AddMaxRuntime adds i to the "max_runtime" field.

func (*ScriptStatsMutation) AddMinRuntime

func (m *ScriptStatsMutation) AddMinRuntime(i int)

AddMinRuntime adds i to the "min_runtime" field.

func (*ScriptStatsMutation) AddProjectID

func (m *ScriptStatsMutation) AddProjectID(i int)

AddProjectID adds i to the "project_id" field.

func (*ScriptStatsMutation) AddScriptID

func (m *ScriptStatsMutation) AddScriptID(i int)

AddScriptID adds i to the "script_id" field.

func (*ScriptStatsMutation) AddSuccessRate

func (m *ScriptStatsMutation) AddSuccessRate(i int)

AddSuccessRate adds i to the "success_rate" field.

func (*ScriptStatsMutation) AddTotalErrors

func (m *ScriptStatsMutation) AddTotalErrors(i int)

AddTotalErrors adds i to the "total_errors" field.

func (*ScriptStatsMutation) AddTotalRuns

func (m *ScriptStatsMutation) AddTotalRuns(i int)

AddTotalRuns adds i to the "total_runs" field.

func (*ScriptStatsMutation) AddTotalRuntime

func (m *ScriptStatsMutation) AddTotalRuntime(i int)

AddTotalRuntime adds i to the "total_runtime" field.

func (*ScriptStatsMutation) AddTotalSuccess

func (m *ScriptStatsMutation) AddTotalSuccess(i int)

AddTotalSuccess adds i to the "total_success" field.

func (*ScriptStatsMutation) AddedAverageRuntime

func (m *ScriptStatsMutation) AddedAverageRuntime() (r int, exists bool)

AddedAverageRuntime returns the value that was added to the "average_runtime" field in this mutation.

func (*ScriptStatsMutation) AddedEdges

func (m *ScriptStatsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScriptStatsMutation) AddedField

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) AddedFields

func (m *ScriptStatsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScriptStatsMutation) AddedIDs

func (m *ScriptStatsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ScriptStatsMutation) AddedMaxRuntime

func (m *ScriptStatsMutation) AddedMaxRuntime() (r int, exists bool)

AddedMaxRuntime returns the value that was added to the "max_runtime" field in this mutation.

func (*ScriptStatsMutation) AddedMinRuntime

func (m *ScriptStatsMutation) AddedMinRuntime() (r int, exists bool)

AddedMinRuntime returns the value that was added to the "min_runtime" field in this mutation.

func (*ScriptStatsMutation) AddedProjectID

func (m *ScriptStatsMutation) AddedProjectID() (r int, exists bool)

AddedProjectID returns the value that was added to the "project_id" field in this mutation.

func (*ScriptStatsMutation) AddedScriptID

func (m *ScriptStatsMutation) AddedScriptID() (r int, exists bool)

AddedScriptID returns the value that was added to the "script_id" field in this mutation.

func (*ScriptStatsMutation) AddedSuccessRate

func (m *ScriptStatsMutation) AddedSuccessRate() (r int, exists bool)

AddedSuccessRate returns the value that was added to the "success_rate" field in this mutation.

func (*ScriptStatsMutation) AddedTotalErrors

func (m *ScriptStatsMutation) AddedTotalErrors() (r int, exists bool)

AddedTotalErrors returns the value that was added to the "total_errors" field in this mutation.

func (*ScriptStatsMutation) AddedTotalRuns

func (m *ScriptStatsMutation) AddedTotalRuns() (r int, exists bool)

AddedTotalRuns returns the value that was added to the "total_runs" field in this mutation.

func (*ScriptStatsMutation) AddedTotalRuntime

func (m *ScriptStatsMutation) AddedTotalRuntime() (r int, exists bool)

AddedTotalRuntime returns the value that was added to the "total_runtime" field in this mutation.

func (*ScriptStatsMutation) AddedTotalSuccess

func (m *ScriptStatsMutation) AddedTotalSuccess() (r int, exists bool)

AddedTotalSuccess returns the value that was added to the "total_success" field in this mutation.

func (*ScriptStatsMutation) AverageRuntime

func (m *ScriptStatsMutation) AverageRuntime() (r int, exists bool)

AverageRuntime returns the value of the "average_runtime" field in the mutation.

func (*ScriptStatsMutation) ClearEdge

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) ClearField

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) ClearedEdges

func (m *ScriptStatsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScriptStatsMutation) ClearedFields

func (m *ScriptStatsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScriptStatsMutation) Client

func (m ScriptStatsMutation) 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 (*ScriptStatsMutation) EdgeCleared

func (m *ScriptStatsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ScriptStatsMutation) Field

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) FieldCleared

func (m *ScriptStatsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ScriptStatsMutation) Fields

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) ID

func (m *ScriptStatsMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ScriptStatsMutation) IDs

func (m *ScriptStatsMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ScriptStatsMutation) LastRun

func (m *ScriptStatsMutation) LastRun() (r time.Time, exists bool)

LastRun returns the value of the "last_run" field in the mutation.

func (*ScriptStatsMutation) MaxRuntime

func (m *ScriptStatsMutation) MaxRuntime() (r int, exists bool)

MaxRuntime returns the value of the "max_runtime" field in the mutation.

func (*ScriptStatsMutation) MinRuntime

func (m *ScriptStatsMutation) MinRuntime() (r int, exists bool)

MinRuntime returns the value of the "min_runtime" field in the mutation.

func (*ScriptStatsMutation) OldAverageRuntime

func (m *ScriptStatsMutation) OldAverageRuntime(ctx context.Context) (v int, err error)

OldAverageRuntime returns the old "average_runtime" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldField

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) OldLastRun

func (m *ScriptStatsMutation) OldLastRun(ctx context.Context) (v time.Time, err error)

OldLastRun returns the old "last_run" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldMaxRuntime

func (m *ScriptStatsMutation) OldMaxRuntime(ctx context.Context) (v int, err error)

OldMaxRuntime returns the old "max_runtime" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldMinRuntime

func (m *ScriptStatsMutation) OldMinRuntime(ctx context.Context) (v int, err error)

OldMinRuntime returns the old "min_runtime" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldProjectID

func (m *ScriptStatsMutation) OldProjectID(ctx context.Context) (v int, err error)

OldProjectID returns the old "project_id" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldScriptID

func (m *ScriptStatsMutation) OldScriptID(ctx context.Context) (v int, err error)

OldScriptID returns the old "script_id" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldSuccessRate

func (m *ScriptStatsMutation) OldSuccessRate(ctx context.Context) (v int, err error)

OldSuccessRate returns the old "success_rate" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldTotalErrors

func (m *ScriptStatsMutation) OldTotalErrors(ctx context.Context) (v int, err error)

OldTotalErrors returns the old "total_errors" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldTotalRuns

func (m *ScriptStatsMutation) OldTotalRuns(ctx context.Context) (v int, err error)

OldTotalRuns returns the old "total_runs" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldTotalRuntime

func (m *ScriptStatsMutation) OldTotalRuntime(ctx context.Context) (v int, err error)

OldTotalRuntime returns the old "total_runtime" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) OldTotalSuccess

func (m *ScriptStatsMutation) OldTotalSuccess(ctx context.Context) (v int, err error)

OldTotalSuccess returns the old "total_success" field's value of the ScriptStats entity. If the ScriptStats object wasn'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 (*ScriptStatsMutation) Op

func (m *ScriptStatsMutation) Op() Op

Op returns the operation name.

func (*ScriptStatsMutation) ProjectID

func (m *ScriptStatsMutation) ProjectID() (r int, exists bool)

ProjectID returns the value of the "project_id" field in the mutation.

func (*ScriptStatsMutation) RemovedEdges

func (m *ScriptStatsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScriptStatsMutation) RemovedIDs

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) ResetAverageRuntime

func (m *ScriptStatsMutation) ResetAverageRuntime()

ResetAverageRuntime resets all changes to the "average_runtime" field.

func (*ScriptStatsMutation) ResetEdge

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) ResetField

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) ResetLastRun

func (m *ScriptStatsMutation) ResetLastRun()

ResetLastRun resets all changes to the "last_run" field.

func (*ScriptStatsMutation) ResetMaxRuntime

func (m *ScriptStatsMutation) ResetMaxRuntime()

ResetMaxRuntime resets all changes to the "max_runtime" field.

func (*ScriptStatsMutation) ResetMinRuntime

func (m *ScriptStatsMutation) ResetMinRuntime()

ResetMinRuntime resets all changes to the "min_runtime" field.

func (*ScriptStatsMutation) ResetProjectID

func (m *ScriptStatsMutation) ResetProjectID()

ResetProjectID resets all changes to the "project_id" field.

func (*ScriptStatsMutation) ResetScriptID

func (m *ScriptStatsMutation) ResetScriptID()

ResetScriptID resets all changes to the "script_id" field.

func (*ScriptStatsMutation) ResetSuccessRate

func (m *ScriptStatsMutation) ResetSuccessRate()

ResetSuccessRate resets all changes to the "success_rate" field.

func (*ScriptStatsMutation) ResetTotalErrors

func (m *ScriptStatsMutation) ResetTotalErrors()

ResetTotalErrors resets all changes to the "total_errors" field.

func (*ScriptStatsMutation) ResetTotalRuns

func (m *ScriptStatsMutation) ResetTotalRuns()

ResetTotalRuns resets all changes to the "total_runs" field.

func (*ScriptStatsMutation) ResetTotalRuntime

func (m *ScriptStatsMutation) ResetTotalRuntime()

ResetTotalRuntime resets all changes to the "total_runtime" field.

func (*ScriptStatsMutation) ResetTotalSuccess

func (m *ScriptStatsMutation) ResetTotalSuccess()

ResetTotalSuccess resets all changes to the "total_success" field.

func (*ScriptStatsMutation) ScriptID

func (m *ScriptStatsMutation) ScriptID() (r int, exists bool)

ScriptID returns the value of the "script_id" field in the mutation.

func (*ScriptStatsMutation) SetAverageRuntime

func (m *ScriptStatsMutation) SetAverageRuntime(i int)

SetAverageRuntime sets the "average_runtime" field.

func (*ScriptStatsMutation) SetField

func (m *ScriptStatsMutation) 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 (*ScriptStatsMutation) SetLastRun

func (m *ScriptStatsMutation) SetLastRun(t time.Time)

SetLastRun sets the "last_run" field.

func (*ScriptStatsMutation) SetMaxRuntime

func (m *ScriptStatsMutation) SetMaxRuntime(i int)

SetMaxRuntime sets the "max_runtime" field.

func (*ScriptStatsMutation) SetMinRuntime

func (m *ScriptStatsMutation) SetMinRuntime(i int)

SetMinRuntime sets the "min_runtime" field.

func (*ScriptStatsMutation) SetOp

func (m *ScriptStatsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ScriptStatsMutation) SetProjectID

func (m *ScriptStatsMutation) SetProjectID(i int)

SetProjectID sets the "project_id" field.

func (*ScriptStatsMutation) SetScriptID

func (m *ScriptStatsMutation) SetScriptID(i int)

SetScriptID sets the "script_id" field.

func (*ScriptStatsMutation) SetSuccessRate

func (m *ScriptStatsMutation) SetSuccessRate(i int)

SetSuccessRate sets the "success_rate" field.

func (*ScriptStatsMutation) SetTotalErrors

func (m *ScriptStatsMutation) SetTotalErrors(i int)

SetTotalErrors sets the "total_errors" field.

func (*ScriptStatsMutation) SetTotalRuns

func (m *ScriptStatsMutation) SetTotalRuns(i int)

SetTotalRuns sets the "total_runs" field.

func (*ScriptStatsMutation) SetTotalRuntime

func (m *ScriptStatsMutation) SetTotalRuntime(i int)

SetTotalRuntime sets the "total_runtime" field.

func (*ScriptStatsMutation) SetTotalSuccess

func (m *ScriptStatsMutation) SetTotalSuccess(i int)

SetTotalSuccess sets the "total_success" field.

func (*ScriptStatsMutation) SuccessRate

func (m *ScriptStatsMutation) SuccessRate() (r int, exists bool)

SuccessRate returns the value of the "success_rate" field in the mutation.

func (*ScriptStatsMutation) TotalErrors

func (m *ScriptStatsMutation) TotalErrors() (r int, exists bool)

TotalErrors returns the value of the "total_errors" field in the mutation.

func (*ScriptStatsMutation) TotalRuns

func (m *ScriptStatsMutation) TotalRuns() (r int, exists bool)

TotalRuns returns the value of the "total_runs" field in the mutation.

func (*ScriptStatsMutation) TotalRuntime

func (m *ScriptStatsMutation) TotalRuntime() (r int, exists bool)

TotalRuntime returns the value of the "total_runtime" field in the mutation.

func (*ScriptStatsMutation) TotalSuccess

func (m *ScriptStatsMutation) TotalSuccess() (r int, exists bool)

TotalSuccess returns the value of the "total_success" field in the mutation.

func (ScriptStatsMutation) Tx

func (m ScriptStatsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScriptStatsMutation) Type

func (m *ScriptStatsMutation) Type() string

Type returns the node type of this mutation (ScriptStats).

func (*ScriptStatsMutation) Where

func (m *ScriptStatsMutation) Where(ps ...predicate.ScriptStats)

Where appends a list predicates to the ScriptStatsMutation builder.

func (*ScriptStatsMutation) WhereP

func (m *ScriptStatsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ScriptStatsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ScriptStatsQuery

type ScriptStatsQuery struct {
	// contains filtered or unexported fields
}

ScriptStatsQuery is the builder for querying ScriptStats entities.

func (*ScriptStatsQuery) Aggregate

func (ssq *ScriptStatsQuery) Aggregate(fns ...AggregateFunc) *ScriptStatsSelect

Aggregate returns a ScriptStatsSelect configured with the given aggregations.

func (*ScriptStatsQuery) All

func (ssq *ScriptStatsQuery) All(ctx context.Context) ([]*ScriptStats, error)

All executes the query and returns a list of ScriptStatsSlice.

func (*ScriptStatsQuery) AllX

func (ssq *ScriptStatsQuery) AllX(ctx context.Context) []*ScriptStats

AllX is like All, but panics if an error occurs.

func (*ScriptStatsQuery) Clone

func (ssq *ScriptStatsQuery) Clone() *ScriptStatsQuery

Clone returns a duplicate of the ScriptStatsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ScriptStatsQuery) Count

func (ssq *ScriptStatsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScriptStatsQuery) CountX

func (ssq *ScriptStatsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScriptStatsQuery) Exist

func (ssq *ScriptStatsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScriptStatsQuery) ExistX

func (ssq *ScriptStatsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScriptStatsQuery) First

func (ssq *ScriptStatsQuery) First(ctx context.Context) (*ScriptStats, error)

First returns the first ScriptStats entity from the query. Returns a *NotFoundError when no ScriptStats was found.

func (*ScriptStatsQuery) FirstID

func (ssq *ScriptStatsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ScriptStats ID from the query. Returns a *NotFoundError when no ScriptStats ID was found.

func (*ScriptStatsQuery) FirstIDX

func (ssq *ScriptStatsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScriptStatsQuery) FirstX

func (ssq *ScriptStatsQuery) FirstX(ctx context.Context) *ScriptStats

FirstX is like First, but panics if an error occurs.

func (*ScriptStatsQuery) GroupBy

func (ssq *ScriptStatsQuery) GroupBy(field string, fields ...string) *ScriptStatsGroupBy

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 {
	ScriptID int `json:"script_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ScriptStats.Query().
	GroupBy(scriptstats.FieldScriptID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ScriptStatsQuery) IDs

func (ssq *ScriptStatsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of ScriptStats IDs.

func (*ScriptStatsQuery) IDsX

func (ssq *ScriptStatsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ScriptStatsQuery) Limit

func (ssq *ScriptStatsQuery) Limit(limit int) *ScriptStatsQuery

Limit the number of records to be returned by this query.

func (*ScriptStatsQuery) Offset

func (ssq *ScriptStatsQuery) Offset(offset int) *ScriptStatsQuery

Offset to start from.

func (*ScriptStatsQuery) Only

func (ssq *ScriptStatsQuery) Only(ctx context.Context) (*ScriptStats, error)

Only returns a single ScriptStats entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ScriptStats entity is found. Returns a *NotFoundError when no ScriptStats entities are found.

func (*ScriptStatsQuery) OnlyID

func (ssq *ScriptStatsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ScriptStats ID in the query. Returns a *NotSingularError when more than one ScriptStats ID is found. Returns a *NotFoundError when no entities are found.

func (*ScriptStatsQuery) OnlyIDX

func (ssq *ScriptStatsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScriptStatsQuery) OnlyX

func (ssq *ScriptStatsQuery) OnlyX(ctx context.Context) *ScriptStats

OnlyX is like Only, but panics if an error occurs.

func (*ScriptStatsQuery) Order

Order specifies how the records should be ordered.

func (*ScriptStatsQuery) Select

func (ssq *ScriptStatsQuery) Select(fields ...string) *ScriptStatsSelect

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 {
	ScriptID int `json:"script_id,omitempty"`
}

client.ScriptStats.Query().
	Select(scriptstats.FieldScriptID).
	Scan(ctx, &v)

func (*ScriptStatsQuery) Unique

func (ssq *ScriptStatsQuery) Unique(unique bool) *ScriptStatsQuery

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 (*ScriptStatsQuery) Where

Where adds a new predicate for the ScriptStatsQuery builder.

type ScriptStatsSelect

type ScriptStatsSelect struct {
	*ScriptStatsQuery
	// contains filtered or unexported fields
}

ScriptStatsSelect is the builder for selecting fields of ScriptStats entities.

func (*ScriptStatsSelect) Aggregate

func (sss *ScriptStatsSelect) Aggregate(fns ...AggregateFunc) *ScriptStatsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ScriptStatsSelect) Bool

func (s *ScriptStatsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) BoolX

func (s *ScriptStatsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScriptStatsSelect) Bools

func (s *ScriptStatsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) BoolsX

func (s *ScriptStatsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScriptStatsSelect) Float64

func (s *ScriptStatsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) Float64X

func (s *ScriptStatsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScriptStatsSelect) Float64s

func (s *ScriptStatsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) Float64sX

func (s *ScriptStatsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScriptStatsSelect) Int

func (s *ScriptStatsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) IntX

func (s *ScriptStatsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScriptStatsSelect) Ints

func (s *ScriptStatsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) IntsX

func (s *ScriptStatsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScriptStatsSelect) Scan

func (sss *ScriptStatsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ScriptStatsSelect) ScanX

func (s *ScriptStatsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ScriptStatsSelect) String

func (s *ScriptStatsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) StringX

func (s *ScriptStatsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScriptStatsSelect) Strings

func (s *ScriptStatsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScriptStatsSelect) StringsX

func (s *ScriptStatsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScriptStatsSlice

type ScriptStatsSlice []*ScriptStats

ScriptStatsSlice is a parsable slice of ScriptStats.

type ScriptStatsUpdate

type ScriptStatsUpdate struct {
	// contains filtered or unexported fields
}

ScriptStatsUpdate is the builder for updating ScriptStats entities.

func (*ScriptStatsUpdate) AddAverageRuntime

func (ssu *ScriptStatsUpdate) AddAverageRuntime(i int) *ScriptStatsUpdate

AddAverageRuntime adds i to the "average_runtime" field.

func (*ScriptStatsUpdate) AddMaxRuntime

func (ssu *ScriptStatsUpdate) AddMaxRuntime(i int) *ScriptStatsUpdate

AddMaxRuntime adds i to the "max_runtime" field.

func (*ScriptStatsUpdate) AddMinRuntime

func (ssu *ScriptStatsUpdate) AddMinRuntime(i int) *ScriptStatsUpdate

AddMinRuntime adds i to the "min_runtime" field.

func (*ScriptStatsUpdate) AddProjectID

func (ssu *ScriptStatsUpdate) AddProjectID(i int) *ScriptStatsUpdate

AddProjectID adds i to the "project_id" field.

func (*ScriptStatsUpdate) AddScriptID

func (ssu *ScriptStatsUpdate) AddScriptID(i int) *ScriptStatsUpdate

AddScriptID adds i to the "script_id" field.

func (*ScriptStatsUpdate) AddSuccessRate

func (ssu *ScriptStatsUpdate) AddSuccessRate(i int) *ScriptStatsUpdate

AddSuccessRate adds i to the "success_rate" field.

func (*ScriptStatsUpdate) AddTotalErrors

func (ssu *ScriptStatsUpdate) AddTotalErrors(i int) *ScriptStatsUpdate

AddTotalErrors adds i to the "total_errors" field.

func (*ScriptStatsUpdate) AddTotalRuns

func (ssu *ScriptStatsUpdate) AddTotalRuns(i int) *ScriptStatsUpdate

AddTotalRuns adds i to the "total_runs" field.

func (*ScriptStatsUpdate) AddTotalRuntime

func (ssu *ScriptStatsUpdate) AddTotalRuntime(i int) *ScriptStatsUpdate

AddTotalRuntime adds i to the "total_runtime" field.

func (*ScriptStatsUpdate) AddTotalSuccess

func (ssu *ScriptStatsUpdate) AddTotalSuccess(i int) *ScriptStatsUpdate

AddTotalSuccess adds i to the "total_success" field.

func (*ScriptStatsUpdate) Exec

func (ssu *ScriptStatsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptStatsUpdate) ExecX

func (ssu *ScriptStatsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptStatsUpdate) Mutation

func (ssu *ScriptStatsUpdate) Mutation() *ScriptStatsMutation

Mutation returns the ScriptStatsMutation object of the builder.

func (*ScriptStatsUpdate) Save

func (ssu *ScriptStatsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScriptStatsUpdate) SaveX

func (ssu *ScriptStatsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ScriptStatsUpdate) SetAverageRuntime

func (ssu *ScriptStatsUpdate) SetAverageRuntime(i int) *ScriptStatsUpdate

SetAverageRuntime sets the "average_runtime" field.

func (*ScriptStatsUpdate) SetLastRun

func (ssu *ScriptStatsUpdate) SetLastRun(t time.Time) *ScriptStatsUpdate

SetLastRun sets the "last_run" field.

func (*ScriptStatsUpdate) SetMaxRuntime

func (ssu *ScriptStatsUpdate) SetMaxRuntime(i int) *ScriptStatsUpdate

SetMaxRuntime sets the "max_runtime" field.

func (*ScriptStatsUpdate) SetMinRuntime

func (ssu *ScriptStatsUpdate) SetMinRuntime(i int) *ScriptStatsUpdate

SetMinRuntime sets the "min_runtime" field.

func (*ScriptStatsUpdate) SetProjectID

func (ssu *ScriptStatsUpdate) SetProjectID(i int) *ScriptStatsUpdate

SetProjectID sets the "project_id" field.

func (*ScriptStatsUpdate) SetScriptID

func (ssu *ScriptStatsUpdate) SetScriptID(i int) *ScriptStatsUpdate

SetScriptID sets the "script_id" field.

func (*ScriptStatsUpdate) SetSuccessRate

func (ssu *ScriptStatsUpdate) SetSuccessRate(i int) *ScriptStatsUpdate

SetSuccessRate sets the "success_rate" field.

func (*ScriptStatsUpdate) SetTotalErrors

func (ssu *ScriptStatsUpdate) SetTotalErrors(i int) *ScriptStatsUpdate

SetTotalErrors sets the "total_errors" field.

func (*ScriptStatsUpdate) SetTotalRuns

func (ssu *ScriptStatsUpdate) SetTotalRuns(i int) *ScriptStatsUpdate

SetTotalRuns sets the "total_runs" field.

func (*ScriptStatsUpdate) SetTotalRuntime

func (ssu *ScriptStatsUpdate) SetTotalRuntime(i int) *ScriptStatsUpdate

SetTotalRuntime sets the "total_runtime" field.

func (*ScriptStatsUpdate) SetTotalSuccess

func (ssu *ScriptStatsUpdate) SetTotalSuccess(i int) *ScriptStatsUpdate

SetTotalSuccess sets the "total_success" field.

func (*ScriptStatsUpdate) Where

Where appends a list predicates to the ScriptStatsUpdate builder.

type ScriptStatsUpdateOne

type ScriptStatsUpdateOne struct {
	// contains filtered or unexported fields
}

ScriptStatsUpdateOne is the builder for updating a single ScriptStats entity.

func (*ScriptStatsUpdateOne) AddAverageRuntime

func (ssuo *ScriptStatsUpdateOne) AddAverageRuntime(i int) *ScriptStatsUpdateOne

AddAverageRuntime adds i to the "average_runtime" field.

func (*ScriptStatsUpdateOne) AddMaxRuntime

func (ssuo *ScriptStatsUpdateOne) AddMaxRuntime(i int) *ScriptStatsUpdateOne

AddMaxRuntime adds i to the "max_runtime" field.

func (*ScriptStatsUpdateOne) AddMinRuntime

func (ssuo *ScriptStatsUpdateOne) AddMinRuntime(i int) *ScriptStatsUpdateOne

AddMinRuntime adds i to the "min_runtime" field.

func (*ScriptStatsUpdateOne) AddProjectID

func (ssuo *ScriptStatsUpdateOne) AddProjectID(i int) *ScriptStatsUpdateOne

AddProjectID adds i to the "project_id" field.

func (*ScriptStatsUpdateOne) AddScriptID

func (ssuo *ScriptStatsUpdateOne) AddScriptID(i int) *ScriptStatsUpdateOne

AddScriptID adds i to the "script_id" field.

func (*ScriptStatsUpdateOne) AddSuccessRate

func (ssuo *ScriptStatsUpdateOne) AddSuccessRate(i int) *ScriptStatsUpdateOne

AddSuccessRate adds i to the "success_rate" field.

func (*ScriptStatsUpdateOne) AddTotalErrors

func (ssuo *ScriptStatsUpdateOne) AddTotalErrors(i int) *ScriptStatsUpdateOne

AddTotalErrors adds i to the "total_errors" field.

func (*ScriptStatsUpdateOne) AddTotalRuns

func (ssuo *ScriptStatsUpdateOne) AddTotalRuns(i int) *ScriptStatsUpdateOne

AddTotalRuns adds i to the "total_runs" field.

func (*ScriptStatsUpdateOne) AddTotalRuntime

func (ssuo *ScriptStatsUpdateOne) AddTotalRuntime(i int) *ScriptStatsUpdateOne

AddTotalRuntime adds i to the "total_runtime" field.

func (*ScriptStatsUpdateOne) AddTotalSuccess

func (ssuo *ScriptStatsUpdateOne) AddTotalSuccess(i int) *ScriptStatsUpdateOne

AddTotalSuccess adds i to the "total_success" field.

func (*ScriptStatsUpdateOne) Exec

func (ssuo *ScriptStatsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ScriptStatsUpdateOne) ExecX

func (ssuo *ScriptStatsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptStatsUpdateOne) Mutation

func (ssuo *ScriptStatsUpdateOne) Mutation() *ScriptStatsMutation

Mutation returns the ScriptStatsMutation object of the builder.

func (*ScriptStatsUpdateOne) Save

Save executes the query and returns the updated ScriptStats entity.

func (*ScriptStatsUpdateOne) SaveX

func (ssuo *ScriptStatsUpdateOne) SaveX(ctx context.Context) *ScriptStats

SaveX is like Save, but panics if an error occurs.

func (*ScriptStatsUpdateOne) Select

func (ssuo *ScriptStatsUpdateOne) Select(field string, fields ...string) *ScriptStatsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ScriptStatsUpdateOne) SetAverageRuntime

func (ssuo *ScriptStatsUpdateOne) SetAverageRuntime(i int) *ScriptStatsUpdateOne

SetAverageRuntime sets the "average_runtime" field.

func (*ScriptStatsUpdateOne) SetLastRun

func (ssuo *ScriptStatsUpdateOne) SetLastRun(t time.Time) *ScriptStatsUpdateOne

SetLastRun sets the "last_run" field.

func (*ScriptStatsUpdateOne) SetMaxRuntime

func (ssuo *ScriptStatsUpdateOne) SetMaxRuntime(i int) *ScriptStatsUpdateOne

SetMaxRuntime sets the "max_runtime" field.

func (*ScriptStatsUpdateOne) SetMinRuntime

func (ssuo *ScriptStatsUpdateOne) SetMinRuntime(i int) *ScriptStatsUpdateOne

SetMinRuntime sets the "min_runtime" field.

func (*ScriptStatsUpdateOne) SetProjectID

func (ssuo *ScriptStatsUpdateOne) SetProjectID(i int) *ScriptStatsUpdateOne

SetProjectID sets the "project_id" field.

func (*ScriptStatsUpdateOne) SetScriptID

func (ssuo *ScriptStatsUpdateOne) SetScriptID(i int) *ScriptStatsUpdateOne

SetScriptID sets the "script_id" field.

func (*ScriptStatsUpdateOne) SetSuccessRate

func (ssuo *ScriptStatsUpdateOne) SetSuccessRate(i int) *ScriptStatsUpdateOne

SetSuccessRate sets the "success_rate" field.

func (*ScriptStatsUpdateOne) SetTotalErrors

func (ssuo *ScriptStatsUpdateOne) SetTotalErrors(i int) *ScriptStatsUpdateOne

SetTotalErrors sets the "total_errors" field.

func (*ScriptStatsUpdateOne) SetTotalRuns

func (ssuo *ScriptStatsUpdateOne) SetTotalRuns(i int) *ScriptStatsUpdateOne

SetTotalRuns sets the "total_runs" field.

func (*ScriptStatsUpdateOne) SetTotalRuntime

func (ssuo *ScriptStatsUpdateOne) SetTotalRuntime(i int) *ScriptStatsUpdateOne

SetTotalRuntime sets the "total_runtime" field.

func (*ScriptStatsUpdateOne) SetTotalSuccess

func (ssuo *ScriptStatsUpdateOne) SetTotalSuccess(i int) *ScriptStatsUpdateOne

SetTotalSuccess sets the "total_success" field.

func (*ScriptStatsUpdateOne) Where

Where appends a list predicates to the ScriptStatsUpdate builder.

type ScriptUpdate

type ScriptUpdate struct {
	// contains filtered or unexported fields
}

ScriptUpdate is the builder for updating Script entities.

func (*ScriptUpdate) AddFailureNotificationChannelID

func (su *ScriptUpdate) AddFailureNotificationChannelID(i int) *ScriptUpdate

AddFailureNotificationChannelID adds i to the "failure_notification_channel_id" field.

func (*ScriptUpdate) AddProjectID

func (su *ScriptUpdate) AddProjectID(i int) *ScriptUpdate

AddProjectID adds i to the "project_id" field.

func (*ScriptUpdate) AddSuccessNotificationChannelID

func (su *ScriptUpdate) AddSuccessNotificationChannelID(i int) *ScriptUpdate

AddSuccessNotificationChannelID adds i to the "success_notification_channel_id" field.

func (*ScriptUpdate) AddTimeoutSeconds

func (su *ScriptUpdate) AddTimeoutSeconds(i int) *ScriptUpdate

AddTimeoutSeconds adds i to the "timeout_seconds" field.

func (*ScriptUpdate) AppendParameters

func (su *ScriptUpdate) AppendParameters(sio []schema.ScriptInputOptions) *ScriptUpdate

AppendParameters appends sio to the "parameters" field.

func (*ScriptUpdate) ClearDescription

func (su *ScriptUpdate) ClearDescription() *ScriptUpdate

ClearDescription clears the value of the "description" field.

func (*ScriptUpdate) ClearFailureNotificationChannelID

func (su *ScriptUpdate) ClearFailureNotificationChannelID() *ScriptUpdate

ClearFailureNotificationChannelID clears the value of the "failure_notification_channel_id" field.

func (*ScriptUpdate) ClearParameters

func (su *ScriptUpdate) ClearParameters() *ScriptUpdate

ClearParameters clears the value of the "parameters" field.

func (*ScriptUpdate) ClearScheduleCron

func (su *ScriptUpdate) ClearScheduleCron() *ScriptUpdate

ClearScheduleCron clears the value of the "schedule_cron" field.

func (*ScriptUpdate) ClearSuccessNotificationChannelID

func (su *ScriptUpdate) ClearSuccessNotificationChannelID() *ScriptUpdate

ClearSuccessNotificationChannelID clears the value of the "success_notification_channel_id" field.

func (*ScriptUpdate) Exec

func (su *ScriptUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScriptUpdate) ExecX

func (su *ScriptUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptUpdate) Mutation

func (su *ScriptUpdate) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptUpdate) Save

func (su *ScriptUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScriptUpdate) SaveX

func (su *ScriptUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ScriptUpdate) SetDescription

func (su *ScriptUpdate) SetDescription(s string) *ScriptUpdate

SetDescription sets the "description" field.

func (*ScriptUpdate) SetFailureNotificationChannelID

func (su *ScriptUpdate) SetFailureNotificationChannelID(i int) *ScriptUpdate

SetFailureNotificationChannelID sets the "failure_notification_channel_id" field.

func (*ScriptUpdate) SetName

func (su *ScriptUpdate) SetName(s string) *ScriptUpdate

SetName sets the "name" field.

func (*ScriptUpdate) SetNillableDescription

func (su *ScriptUpdate) SetNillableDescription(s *string) *ScriptUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ScriptUpdate) SetNillableFailureNotificationChannelID

func (su *ScriptUpdate) SetNillableFailureNotificationChannelID(i *int) *ScriptUpdate

SetNillableFailureNotificationChannelID sets the "failure_notification_channel_id" field if the given value is not nil.

func (*ScriptUpdate) SetNillableScheduleCron

func (su *ScriptUpdate) SetNillableScheduleCron(s *string) *ScriptUpdate

SetNillableScheduleCron sets the "schedule_cron" field if the given value is not nil.

func (*ScriptUpdate) SetNillableScheduleEnabled

func (su *ScriptUpdate) SetNillableScheduleEnabled(b *bool) *ScriptUpdate

SetNillableScheduleEnabled sets the "schedule_enabled" field if the given value is not nil.

func (*ScriptUpdate) SetNillableSuccessNotificationChannelID

func (su *ScriptUpdate) SetNillableSuccessNotificationChannelID(i *int) *ScriptUpdate

SetNillableSuccessNotificationChannelID sets the "success_notification_channel_id" field if the given value is not nil.

func (*ScriptUpdate) SetNillableTimeoutSeconds

func (su *ScriptUpdate) SetNillableTimeoutSeconds(i *int) *ScriptUpdate

SetNillableTimeoutSeconds sets the "timeout_seconds" field if the given value is not nil.

func (*ScriptUpdate) SetParameters

func (su *ScriptUpdate) SetParameters(sio []schema.ScriptInputOptions) *ScriptUpdate

SetParameters sets the "parameters" field.

func (*ScriptUpdate) SetProjectID

func (su *ScriptUpdate) SetProjectID(i int) *ScriptUpdate

SetProjectID sets the "project_id" field.

func (*ScriptUpdate) SetScheduleCron

func (su *ScriptUpdate) SetScheduleCron(s string) *ScriptUpdate

SetScheduleCron sets the "schedule_cron" field.

func (*ScriptUpdate) SetScheduleEnabled

func (su *ScriptUpdate) SetScheduleEnabled(b bool) *ScriptUpdate

SetScheduleEnabled sets the "schedule_enabled" field.

func (*ScriptUpdate) SetScript

func (su *ScriptUpdate) SetScript(s string) *ScriptUpdate

SetScript sets the "script" field.

func (*ScriptUpdate) SetSuccessNotificationChannelID

func (su *ScriptUpdate) SetSuccessNotificationChannelID(i int) *ScriptUpdate

SetSuccessNotificationChannelID sets the "success_notification_channel_id" field.

func (*ScriptUpdate) SetTimeoutSeconds

func (su *ScriptUpdate) SetTimeoutSeconds(i int) *ScriptUpdate

SetTimeoutSeconds sets the "timeout_seconds" field.

func (*ScriptUpdate) SetUpdatedAt

func (su *ScriptUpdate) SetUpdatedAt(t time.Time) *ScriptUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ScriptUpdate) Where

func (su *ScriptUpdate) Where(ps ...predicate.Script) *ScriptUpdate

Where appends a list predicates to the ScriptUpdate builder.

type ScriptUpdateOne

type ScriptUpdateOne struct {
	// contains filtered or unexported fields
}

ScriptUpdateOne is the builder for updating a single Script entity.

func (*ScriptUpdateOne) AddFailureNotificationChannelID

func (suo *ScriptUpdateOne) AddFailureNotificationChannelID(i int) *ScriptUpdateOne

AddFailureNotificationChannelID adds i to the "failure_notification_channel_id" field.

func (*ScriptUpdateOne) AddProjectID

func (suo *ScriptUpdateOne) AddProjectID(i int) *ScriptUpdateOne

AddProjectID adds i to the "project_id" field.

func (*ScriptUpdateOne) AddSuccessNotificationChannelID

func (suo *ScriptUpdateOne) AddSuccessNotificationChannelID(i int) *ScriptUpdateOne

AddSuccessNotificationChannelID adds i to the "success_notification_channel_id" field.

func (*ScriptUpdateOne) AddTimeoutSeconds

func (suo *ScriptUpdateOne) AddTimeoutSeconds(i int) *ScriptUpdateOne

AddTimeoutSeconds adds i to the "timeout_seconds" field.

func (*ScriptUpdateOne) AppendParameters

func (suo *ScriptUpdateOne) AppendParameters(sio []schema.ScriptInputOptions) *ScriptUpdateOne

AppendParameters appends sio to the "parameters" field.

func (*ScriptUpdateOne) ClearDescription

func (suo *ScriptUpdateOne) ClearDescription() *ScriptUpdateOne

ClearDescription clears the value of the "description" field.

func (*ScriptUpdateOne) ClearFailureNotificationChannelID

func (suo *ScriptUpdateOne) ClearFailureNotificationChannelID() *ScriptUpdateOne

ClearFailureNotificationChannelID clears the value of the "failure_notification_channel_id" field.

func (*ScriptUpdateOne) ClearParameters

func (suo *ScriptUpdateOne) ClearParameters() *ScriptUpdateOne

ClearParameters clears the value of the "parameters" field.

func (*ScriptUpdateOne) ClearScheduleCron

func (suo *ScriptUpdateOne) ClearScheduleCron() *ScriptUpdateOne

ClearScheduleCron clears the value of the "schedule_cron" field.

func (*ScriptUpdateOne) ClearSuccessNotificationChannelID

func (suo *ScriptUpdateOne) ClearSuccessNotificationChannelID() *ScriptUpdateOne

ClearSuccessNotificationChannelID clears the value of the "success_notification_channel_id" field.

func (*ScriptUpdateOne) Exec

func (suo *ScriptUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ScriptUpdateOne) ExecX

func (suo *ScriptUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScriptUpdateOne) Mutation

func (suo *ScriptUpdateOne) Mutation() *ScriptMutation

Mutation returns the ScriptMutation object of the builder.

func (*ScriptUpdateOne) Save

func (suo *ScriptUpdateOne) Save(ctx context.Context) (*Script, error)

Save executes the query and returns the updated Script entity.

func (*ScriptUpdateOne) SaveX

func (suo *ScriptUpdateOne) SaveX(ctx context.Context) *Script

SaveX is like Save, but panics if an error occurs.

func (*ScriptUpdateOne) Select

func (suo *ScriptUpdateOne) Select(field string, fields ...string) *ScriptUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ScriptUpdateOne) SetDescription

func (suo *ScriptUpdateOne) SetDescription(s string) *ScriptUpdateOne

SetDescription sets the "description" field.

func (*ScriptUpdateOne) SetFailureNotificationChannelID

func (suo *ScriptUpdateOne) SetFailureNotificationChannelID(i int) *ScriptUpdateOne

SetFailureNotificationChannelID sets the "failure_notification_channel_id" field.

func (*ScriptUpdateOne) SetName

func (suo *ScriptUpdateOne) SetName(s string) *ScriptUpdateOne

SetName sets the "name" field.

func (*ScriptUpdateOne) SetNillableDescription

func (suo *ScriptUpdateOne) SetNillableDescription(s *string) *ScriptUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableFailureNotificationChannelID

func (suo *ScriptUpdateOne) SetNillableFailureNotificationChannelID(i *int) *ScriptUpdateOne

SetNillableFailureNotificationChannelID sets the "failure_notification_channel_id" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableScheduleCron

func (suo *ScriptUpdateOne) SetNillableScheduleCron(s *string) *ScriptUpdateOne

SetNillableScheduleCron sets the "schedule_cron" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableScheduleEnabled

func (suo *ScriptUpdateOne) SetNillableScheduleEnabled(b *bool) *ScriptUpdateOne

SetNillableScheduleEnabled sets the "schedule_enabled" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableSuccessNotificationChannelID

func (suo *ScriptUpdateOne) SetNillableSuccessNotificationChannelID(i *int) *ScriptUpdateOne

SetNillableSuccessNotificationChannelID sets the "success_notification_channel_id" field if the given value is not nil.

func (*ScriptUpdateOne) SetNillableTimeoutSeconds

func (suo *ScriptUpdateOne) SetNillableTimeoutSeconds(i *int) *ScriptUpdateOne

SetNillableTimeoutSeconds sets the "timeout_seconds" field if the given value is not nil.

func (*ScriptUpdateOne) SetParameters

func (suo *ScriptUpdateOne) SetParameters(sio []schema.ScriptInputOptions) *ScriptUpdateOne

SetParameters sets the "parameters" field.

func (*ScriptUpdateOne) SetProjectID

func (suo *ScriptUpdateOne) SetProjectID(i int) *ScriptUpdateOne

SetProjectID sets the "project_id" field.

func (*ScriptUpdateOne) SetScheduleCron

func (suo *ScriptUpdateOne) SetScheduleCron(s string) *ScriptUpdateOne

SetScheduleCron sets the "schedule_cron" field.

func (*ScriptUpdateOne) SetScheduleEnabled

func (suo *ScriptUpdateOne) SetScheduleEnabled(b bool) *ScriptUpdateOne

SetScheduleEnabled sets the "schedule_enabled" field.

func (*ScriptUpdateOne) SetScript

func (suo *ScriptUpdateOne) SetScript(s string) *ScriptUpdateOne

SetScript sets the "script" field.

func (*ScriptUpdateOne) SetSuccessNotificationChannelID

func (suo *ScriptUpdateOne) SetSuccessNotificationChannelID(i int) *ScriptUpdateOne

SetSuccessNotificationChannelID sets the "success_notification_channel_id" field.

func (*ScriptUpdateOne) SetTimeoutSeconds

func (suo *ScriptUpdateOne) SetTimeoutSeconds(i int) *ScriptUpdateOne

SetTimeoutSeconds sets the "timeout_seconds" field.

func (*ScriptUpdateOne) SetUpdatedAt

func (suo *ScriptUpdateOne) SetUpdatedAt(t time.Time) *ScriptUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ScriptUpdateOne) Where

func (suo *ScriptUpdateOne) Where(ps ...predicate.Script) *ScriptUpdateOne

Where appends a list predicates to the ScriptUpdate builder.

type Scripts

type Scripts []*Script

Scripts is a parsable slice of Script.

type Secret

type Secret struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// ProjectID holds the value of the "project_id" field.
	ProjectID int `json:"project_id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy string `json:"created_by,omitempty"`
	// contains filtered or unexported fields
}

Secret is the model entity for the Secret schema.

func (*Secret) GetValue

func (s *Secret) GetValue(name string) (ent.Value, error)

GetValue returns the ent.Value that was dynamically selected and assigned to the Secret. This includes values selected through modifiers, order, etc.

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 int) *SecretDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SecretClient) Get

func (c *SecretClient) Get(ctx context.Context, id int) (*Secret, error)

Get returns a Secret entity by its id.

func (*SecretClient) GetX

func (c *SecretClient) GetX(ctx context.Context, id int) *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) Intercept

func (c *SecretClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `secret.Intercept(f(g(h())))`.

func (*SecretClient) Interceptors

func (c *SecretClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

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 int) *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) SetName

func (sc *SecretCreate) SetName(s string) *SecretCreate

SetName sets the "name" 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) SetNillableUpdatedAt

func (sc *SecretCreate) SetNillableUpdatedAt(t *time.Time) *SecretCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SecretCreate) SetProjectID

func (sc *SecretCreate) SetProjectID(i int) *SecretCreate

SetProjectID sets the "project_id" field.

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.

func (*SecretDeleteOne) Where

func (sdo *SecretDeleteOne) Where(ps ...predicate.Secret) *SecretDeleteOne

Where appends a list predicates to the SecretDelete builder.

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 selector 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) AddProjectID

func (m *SecretMutation) AddProjectID(i int)

AddProjectID adds i to the "project_id" field.

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) AddedProjectID

func (m *SecretMutation) AddedProjectID() (r int, exists bool)

AddedProjectID returns the value that was added to the "project_id" field 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 int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SecretMutation) IDs

func (m *SecretMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SecretMutation) Name

func (m *SecretMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in 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) OldName

func (m *SecretMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" 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) OldProjectID

func (m *SecretMutation) OldProjectID(ctx context.Context) (v int, err error)

OldProjectID returns the old "project_id" 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) 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) ProjectID

func (m *SecretMutation) ProjectID() (r int, exists bool)

ProjectID returns the value of the "project_id" field in the mutation.

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) ResetName

func (m *SecretMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SecretMutation) ResetProjectID

func (m *SecretMutation) ResetProjectID()

ResetProjectID resets all changes to the "project_id" field.

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) SetName

func (m *SecretMutation) SetName(s string)

SetName sets the "name" field.

func (*SecretMutation) SetOp

func (m *SecretMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SecretMutation) SetProjectID

func (m *SecretMutation) SetProjectID(i int)

SetProjectID sets the "project_id" field.

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.

func (*SecretMutation) WhereP

func (m *SecretMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SecretMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

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 int, 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) int

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) (ids []int, err error)

IDs executes the query and returns a list of Secret IDs.

func (*SecretQuery) IDsX

func (sq *SecretQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SecretQuery) Limit

func (sq *SecretQuery) Limit(limit int) *SecretQuery

Limit the number of records to be returned by this query.

func (*SecretQuery) Offset

func (sq *SecretQuery) Offset(offset int) *SecretQuery

Offset to start from.

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 int, 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) int

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 ...secret.OrderOption) *SecretQuery

Order specifies how the records should be ordered.

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) AddProjectID

func (su *SecretUpdate) AddProjectID(i int) *SecretUpdate

AddProjectID adds i to the "project_id" field.

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) SetCreatedBy

func (su *SecretUpdate) SetCreatedBy(s string) *SecretUpdate

SetCreatedBy sets the "created_by" field.

func (*SecretUpdate) SetName

func (su *SecretUpdate) SetName(s string) *SecretUpdate

SetName sets the "name" field.

func (*SecretUpdate) SetProjectID

func (su *SecretUpdate) SetProjectID(i int) *SecretUpdate

SetProjectID sets the "project_id" field.

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) AddProjectID

func (suo *SecretUpdateOne) AddProjectID(i int) *SecretUpdateOne

AddProjectID adds i to the "project_id" field.

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) SetCreatedBy

func (suo *SecretUpdateOne) SetCreatedBy(s string) *SecretUpdateOne

SetCreatedBy sets the "created_by" field.

func (*SecretUpdateOne) SetName

func (suo *SecretUpdateOne) SetName(s string) *SecretUpdateOne

SetName sets the "name" field.

func (*SecretUpdateOne) SetProjectID

func (suo *SecretUpdateOne) SetProjectID(i int) *SecretUpdateOne

SetProjectID sets the "project_id" field.

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.

func (*SecretUpdateOne) Where

func (suo *SecretUpdateOne) Where(ps ...predicate.Secret) *SecretUpdateOne

Where appends a list predicates to the SecretUpdate builder.

type Secrets

type Secrets []*Secret

Secrets is a parsable slice of Secret.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Access is the client for interacting with the Access builders.
	Access *AccessClient
	// History is the client for interacting with the History builders.
	History *HistoryClient
	// NotificationChannel is the client for interacting with the NotificationChannel builders.
	NotificationChannel *NotificationChannelClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Script is the client for interacting with the Script builders.
	Script *ScriptClient
	// ScriptStats is the client for interacting with the ScriptStats builders.
	ScriptStats *ScriptStatsClient
	// Secret is the client for interacting with the Secret builders.
	Secret *SecretClient
	// 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 int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// HashedPassword holds the value of the "hashed_password" field.
	HashedPassword string `json:"hashed_password,omitempty"`
	// APIKey holds the value of the "api_key" field.
	APIKey string `json:"api_key,omitempty"`
	// Role holds the value of the "role" field.
	Role user.Role `json:"role,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.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

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 int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *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) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

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 int) *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) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetHashedPassword

func (uc *UserCreate) SetHashedPassword(s string) *UserCreate

SetHashedPassword sets the "hashed_password" 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) SetNillableRole

func (uc *UserCreate) SetNillableRole(u *user.Role) *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(u user.Role) *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.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

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 selector 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) 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) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the 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) HashedPassword

func (m *UserMutation) HashedPassword() (r string, exists bool)

HashedPassword returns the value of the "hashed_password" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*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) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" 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) OldHashedPassword

func (m *UserMutation) OldHashedPassword(ctx context.Context) (v string, err error)

OldHashedPassword returns the old "hashed_password" 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 user.Role, 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) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

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) ResetHashedPassword

func (m *UserMutation) ResetHashedPassword()

ResetHashedPassword resets all changes to the "hashed_password" 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 user.Role, 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) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" 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) SetHashedPassword

func (m *UserMutation) SetHashedPassword(s string)

SetHashedPassword sets the "hashed_password" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(u user.Role)

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.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

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 int, 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) int

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

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 int, 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) int

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 ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.User.Query().
	Select(user.FieldCreatedAt).
	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) 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) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetHashedPassword

func (uu *UserUpdate) SetHashedPassword(s string) *UserUpdate

SetHashedPassword sets the "hashed_password" field.

func (*UserUpdate) SetNillableRole

func (uu *UserUpdate) SetNillableRole(u *user.Role) *UserUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdate) SetRole

func (uu *UserUpdate) SetRole(u user.Role) *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) 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) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetHashedPassword

func (uuo *UserUpdateOne) SetHashedPassword(s string) *UserUpdateOne

SetHashedPassword sets the "hashed_password" field.

func (*UserUpdateOne) SetNillableRole

func (uuo *UserUpdateOne) SetNillableRole(u *user.Role) *UserUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdateOne) SetRole

func (uuo *UserUpdateOne) SetRole(u user.Role) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL