ent

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 26 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.
	TypeHistory  = "History"
	TypeJob      = "Job"
	TypeTag      = "Tag"
	TypeWorkflow = "Workflow"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// History is the client for interacting with the History builders.
	History *HistoryClient
	// Job is the client for interacting with the Job builders.
	Job *JobClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// Workflow is the client for interacting with the Workflow builders.
	Workflow *WorkflowClient
	// 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().
	History.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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"`
	// modification time
	Mtime time.Time `json:"mtime,omitempty"`
	// Status holds the value of the "status" field.
	Status model.JobStatus `json:"status,omitempty"`
	// Definition holds the value of the "definition" field.
	Definition map[string]interface{} `json:"definition,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the HistoryQuery when eager-loading is set.
	Edges HistoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

History is the model entity for the History schema.

func (*History) ExecContext

func (c *History) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*History) QueryContext

func (c *History) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*History) QueryJob

func (h *History) QueryJob() *JobQuery

QueryJob queries the "job" edge of the History entity.

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

func (c *HistoryClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) MapCreateBulk added in v0.2.0

func (c *HistoryClient) MapCreateBulk(slice any, setFunc func(*HistoryCreate, int)) *HistoryCreateBulk

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

func (*HistoryClient) Query

func (c *HistoryClient) Query() *HistoryQuery

Query returns a query builder for History.

func (*HistoryClient) QueryContext

func (c *HistoryClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*HistoryClient) QueryJob

func (c *HistoryClient) QueryJob(h *History) *JobQuery

QueryJob queries the job edge of a 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) ExecContext

func (c *HistoryCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *HistoryCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (hc *HistoryCreate) SetDefinition(m map[string]interface{}) *HistoryCreate

SetDefinition sets the "definition" field.

func (*HistoryCreate) SetJob

func (hc *HistoryCreate) SetJob(j *Job) *HistoryCreate

SetJob sets the "job" edge to the Job entity.

func (*HistoryCreate) SetJobID

func (hc *HistoryCreate) SetJobID(id string) *HistoryCreate

SetJobID sets the "job" edge to the Job entity by ID.

func (*HistoryCreate) SetMtime

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

SetMtime sets the "mtime" field.

func (*HistoryCreate) SetNillableJobID

func (hc *HistoryCreate) SetNillableJobID(id *string) *HistoryCreate

SetNillableJobID sets the "job" edge to the Job entity by ID if the given value is not nil.

func (*HistoryCreate) SetNillableStatus

func (hc *HistoryCreate) SetNillableStatus(ms *model.JobStatus) *HistoryCreate

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

func (*HistoryCreate) SetStatus

func (hc *HistoryCreate) SetStatus(ms model.JobStatus) *HistoryCreate

SetStatus sets the "status" 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) ExecContext

func (c *HistoryCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*HistoryCreateBulk) ExecX

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

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

func (*HistoryCreateBulk) QueryContext

func (c *HistoryCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (c *HistoryDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*HistoryDelete) ExecX

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

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

func (*HistoryDelete) QueryContext

func (c *HistoryDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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 HistoryEdges

type HistoryEdges struct {
	// Job holds the value of the job edge.
	Job *Job `json:"job,omitempty"`
	// contains filtered or unexported fields
}

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

func (HistoryEdges) JobOrErr

func (e HistoryEdges) JobOrErr() (*Job, error)

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

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

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

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

func (m *HistoryMutation) ClearDefinition()

ClearDefinition clears the value of the "definition" field.

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

func (m *HistoryMutation) ClearJob()

ClearJob clears the "job" edge to the Job entity.

func (*HistoryMutation) ClearStatus

func (m *HistoryMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

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

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

Definition returns the value of the "definition" field in the mutation.

func (*HistoryMutation) DefinitionCleared

func (m *HistoryMutation) DefinitionCleared() bool

DefinitionCleared returns if the "definition" field was cleared in this 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) ExecContext

func (c *HistoryMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (m *HistoryMutation) JobCleared() bool

JobCleared reports if the "job" edge to the Job entity was cleared.

func (*HistoryMutation) JobID

func (m *HistoryMutation) JobID() (id string, exists bool)

JobID returns the "job" edge ID in the mutation.

func (*HistoryMutation) JobIDs

func (m *HistoryMutation) JobIDs() (ids []string)

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

func (*HistoryMutation) Mtime

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

Mtime returns the value of the "mtime" field in the mutation.

func (*HistoryMutation) OldDefinition

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

OldDefinition returns the old "definition" 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) OldMtime

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

OldMtime returns the old "mtime" 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 model.JobStatus, 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) Op

func (m *HistoryMutation) Op() Op

Op returns the operation name.

func (*HistoryMutation) QueryContext

func (c *HistoryMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (m *HistoryMutation) ResetDefinition()

ResetDefinition resets all changes to the "definition" 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) 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) ResetJob

func (m *HistoryMutation) ResetJob()

ResetJob resets all changes to the "job" edge.

func (*HistoryMutation) ResetMtime

func (m *HistoryMutation) ResetMtime()

ResetMtime resets all changes to the "mtime" field.

func (*HistoryMutation) ResetStatus

func (m *HistoryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*HistoryMutation) SetDefinition

func (m *HistoryMutation) SetDefinition(value map[string]interface{})

SetDefinition sets the "definition" 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) SetJobID

func (m *HistoryMutation) SetJobID(id string)

SetJobID sets the "job" edge to the Job entity by id.

func (*HistoryMutation) SetMtime

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

SetMtime sets the "mtime" field.

func (*HistoryMutation) SetOp

func (m *HistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*HistoryMutation) SetStatus

func (m *HistoryMutation) SetStatus(ms model.JobStatus)

SetStatus sets the "status" field.

func (*HistoryMutation) Status

func (m *HistoryMutation) Status() (r model.JobStatus, exists bool)

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

func (*HistoryMutation) StatusCleared

func (m *HistoryMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this 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) 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) ExecContext

func (c *HistoryQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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 {
	Mtime time.Time `json:"mtime,omitempty"`
	Count int `json:"count,omitempty"`
}

client.History.Query().
	GroupBy(history.FieldMtime).
	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) QueryContext

func (c *HistoryQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*HistoryQuery) QueryJob

func (hq *HistoryQuery) QueryJob() *JobQuery

QueryJob chains the current query on the "job" edge.

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 {
	Mtime time.Time `json:"mtime,omitempty"`
}

client.History.Query().
	Select(history.FieldMtime).
	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.

func (*HistoryQuery) WithJob

func (hq *HistoryQuery) WithJob(opts ...func(*JobQuery)) *HistoryQuery

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

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

func (c HistorySelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c HistorySelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (hu *HistoryUpdate) ClearDefinition() *HistoryUpdate

ClearDefinition clears the value of the "definition" field.

func (*HistoryUpdate) ClearJob

func (hu *HistoryUpdate) ClearJob() *HistoryUpdate

ClearJob clears the "job" edge to the Job entity.

func (*HistoryUpdate) ClearStatus

func (hu *HistoryUpdate) ClearStatus() *HistoryUpdate

ClearStatus clears the value of the "status" field.

func (*HistoryUpdate) Exec

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

Exec executes the query.

func (*HistoryUpdate) ExecContext

func (c *HistoryUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *HistoryUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (hu *HistoryUpdate) SetDefinition(m map[string]interface{}) *HistoryUpdate

SetDefinition sets the "definition" field.

func (*HistoryUpdate) SetJob

func (hu *HistoryUpdate) SetJob(j *Job) *HistoryUpdate

SetJob sets the "job" edge to the Job entity.

func (*HistoryUpdate) SetJobID

func (hu *HistoryUpdate) SetJobID(id string) *HistoryUpdate

SetJobID sets the "job" edge to the Job entity by ID.

func (*HistoryUpdate) SetMtime

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

SetMtime sets the "mtime" field.

func (*HistoryUpdate) SetNillableJobID

func (hu *HistoryUpdate) SetNillableJobID(id *string) *HistoryUpdate

SetNillableJobID sets the "job" edge to the Job entity by ID if the given value is not nil.

func (*HistoryUpdate) SetNillableMtime added in v0.2.0

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

SetNillableMtime sets the "mtime" field if the given value is not nil.

func (*HistoryUpdate) SetNillableStatus

func (hu *HistoryUpdate) SetNillableStatus(ms *model.JobStatus) *HistoryUpdate

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

func (*HistoryUpdate) SetStatus

func (hu *HistoryUpdate) SetStatus(ms model.JobStatus) *HistoryUpdate

SetStatus sets the "status" 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) ClearDefinition

func (huo *HistoryUpdateOne) ClearDefinition() *HistoryUpdateOne

ClearDefinition clears the value of the "definition" field.

func (*HistoryUpdateOne) ClearJob

func (huo *HistoryUpdateOne) ClearJob() *HistoryUpdateOne

ClearJob clears the "job" edge to the Job entity.

func (*HistoryUpdateOne) ClearStatus

func (huo *HistoryUpdateOne) ClearStatus() *HistoryUpdateOne

ClearStatus clears the value of the "status" field.

func (*HistoryUpdateOne) Exec

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

Exec executes the query on the entity.

func (*HistoryUpdateOne) ExecContext

func (c *HistoryUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *HistoryUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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

func (huo *HistoryUpdateOne) SetDefinition(m map[string]interface{}) *HistoryUpdateOne

SetDefinition sets the "definition" field.

func (*HistoryUpdateOne) SetJob

func (huo *HistoryUpdateOne) SetJob(j *Job) *HistoryUpdateOne

SetJob sets the "job" edge to the Job entity.

func (*HistoryUpdateOne) SetJobID

func (huo *HistoryUpdateOne) SetJobID(id string) *HistoryUpdateOne

SetJobID sets the "job" edge to the Job entity by ID.

func (*HistoryUpdateOne) SetMtime

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

SetMtime sets the "mtime" field.

func (*HistoryUpdateOne) SetNillableJobID

func (huo *HistoryUpdateOne) SetNillableJobID(id *string) *HistoryUpdateOne

SetNillableJobID sets the "job" edge to the Job entity by ID if the given value is not nil.

func (*HistoryUpdateOne) SetNillableMtime added in v0.2.0

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

SetNillableMtime sets the "mtime" field if the given value is not nil.

func (*HistoryUpdateOne) SetNillableStatus

func (huo *HistoryUpdateOne) SetNillableStatus(ms *model.JobStatus) *HistoryUpdateOne

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

func (*HistoryUpdateOne) SetStatus

func (huo *HistoryUpdateOne) SetStatus(ms model.JobStatus) *HistoryUpdateOne

SetStatus sets the "status" 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 Job

type Job struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// start time
	Stime time.Time `json:"stime,omitempty"`
	// modification time
	Mtime time.Time `json:"mtime,omitempty"`
	// ClientID holds the value of the "client_id" field.
	ClientID string `json:"client_id,omitempty"`
	// Definition holds the value of the "definition" field.
	Definition map[string]interface{} `json:"definition,omitempty"`
	// Status holds the value of the "status" field.
	Status model.JobStatus `json:"status,omitempty"`
	// Group holds the value of the "group" field.
	Group string `json:"group,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the JobQuery when eager-loading is set.
	Edges JobEdges `json:"edges"`
	// contains filtered or unexported fields
}

Job is the model entity for the Job schema.

func (*Job) ExecContext

func (c *Job) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Job) QueryContext

func (c *Job) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Job) QueryHistory

func (j *Job) QueryHistory() *HistoryQuery

QueryHistory queries the "history" edge of the Job entity.

func (*Job) QueryTags

func (j *Job) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Job entity.

func (*Job) QueryWorkflow

func (j *Job) QueryWorkflow() *WorkflowQuery

QueryWorkflow queries the "workflow" edge of the Job entity.

func (*Job) String

func (j *Job) String() string

String implements the fmt.Stringer.

func (*Job) Unwrap

func (j *Job) Unwrap() *Job

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

func (j *Job) Update() *JobUpdateOne

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

func (*Job) Value

func (j *Job) Value(name string) (ent.Value, error)

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

type JobClient

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

JobClient is a client for the Job schema.

func NewJobClient

func NewJobClient(c config) *JobClient

NewJobClient returns a client for the Job from the given config.

func (*JobClient) Create

func (c *JobClient) Create() *JobCreate

Create returns a builder for creating a Job entity.

func (*JobClient) CreateBulk

func (c *JobClient) CreateBulk(builders ...*JobCreate) *JobCreateBulk

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

func (*JobClient) Delete

func (c *JobClient) Delete() *JobDelete

Delete returns a delete builder for Job.

func (*JobClient) DeleteOne

func (c *JobClient) DeleteOne(j *Job) *JobDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*JobClient) DeleteOneID

func (c *JobClient) DeleteOneID(id string) *JobDeleteOne

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

func (*JobClient) ExecContext

func (c *JobClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobClient) Get

func (c *JobClient) Get(ctx context.Context, id string) (*Job, error)

Get returns a Job entity by its id.

func (*JobClient) GetX

func (c *JobClient) GetX(ctx context.Context, id string) *Job

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

func (*JobClient) Hooks

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

Hooks returns the client hooks.

func (*JobClient) Intercept

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

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

func (*JobClient) Interceptors

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

Interceptors returns the client interceptors.

func (*JobClient) MapCreateBulk added in v0.2.0

func (c *JobClient) MapCreateBulk(slice any, setFunc func(*JobCreate, int)) *JobCreateBulk

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

func (*JobClient) Query

func (c *JobClient) Query() *JobQuery

Query returns a query builder for Job.

func (*JobClient) QueryContext

func (c *JobClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobClient) QueryHistory

func (c *JobClient) QueryHistory(j *Job) *HistoryQuery

QueryHistory queries the history edge of a Job.

func (*JobClient) QueryTags

func (c *JobClient) QueryTags(j *Job) *TagQuery

QueryTags queries the tags edge of a Job.

func (*JobClient) QueryWorkflow

func (c *JobClient) QueryWorkflow(j *Job) *WorkflowQuery

QueryWorkflow queries the workflow edge of a Job.

func (*JobClient) Update

func (c *JobClient) Update() *JobUpdate

Update returns an update builder for Job.

func (*JobClient) UpdateOne

func (c *JobClient) UpdateOne(j *Job) *JobUpdateOne

UpdateOne returns an update builder for the given entity.

func (*JobClient) UpdateOneID

func (c *JobClient) UpdateOneID(id string) *JobUpdateOne

UpdateOneID returns an update builder for the given id.

func (*JobClient) Use

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

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

type JobCreate

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

JobCreate is the builder for creating a Job entity.

func (*JobCreate) AddHistory

func (jc *JobCreate) AddHistory(h ...*History) *JobCreate

AddHistory adds the "history" edges to the History entity.

func (*JobCreate) AddHistoryIDs

func (jc *JobCreate) AddHistoryIDs(ids ...int) *JobCreate

AddHistoryIDs adds the "history" edge to the History entity by IDs.

func (*JobCreate) AddTagIDs

func (jc *JobCreate) AddTagIDs(ids ...int) *JobCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*JobCreate) AddTags

func (jc *JobCreate) AddTags(t ...*Tag) *JobCreate

AddTags adds the "tags" edges to the Tag entity.

func (*JobCreate) Exec

func (jc *JobCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*JobCreate) ExecContext

func (c *JobCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobCreate) ExecX

func (jc *JobCreate) ExecX(ctx context.Context)

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

func (*JobCreate) Mutation

func (jc *JobCreate) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobCreate) QueryContext

func (c *JobCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobCreate) Save

func (jc *JobCreate) Save(ctx context.Context) (*Job, error)

Save creates the Job in the database.

func (*JobCreate) SaveX

func (jc *JobCreate) SaveX(ctx context.Context) *Job

SaveX calls Save and panics if Save returns an error.

func (*JobCreate) SetClientID

func (jc *JobCreate) SetClientID(s string) *JobCreate

SetClientID sets the "client_id" field.

func (*JobCreate) SetDefinition

func (jc *JobCreate) SetDefinition(m map[string]interface{}) *JobCreate

SetDefinition sets the "definition" field.

func (*JobCreate) SetGroup

func (jc *JobCreate) SetGroup(s string) *JobCreate

SetGroup sets the "group" field.

func (*JobCreate) SetID

func (jc *JobCreate) SetID(s string) *JobCreate

SetID sets the "id" field.

func (*JobCreate) SetMtime

func (jc *JobCreate) SetMtime(t time.Time) *JobCreate

SetMtime sets the "mtime" field.

func (*JobCreate) SetNillableGroup

func (jc *JobCreate) SetNillableGroup(s *string) *JobCreate

SetNillableGroup sets the "group" field if the given value is not nil.

func (*JobCreate) SetNillableID

func (jc *JobCreate) SetNillableID(s *string) *JobCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*JobCreate) SetNillableMtime

func (jc *JobCreate) SetNillableMtime(t *time.Time) *JobCreate

SetNillableMtime sets the "mtime" field if the given value is not nil.

func (*JobCreate) SetNillableStime

func (jc *JobCreate) SetNillableStime(t *time.Time) *JobCreate

SetNillableStime sets the "stime" field if the given value is not nil.

func (*JobCreate) SetNillableWorkflowID

func (jc *JobCreate) SetNillableWorkflowID(id *int) *JobCreate

SetNillableWorkflowID sets the "workflow" edge to the Workflow entity by ID if the given value is not nil.

func (*JobCreate) SetStatus

func (jc *JobCreate) SetStatus(ms model.JobStatus) *JobCreate

SetStatus sets the "status" field.

func (*JobCreate) SetStime

func (jc *JobCreate) SetStime(t time.Time) *JobCreate

SetStime sets the "stime" field.

func (*JobCreate) SetWorkflow

func (jc *JobCreate) SetWorkflow(w *Workflow) *JobCreate

SetWorkflow sets the "workflow" edge to the Workflow entity.

func (*JobCreate) SetWorkflowID

func (jc *JobCreate) SetWorkflowID(id int) *JobCreate

SetWorkflowID sets the "workflow" edge to the Workflow entity by ID.

type JobCreateBulk

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

JobCreateBulk is the builder for creating many Job entities in bulk.

func (*JobCreateBulk) Exec

func (jcb *JobCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*JobCreateBulk) ExecContext

func (c *JobCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobCreateBulk) ExecX

func (jcb *JobCreateBulk) ExecX(ctx context.Context)

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

func (*JobCreateBulk) QueryContext

func (c *JobCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobCreateBulk) Save

func (jcb *JobCreateBulk) Save(ctx context.Context) ([]*Job, error)

Save creates the Job entities in the database.

func (*JobCreateBulk) SaveX

func (jcb *JobCreateBulk) SaveX(ctx context.Context) []*Job

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

type JobDelete

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

JobDelete is the builder for deleting a Job entity.

func (*JobDelete) Exec

func (jd *JobDelete) Exec(ctx context.Context) (int, error)

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

func (*JobDelete) ExecContext

func (c *JobDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobDelete) ExecX

func (jd *JobDelete) ExecX(ctx context.Context) int

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

func (*JobDelete) QueryContext

func (c *JobDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobDelete) Where

func (jd *JobDelete) Where(ps ...predicate.Job) *JobDelete

Where appends a list predicates to the JobDelete builder.

type JobDeleteOne

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

JobDeleteOne is the builder for deleting a single Job entity.

func (*JobDeleteOne) Exec

func (jdo *JobDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*JobDeleteOne) ExecX

func (jdo *JobDeleteOne) ExecX(ctx context.Context)

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

func (*JobDeleteOne) Where

func (jdo *JobDeleteOne) Where(ps ...predicate.Job) *JobDeleteOne

Where appends a list predicates to the JobDelete builder.

type JobEdges

type JobEdges struct {
	// Workflow holds the value of the workflow edge.
	Workflow *Workflow `json:"workflow,omitempty"`
	// History holds the value of the history edge.
	History []*History `json:"history,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (JobEdges) HistoryOrErr

func (e JobEdges) HistoryOrErr() ([]*History, error)

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

func (JobEdges) TagsOrErr

func (e JobEdges) TagsOrErr() ([]*Tag, error)

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

func (JobEdges) WorkflowOrErr

func (e JobEdges) WorkflowOrErr() (*Workflow, error)

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

type JobGroupBy

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

JobGroupBy is the group-by builder for Job entities.

func (*JobGroupBy) Aggregate

func (jgb *JobGroupBy) Aggregate(fns ...AggregateFunc) *JobGroupBy

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

func (*JobGroupBy) Bool

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

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

func (*JobGroupBy) BoolX

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

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

func (*JobGroupBy) Bools

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

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

func (*JobGroupBy) BoolsX

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

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

func (*JobGroupBy) Float64

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

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

func (*JobGroupBy) Float64X

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

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

func (*JobGroupBy) Float64s

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

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

func (*JobGroupBy) Float64sX

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

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

func (*JobGroupBy) Int

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

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

func (*JobGroupBy) IntX

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

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

func (*JobGroupBy) Ints

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

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

func (*JobGroupBy) IntsX

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

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

func (*JobGroupBy) Scan

func (jgb *JobGroupBy) Scan(ctx context.Context, v any) error

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

func (*JobGroupBy) ScanX

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

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

func (*JobGroupBy) String

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

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

func (*JobGroupBy) StringX

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

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

func (*JobGroupBy) Strings

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

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

func (*JobGroupBy) StringsX

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

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

type JobMutation

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

JobMutation represents an operation that mutates the Job nodes in the graph.

func (*JobMutation) AddField

func (m *JobMutation) 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 (*JobMutation) AddHistoryIDs

func (m *JobMutation) AddHistoryIDs(ids ...int)

AddHistoryIDs adds the "history" edge to the History entity by ids.

func (*JobMutation) AddTagIDs

func (m *JobMutation) AddTagIDs(ids ...int)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*JobMutation) AddedEdges

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

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

func (*JobMutation) AddedField

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

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

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

func (*JobMutation) AddedIDs

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

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

func (*JobMutation) ClearDefinition

func (m *JobMutation) ClearDefinition()

ClearDefinition clears the value of the "definition" field.

func (*JobMutation) ClearEdge

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

func (m *JobMutation) 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 (*JobMutation) ClearGroup

func (m *JobMutation) ClearGroup()

ClearGroup clears the value of the "group" field.

func (*JobMutation) ClearHistory

func (m *JobMutation) ClearHistory()

ClearHistory clears the "history" edge to the History entity.

func (*JobMutation) ClearTags

func (m *JobMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*JobMutation) ClearWorkflow

func (m *JobMutation) ClearWorkflow()

ClearWorkflow clears the "workflow" edge to the Workflow entity.

func (*JobMutation) ClearedEdges

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

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

func (*JobMutation) ClearedFields

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

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

func (JobMutation) Client

func (m JobMutation) 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 (*JobMutation) ClientID

func (m *JobMutation) ClientID() (r string, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*JobMutation) Definition

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

Definition returns the value of the "definition" field in the mutation.

func (*JobMutation) DefinitionCleared

func (m *JobMutation) DefinitionCleared() bool

DefinitionCleared returns if the "definition" field was cleared in this mutation.

func (*JobMutation) EdgeCleared

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

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

func (*JobMutation) ExecContext

func (c *JobMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobMutation) Field

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

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

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

func (*JobMutation) Fields

func (m *JobMutation) 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 (*JobMutation) Group

func (m *JobMutation) Group() (r string, exists bool)

Group returns the value of the "group" field in the mutation.

func (*JobMutation) GroupCleared

func (m *JobMutation) GroupCleared() bool

GroupCleared returns if the "group" field was cleared in this mutation.

func (*JobMutation) HistoryCleared

func (m *JobMutation) HistoryCleared() bool

HistoryCleared reports if the "history" edge to the History entity was cleared.

func (*JobMutation) HistoryIDs

func (m *JobMutation) HistoryIDs() (ids []int)

HistoryIDs returns the "history" edge IDs in the mutation.

func (*JobMutation) ID

func (m *JobMutation) ID() (id string, exists bool)

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

func (*JobMutation) IDs

func (m *JobMutation) IDs(ctx context.Context) ([]string, error)

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

func (*JobMutation) Mtime

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

Mtime returns the value of the "mtime" field in the mutation.

func (*JobMutation) OldClientID

func (m *JobMutation) OldClientID(ctx context.Context) (v string, err error)

OldClientID returns the old "client_id" field's value of the Job entity. If the Job object wasn'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 (*JobMutation) OldDefinition

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

OldDefinition returns the old "definition" field's value of the Job entity. If the Job object wasn'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 (*JobMutation) OldField

func (m *JobMutation) 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 (*JobMutation) OldGroup

func (m *JobMutation) OldGroup(ctx context.Context) (v string, err error)

OldGroup returns the old "group" field's value of the Job entity. If the Job object wasn'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 (*JobMutation) OldMtime

func (m *JobMutation) OldMtime(ctx context.Context) (v time.Time, err error)

OldMtime returns the old "mtime" field's value of the Job entity. If the Job object wasn'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 (*JobMutation) OldStatus

func (m *JobMutation) OldStatus(ctx context.Context) (v model.JobStatus, err error)

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

func (m *JobMutation) OldStime(ctx context.Context) (v time.Time, err error)

OldStime returns the old "stime" field's value of the Job entity. If the Job object wasn'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 (*JobMutation) Op

func (m *JobMutation) Op() Op

Op returns the operation name.

func (*JobMutation) QueryContext

func (c *JobMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobMutation) RemoveHistoryIDs

func (m *JobMutation) RemoveHistoryIDs(ids ...int)

RemoveHistoryIDs removes the "history" edge to the History entity by IDs.

func (*JobMutation) RemoveTagIDs

func (m *JobMutation) RemoveTagIDs(ids ...int)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*JobMutation) RemovedEdges

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

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

func (*JobMutation) RemovedHistoryIDs

func (m *JobMutation) RemovedHistoryIDs() (ids []int)

RemovedHistory returns the removed IDs of the "history" edge to the History entity.

func (*JobMutation) RemovedIDs

func (m *JobMutation) 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 (*JobMutation) RemovedTagsIDs

func (m *JobMutation) RemovedTagsIDs() (ids []int)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*JobMutation) ResetClientID

func (m *JobMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*JobMutation) ResetDefinition

func (m *JobMutation) ResetDefinition()

ResetDefinition resets all changes to the "definition" field.

func (*JobMutation) ResetEdge

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

func (m *JobMutation) 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 (*JobMutation) ResetGroup

func (m *JobMutation) ResetGroup()

ResetGroup resets all changes to the "group" field.

func (*JobMutation) ResetHistory

func (m *JobMutation) ResetHistory()

ResetHistory resets all changes to the "history" edge.

func (*JobMutation) ResetMtime

func (m *JobMutation) ResetMtime()

ResetMtime resets all changes to the "mtime" field.

func (*JobMutation) ResetStatus

func (m *JobMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*JobMutation) ResetStime

func (m *JobMutation) ResetStime()

ResetStime resets all changes to the "stime" field.

func (*JobMutation) ResetTags

func (m *JobMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*JobMutation) ResetWorkflow

func (m *JobMutation) ResetWorkflow()

ResetWorkflow resets all changes to the "workflow" edge.

func (*JobMutation) SetClientID

func (m *JobMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*JobMutation) SetDefinition

func (m *JobMutation) SetDefinition(value map[string]interface{})

SetDefinition sets the "definition" field.

func (*JobMutation) SetField

func (m *JobMutation) 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 (*JobMutation) SetGroup

func (m *JobMutation) SetGroup(s string)

SetGroup sets the "group" field.

func (*JobMutation) SetID

func (m *JobMutation) SetID(id string)

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

func (*JobMutation) SetMtime

func (m *JobMutation) SetMtime(t time.Time)

SetMtime sets the "mtime" field.

func (*JobMutation) SetOp

func (m *JobMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*JobMutation) SetStatus

func (m *JobMutation) SetStatus(ms model.JobStatus)

SetStatus sets the "status" field.

func (*JobMutation) SetStime

func (m *JobMutation) SetStime(t time.Time)

SetStime sets the "stime" field.

func (*JobMutation) SetWorkflowID

func (m *JobMutation) SetWorkflowID(id int)

SetWorkflowID sets the "workflow" edge to the Workflow entity by id.

func (*JobMutation) Status

func (m *JobMutation) Status() (r model.JobStatus, exists bool)

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

func (*JobMutation) Stime

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

Stime returns the value of the "stime" field in the mutation.

func (*JobMutation) TagsCleared

func (m *JobMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*JobMutation) TagsIDs

func (m *JobMutation) TagsIDs() (ids []int)

TagsIDs returns the "tags" edge IDs in the mutation.

func (JobMutation) Tx

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

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

func (*JobMutation) Type

func (m *JobMutation) Type() string

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

func (*JobMutation) Where

func (m *JobMutation) Where(ps ...predicate.Job)

Where appends a list predicates to the JobMutation builder.

func (*JobMutation) WhereP

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

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

func (*JobMutation) WorkflowCleared

func (m *JobMutation) WorkflowCleared() bool

WorkflowCleared reports if the "workflow" edge to the Workflow entity was cleared.

func (*JobMutation) WorkflowID

func (m *JobMutation) WorkflowID() (id int, exists bool)

WorkflowID returns the "workflow" edge ID in the mutation.

func (*JobMutation) WorkflowIDs

func (m *JobMutation) WorkflowIDs() (ids []int)

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

type JobQuery

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

JobQuery is the builder for querying Job entities.

func (*JobQuery) Aggregate

func (jq *JobQuery) Aggregate(fns ...AggregateFunc) *JobSelect

Aggregate returns a JobSelect configured with the given aggregations.

func (*JobQuery) All

func (jq *JobQuery) All(ctx context.Context) ([]*Job, error)

All executes the query and returns a list of Jobs.

func (*JobQuery) AllX

func (jq *JobQuery) AllX(ctx context.Context) []*Job

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

func (*JobQuery) Clone

func (jq *JobQuery) Clone() *JobQuery

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

func (*JobQuery) Count

func (jq *JobQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*JobQuery) CountX

func (jq *JobQuery) CountX(ctx context.Context) int

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

func (*JobQuery) ExecContext

func (c *JobQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobQuery) Exist

func (jq *JobQuery) Exist(ctx context.Context) (bool, error)

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

func (*JobQuery) ExistX

func (jq *JobQuery) ExistX(ctx context.Context) bool

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

func (*JobQuery) First

func (jq *JobQuery) First(ctx context.Context) (*Job, error)

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

func (*JobQuery) FirstID

func (jq *JobQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*JobQuery) FirstIDX

func (jq *JobQuery) FirstIDX(ctx context.Context) string

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

func (*JobQuery) FirstX

func (jq *JobQuery) FirstX(ctx context.Context) *Job

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

func (*JobQuery) GroupBy

func (jq *JobQuery) GroupBy(field string, fields ...string) *JobGroupBy

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 {
	Stime time.Time `json:"stime,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Job.Query().
	GroupBy(job.FieldStime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*JobQuery) IDs

func (jq *JobQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*JobQuery) IDsX

func (jq *JobQuery) IDsX(ctx context.Context) []string

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

func (*JobQuery) Limit

func (jq *JobQuery) Limit(limit int) *JobQuery

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

func (*JobQuery) Offset

func (jq *JobQuery) Offset(offset int) *JobQuery

Offset to start from.

func (*JobQuery) Only

func (jq *JobQuery) Only(ctx context.Context) (*Job, error)

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

func (*JobQuery) OnlyID

func (jq *JobQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*JobQuery) OnlyIDX

func (jq *JobQuery) OnlyIDX(ctx context.Context) string

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

func (*JobQuery) OnlyX

func (jq *JobQuery) OnlyX(ctx context.Context) *Job

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

func (*JobQuery) Order

func (jq *JobQuery) Order(o ...job.OrderOption) *JobQuery

Order specifies how the records should be ordered.

func (*JobQuery) QueryContext

func (c *JobQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobQuery) QueryHistory

func (jq *JobQuery) QueryHistory() *HistoryQuery

QueryHistory chains the current query on the "history" edge.

func (*JobQuery) QueryTags

func (jq *JobQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*JobQuery) QueryWorkflow

func (jq *JobQuery) QueryWorkflow() *WorkflowQuery

QueryWorkflow chains the current query on the "workflow" edge.

func (*JobQuery) Select

func (jq *JobQuery) Select(fields ...string) *JobSelect

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 {
	Stime time.Time `json:"stime,omitempty"`
}

client.Job.Query().
	Select(job.FieldStime).
	Scan(ctx, &v)

func (*JobQuery) Unique

func (jq *JobQuery) Unique(unique bool) *JobQuery

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

func (jq *JobQuery) Where(ps ...predicate.Job) *JobQuery

Where adds a new predicate for the JobQuery builder.

func (*JobQuery) WithHistory

func (jq *JobQuery) WithHistory(opts ...func(*HistoryQuery)) *JobQuery

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

func (*JobQuery) WithTags

func (jq *JobQuery) WithTags(opts ...func(*TagQuery)) *JobQuery

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

func (*JobQuery) WithWorkflow

func (jq *JobQuery) WithWorkflow(opts ...func(*WorkflowQuery)) *JobQuery

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

type JobSelect

type JobSelect struct {
	*JobQuery
	// contains filtered or unexported fields
}

JobSelect is the builder for selecting fields of Job entities.

func (*JobSelect) Aggregate

func (js *JobSelect) Aggregate(fns ...AggregateFunc) *JobSelect

Aggregate adds the given aggregation functions to the selector query.

func (*JobSelect) Bool

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

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

func (*JobSelect) BoolX

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

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

func (*JobSelect) Bools

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

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

func (*JobSelect) BoolsX

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

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

func (JobSelect) ExecContext

func (c JobSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobSelect) Float64

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

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

func (*JobSelect) Float64X

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

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

func (*JobSelect) Float64s

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

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

func (*JobSelect) Float64sX

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

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

func (*JobSelect) Int

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

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

func (*JobSelect) IntX

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

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

func (*JobSelect) Ints

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

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

func (*JobSelect) IntsX

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

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

func (JobSelect) QueryContext

func (c JobSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobSelect) Scan

func (js *JobSelect) Scan(ctx context.Context, v any) error

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

func (*JobSelect) ScanX

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

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

func (*JobSelect) String

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

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

func (*JobSelect) StringX

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

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

func (*JobSelect) Strings

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

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

func (*JobSelect) StringsX

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

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

type JobUpdate

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

JobUpdate is the builder for updating Job entities.

func (*JobUpdate) AddHistory

func (ju *JobUpdate) AddHistory(h ...*History) *JobUpdate

AddHistory adds the "history" edges to the History entity.

func (*JobUpdate) AddHistoryIDs

func (ju *JobUpdate) AddHistoryIDs(ids ...int) *JobUpdate

AddHistoryIDs adds the "history" edge to the History entity by IDs.

func (*JobUpdate) AddTagIDs

func (ju *JobUpdate) AddTagIDs(ids ...int) *JobUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*JobUpdate) AddTags

func (ju *JobUpdate) AddTags(t ...*Tag) *JobUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*JobUpdate) ClearDefinition

func (ju *JobUpdate) ClearDefinition() *JobUpdate

ClearDefinition clears the value of the "definition" field.

func (*JobUpdate) ClearGroup

func (ju *JobUpdate) ClearGroup() *JobUpdate

ClearGroup clears the value of the "group" field.

func (*JobUpdate) ClearHistory

func (ju *JobUpdate) ClearHistory() *JobUpdate

ClearHistory clears all "history" edges to the History entity.

func (*JobUpdate) ClearTags

func (ju *JobUpdate) ClearTags() *JobUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*JobUpdate) ClearWorkflow

func (ju *JobUpdate) ClearWorkflow() *JobUpdate

ClearWorkflow clears the "workflow" edge to the Workflow entity.

func (*JobUpdate) Exec

func (ju *JobUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*JobUpdate) ExecContext

func (c *JobUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobUpdate) ExecX

func (ju *JobUpdate) ExecX(ctx context.Context)

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

func (*JobUpdate) Mutation

func (ju *JobUpdate) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobUpdate) QueryContext

func (c *JobUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobUpdate) RemoveHistory

func (ju *JobUpdate) RemoveHistory(h ...*History) *JobUpdate

RemoveHistory removes "history" edges to History entities.

func (*JobUpdate) RemoveHistoryIDs

func (ju *JobUpdate) RemoveHistoryIDs(ids ...int) *JobUpdate

RemoveHistoryIDs removes the "history" edge to History entities by IDs.

func (*JobUpdate) RemoveTagIDs

func (ju *JobUpdate) RemoveTagIDs(ids ...int) *JobUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*JobUpdate) RemoveTags

func (ju *JobUpdate) RemoveTags(t ...*Tag) *JobUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*JobUpdate) Save

func (ju *JobUpdate) Save(ctx context.Context) (int, error)

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

func (*JobUpdate) SaveX

func (ju *JobUpdate) SaveX(ctx context.Context) int

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

func (*JobUpdate) SetClientID

func (ju *JobUpdate) SetClientID(s string) *JobUpdate

SetClientID sets the "client_id" field.

func (*JobUpdate) SetDefinition

func (ju *JobUpdate) SetDefinition(m map[string]interface{}) *JobUpdate

SetDefinition sets the "definition" field.

func (*JobUpdate) SetGroup

func (ju *JobUpdate) SetGroup(s string) *JobUpdate

SetGroup sets the "group" field.

func (*JobUpdate) SetMtime

func (ju *JobUpdate) SetMtime(t time.Time) *JobUpdate

SetMtime sets the "mtime" field.

func (*JobUpdate) SetNillableClientID added in v0.2.0

func (ju *JobUpdate) SetNillableClientID(s *string) *JobUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*JobUpdate) SetNillableGroup

func (ju *JobUpdate) SetNillableGroup(s *string) *JobUpdate

SetNillableGroup sets the "group" field if the given value is not nil.

func (*JobUpdate) SetNillableStatus added in v0.2.0

func (ju *JobUpdate) SetNillableStatus(ms *model.JobStatus) *JobUpdate

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

func (*JobUpdate) SetNillableStime

func (ju *JobUpdate) SetNillableStime(t *time.Time) *JobUpdate

SetNillableStime sets the "stime" field if the given value is not nil.

func (*JobUpdate) SetNillableWorkflowID

func (ju *JobUpdate) SetNillableWorkflowID(id *int) *JobUpdate

SetNillableWorkflowID sets the "workflow" edge to the Workflow entity by ID if the given value is not nil.

func (*JobUpdate) SetStatus

func (ju *JobUpdate) SetStatus(ms model.JobStatus) *JobUpdate

SetStatus sets the "status" field.

func (*JobUpdate) SetStime

func (ju *JobUpdate) SetStime(t time.Time) *JobUpdate

SetStime sets the "stime" field.

func (*JobUpdate) SetWorkflow

func (ju *JobUpdate) SetWorkflow(w *Workflow) *JobUpdate

SetWorkflow sets the "workflow" edge to the Workflow entity.

func (*JobUpdate) SetWorkflowID

func (ju *JobUpdate) SetWorkflowID(id int) *JobUpdate

SetWorkflowID sets the "workflow" edge to the Workflow entity by ID.

func (*JobUpdate) Where

func (ju *JobUpdate) Where(ps ...predicate.Job) *JobUpdate

Where appends a list predicates to the JobUpdate builder.

type JobUpdateOne

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

JobUpdateOne is the builder for updating a single Job entity.

func (*JobUpdateOne) AddHistory

func (juo *JobUpdateOne) AddHistory(h ...*History) *JobUpdateOne

AddHistory adds the "history" edges to the History entity.

func (*JobUpdateOne) AddHistoryIDs

func (juo *JobUpdateOne) AddHistoryIDs(ids ...int) *JobUpdateOne

AddHistoryIDs adds the "history" edge to the History entity by IDs.

func (*JobUpdateOne) AddTagIDs

func (juo *JobUpdateOne) AddTagIDs(ids ...int) *JobUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*JobUpdateOne) AddTags

func (juo *JobUpdateOne) AddTags(t ...*Tag) *JobUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*JobUpdateOne) ClearDefinition

func (juo *JobUpdateOne) ClearDefinition() *JobUpdateOne

ClearDefinition clears the value of the "definition" field.

func (*JobUpdateOne) ClearGroup

func (juo *JobUpdateOne) ClearGroup() *JobUpdateOne

ClearGroup clears the value of the "group" field.

func (*JobUpdateOne) ClearHistory

func (juo *JobUpdateOne) ClearHistory() *JobUpdateOne

ClearHistory clears all "history" edges to the History entity.

func (*JobUpdateOne) ClearTags

func (juo *JobUpdateOne) ClearTags() *JobUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*JobUpdateOne) ClearWorkflow

func (juo *JobUpdateOne) ClearWorkflow() *JobUpdateOne

ClearWorkflow clears the "workflow" edge to the Workflow entity.

func (*JobUpdateOne) Exec

func (juo *JobUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*JobUpdateOne) ExecContext

func (c *JobUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*JobUpdateOne) ExecX

func (juo *JobUpdateOne) ExecX(ctx context.Context)

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

func (*JobUpdateOne) Mutation

func (juo *JobUpdateOne) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobUpdateOne) QueryContext

func (c *JobUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*JobUpdateOne) RemoveHistory

func (juo *JobUpdateOne) RemoveHistory(h ...*History) *JobUpdateOne

RemoveHistory removes "history" edges to History entities.

func (*JobUpdateOne) RemoveHistoryIDs

func (juo *JobUpdateOne) RemoveHistoryIDs(ids ...int) *JobUpdateOne

RemoveHistoryIDs removes the "history" edge to History entities by IDs.

func (*JobUpdateOne) RemoveTagIDs

func (juo *JobUpdateOne) RemoveTagIDs(ids ...int) *JobUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*JobUpdateOne) RemoveTags

func (juo *JobUpdateOne) RemoveTags(t ...*Tag) *JobUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*JobUpdateOne) Save

func (juo *JobUpdateOne) Save(ctx context.Context) (*Job, error)

Save executes the query and returns the updated Job entity.

func (*JobUpdateOne) SaveX

func (juo *JobUpdateOne) SaveX(ctx context.Context) *Job

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

func (*JobUpdateOne) Select

func (juo *JobUpdateOne) Select(field string, fields ...string) *JobUpdateOne

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

func (*JobUpdateOne) SetClientID

func (juo *JobUpdateOne) SetClientID(s string) *JobUpdateOne

SetClientID sets the "client_id" field.

func (*JobUpdateOne) SetDefinition

func (juo *JobUpdateOne) SetDefinition(m map[string]interface{}) *JobUpdateOne

SetDefinition sets the "definition" field.

func (*JobUpdateOne) SetGroup

func (juo *JobUpdateOne) SetGroup(s string) *JobUpdateOne

SetGroup sets the "group" field.

func (*JobUpdateOne) SetMtime

func (juo *JobUpdateOne) SetMtime(t time.Time) *JobUpdateOne

SetMtime sets the "mtime" field.

func (*JobUpdateOne) SetNillableClientID added in v0.2.0

func (juo *JobUpdateOne) SetNillableClientID(s *string) *JobUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*JobUpdateOne) SetNillableGroup

func (juo *JobUpdateOne) SetNillableGroup(s *string) *JobUpdateOne

SetNillableGroup sets the "group" field if the given value is not nil.

func (*JobUpdateOne) SetNillableStatus added in v0.2.0

func (juo *JobUpdateOne) SetNillableStatus(ms *model.JobStatus) *JobUpdateOne

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

func (*JobUpdateOne) SetNillableStime

func (juo *JobUpdateOne) SetNillableStime(t *time.Time) *JobUpdateOne

SetNillableStime sets the "stime" field if the given value is not nil.

func (*JobUpdateOne) SetNillableWorkflowID

func (juo *JobUpdateOne) SetNillableWorkflowID(id *int) *JobUpdateOne

SetNillableWorkflowID sets the "workflow" edge to the Workflow entity by ID if the given value is not nil.

func (*JobUpdateOne) SetStatus

func (juo *JobUpdateOne) SetStatus(ms model.JobStatus) *JobUpdateOne

SetStatus sets the "status" field.

func (*JobUpdateOne) SetStime

func (juo *JobUpdateOne) SetStime(t time.Time) *JobUpdateOne

SetStime sets the "stime" field.

func (*JobUpdateOne) SetWorkflow

func (juo *JobUpdateOne) SetWorkflow(w *Workflow) *JobUpdateOne

SetWorkflow sets the "workflow" edge to the Workflow entity.

func (*JobUpdateOne) SetWorkflowID

func (juo *JobUpdateOne) SetWorkflowID(id int) *JobUpdateOne

SetWorkflowID sets the "workflow" edge to the Workflow entity by ID.

func (*JobUpdateOne) Where

func (juo *JobUpdateOne) Where(ps ...predicate.Job) *JobUpdateOne

Where appends a list predicates to the JobUpdate builder.

type Jobs

type Jobs []*Job

Jobs is a parsable slice of Job.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

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

type Querier

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 Tag

type Tag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the tag
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) ExecContext

func (c *Tag) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tag) QueryContext

func (c *Tag) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tag) QueryJobs

func (t *Tag) QueryJobs() *JobQuery

QueryJobs queries the "jobs" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

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

func (t *Tag) Update() *TagUpdateOne

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

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

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

type TagClient

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

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

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

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id int) *TagDeleteOne

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

func (*TagClient) ExecContext

func (c *TagClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int) *Tag

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

func (*TagClient) Hooks

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

Hooks returns the client hooks.

func (*TagClient) Intercept

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

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

func (*TagClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TagClient) MapCreateBulk added in v0.2.0

func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk

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

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryContext

func (c *TagClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagClient) QueryJobs

func (c *TagClient) QueryJobs(t *Tag) *JobQuery

QueryJobs queries the jobs edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id int) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

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

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

type TagCreate

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

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddJobIDs

func (tc *TagCreate) AddJobIDs(ids ...string) *TagCreate

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*TagCreate) AddJobs

func (tc *TagCreate) AddJobs(j ...*Job) *TagCreate

AddJobs adds the "jobs" edges to the Job entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecContext

func (c *TagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

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

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) QueryContext

func (c *TagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetName

func (tc *TagCreate) SetName(s string) *TagCreate

SetName sets the "name" field.

type TagCreateBulk

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

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecContext

func (c *TagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

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

func (*TagCreateBulk) QueryContext

func (c *TagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

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

type TagDelete

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

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

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

func (*TagDelete) ExecContext

func (c *TagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

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

func (*TagDelete) QueryContext

func (c *TagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

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

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

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

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Jobs holds the value of the jobs edge.
	Jobs []*Job `json:"jobs,omitempty"`
	// contains filtered or unexported fields
}

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

func (TagEdges) JobsOrErr

func (e TagEdges) JobsOrErr() ([]*Job, error)

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

type TagGroupBy

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

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

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

func (*TagGroupBy) Bool

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

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

func (*TagGroupBy) BoolX

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

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

func (*TagGroupBy) Bools

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

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

func (*TagGroupBy) BoolsX

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

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

func (*TagGroupBy) Float64

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

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

func (*TagGroupBy) Float64X

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

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

func (*TagGroupBy) Float64s

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

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

func (*TagGroupBy) Float64sX

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

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

func (*TagGroupBy) Int

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

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

func (*TagGroupBy) IntX

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

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

func (*TagGroupBy) Ints

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

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

func (*TagGroupBy) IntsX

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

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

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error

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

func (*TagGroupBy) ScanX

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

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

func (*TagGroupBy) String

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

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

func (*TagGroupBy) StringX

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

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

func (*TagGroupBy) Strings

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

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

func (*TagGroupBy) StringsX

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

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

type TagMutation

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

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) 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 (*TagMutation) AddJobIDs

func (m *TagMutation) AddJobIDs(ids ...string)

AddJobIDs adds the "jobs" edge to the Job entity by ids.

func (*TagMutation) AddedEdges

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

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

func (*TagMutation) AddedField

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

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

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

func (*TagMutation) AddedIDs

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

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

func (*TagMutation) ClearEdge

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

func (m *TagMutation) 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 (*TagMutation) ClearJobs

func (m *TagMutation) ClearJobs()

ClearJobs clears the "jobs" edge to the Job entity.

func (*TagMutation) ClearedEdges

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

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

func (*TagMutation) ClearedFields

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

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

func (TagMutation) Client

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

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

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

func (*TagMutation) ExecContext

func (c *TagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagMutation) Field

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

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

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

func (*TagMutation) Fields

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

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

func (m *TagMutation) 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 (*TagMutation) JobsCleared

func (m *TagMutation) JobsCleared() bool

JobsCleared reports if the "jobs" edge to the Job entity was cleared.

func (*TagMutation) JobsIDs

func (m *TagMutation) JobsIDs() (ids []string)

JobsIDs returns the "jobs" edge IDs in the mutation.

func (*TagMutation) Name

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

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

func (*TagMutation) OldField

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

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

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

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) QueryContext

func (c *TagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagMutation) RemoveJobIDs

func (m *TagMutation) RemoveJobIDs(ids ...string)

RemoveJobIDs removes the "jobs" edge to the Job entity by IDs.

func (*TagMutation) RemovedEdges

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

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

func (*TagMutation) RemovedIDs

func (m *TagMutation) 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 (*TagMutation) RemovedJobsIDs

func (m *TagMutation) RemovedJobsIDs() (ids []string)

RemovedJobs returns the removed IDs of the "jobs" edge to the Job entity.

func (*TagMutation) ResetEdge

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

func (m *TagMutation) 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 (*TagMutation) ResetJobs

func (m *TagMutation) ResetJobs()

ResetJobs resets all changes to the "jobs" edge.

func (*TagMutation) ResetName

func (m *TagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TagMutation) SetField

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

func (m *TagMutation) SetName(s string)

SetName sets the "name" field.

func (*TagMutation) SetOp

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (TagMutation) Tx

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

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

func (*TagMutation) Type

func (m *TagMutation) Type() string

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

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

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

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

type TagQuery

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

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

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

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

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

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

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

func (*TagQuery) ExecContext

func (c *TagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

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

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

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

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

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

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) int

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

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

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

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tag.Query().
	GroupBy(tag.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

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

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

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []int

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

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

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

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

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

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) int

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

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

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

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryContext

func (c *TagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagQuery) QueryJobs

func (tq *TagQuery) QueryJobs() *JobQuery

QueryJobs chains the current query on the "jobs" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldName).
	Scan(ctx, &v)

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithJobs

func (tq *TagQuery) WithJobs(opts ...func(*JobQuery)) *TagQuery

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

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

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

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

func (*TagSelect) BoolX

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

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

func (*TagSelect) Bools

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

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

func (*TagSelect) BoolsX

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

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

func (TagSelect) ExecContext

func (c TagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagSelect) Float64

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

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

func (*TagSelect) Float64X

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

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

func (*TagSelect) Float64s

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

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

func (*TagSelect) Float64sX

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

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

func (*TagSelect) Int

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

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

func (*TagSelect) IntX

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

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

func (*TagSelect) Ints

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

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

func (*TagSelect) IntsX

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

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

func (TagSelect) QueryContext

func (c TagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

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

func (*TagSelect) ScanX

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

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

func (*TagSelect) String

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

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

func (*TagSelect) StringX

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

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

func (*TagSelect) Strings

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

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

func (*TagSelect) StringsX

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

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

type TagUpdate

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

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddJobIDs

func (tu *TagUpdate) AddJobIDs(ids ...string) *TagUpdate

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*TagUpdate) AddJobs

func (tu *TagUpdate) AddJobs(j ...*Job) *TagUpdate

AddJobs adds the "jobs" edges to the Job entity.

func (*TagUpdate) ClearJobs

func (tu *TagUpdate) ClearJobs() *TagUpdate

ClearJobs clears all "jobs" edges to the Job entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecContext

func (c *TagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

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

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) QueryContext

func (c *TagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagUpdate) RemoveJobIDs

func (tu *TagUpdate) RemoveJobIDs(ids ...string) *TagUpdate

RemoveJobIDs removes the "jobs" edge to Job entities by IDs.

func (*TagUpdate) RemoveJobs

func (tu *TagUpdate) RemoveJobs(j ...*Job) *TagUpdate

RemoveJobs removes "jobs" edges to Job entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

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

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

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

func (*TagUpdate) SetName

func (tu *TagUpdate) SetName(s string) *TagUpdate

SetName sets the "name" field.

func (*TagUpdate) SetNillableName added in v0.2.0

func (tu *TagUpdate) SetNillableName(s *string) *TagUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

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

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddJobIDs

func (tuo *TagUpdateOne) AddJobIDs(ids ...string) *TagUpdateOne

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*TagUpdateOne) AddJobs

func (tuo *TagUpdateOne) AddJobs(j ...*Job) *TagUpdateOne

AddJobs adds the "jobs" edges to the Job entity.

func (*TagUpdateOne) ClearJobs

func (tuo *TagUpdateOne) ClearJobs() *TagUpdateOne

ClearJobs clears all "jobs" edges to the Job entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecContext

func (c *TagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

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

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) QueryContext

func (c *TagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TagUpdateOne) RemoveJobIDs

func (tuo *TagUpdateOne) RemoveJobIDs(ids ...string) *TagUpdateOne

RemoveJobIDs removes the "jobs" edge to Job entities by IDs.

func (*TagUpdateOne) RemoveJobs

func (tuo *TagUpdateOne) RemoveJobs(j ...*Job) *TagUpdateOne

RemoveJobs removes "jobs" edges to Job entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

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

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

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

func (*TagUpdateOne) SetName

func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne

SetName sets the "name" field.

func (*TagUpdateOne) SetNillableName added in v0.2.0

func (tuo *TagUpdateOne) SetNillableName(s *string) *TagUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

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 {

	// History is the client for interacting with the History builders.
	History *HistoryClient
	// Job is the client for interacting with the Job builders.
	Job *JobClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// Workflow is the client for interacting with the Workflow builders.
	Workflow *WorkflowClient
	// 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) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

type Workflow

type Workflow struct {

	// ID of the ent.
	ID int `json:"id,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"`
	// States holds the value of the "states" field.
	States []*model.State `json:"states,omitempty"`
	// Transitions holds the value of the "transitions" field.
	Transitions []*model.Transition `json:"transitions,omitempty"`
	// Groups holds the value of the "groups" field.
	Groups []*model.Group `json:"groups,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WorkflowQuery when eager-loading is set.
	Edges WorkflowEdges `json:"edges"`
	// contains filtered or unexported fields
}

Workflow is the model entity for the Workflow schema.

func (*Workflow) ExecContext

func (c *Workflow) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Workflow) QueryContext

func (c *Workflow) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Workflow) QueryJobs

func (w *Workflow) QueryJobs() *JobQuery

QueryJobs queries the "jobs" edge of the Workflow entity.

func (*Workflow) String

func (w *Workflow) String() string

String implements the fmt.Stringer.

func (*Workflow) Unwrap

func (w *Workflow) Unwrap() *Workflow

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

func (w *Workflow) Update() *WorkflowUpdateOne

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

func (*Workflow) Value

func (w *Workflow) Value(name string) (ent.Value, error)

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

type WorkflowClient

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

WorkflowClient is a client for the Workflow schema.

func NewWorkflowClient

func NewWorkflowClient(c config) *WorkflowClient

NewWorkflowClient returns a client for the Workflow from the given config.

func (*WorkflowClient) Create

func (c *WorkflowClient) Create() *WorkflowCreate

Create returns a builder for creating a Workflow entity.

func (*WorkflowClient) CreateBulk

func (c *WorkflowClient) CreateBulk(builders ...*WorkflowCreate) *WorkflowCreateBulk

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

func (*WorkflowClient) Delete

func (c *WorkflowClient) Delete() *WorkflowDelete

Delete returns a delete builder for Workflow.

func (*WorkflowClient) DeleteOne

func (c *WorkflowClient) DeleteOne(w *Workflow) *WorkflowDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkflowClient) DeleteOneID

func (c *WorkflowClient) DeleteOneID(id int) *WorkflowDeleteOne

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

func (*WorkflowClient) ExecContext

func (c *WorkflowClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowClient) Get

func (c *WorkflowClient) Get(ctx context.Context, id int) (*Workflow, error)

Get returns a Workflow entity by its id.

func (*WorkflowClient) GetX

func (c *WorkflowClient) GetX(ctx context.Context, id int) *Workflow

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

func (*WorkflowClient) Hooks

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

Hooks returns the client hooks.

func (*WorkflowClient) Intercept

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

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

func (*WorkflowClient) Interceptors

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

Interceptors returns the client interceptors.

func (*WorkflowClient) MapCreateBulk added in v0.2.0

func (c *WorkflowClient) MapCreateBulk(slice any, setFunc func(*WorkflowCreate, int)) *WorkflowCreateBulk

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

func (*WorkflowClient) Query

func (c *WorkflowClient) Query() *WorkflowQuery

Query returns a query builder for Workflow.

func (*WorkflowClient) QueryContext

func (c *WorkflowClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowClient) QueryJobs

func (c *WorkflowClient) QueryJobs(w *Workflow) *JobQuery

QueryJobs queries the jobs edge of a Workflow.

func (*WorkflowClient) Update

func (c *WorkflowClient) Update() *WorkflowUpdate

Update returns an update builder for Workflow.

func (*WorkflowClient) UpdateOne

func (c *WorkflowClient) UpdateOne(w *Workflow) *WorkflowUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkflowClient) UpdateOneID

func (c *WorkflowClient) UpdateOneID(id int) *WorkflowUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WorkflowClient) Use

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

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

type WorkflowCreate

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

WorkflowCreate is the builder for creating a Workflow entity.

func (*WorkflowCreate) AddJobIDs

func (wc *WorkflowCreate) AddJobIDs(ids ...string) *WorkflowCreate

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*WorkflowCreate) AddJobs

func (wc *WorkflowCreate) AddJobs(j ...*Job) *WorkflowCreate

AddJobs adds the "jobs" edges to the Job entity.

func (*WorkflowCreate) Exec

func (wc *WorkflowCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkflowCreate) ExecContext

func (c *WorkflowCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowCreate) ExecX

func (wc *WorkflowCreate) ExecX(ctx context.Context)

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

func (*WorkflowCreate) Mutation

func (wc *WorkflowCreate) Mutation() *WorkflowMutation

Mutation returns the WorkflowMutation object of the builder.

func (*WorkflowCreate) QueryContext

func (c *WorkflowCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowCreate) Save

func (wc *WorkflowCreate) Save(ctx context.Context) (*Workflow, error)

Save creates the Workflow in the database.

func (*WorkflowCreate) SaveX

func (wc *WorkflowCreate) SaveX(ctx context.Context) *Workflow

SaveX calls Save and panics if Save returns an error.

func (*WorkflowCreate) SetDescription added in v0.2.0

func (wc *WorkflowCreate) SetDescription(s string) *WorkflowCreate

SetDescription sets the "description" field.

func (*WorkflowCreate) SetGroups

func (wc *WorkflowCreate) SetGroups(m []*model.Group) *WorkflowCreate

SetGroups sets the "groups" field.

func (*WorkflowCreate) SetName

func (wc *WorkflowCreate) SetName(s string) *WorkflowCreate

SetName sets the "name" field.

func (*WorkflowCreate) SetNillableDescription added in v0.2.0

func (wc *WorkflowCreate) SetNillableDescription(s *string) *WorkflowCreate

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

func (*WorkflowCreate) SetStates

func (wc *WorkflowCreate) SetStates(m []*model.State) *WorkflowCreate

SetStates sets the "states" field.

func (*WorkflowCreate) SetTransitions

func (wc *WorkflowCreate) SetTransitions(m []*model.Transition) *WorkflowCreate

SetTransitions sets the "transitions" field.

type WorkflowCreateBulk

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

WorkflowCreateBulk is the builder for creating many Workflow entities in bulk.

func (*WorkflowCreateBulk) Exec

func (wcb *WorkflowCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkflowCreateBulk) ExecContext

func (c *WorkflowCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowCreateBulk) ExecX

func (wcb *WorkflowCreateBulk) ExecX(ctx context.Context)

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

func (*WorkflowCreateBulk) QueryContext

func (c *WorkflowCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowCreateBulk) Save

func (wcb *WorkflowCreateBulk) Save(ctx context.Context) ([]*Workflow, error)

Save creates the Workflow entities in the database.

func (*WorkflowCreateBulk) SaveX

func (wcb *WorkflowCreateBulk) SaveX(ctx context.Context) []*Workflow

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

type WorkflowDelete

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

WorkflowDelete is the builder for deleting a Workflow entity.

func (*WorkflowDelete) Exec

func (wd *WorkflowDelete) Exec(ctx context.Context) (int, error)

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

func (*WorkflowDelete) ExecContext

func (c *WorkflowDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowDelete) ExecX

func (wd *WorkflowDelete) ExecX(ctx context.Context) int

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

func (*WorkflowDelete) QueryContext

func (c *WorkflowDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowDelete) Where

func (wd *WorkflowDelete) Where(ps ...predicate.Workflow) *WorkflowDelete

Where appends a list predicates to the WorkflowDelete builder.

type WorkflowDeleteOne

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

WorkflowDeleteOne is the builder for deleting a single Workflow entity.

func (*WorkflowDeleteOne) Exec

func (wdo *WorkflowDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WorkflowDeleteOne) ExecX

func (wdo *WorkflowDeleteOne) ExecX(ctx context.Context)

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

func (*WorkflowDeleteOne) Where

Where appends a list predicates to the WorkflowDelete builder.

type WorkflowEdges

type WorkflowEdges struct {
	// Jobs holds the value of the jobs edge.
	Jobs []*Job `json:"jobs,omitempty"`
	// contains filtered or unexported fields
}

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

func (WorkflowEdges) JobsOrErr

func (e WorkflowEdges) JobsOrErr() ([]*Job, error)

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

type WorkflowGroupBy

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

WorkflowGroupBy is the group-by builder for Workflow entities.

func (*WorkflowGroupBy) Aggregate

func (wgb *WorkflowGroupBy) Aggregate(fns ...AggregateFunc) *WorkflowGroupBy

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

func (*WorkflowGroupBy) Bool

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

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

func (*WorkflowGroupBy) BoolX

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

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

func (*WorkflowGroupBy) Bools

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

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

func (*WorkflowGroupBy) BoolsX

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

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

func (*WorkflowGroupBy) Float64

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

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

func (*WorkflowGroupBy) Float64X

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

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

func (*WorkflowGroupBy) Float64s

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

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

func (*WorkflowGroupBy) Float64sX

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

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

func (*WorkflowGroupBy) Int

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

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

func (*WorkflowGroupBy) IntX

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

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

func (*WorkflowGroupBy) Ints

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

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

func (*WorkflowGroupBy) IntsX

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

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

func (*WorkflowGroupBy) Scan

func (wgb *WorkflowGroupBy) Scan(ctx context.Context, v any) error

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

func (*WorkflowGroupBy) ScanX

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

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

func (*WorkflowGroupBy) String

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

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

func (*WorkflowGroupBy) StringX

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

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

func (*WorkflowGroupBy) Strings

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

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

func (*WorkflowGroupBy) StringsX

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

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

type WorkflowMutation

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

WorkflowMutation represents an operation that mutates the Workflow nodes in the graph.

func (*WorkflowMutation) AddField

func (m *WorkflowMutation) 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 (*WorkflowMutation) AddJobIDs

func (m *WorkflowMutation) AddJobIDs(ids ...string)

AddJobIDs adds the "jobs" edge to the Job entity by ids.

func (*WorkflowMutation) AddedEdges

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

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

func (*WorkflowMutation) AddedField

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

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

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

func (*WorkflowMutation) AddedIDs

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

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

func (*WorkflowMutation) AppendGroups

func (m *WorkflowMutation) AppendGroups(value []*model.Group)

AppendGroups adds value to the "groups" field.

func (*WorkflowMutation) AppendStates

func (m *WorkflowMutation) AppendStates(value []*model.State)

AppendStates adds value to the "states" field.

func (*WorkflowMutation) AppendTransitions

func (m *WorkflowMutation) AppendTransitions(value []*model.Transition)

AppendTransitions adds value to the "transitions" field.

func (*WorkflowMutation) AppendedGroups

func (m *WorkflowMutation) AppendedGroups() ([]*model.Group, bool)

AppendedGroups returns the list of values that were appended to the "groups" field in this mutation.

func (*WorkflowMutation) AppendedStates

func (m *WorkflowMutation) AppendedStates() ([]*model.State, bool)

AppendedStates returns the list of values that were appended to the "states" field in this mutation.

func (*WorkflowMutation) AppendedTransitions

func (m *WorkflowMutation) AppendedTransitions() ([]*model.Transition, bool)

AppendedTransitions returns the list of values that were appended to the "transitions" field in this mutation.

func (*WorkflowMutation) ClearDescription added in v0.2.0

func (m *WorkflowMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*WorkflowMutation) ClearEdge

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

func (m *WorkflowMutation) 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 (*WorkflowMutation) ClearJobs

func (m *WorkflowMutation) ClearJobs()

ClearJobs clears the "jobs" edge to the Job entity.

func (*WorkflowMutation) ClearedEdges

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

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

func (*WorkflowMutation) ClearedFields

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

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

func (WorkflowMutation) Client

func (m WorkflowMutation) 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 (*WorkflowMutation) Description added in v0.2.0

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

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

func (*WorkflowMutation) DescriptionCleared added in v0.2.0

func (m *WorkflowMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*WorkflowMutation) EdgeCleared

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

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

func (*WorkflowMutation) ExecContext

func (c *WorkflowMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowMutation) Field

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

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

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

func (*WorkflowMutation) Fields

func (m *WorkflowMutation) 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 (*WorkflowMutation) Groups

func (m *WorkflowMutation) Groups() (r []*model.Group, exists bool)

Groups returns the value of the "groups" field in the mutation.

func (*WorkflowMutation) ID

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

func (m *WorkflowMutation) 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 (*WorkflowMutation) JobsCleared

func (m *WorkflowMutation) JobsCleared() bool

JobsCleared reports if the "jobs" edge to the Job entity was cleared.

func (*WorkflowMutation) JobsIDs

func (m *WorkflowMutation) JobsIDs() (ids []string)

JobsIDs returns the "jobs" edge IDs in the mutation.

func (*WorkflowMutation) Name

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

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

func (*WorkflowMutation) OldDescription added in v0.2.0

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

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

func (m *WorkflowMutation) 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 (*WorkflowMutation) OldGroups

func (m *WorkflowMutation) OldGroups(ctx context.Context) (v []*model.Group, err error)

OldGroups returns the old "groups" field's value of the Workflow entity. If the Workflow object wasn'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 (*WorkflowMutation) OldName

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

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

func (m *WorkflowMutation) OldStates(ctx context.Context) (v []*model.State, err error)

OldStates returns the old "states" field's value of the Workflow entity. If the Workflow object wasn'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 (*WorkflowMutation) OldTransitions

func (m *WorkflowMutation) OldTransitions(ctx context.Context) (v []*model.Transition, err error)

OldTransitions returns the old "transitions" field's value of the Workflow entity. If the Workflow object wasn'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 (*WorkflowMutation) Op

func (m *WorkflowMutation) Op() Op

Op returns the operation name.

func (*WorkflowMutation) QueryContext

func (c *WorkflowMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowMutation) RemoveJobIDs

func (m *WorkflowMutation) RemoveJobIDs(ids ...string)

RemoveJobIDs removes the "jobs" edge to the Job entity by IDs.

func (*WorkflowMutation) RemovedEdges

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

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

func (*WorkflowMutation) RemovedIDs

func (m *WorkflowMutation) 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 (*WorkflowMutation) RemovedJobsIDs

func (m *WorkflowMutation) RemovedJobsIDs() (ids []string)

RemovedJobs returns the removed IDs of the "jobs" edge to the Job entity.

func (*WorkflowMutation) ResetDescription added in v0.2.0

func (m *WorkflowMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*WorkflowMutation) ResetEdge

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

func (m *WorkflowMutation) 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 (*WorkflowMutation) ResetGroups

func (m *WorkflowMutation) ResetGroups()

ResetGroups resets all changes to the "groups" field.

func (*WorkflowMutation) ResetJobs

func (m *WorkflowMutation) ResetJobs()

ResetJobs resets all changes to the "jobs" edge.

func (*WorkflowMutation) ResetName

func (m *WorkflowMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*WorkflowMutation) ResetStates

func (m *WorkflowMutation) ResetStates()

ResetStates resets all changes to the "states" field.

func (*WorkflowMutation) ResetTransitions

func (m *WorkflowMutation) ResetTransitions()

ResetTransitions resets all changes to the "transitions" field.

func (*WorkflowMutation) SetDescription added in v0.2.0

func (m *WorkflowMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*WorkflowMutation) SetField

func (m *WorkflowMutation) 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 (*WorkflowMutation) SetGroups

func (m *WorkflowMutation) SetGroups(value []*model.Group)

SetGroups sets the "groups" field.

func (*WorkflowMutation) SetName

func (m *WorkflowMutation) SetName(s string)

SetName sets the "name" field.

func (*WorkflowMutation) SetOp

func (m *WorkflowMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WorkflowMutation) SetStates

func (m *WorkflowMutation) SetStates(value []*model.State)

SetStates sets the "states" field.

func (*WorkflowMutation) SetTransitions

func (m *WorkflowMutation) SetTransitions(value []*model.Transition)

SetTransitions sets the "transitions" field.

func (*WorkflowMutation) States

func (m *WorkflowMutation) States() (r []*model.State, exists bool)

States returns the value of the "states" field in the mutation.

func (*WorkflowMutation) Transitions

func (m *WorkflowMutation) Transitions() (r []*model.Transition, exists bool)

Transitions returns the value of the "transitions" field in the mutation.

func (WorkflowMutation) Tx

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

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

func (*WorkflowMutation) Type

func (m *WorkflowMutation) Type() string

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

func (*WorkflowMutation) Where

func (m *WorkflowMutation) Where(ps ...predicate.Workflow)

Where appends a list predicates to the WorkflowMutation builder.

func (*WorkflowMutation) WhereP

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

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

type WorkflowQuery

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

WorkflowQuery is the builder for querying Workflow entities.

func (*WorkflowQuery) Aggregate

func (wq *WorkflowQuery) Aggregate(fns ...AggregateFunc) *WorkflowSelect

Aggregate returns a WorkflowSelect configured with the given aggregations.

func (*WorkflowQuery) All

func (wq *WorkflowQuery) All(ctx context.Context) ([]*Workflow, error)

All executes the query and returns a list of Workflows.

func (*WorkflowQuery) AllX

func (wq *WorkflowQuery) AllX(ctx context.Context) []*Workflow

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

func (*WorkflowQuery) Clone

func (wq *WorkflowQuery) Clone() *WorkflowQuery

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

func (*WorkflowQuery) Count

func (wq *WorkflowQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkflowQuery) CountX

func (wq *WorkflowQuery) CountX(ctx context.Context) int

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

func (*WorkflowQuery) ExecContext

func (c *WorkflowQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowQuery) Exist

func (wq *WorkflowQuery) Exist(ctx context.Context) (bool, error)

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

func (*WorkflowQuery) ExistX

func (wq *WorkflowQuery) ExistX(ctx context.Context) bool

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

func (*WorkflowQuery) First

func (wq *WorkflowQuery) First(ctx context.Context) (*Workflow, error)

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

func (*WorkflowQuery) FirstID

func (wq *WorkflowQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*WorkflowQuery) FirstIDX

func (wq *WorkflowQuery) FirstIDX(ctx context.Context) int

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

func (*WorkflowQuery) FirstX

func (wq *WorkflowQuery) FirstX(ctx context.Context) *Workflow

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

func (*WorkflowQuery) GroupBy

func (wq *WorkflowQuery) GroupBy(field string, fields ...string) *WorkflowGroupBy

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Workflow.Query().
	GroupBy(workflow.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WorkflowQuery) IDs

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

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

func (*WorkflowQuery) IDsX

func (wq *WorkflowQuery) IDsX(ctx context.Context) []int

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

func (*WorkflowQuery) Limit

func (wq *WorkflowQuery) Limit(limit int) *WorkflowQuery

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

func (*WorkflowQuery) Offset

func (wq *WorkflowQuery) Offset(offset int) *WorkflowQuery

Offset to start from.

func (*WorkflowQuery) Only

func (wq *WorkflowQuery) Only(ctx context.Context) (*Workflow, error)

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

func (*WorkflowQuery) OnlyID

func (wq *WorkflowQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*WorkflowQuery) OnlyIDX

func (wq *WorkflowQuery) OnlyIDX(ctx context.Context) int

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

func (*WorkflowQuery) OnlyX

func (wq *WorkflowQuery) OnlyX(ctx context.Context) *Workflow

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

func (*WorkflowQuery) Order

Order specifies how the records should be ordered.

func (*WorkflowQuery) QueryContext

func (c *WorkflowQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowQuery) QueryJobs

func (wq *WorkflowQuery) QueryJobs() *JobQuery

QueryJobs chains the current query on the "jobs" edge.

func (*WorkflowQuery) Select

func (wq *WorkflowQuery) Select(fields ...string) *WorkflowSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Workflow.Query().
	Select(workflow.FieldName).
	Scan(ctx, &v)

func (*WorkflowQuery) Unique

func (wq *WorkflowQuery) Unique(unique bool) *WorkflowQuery

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

func (wq *WorkflowQuery) Where(ps ...predicate.Workflow) *WorkflowQuery

Where adds a new predicate for the WorkflowQuery builder.

func (*WorkflowQuery) WithJobs

func (wq *WorkflowQuery) WithJobs(opts ...func(*JobQuery)) *WorkflowQuery

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

type WorkflowSelect

type WorkflowSelect struct {
	*WorkflowQuery
	// contains filtered or unexported fields
}

WorkflowSelect is the builder for selecting fields of Workflow entities.

func (*WorkflowSelect) Aggregate

func (ws *WorkflowSelect) Aggregate(fns ...AggregateFunc) *WorkflowSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WorkflowSelect) Bool

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

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

func (*WorkflowSelect) BoolX

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

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

func (*WorkflowSelect) Bools

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

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

func (*WorkflowSelect) BoolsX

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

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

func (WorkflowSelect) ExecContext

func (c WorkflowSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowSelect) Float64

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

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

func (*WorkflowSelect) Float64X

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

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

func (*WorkflowSelect) Float64s

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

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

func (*WorkflowSelect) Float64sX

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

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

func (*WorkflowSelect) Int

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

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

func (*WorkflowSelect) IntX

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

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

func (*WorkflowSelect) Ints

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

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

func (*WorkflowSelect) IntsX

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

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

func (WorkflowSelect) QueryContext

func (c WorkflowSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowSelect) Scan

func (ws *WorkflowSelect) Scan(ctx context.Context, v any) error

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

func (*WorkflowSelect) ScanX

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

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

func (*WorkflowSelect) String

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

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

func (*WorkflowSelect) StringX

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

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

func (*WorkflowSelect) Strings

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

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

func (*WorkflowSelect) StringsX

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

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

type WorkflowUpdate

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

WorkflowUpdate is the builder for updating Workflow entities.

func (*WorkflowUpdate) AddJobIDs

func (wu *WorkflowUpdate) AddJobIDs(ids ...string) *WorkflowUpdate

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*WorkflowUpdate) AddJobs

func (wu *WorkflowUpdate) AddJobs(j ...*Job) *WorkflowUpdate

AddJobs adds the "jobs" edges to the Job entity.

func (*WorkflowUpdate) AppendGroups

func (wu *WorkflowUpdate) AppendGroups(m []*model.Group) *WorkflowUpdate

AppendGroups appends m to the "groups" field.

func (*WorkflowUpdate) AppendStates

func (wu *WorkflowUpdate) AppendStates(m []*model.State) *WorkflowUpdate

AppendStates appends m to the "states" field.

func (*WorkflowUpdate) AppendTransitions

func (wu *WorkflowUpdate) AppendTransitions(m []*model.Transition) *WorkflowUpdate

AppendTransitions appends m to the "transitions" field.

func (*WorkflowUpdate) ClearDescription added in v0.2.0

func (wu *WorkflowUpdate) ClearDescription() *WorkflowUpdate

ClearDescription clears the value of the "description" field.

func (*WorkflowUpdate) ClearJobs

func (wu *WorkflowUpdate) ClearJobs() *WorkflowUpdate

ClearJobs clears all "jobs" edges to the Job entity.

func (*WorkflowUpdate) Exec

func (wu *WorkflowUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkflowUpdate) ExecContext

func (c *WorkflowUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowUpdate) ExecX

func (wu *WorkflowUpdate) ExecX(ctx context.Context)

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

func (*WorkflowUpdate) Mutation

func (wu *WorkflowUpdate) Mutation() *WorkflowMutation

Mutation returns the WorkflowMutation object of the builder.

func (*WorkflowUpdate) QueryContext

func (c *WorkflowUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowUpdate) RemoveJobIDs

func (wu *WorkflowUpdate) RemoveJobIDs(ids ...string) *WorkflowUpdate

RemoveJobIDs removes the "jobs" edge to Job entities by IDs.

func (*WorkflowUpdate) RemoveJobs

func (wu *WorkflowUpdate) RemoveJobs(j ...*Job) *WorkflowUpdate

RemoveJobs removes "jobs" edges to Job entities.

func (*WorkflowUpdate) Save

func (wu *WorkflowUpdate) Save(ctx context.Context) (int, error)

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

func (*WorkflowUpdate) SaveX

func (wu *WorkflowUpdate) SaveX(ctx context.Context) int

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

func (*WorkflowUpdate) SetDescription added in v0.2.0

func (wu *WorkflowUpdate) SetDescription(s string) *WorkflowUpdate

SetDescription sets the "description" field.

func (*WorkflowUpdate) SetGroups

func (wu *WorkflowUpdate) SetGroups(m []*model.Group) *WorkflowUpdate

SetGroups sets the "groups" field.

func (*WorkflowUpdate) SetName

func (wu *WorkflowUpdate) SetName(s string) *WorkflowUpdate

SetName sets the "name" field.

func (*WorkflowUpdate) SetNillableDescription added in v0.2.0

func (wu *WorkflowUpdate) SetNillableDescription(s *string) *WorkflowUpdate

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

func (*WorkflowUpdate) SetNillableName added in v0.2.0

func (wu *WorkflowUpdate) SetNillableName(s *string) *WorkflowUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*WorkflowUpdate) SetStates

func (wu *WorkflowUpdate) SetStates(m []*model.State) *WorkflowUpdate

SetStates sets the "states" field.

func (*WorkflowUpdate) SetTransitions

func (wu *WorkflowUpdate) SetTransitions(m []*model.Transition) *WorkflowUpdate

SetTransitions sets the "transitions" field.

func (*WorkflowUpdate) Where

func (wu *WorkflowUpdate) Where(ps ...predicate.Workflow) *WorkflowUpdate

Where appends a list predicates to the WorkflowUpdate builder.

type WorkflowUpdateOne

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

WorkflowUpdateOne is the builder for updating a single Workflow entity.

func (*WorkflowUpdateOne) AddJobIDs

func (wuo *WorkflowUpdateOne) AddJobIDs(ids ...string) *WorkflowUpdateOne

AddJobIDs adds the "jobs" edge to the Job entity by IDs.

func (*WorkflowUpdateOne) AddJobs

func (wuo *WorkflowUpdateOne) AddJobs(j ...*Job) *WorkflowUpdateOne

AddJobs adds the "jobs" edges to the Job entity.

func (*WorkflowUpdateOne) AppendGroups

func (wuo *WorkflowUpdateOne) AppendGroups(m []*model.Group) *WorkflowUpdateOne

AppendGroups appends m to the "groups" field.

func (*WorkflowUpdateOne) AppendStates

func (wuo *WorkflowUpdateOne) AppendStates(m []*model.State) *WorkflowUpdateOne

AppendStates appends m to the "states" field.

func (*WorkflowUpdateOne) AppendTransitions

func (wuo *WorkflowUpdateOne) AppendTransitions(m []*model.Transition) *WorkflowUpdateOne

AppendTransitions appends m to the "transitions" field.

func (*WorkflowUpdateOne) ClearDescription added in v0.2.0

func (wuo *WorkflowUpdateOne) ClearDescription() *WorkflowUpdateOne

ClearDescription clears the value of the "description" field.

func (*WorkflowUpdateOne) ClearJobs

func (wuo *WorkflowUpdateOne) ClearJobs() *WorkflowUpdateOne

ClearJobs clears all "jobs" edges to the Job entity.

func (*WorkflowUpdateOne) Exec

func (wuo *WorkflowUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WorkflowUpdateOne) ExecContext

func (c *WorkflowUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WorkflowUpdateOne) ExecX

func (wuo *WorkflowUpdateOne) ExecX(ctx context.Context)

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

func (*WorkflowUpdateOne) Mutation

func (wuo *WorkflowUpdateOne) Mutation() *WorkflowMutation

Mutation returns the WorkflowMutation object of the builder.

func (*WorkflowUpdateOne) QueryContext

func (c *WorkflowUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WorkflowUpdateOne) RemoveJobIDs

func (wuo *WorkflowUpdateOne) RemoveJobIDs(ids ...string) *WorkflowUpdateOne

RemoveJobIDs removes the "jobs" edge to Job entities by IDs.

func (*WorkflowUpdateOne) RemoveJobs

func (wuo *WorkflowUpdateOne) RemoveJobs(j ...*Job) *WorkflowUpdateOne

RemoveJobs removes "jobs" edges to Job entities.

func (*WorkflowUpdateOne) Save

func (wuo *WorkflowUpdateOne) Save(ctx context.Context) (*Workflow, error)

Save executes the query and returns the updated Workflow entity.

func (*WorkflowUpdateOne) SaveX

func (wuo *WorkflowUpdateOne) SaveX(ctx context.Context) *Workflow

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

func (*WorkflowUpdateOne) Select

func (wuo *WorkflowUpdateOne) Select(field string, fields ...string) *WorkflowUpdateOne

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

func (*WorkflowUpdateOne) SetDescription added in v0.2.0

func (wuo *WorkflowUpdateOne) SetDescription(s string) *WorkflowUpdateOne

SetDescription sets the "description" field.

func (*WorkflowUpdateOne) SetGroups

func (wuo *WorkflowUpdateOne) SetGroups(m []*model.Group) *WorkflowUpdateOne

SetGroups sets the "groups" field.

func (*WorkflowUpdateOne) SetName

func (wuo *WorkflowUpdateOne) SetName(s string) *WorkflowUpdateOne

SetName sets the "name" field.

func (*WorkflowUpdateOne) SetNillableDescription added in v0.2.0

func (wuo *WorkflowUpdateOne) SetNillableDescription(s *string) *WorkflowUpdateOne

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

func (*WorkflowUpdateOne) SetNillableName added in v0.2.0

func (wuo *WorkflowUpdateOne) SetNillableName(s *string) *WorkflowUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*WorkflowUpdateOne) SetStates

func (wuo *WorkflowUpdateOne) SetStates(m []*model.State) *WorkflowUpdateOne

SetStates sets the "states" field.

func (*WorkflowUpdateOne) SetTransitions

func (wuo *WorkflowUpdateOne) SetTransitions(m []*model.Transition) *WorkflowUpdateOne

SetTransitions sets the "transitions" field.

func (*WorkflowUpdateOne) Where

Where appends a list predicates to the WorkflowUpdate builder.

type Workflows

type Workflows []*Workflow

Workflows is a parsable slice of Workflow.

Directories

Path Synopsis
SPDX-FileCopyrightText: 2023 Siemens AG
SPDX-FileCopyrightText: 2023 Siemens AG

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL