ent

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: AGPL-3.0 Imports: 25 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.
	TypeDimension    = "Dimension"
	TypeItem         = "Item"
	TypeMetric       = "Metric"
	TypeTask         = "Task"
	TypeTaskCategory = "TaskCategory"
	TypeTaskInstance = "TaskInstance"
	TypeTaskTag      = "TaskTag"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Dimension is the client for interacting with the Dimension builders.
	Dimension *DimensionClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// Metric is the client for interacting with the Metric builders.
	Metric *MetricClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// TaskCategory is the client for interacting with the TaskCategory builders.
	TaskCategory *TaskCategoryClient
	// TaskInstance is the client for interacting with the TaskInstance builders.
	TaskInstance *TaskInstanceClient
	// TaskTag is the client for interacting with the TaskTag builders.
	TaskTag *TaskTagClient
	// 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().
	Dimension.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Dimension

type Dimension struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// DisplayTitle holds the value of the "display_title" field.
	DisplayTitle map[string]string `json:"display_title,omitempty"`
	// DisplayValue holds the value of the "display_value" field.
	DisplayValue map[string]string `json:"display_value,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DimensionQuery when eager-loading is set.
	Edges DimensionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Dimension is the model entity for the Dimension schema.

func (*Dimension) QueryItem

func (d *Dimension) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the Dimension entity.

func (*Dimension) String

func (d *Dimension) String() string

String implements the fmt.Stringer.

func (*Dimension) Unwrap

func (d *Dimension) Unwrap() *Dimension

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

func (d *Dimension) Update() *DimensionUpdateOne

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

type DimensionClient

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

DimensionClient is a client for the Dimension schema.

func NewDimensionClient

func NewDimensionClient(c config) *DimensionClient

NewDimensionClient returns a client for the Dimension from the given config.

func (*DimensionClient) Create

func (c *DimensionClient) Create() *DimensionCreate

Create returns a create builder for Dimension.

func (*DimensionClient) CreateBulk

func (c *DimensionClient) CreateBulk(builders ...*DimensionCreate) *DimensionCreateBulk

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

func (*DimensionClient) Delete

func (c *DimensionClient) Delete() *DimensionDelete

Delete returns a delete builder for Dimension.

func (*DimensionClient) DeleteOne

func (c *DimensionClient) DeleteOne(d *Dimension) *DimensionDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DimensionClient) DeleteOneID

func (c *DimensionClient) DeleteOneID(id int) *DimensionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DimensionClient) Get

func (c *DimensionClient) Get(ctx context.Context, id int) (*Dimension, error)

Get returns a Dimension entity by its id.

func (*DimensionClient) GetX

func (c *DimensionClient) GetX(ctx context.Context, id int) *Dimension

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

func (*DimensionClient) Hooks

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

Hooks returns the client hooks.

func (*DimensionClient) Query

func (c *DimensionClient) Query() *DimensionQuery

Query returns a query builder for Dimension.

func (*DimensionClient) QueryItem

func (c *DimensionClient) QueryItem(d *Dimension) *ItemQuery

QueryItem queries the item edge of a Dimension.

func (*DimensionClient) Update

func (c *DimensionClient) Update() *DimensionUpdate

Update returns an update builder for Dimension.

func (*DimensionClient) UpdateOne

func (c *DimensionClient) UpdateOne(d *Dimension) *DimensionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DimensionClient) UpdateOneID

func (c *DimensionClient) UpdateOneID(id int) *DimensionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DimensionClient) Use

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

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

type DimensionCreate

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

DimensionCreate is the builder for creating a Dimension entity.

func (*DimensionCreate) AddItem

func (dc *DimensionCreate) AddItem(i ...*Item) *DimensionCreate

AddItem adds the "item" edges to the Item entity.

func (*DimensionCreate) AddItemIDs

func (dc *DimensionCreate) AddItemIDs(ids ...int) *DimensionCreate

AddItemIDs adds the "item" edge to the Item entity by IDs.

func (*DimensionCreate) Exec

func (dc *DimensionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DimensionCreate) ExecX

func (dc *DimensionCreate) ExecX(ctx context.Context)

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

func (*DimensionCreate) Mutation

func (dc *DimensionCreate) Mutation() *DimensionMutation

Mutation returns the DimensionMutation object of the builder.

func (*DimensionCreate) Save

func (dc *DimensionCreate) Save(ctx context.Context) (*Dimension, error)

Save creates the Dimension in the database.

func (*DimensionCreate) SaveX

func (dc *DimensionCreate) SaveX(ctx context.Context) *Dimension

SaveX calls Save and panics if Save returns an error.

func (*DimensionCreate) SetCreateTime

func (dc *DimensionCreate) SetCreateTime(t time.Time) *DimensionCreate

SetCreateTime sets the "create_time" field.

func (*DimensionCreate) SetDisplayTitle

func (dc *DimensionCreate) SetDisplayTitle(m map[string]string) *DimensionCreate

SetDisplayTitle sets the "display_title" field.

func (*DimensionCreate) SetDisplayValue

func (dc *DimensionCreate) SetDisplayValue(m map[string]string) *DimensionCreate

SetDisplayValue sets the "display_value" field.

func (*DimensionCreate) SetMeta

func (dc *DimensionCreate) SetMeta(m map[string]interface{}) *DimensionCreate

SetMeta sets the "meta" field.

func (*DimensionCreate) SetNillableCreateTime

func (dc *DimensionCreate) SetNillableCreateTime(t *time.Time) *DimensionCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*DimensionCreate) SetTitle

func (dc *DimensionCreate) SetTitle(s string) *DimensionCreate

SetTitle sets the "title" field.

func (*DimensionCreate) SetValue

func (dc *DimensionCreate) SetValue(s string) *DimensionCreate

SetValue sets the "value" field.

type DimensionCreateBulk

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

DimensionCreateBulk is the builder for creating many Dimension entities in bulk.

func (*DimensionCreateBulk) Exec

func (dcb *DimensionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DimensionCreateBulk) ExecX

func (dcb *DimensionCreateBulk) ExecX(ctx context.Context)

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

func (*DimensionCreateBulk) Save

func (dcb *DimensionCreateBulk) Save(ctx context.Context) ([]*Dimension, error)

Save creates the Dimension entities in the database.

func (*DimensionCreateBulk) SaveX

func (dcb *DimensionCreateBulk) SaveX(ctx context.Context) []*Dimension

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

type DimensionDelete

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

DimensionDelete is the builder for deleting a Dimension entity.

func (*DimensionDelete) Exec

func (dd *DimensionDelete) Exec(ctx context.Context) (int, error)

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

func (*DimensionDelete) ExecX

func (dd *DimensionDelete) ExecX(ctx context.Context) int

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

func (*DimensionDelete) Where

Where appends a list predicates to the DimensionDelete builder.

type DimensionDeleteOne

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

DimensionDeleteOne is the builder for deleting a single Dimension entity.

func (*DimensionDeleteOne) Exec

func (ddo *DimensionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DimensionDeleteOne) ExecX

func (ddo *DimensionDeleteOne) ExecX(ctx context.Context)

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

type DimensionEdges

type DimensionEdges struct {
	// Item holds the value of the item edge.
	Item []*Item `json:"item,omitempty"`
	// contains filtered or unexported fields
}

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

func (DimensionEdges) ItemOrErr

func (e DimensionEdges) ItemOrErr() ([]*Item, error)

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

type DimensionGroupBy

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

DimensionGroupBy is the group-by builder for Dimension entities.

func (*DimensionGroupBy) Aggregate

func (dgb *DimensionGroupBy) Aggregate(fns ...AggregateFunc) *DimensionGroupBy

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

func (*DimensionGroupBy) Bool

func (dgb *DimensionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) BoolX

func (dgb *DimensionGroupBy) BoolX(ctx context.Context) bool

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

func (*DimensionGroupBy) Bools

func (dgb *DimensionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) BoolsX

func (dgb *DimensionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DimensionGroupBy) Float64

func (dgb *DimensionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) Float64X

func (dgb *DimensionGroupBy) Float64X(ctx context.Context) float64

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

func (*DimensionGroupBy) Float64s

func (dgb *DimensionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) Float64sX

func (dgb *DimensionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DimensionGroupBy) Int

func (dgb *DimensionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) IntX

func (dgb *DimensionGroupBy) IntX(ctx context.Context) int

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

func (*DimensionGroupBy) Ints

func (dgb *DimensionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) IntsX

func (dgb *DimensionGroupBy) IntsX(ctx context.Context) []int

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

func (*DimensionGroupBy) Scan

func (dgb *DimensionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DimensionGroupBy) ScanX

func (dgb *DimensionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DimensionGroupBy) String

func (dgb *DimensionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) StringX

func (dgb *DimensionGroupBy) StringX(ctx context.Context) string

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

func (*DimensionGroupBy) Strings

func (dgb *DimensionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*DimensionGroupBy) StringsX

func (dgb *DimensionGroupBy) StringsX(ctx context.Context) []string

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

type DimensionMutation

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

DimensionMutation represents an operation that mutates the Dimension nodes in the graph.

func (*DimensionMutation) AddField

func (m *DimensionMutation) 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 (*DimensionMutation) AddItemIDs

func (m *DimensionMutation) AddItemIDs(ids ...int)

AddItemIDs adds the "item" edge to the Item entity by ids.

func (*DimensionMutation) AddedEdges

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

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

func (*DimensionMutation) AddedField

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

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

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

func (*DimensionMutation) AddedIDs

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

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

func (*DimensionMutation) ClearDisplayTitle

func (m *DimensionMutation) ClearDisplayTitle()

ClearDisplayTitle clears the value of the "display_title" field.

func (*DimensionMutation) ClearDisplayValue

func (m *DimensionMutation) ClearDisplayValue()

ClearDisplayValue clears the value of the "display_value" field.

func (*DimensionMutation) ClearEdge

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

func (m *DimensionMutation) 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 (*DimensionMutation) ClearItem

func (m *DimensionMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*DimensionMutation) ClearMeta

func (m *DimensionMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*DimensionMutation) ClearedEdges

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

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

func (*DimensionMutation) ClearedFields

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

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

func (DimensionMutation) Client

func (m DimensionMutation) 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 (*DimensionMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*DimensionMutation) DisplayTitle

func (m *DimensionMutation) DisplayTitle() (r map[string]string, exists bool)

DisplayTitle returns the value of the "display_title" field in the mutation.

func (*DimensionMutation) DisplayTitleCleared

func (m *DimensionMutation) DisplayTitleCleared() bool

DisplayTitleCleared returns if the "display_title" field was cleared in this mutation.

func (*DimensionMutation) DisplayValue

func (m *DimensionMutation) DisplayValue() (r map[string]string, exists bool)

DisplayValue returns the value of the "display_value" field in the mutation.

func (*DimensionMutation) DisplayValueCleared

func (m *DimensionMutation) DisplayValueCleared() bool

DisplayValueCleared returns if the "display_value" field was cleared in this mutation.

func (*DimensionMutation) EdgeCleared

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

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

func (*DimensionMutation) Field

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

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

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

func (*DimensionMutation) Fields

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

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

func (m *DimensionMutation) 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 (*DimensionMutation) ItemCleared

func (m *DimensionMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*DimensionMutation) ItemIDs

func (m *DimensionMutation) ItemIDs() (ids []int)

ItemIDs returns the "item" edge IDs in the mutation.

func (*DimensionMutation) Meta

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

Meta returns the value of the "meta" field in the mutation.

func (*DimensionMutation) MetaCleared

func (m *DimensionMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*DimensionMutation) OldCreateTime

func (m *DimensionMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Dimension entity. If the Dimension 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 (*DimensionMutation) OldDisplayTitle

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

OldDisplayTitle returns the old "display_title" field's value of the Dimension entity. If the Dimension 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 (*DimensionMutation) OldDisplayValue

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

OldDisplayValue returns the old "display_value" field's value of the Dimension entity. If the Dimension 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 (*DimensionMutation) OldField

func (m *DimensionMutation) 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 (*DimensionMutation) OldMeta

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

OldMeta returns the old "meta" field's value of the Dimension entity. If the Dimension 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 (*DimensionMutation) OldTitle

func (m *DimensionMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Dimension entity. If the Dimension 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 (*DimensionMutation) OldValue

func (m *DimensionMutation) OldValue(ctx context.Context) (v string, err error)

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

func (m *DimensionMutation) Op() Op

Op returns the operation name.

func (*DimensionMutation) RemoveItemIDs

func (m *DimensionMutation) RemoveItemIDs(ids ...int)

RemoveItemIDs removes the "item" edge to the Item entity by IDs.

func (*DimensionMutation) RemovedEdges

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

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

func (*DimensionMutation) RemovedIDs

func (m *DimensionMutation) 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 (*DimensionMutation) RemovedItemIDs

func (m *DimensionMutation) RemovedItemIDs() (ids []int)

RemovedItem returns the removed IDs of the "item" edge to the Item entity.

func (*DimensionMutation) ResetCreateTime

func (m *DimensionMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DimensionMutation) ResetDisplayTitle

func (m *DimensionMutation) ResetDisplayTitle()

ResetDisplayTitle resets all changes to the "display_title" field.

func (*DimensionMutation) ResetDisplayValue

func (m *DimensionMutation) ResetDisplayValue()

ResetDisplayValue resets all changes to the "display_value" field.

func (*DimensionMutation) ResetEdge

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

func (m *DimensionMutation) 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 (*DimensionMutation) ResetItem

func (m *DimensionMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*DimensionMutation) ResetMeta

func (m *DimensionMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*DimensionMutation) ResetTitle

func (m *DimensionMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*DimensionMutation) ResetValue

func (m *DimensionMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*DimensionMutation) SetCreateTime

func (m *DimensionMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DimensionMutation) SetDisplayTitle

func (m *DimensionMutation) SetDisplayTitle(value map[string]string)

SetDisplayTitle sets the "display_title" field.

func (*DimensionMutation) SetDisplayValue

func (m *DimensionMutation) SetDisplayValue(value map[string]string)

SetDisplayValue sets the "display_value" field.

func (*DimensionMutation) SetField

func (m *DimensionMutation) 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 (*DimensionMutation) SetMeta

func (m *DimensionMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*DimensionMutation) SetTitle

func (m *DimensionMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*DimensionMutation) SetValue

func (m *DimensionMutation) SetValue(s string)

SetValue sets the "value" field.

func (*DimensionMutation) Title

func (m *DimensionMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (DimensionMutation) Tx

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

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

func (*DimensionMutation) Type

func (m *DimensionMutation) Type() string

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

func (*DimensionMutation) Value

func (m *DimensionMutation) Value() (r string, exists bool)

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

func (*DimensionMutation) Where

func (m *DimensionMutation) Where(ps ...predicate.Dimension)

Where appends a list predicates to the DimensionMutation builder.

type DimensionQuery

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

DimensionQuery is the builder for querying Dimension entities.

func (*DimensionQuery) All

func (dq *DimensionQuery) All(ctx context.Context) ([]*Dimension, error)

All executes the query and returns a list of Dimensions.

func (*DimensionQuery) AllX

func (dq *DimensionQuery) AllX(ctx context.Context) []*Dimension

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

func (*DimensionQuery) Clone

func (dq *DimensionQuery) Clone() *DimensionQuery

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

func (*DimensionQuery) Count

func (dq *DimensionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DimensionQuery) CountX

func (dq *DimensionQuery) CountX(ctx context.Context) int

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

func (*DimensionQuery) Exist

func (dq *DimensionQuery) Exist(ctx context.Context) (bool, error)

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

func (*DimensionQuery) ExistX

func (dq *DimensionQuery) ExistX(ctx context.Context) bool

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

func (*DimensionQuery) First

func (dq *DimensionQuery) First(ctx context.Context) (*Dimension, error)

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

func (*DimensionQuery) FirstID

func (dq *DimensionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DimensionQuery) FirstIDX

func (dq *DimensionQuery) FirstIDX(ctx context.Context) int

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

func (*DimensionQuery) FirstX

func (dq *DimensionQuery) FirstX(ctx context.Context) *Dimension

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

func (*DimensionQuery) GroupBy

func (dq *DimensionQuery) GroupBy(field string, fields ...string) *DimensionGroupBy

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

client.Dimension.Query().
	GroupBy(dimension.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DimensionQuery) IDs

func (dq *DimensionQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DimensionQuery) IDsX

func (dq *DimensionQuery) IDsX(ctx context.Context) []int

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

func (*DimensionQuery) Limit

func (dq *DimensionQuery) Limit(limit int) *DimensionQuery

Limit adds a limit step to the query.

func (*DimensionQuery) Offset

func (dq *DimensionQuery) Offset(offset int) *DimensionQuery

Offset adds an offset step to the query.

func (*DimensionQuery) Only

func (dq *DimensionQuery) Only(ctx context.Context) (*Dimension, error)

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

func (*DimensionQuery) OnlyID

func (dq *DimensionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DimensionQuery) OnlyIDX

func (dq *DimensionQuery) OnlyIDX(ctx context.Context) int

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

func (*DimensionQuery) OnlyX

func (dq *DimensionQuery) OnlyX(ctx context.Context) *Dimension

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

func (*DimensionQuery) Order

func (dq *DimensionQuery) Order(o ...OrderFunc) *DimensionQuery

Order adds an order step to the query.

func (*DimensionQuery) QueryItem

func (dq *DimensionQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*DimensionQuery) Select

func (dq *DimensionQuery) Select(fields ...string) *DimensionSelect

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

client.Dimension.Query().
	Select(dimension.FieldCreateTime).
	Scan(ctx, &v)

func (*DimensionQuery) Unique

func (dq *DimensionQuery) Unique(unique bool) *DimensionQuery

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

Where adds a new predicate for the DimensionQuery builder.

func (*DimensionQuery) WithItem

func (dq *DimensionQuery) WithItem(opts ...func(*ItemQuery)) *DimensionQuery

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

type DimensionSelect

type DimensionSelect struct {
	*DimensionQuery
	// contains filtered or unexported fields
}

DimensionSelect is the builder for selecting fields of Dimension entities.

func (*DimensionSelect) Bool

func (ds *DimensionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DimensionSelect) BoolX

func (ds *DimensionSelect) BoolX(ctx context.Context) bool

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

func (*DimensionSelect) Bools

func (ds *DimensionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DimensionSelect) BoolsX

func (ds *DimensionSelect) BoolsX(ctx context.Context) []bool

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

func (*DimensionSelect) Float64

func (ds *DimensionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DimensionSelect) Float64X

func (ds *DimensionSelect) Float64X(ctx context.Context) float64

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

func (*DimensionSelect) Float64s

func (ds *DimensionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DimensionSelect) Float64sX

func (ds *DimensionSelect) Float64sX(ctx context.Context) []float64

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

func (*DimensionSelect) Int

func (ds *DimensionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DimensionSelect) IntX

func (ds *DimensionSelect) IntX(ctx context.Context) int

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

func (*DimensionSelect) Ints

func (ds *DimensionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DimensionSelect) IntsX

func (ds *DimensionSelect) IntsX(ctx context.Context) []int

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

func (*DimensionSelect) Scan

func (ds *DimensionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DimensionSelect) ScanX

func (ds *DimensionSelect) ScanX(ctx context.Context, v interface{})

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

func (*DimensionSelect) String

func (ds *DimensionSelect) String(ctx context.Context) (_ string, err error)

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

func (*DimensionSelect) StringX

func (ds *DimensionSelect) StringX(ctx context.Context) string

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

func (*DimensionSelect) Strings

func (ds *DimensionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DimensionSelect) StringsX

func (ds *DimensionSelect) StringsX(ctx context.Context) []string

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

type DimensionUpdate

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

DimensionUpdate is the builder for updating Dimension entities.

func (*DimensionUpdate) AddItem

func (du *DimensionUpdate) AddItem(i ...*Item) *DimensionUpdate

AddItem adds the "item" edges to the Item entity.

func (*DimensionUpdate) AddItemIDs

func (du *DimensionUpdate) AddItemIDs(ids ...int) *DimensionUpdate

AddItemIDs adds the "item" edge to the Item entity by IDs.

func (*DimensionUpdate) ClearDisplayTitle

func (du *DimensionUpdate) ClearDisplayTitle() *DimensionUpdate

ClearDisplayTitle clears the value of the "display_title" field.

func (*DimensionUpdate) ClearDisplayValue

func (du *DimensionUpdate) ClearDisplayValue() *DimensionUpdate

ClearDisplayValue clears the value of the "display_value" field.

func (*DimensionUpdate) ClearItem

func (du *DimensionUpdate) ClearItem() *DimensionUpdate

ClearItem clears all "item" edges to the Item entity.

func (*DimensionUpdate) ClearMeta

func (du *DimensionUpdate) ClearMeta() *DimensionUpdate

ClearMeta clears the value of the "meta" field.

func (*DimensionUpdate) Exec

func (du *DimensionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DimensionUpdate) ExecX

func (du *DimensionUpdate) ExecX(ctx context.Context)

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

func (*DimensionUpdate) Mutation

func (du *DimensionUpdate) Mutation() *DimensionMutation

Mutation returns the DimensionMutation object of the builder.

func (*DimensionUpdate) RemoveItem

func (du *DimensionUpdate) RemoveItem(i ...*Item) *DimensionUpdate

RemoveItem removes "item" edges to Item entities.

func (*DimensionUpdate) RemoveItemIDs

func (du *DimensionUpdate) RemoveItemIDs(ids ...int) *DimensionUpdate

RemoveItemIDs removes the "item" edge to Item entities by IDs.

func (*DimensionUpdate) Save

func (du *DimensionUpdate) Save(ctx context.Context) (int, error)

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

func (*DimensionUpdate) SaveX

func (du *DimensionUpdate) SaveX(ctx context.Context) int

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

func (*DimensionUpdate) SetDisplayTitle

func (du *DimensionUpdate) SetDisplayTitle(m map[string]string) *DimensionUpdate

SetDisplayTitle sets the "display_title" field.

func (*DimensionUpdate) SetDisplayValue

func (du *DimensionUpdate) SetDisplayValue(m map[string]string) *DimensionUpdate

SetDisplayValue sets the "display_value" field.

func (*DimensionUpdate) SetMeta

func (du *DimensionUpdate) SetMeta(m map[string]interface{}) *DimensionUpdate

SetMeta sets the "meta" field.

func (*DimensionUpdate) SetTitle

func (du *DimensionUpdate) SetTitle(s string) *DimensionUpdate

SetTitle sets the "title" field.

func (*DimensionUpdate) SetValue

func (du *DimensionUpdate) SetValue(s string) *DimensionUpdate

SetValue sets the "value" field.

func (*DimensionUpdate) Where

Where appends a list predicates to the DimensionUpdate builder.

type DimensionUpdateOne

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

DimensionUpdateOne is the builder for updating a single Dimension entity.

func (*DimensionUpdateOne) AddItem

func (duo *DimensionUpdateOne) AddItem(i ...*Item) *DimensionUpdateOne

AddItem adds the "item" edges to the Item entity.

func (*DimensionUpdateOne) AddItemIDs

func (duo *DimensionUpdateOne) AddItemIDs(ids ...int) *DimensionUpdateOne

AddItemIDs adds the "item" edge to the Item entity by IDs.

func (*DimensionUpdateOne) ClearDisplayTitle

func (duo *DimensionUpdateOne) ClearDisplayTitle() *DimensionUpdateOne

ClearDisplayTitle clears the value of the "display_title" field.

func (*DimensionUpdateOne) ClearDisplayValue

func (duo *DimensionUpdateOne) ClearDisplayValue() *DimensionUpdateOne

ClearDisplayValue clears the value of the "display_value" field.

func (*DimensionUpdateOne) ClearItem

func (duo *DimensionUpdateOne) ClearItem() *DimensionUpdateOne

ClearItem clears all "item" edges to the Item entity.

func (*DimensionUpdateOne) ClearMeta

func (duo *DimensionUpdateOne) ClearMeta() *DimensionUpdateOne

ClearMeta clears the value of the "meta" field.

func (*DimensionUpdateOne) Exec

func (duo *DimensionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DimensionUpdateOne) ExecX

func (duo *DimensionUpdateOne) ExecX(ctx context.Context)

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

func (*DimensionUpdateOne) Mutation

func (duo *DimensionUpdateOne) Mutation() *DimensionMutation

Mutation returns the DimensionMutation object of the builder.

func (*DimensionUpdateOne) RemoveItem

func (duo *DimensionUpdateOne) RemoveItem(i ...*Item) *DimensionUpdateOne

RemoveItem removes "item" edges to Item entities.

func (*DimensionUpdateOne) RemoveItemIDs

func (duo *DimensionUpdateOne) RemoveItemIDs(ids ...int) *DimensionUpdateOne

RemoveItemIDs removes the "item" edge to Item entities by IDs.

func (*DimensionUpdateOne) Save

func (duo *DimensionUpdateOne) Save(ctx context.Context) (*Dimension, error)

Save executes the query and returns the updated Dimension entity.

func (*DimensionUpdateOne) SaveX

func (duo *DimensionUpdateOne) SaveX(ctx context.Context) *Dimension

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

func (*DimensionUpdateOne) Select

func (duo *DimensionUpdateOne) Select(field string, fields ...string) *DimensionUpdateOne

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

func (*DimensionUpdateOne) SetDisplayTitle

func (duo *DimensionUpdateOne) SetDisplayTitle(m map[string]string) *DimensionUpdateOne

SetDisplayTitle sets the "display_title" field.

func (*DimensionUpdateOne) SetDisplayValue

func (duo *DimensionUpdateOne) SetDisplayValue(m map[string]string) *DimensionUpdateOne

SetDisplayValue sets the "display_value" field.

func (*DimensionUpdateOne) SetMeta

func (duo *DimensionUpdateOne) SetMeta(m map[string]interface{}) *DimensionUpdateOne

SetMeta sets the "meta" field.

func (*DimensionUpdateOne) SetTitle

func (duo *DimensionUpdateOne) SetTitle(s string) *DimensionUpdateOne

SetTitle sets the "title" field.

func (*DimensionUpdateOne) SetValue

func (duo *DimensionUpdateOne) SetValue(s string) *DimensionUpdateOne

SetValue sets the "value" field.

type Dimensions

type Dimensions []*Dimension

Dimensions is a parsable slice of Dimension.

type Hook

type Hook = ent.Hook

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

type Item

type Item struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Value holds the value of the "value" field.
	Value float64 `json:"value,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemQuery when eager-loading is set.
	Edges ItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

Item is the model entity for the Item schema.

func (*Item) QueryDimensions

func (i *Item) QueryDimensions() *DimensionQuery

QueryDimensions queries the "dimensions" edge of the Item entity.

func (*Item) QueryMetric

func (i *Item) QueryMetric() *MetricQuery

QueryMetric queries the "metric" edge of the Item entity.

func (*Item) QueryTaskInstance

func (i *Item) QueryTaskInstance() *TaskInstanceQuery

QueryTaskInstance queries the "task_instance" edge of the Item entity.

func (*Item) String

func (i *Item) String() string

String implements the fmt.Stringer.

func (*Item) Unwrap

func (i *Item) Unwrap() *Item

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

func (i *Item) Update() *ItemUpdateOne

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

type ItemClient

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

ItemClient is a client for the Item schema.

func NewItemClient

func NewItemClient(c config) *ItemClient

NewItemClient returns a client for the Item from the given config.

func (*ItemClient) Create

func (c *ItemClient) Create() *ItemCreate

Create returns a create builder for Item.

func (*ItemClient) CreateBulk

func (c *ItemClient) CreateBulk(builders ...*ItemCreate) *ItemCreateBulk

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

func (*ItemClient) Delete

func (c *ItemClient) Delete() *ItemDelete

Delete returns a delete builder for Item.

func (*ItemClient) DeleteOne

func (c *ItemClient) DeleteOne(i *Item) *ItemDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ItemClient) DeleteOneID

func (c *ItemClient) DeleteOneID(id int) *ItemDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ItemClient) Get

func (c *ItemClient) Get(ctx context.Context, id int) (*Item, error)

Get returns a Item entity by its id.

func (*ItemClient) GetX

func (c *ItemClient) GetX(ctx context.Context, id int) *Item

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

func (*ItemClient) Hooks

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

Hooks returns the client hooks.

func (*ItemClient) Query

func (c *ItemClient) Query() *ItemQuery

Query returns a query builder for Item.

func (*ItemClient) QueryDimensions

func (c *ItemClient) QueryDimensions(i *Item) *DimensionQuery

QueryDimensions queries the dimensions edge of a Item.

func (*ItemClient) QueryMetric

func (c *ItemClient) QueryMetric(i *Item) *MetricQuery

QueryMetric queries the metric edge of a Item.

func (*ItemClient) QueryTaskInstance

func (c *ItemClient) QueryTaskInstance(i *Item) *TaskInstanceQuery

QueryTaskInstance queries the task_instance edge of a Item.

func (*ItemClient) Update

func (c *ItemClient) Update() *ItemUpdate

Update returns an update builder for Item.

func (*ItemClient) UpdateOne

func (c *ItemClient) UpdateOne(i *Item) *ItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemClient) UpdateOneID

func (c *ItemClient) UpdateOneID(id int) *ItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ItemClient) Use

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

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

type ItemCreate

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

ItemCreate is the builder for creating a Item entity.

func (*ItemCreate) AddDimensionIDs

func (ic *ItemCreate) AddDimensionIDs(ids ...int) *ItemCreate

AddDimensionIDs adds the "dimensions" edge to the Dimension entity by IDs.

func (*ItemCreate) AddDimensions

func (ic *ItemCreate) AddDimensions(d ...*Dimension) *ItemCreate

AddDimensions adds the "dimensions" edges to the Dimension entity.

func (*ItemCreate) Exec

func (ic *ItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreate) ExecX

func (ic *ItemCreate) ExecX(ctx context.Context)

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

func (*ItemCreate) Mutation

func (ic *ItemCreate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemCreate) Save

func (ic *ItemCreate) Save(ctx context.Context) (*Item, error)

Save creates the Item in the database.

func (*ItemCreate) SaveX

func (ic *ItemCreate) SaveX(ctx context.Context) *Item

SaveX calls Save and panics if Save returns an error.

func (*ItemCreate) SetCreateTime

func (ic *ItemCreate) SetCreateTime(t time.Time) *ItemCreate

SetCreateTime sets the "create_time" field.

func (*ItemCreate) SetMeta

func (ic *ItemCreate) SetMeta(m map[string]interface{}) *ItemCreate

SetMeta sets the "meta" field.

func (*ItemCreate) SetMetric

func (ic *ItemCreate) SetMetric(m *Metric) *ItemCreate

SetMetric sets the "metric" edge to the Metric entity.

func (*ItemCreate) SetMetricID

func (ic *ItemCreate) SetMetricID(id int) *ItemCreate

SetMetricID sets the "metric" edge to the Metric entity by ID.

func (*ItemCreate) SetNillableCreateTime

func (ic *ItemCreate) SetNillableCreateTime(t *time.Time) *ItemCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ItemCreate) SetNillableTimestamp

func (ic *ItemCreate) SetNillableTimestamp(t *time.Time) *ItemCreate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*ItemCreate) SetNillableUpdateTime

func (ic *ItemCreate) SetNillableUpdateTime(t *time.Time) *ItemCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ItemCreate) SetTaskInstance

func (ic *ItemCreate) SetTaskInstance(t *TaskInstance) *ItemCreate

SetTaskInstance sets the "task_instance" edge to the TaskInstance entity.

func (*ItemCreate) SetTaskInstanceID

func (ic *ItemCreate) SetTaskInstanceID(id int) *ItemCreate

SetTaskInstanceID sets the "task_instance" edge to the TaskInstance entity by ID.

func (*ItemCreate) SetTimestamp

func (ic *ItemCreate) SetTimestamp(t time.Time) *ItemCreate

SetTimestamp sets the "timestamp" field.

func (*ItemCreate) SetUpdateTime

func (ic *ItemCreate) SetUpdateTime(t time.Time) *ItemCreate

SetUpdateTime sets the "update_time" field.

func (*ItemCreate) SetValue

func (ic *ItemCreate) SetValue(f float64) *ItemCreate

SetValue sets the "value" field.

type ItemCreateBulk

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

ItemCreateBulk is the builder for creating many Item entities in bulk.

func (*ItemCreateBulk) Exec

func (icb *ItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreateBulk) ExecX

func (icb *ItemCreateBulk) ExecX(ctx context.Context)

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

func (*ItemCreateBulk) Save

func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error)

Save creates the Item entities in the database.

func (*ItemCreateBulk) SaveX

func (icb *ItemCreateBulk) SaveX(ctx context.Context) []*Item

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

type ItemDelete

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

ItemDelete is the builder for deleting a Item entity.

func (*ItemDelete) Exec

func (id *ItemDelete) Exec(ctx context.Context) (int, error)

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

func (*ItemDelete) ExecX

func (id *ItemDelete) ExecX(ctx context.Context) int

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

func (*ItemDelete) Where

func (id *ItemDelete) Where(ps ...predicate.Item) *ItemDelete

Where appends a list predicates to the ItemDelete builder.

type ItemDeleteOne

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

ItemDeleteOne is the builder for deleting a single Item entity.

func (*ItemDeleteOne) Exec

func (ido *ItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ItemDeleteOne) ExecX

func (ido *ItemDeleteOne) ExecX(ctx context.Context)

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

type ItemEdges

type ItemEdges struct {
	// Dimensions holds the value of the dimensions edge.
	Dimensions []*Dimension `json:"dimensions,omitempty"`
	// TaskInstance holds the value of the task_instance edge.
	TaskInstance *TaskInstance `json:"task_instance,omitempty"`
	// Metric holds the value of the metric edge.
	Metric *Metric `json:"metric,omitempty"`
	// contains filtered or unexported fields
}

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

func (ItemEdges) DimensionsOrErr

func (e ItemEdges) DimensionsOrErr() ([]*Dimension, error)

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

func (ItemEdges) MetricOrErr

func (e ItemEdges) MetricOrErr() (*Metric, error)

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

func (ItemEdges) TaskInstanceOrErr

func (e ItemEdges) TaskInstanceOrErr() (*TaskInstance, error)

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

type ItemGroupBy

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

ItemGroupBy is the group-by builder for Item entities.

func (*ItemGroupBy) Aggregate

func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy

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

func (*ItemGroupBy) Bool

func (igb *ItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) BoolX

func (igb *ItemGroupBy) BoolX(ctx context.Context) bool

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

func (*ItemGroupBy) Bools

func (igb *ItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) BoolsX

func (igb *ItemGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ItemGroupBy) Float64

func (igb *ItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) Float64X

func (igb *ItemGroupBy) Float64X(ctx context.Context) float64

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

func (*ItemGroupBy) Float64s

func (igb *ItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) Float64sX

func (igb *ItemGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ItemGroupBy) Int

func (igb *ItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) IntX

func (igb *ItemGroupBy) IntX(ctx context.Context) int

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

func (*ItemGroupBy) Ints

func (igb *ItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) IntsX

func (igb *ItemGroupBy) IntsX(ctx context.Context) []int

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

func (*ItemGroupBy) Scan

func (igb *ItemGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ItemGroupBy) ScanX

func (igb *ItemGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ItemGroupBy) String

func (igb *ItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) StringX

func (igb *ItemGroupBy) StringX(ctx context.Context) string

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

func (*ItemGroupBy) Strings

func (igb *ItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*ItemGroupBy) StringsX

func (igb *ItemGroupBy) StringsX(ctx context.Context) []string

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

type ItemMutation

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

ItemMutation represents an operation that mutates the Item nodes in the graph.

func (*ItemMutation) AddDimensionIDs

func (m *ItemMutation) AddDimensionIDs(ids ...int)

AddDimensionIDs adds the "dimensions" edge to the Dimension entity by ids.

func (*ItemMutation) AddField

func (m *ItemMutation) 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 (*ItemMutation) AddValue

func (m *ItemMutation) AddValue(f float64)

AddValue adds f to the "value" field.

func (*ItemMutation) AddedEdges

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

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

func (*ItemMutation) AddedField

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

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

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

func (*ItemMutation) AddedIDs

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

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

func (*ItemMutation) AddedValue

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

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

func (*ItemMutation) ClearDimensions

func (m *ItemMutation) ClearDimensions()

ClearDimensions clears the "dimensions" edge to the Dimension entity.

func (*ItemMutation) ClearEdge

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

func (m *ItemMutation) 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 (*ItemMutation) ClearMeta

func (m *ItemMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*ItemMutation) ClearMetric

func (m *ItemMutation) ClearMetric()

ClearMetric clears the "metric" edge to the Metric entity.

func (*ItemMutation) ClearTaskInstance

func (m *ItemMutation) ClearTaskInstance()

ClearTaskInstance clears the "task_instance" edge to the TaskInstance entity.

func (*ItemMutation) ClearedEdges

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

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

func (*ItemMutation) ClearedFields

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

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

func (ItemMutation) Client

func (m ItemMutation) 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 (*ItemMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*ItemMutation) DimensionsCleared

func (m *ItemMutation) DimensionsCleared() bool

DimensionsCleared reports if the "dimensions" edge to the Dimension entity was cleared.

func (*ItemMutation) DimensionsIDs

func (m *ItemMutation) DimensionsIDs() (ids []int)

DimensionsIDs returns the "dimensions" edge IDs in the mutation.

func (*ItemMutation) EdgeCleared

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

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

func (*ItemMutation) Field

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

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

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

func (*ItemMutation) Fields

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

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

func (m *ItemMutation) 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 (*ItemMutation) Meta

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

Meta returns the value of the "meta" field in the mutation.

func (*ItemMutation) MetaCleared

func (m *ItemMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*ItemMutation) MetricCleared

func (m *ItemMutation) MetricCleared() bool

MetricCleared reports if the "metric" edge to the Metric entity was cleared.

func (*ItemMutation) MetricID

func (m *ItemMutation) MetricID() (id int, exists bool)

MetricID returns the "metric" edge ID in the mutation.

func (*ItemMutation) MetricIDs

func (m *ItemMutation) MetricIDs() (ids []int)

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

func (*ItemMutation) OldCreateTime

func (m *ItemMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Item entity. If the Item 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 (*ItemMutation) OldField

func (m *ItemMutation) 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 (*ItemMutation) OldMeta

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

OldMeta returns the old "meta" field's value of the Item entity. If the Item 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 (*ItemMutation) OldTimestamp

func (m *ItemMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the Item entity. If the Item 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 (*ItemMutation) OldUpdateTime

func (m *ItemMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Item entity. If the Item 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 (*ItemMutation) OldValue

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

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

func (m *ItemMutation) Op() Op

Op returns the operation name.

func (*ItemMutation) RemoveDimensionIDs

func (m *ItemMutation) RemoveDimensionIDs(ids ...int)

RemoveDimensionIDs removes the "dimensions" edge to the Dimension entity by IDs.

func (*ItemMutation) RemovedDimensionsIDs

func (m *ItemMutation) RemovedDimensionsIDs() (ids []int)

RemovedDimensions returns the removed IDs of the "dimensions" edge to the Dimension entity.

func (*ItemMutation) RemovedEdges

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

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

func (*ItemMutation) RemovedIDs

func (m *ItemMutation) 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 (*ItemMutation) ResetCreateTime

func (m *ItemMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ItemMutation) ResetDimensions

func (m *ItemMutation) ResetDimensions()

ResetDimensions resets all changes to the "dimensions" edge.

func (*ItemMutation) ResetEdge

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

func (m *ItemMutation) 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 (*ItemMutation) ResetMeta

func (m *ItemMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*ItemMutation) ResetMetric

func (m *ItemMutation) ResetMetric()

ResetMetric resets all changes to the "metric" edge.

func (*ItemMutation) ResetTaskInstance

func (m *ItemMutation) ResetTaskInstance()

ResetTaskInstance resets all changes to the "task_instance" edge.

func (*ItemMutation) ResetTimestamp

func (m *ItemMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*ItemMutation) ResetUpdateTime

func (m *ItemMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ItemMutation) ResetValue

func (m *ItemMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*ItemMutation) SetCreateTime

func (m *ItemMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ItemMutation) SetField

func (m *ItemMutation) 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 (*ItemMutation) SetMeta

func (m *ItemMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*ItemMutation) SetMetricID

func (m *ItemMutation) SetMetricID(id int)

SetMetricID sets the "metric" edge to the Metric entity by id.

func (*ItemMutation) SetTaskInstanceID

func (m *ItemMutation) SetTaskInstanceID(id int)

SetTaskInstanceID sets the "task_instance" edge to the TaskInstance entity by id.

func (*ItemMutation) SetTimestamp

func (m *ItemMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*ItemMutation) SetUpdateTime

func (m *ItemMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ItemMutation) SetValue

func (m *ItemMutation) SetValue(f float64)

SetValue sets the "value" field.

func (*ItemMutation) TaskInstanceCleared

func (m *ItemMutation) TaskInstanceCleared() bool

TaskInstanceCleared reports if the "task_instance" edge to the TaskInstance entity was cleared.

func (*ItemMutation) TaskInstanceID

func (m *ItemMutation) TaskInstanceID() (id int, exists bool)

TaskInstanceID returns the "task_instance" edge ID in the mutation.

func (*ItemMutation) TaskInstanceIDs

func (m *ItemMutation) TaskInstanceIDs() (ids []int)

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

func (*ItemMutation) Timestamp

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

Timestamp returns the value of the "timestamp" field in the mutation.

func (ItemMutation) Tx

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

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

func (*ItemMutation) Type

func (m *ItemMutation) Type() string

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

func (*ItemMutation) UpdateTime

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

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ItemMutation) Value

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

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

func (*ItemMutation) Where

func (m *ItemMutation) Where(ps ...predicate.Item)

Where appends a list predicates to the ItemMutation builder.

type ItemQuery

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

ItemQuery is the builder for querying Item entities.

func (*ItemQuery) All

func (iq *ItemQuery) All(ctx context.Context) ([]*Item, error)

All executes the query and returns a list of Items.

func (*ItemQuery) AllX

func (iq *ItemQuery) AllX(ctx context.Context) []*Item

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

func (*ItemQuery) Clone

func (iq *ItemQuery) Clone() *ItemQuery

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

func (*ItemQuery) Count

func (iq *ItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemQuery) CountX

func (iq *ItemQuery) CountX(ctx context.Context) int

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

func (*ItemQuery) Exist

func (iq *ItemQuery) Exist(ctx context.Context) (bool, error)

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

func (*ItemQuery) ExistX

func (iq *ItemQuery) ExistX(ctx context.Context) bool

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

func (*ItemQuery) First

func (iq *ItemQuery) First(ctx context.Context) (*Item, error)

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

func (*ItemQuery) FirstID

func (iq *ItemQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ItemQuery) FirstIDX

func (iq *ItemQuery) FirstIDX(ctx context.Context) int

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

func (*ItemQuery) FirstX

func (iq *ItemQuery) FirstX(ctx context.Context) *Item

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

func (*ItemQuery) GroupBy

func (iq *ItemQuery) GroupBy(field string, fields ...string) *ItemGroupBy

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

client.Item.Query().
	GroupBy(item.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemQuery) IDs

func (iq *ItemQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ItemQuery) IDsX

func (iq *ItemQuery) IDsX(ctx context.Context) []int

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

func (*ItemQuery) Limit

func (iq *ItemQuery) Limit(limit int) *ItemQuery

Limit adds a limit step to the query.

func (*ItemQuery) Offset

func (iq *ItemQuery) Offset(offset int) *ItemQuery

Offset adds an offset step to the query.

func (*ItemQuery) Only

func (iq *ItemQuery) Only(ctx context.Context) (*Item, error)

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

func (*ItemQuery) OnlyID

func (iq *ItemQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ItemQuery) OnlyIDX

func (iq *ItemQuery) OnlyIDX(ctx context.Context) int

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

func (*ItemQuery) OnlyX

func (iq *ItemQuery) OnlyX(ctx context.Context) *Item

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

func (*ItemQuery) Order

func (iq *ItemQuery) Order(o ...OrderFunc) *ItemQuery

Order adds an order step to the query.

func (*ItemQuery) QueryDimensions

func (iq *ItemQuery) QueryDimensions() *DimensionQuery

QueryDimensions chains the current query on the "dimensions" edge.

func (*ItemQuery) QueryMetric

func (iq *ItemQuery) QueryMetric() *MetricQuery

QueryMetric chains the current query on the "metric" edge.

func (*ItemQuery) QueryTaskInstance

func (iq *ItemQuery) QueryTaskInstance() *TaskInstanceQuery

QueryTaskInstance chains the current query on the "task_instance" edge.

func (*ItemQuery) Select

func (iq *ItemQuery) Select(fields ...string) *ItemSelect

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

client.Item.Query().
	Select(item.FieldCreateTime).
	Scan(ctx, &v)

func (*ItemQuery) Unique

func (iq *ItemQuery) Unique(unique bool) *ItemQuery

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

func (iq *ItemQuery) Where(ps ...predicate.Item) *ItemQuery

Where adds a new predicate for the ItemQuery builder.

func (*ItemQuery) WithDimensions

func (iq *ItemQuery) WithDimensions(opts ...func(*DimensionQuery)) *ItemQuery

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

func (*ItemQuery) WithMetric

func (iq *ItemQuery) WithMetric(opts ...func(*MetricQuery)) *ItemQuery

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

func (*ItemQuery) WithTaskInstance

func (iq *ItemQuery) WithTaskInstance(opts ...func(*TaskInstanceQuery)) *ItemQuery

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

type ItemSelect

type ItemSelect struct {
	*ItemQuery
	// contains filtered or unexported fields
}

ItemSelect is the builder for selecting fields of Item entities.

func (*ItemSelect) Bool

func (is *ItemSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ItemSelect) BoolX

func (is *ItemSelect) BoolX(ctx context.Context) bool

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

func (*ItemSelect) Bools

func (is *ItemSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ItemSelect) BoolsX

func (is *ItemSelect) BoolsX(ctx context.Context) []bool

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

func (*ItemSelect) Float64

func (is *ItemSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ItemSelect) Float64X

func (is *ItemSelect) Float64X(ctx context.Context) float64

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

func (*ItemSelect) Float64s

func (is *ItemSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ItemSelect) Float64sX

func (is *ItemSelect) Float64sX(ctx context.Context) []float64

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

func (*ItemSelect) Int

func (is *ItemSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ItemSelect) IntX

func (is *ItemSelect) IntX(ctx context.Context) int

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

func (*ItemSelect) Ints

func (is *ItemSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ItemSelect) IntsX

func (is *ItemSelect) IntsX(ctx context.Context) []int

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

func (*ItemSelect) Scan

func (is *ItemSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ItemSelect) ScanX

func (is *ItemSelect) ScanX(ctx context.Context, v interface{})

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

func (*ItemSelect) String

func (is *ItemSelect) String(ctx context.Context) (_ string, err error)

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

func (*ItemSelect) StringX

func (is *ItemSelect) StringX(ctx context.Context) string

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

func (*ItemSelect) Strings

func (is *ItemSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ItemSelect) StringsX

func (is *ItemSelect) StringsX(ctx context.Context) []string

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

type ItemUpdate

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

ItemUpdate is the builder for updating Item entities.

func (*ItemUpdate) AddDimensionIDs

func (iu *ItemUpdate) AddDimensionIDs(ids ...int) *ItemUpdate

AddDimensionIDs adds the "dimensions" edge to the Dimension entity by IDs.

func (*ItemUpdate) AddDimensions

func (iu *ItemUpdate) AddDimensions(d ...*Dimension) *ItemUpdate

AddDimensions adds the "dimensions" edges to the Dimension entity.

func (*ItemUpdate) AddValue

func (iu *ItemUpdate) AddValue(f float64) *ItemUpdate

AddValue adds f to the "value" field.

func (*ItemUpdate) ClearDimensions

func (iu *ItemUpdate) ClearDimensions() *ItemUpdate

ClearDimensions clears all "dimensions" edges to the Dimension entity.

func (*ItemUpdate) ClearMeta

func (iu *ItemUpdate) ClearMeta() *ItemUpdate

ClearMeta clears the value of the "meta" field.

func (*ItemUpdate) ClearMetric

func (iu *ItemUpdate) ClearMetric() *ItemUpdate

ClearMetric clears the "metric" edge to the Metric entity.

func (*ItemUpdate) ClearTaskInstance

func (iu *ItemUpdate) ClearTaskInstance() *ItemUpdate

ClearTaskInstance clears the "task_instance" edge to the TaskInstance entity.

func (*ItemUpdate) Exec

func (iu *ItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpdate) ExecX

func (iu *ItemUpdate) ExecX(ctx context.Context)

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

func (*ItemUpdate) Mutation

func (iu *ItemUpdate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdate) RemoveDimensionIDs

func (iu *ItemUpdate) RemoveDimensionIDs(ids ...int) *ItemUpdate

RemoveDimensionIDs removes the "dimensions" edge to Dimension entities by IDs.

func (*ItemUpdate) RemoveDimensions

func (iu *ItemUpdate) RemoveDimensions(d ...*Dimension) *ItemUpdate

RemoveDimensions removes "dimensions" edges to Dimension entities.

func (*ItemUpdate) Save

func (iu *ItemUpdate) Save(ctx context.Context) (int, error)

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

func (*ItemUpdate) SaveX

func (iu *ItemUpdate) SaveX(ctx context.Context) int

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

func (*ItemUpdate) SetMeta

func (iu *ItemUpdate) SetMeta(m map[string]interface{}) *ItemUpdate

SetMeta sets the "meta" field.

func (*ItemUpdate) SetMetric

func (iu *ItemUpdate) SetMetric(m *Metric) *ItemUpdate

SetMetric sets the "metric" edge to the Metric entity.

func (*ItemUpdate) SetMetricID

func (iu *ItemUpdate) SetMetricID(id int) *ItemUpdate

SetMetricID sets the "metric" edge to the Metric entity by ID.

func (*ItemUpdate) SetNillableTimestamp

func (iu *ItemUpdate) SetNillableTimestamp(t *time.Time) *ItemUpdate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*ItemUpdate) SetTaskInstance

func (iu *ItemUpdate) SetTaskInstance(t *TaskInstance) *ItemUpdate

SetTaskInstance sets the "task_instance" edge to the TaskInstance entity.

func (*ItemUpdate) SetTaskInstanceID

func (iu *ItemUpdate) SetTaskInstanceID(id int) *ItemUpdate

SetTaskInstanceID sets the "task_instance" edge to the TaskInstance entity by ID.

func (*ItemUpdate) SetTimestamp

func (iu *ItemUpdate) SetTimestamp(t time.Time) *ItemUpdate

SetTimestamp sets the "timestamp" field.

func (*ItemUpdate) SetUpdateTime

func (iu *ItemUpdate) SetUpdateTime(t time.Time) *ItemUpdate

SetUpdateTime sets the "update_time" field.

func (*ItemUpdate) SetValue

func (iu *ItemUpdate) SetValue(f float64) *ItemUpdate

SetValue sets the "value" field.

func (*ItemUpdate) Where

func (iu *ItemUpdate) Where(ps ...predicate.Item) *ItemUpdate

Where appends a list predicates to the ItemUpdate builder.

type ItemUpdateOne

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

ItemUpdateOne is the builder for updating a single Item entity.

func (*ItemUpdateOne) AddDimensionIDs

func (iuo *ItemUpdateOne) AddDimensionIDs(ids ...int) *ItemUpdateOne

AddDimensionIDs adds the "dimensions" edge to the Dimension entity by IDs.

func (*ItemUpdateOne) AddDimensions

func (iuo *ItemUpdateOne) AddDimensions(d ...*Dimension) *ItemUpdateOne

AddDimensions adds the "dimensions" edges to the Dimension entity.

func (*ItemUpdateOne) AddValue

func (iuo *ItemUpdateOne) AddValue(f float64) *ItemUpdateOne

AddValue adds f to the "value" field.

func (*ItemUpdateOne) ClearDimensions

func (iuo *ItemUpdateOne) ClearDimensions() *ItemUpdateOne

ClearDimensions clears all "dimensions" edges to the Dimension entity.

func (*ItemUpdateOne) ClearMeta

func (iuo *ItemUpdateOne) ClearMeta() *ItemUpdateOne

ClearMeta clears the value of the "meta" field.

func (*ItemUpdateOne) ClearMetric

func (iuo *ItemUpdateOne) ClearMetric() *ItemUpdateOne

ClearMetric clears the "metric" edge to the Metric entity.

func (*ItemUpdateOne) ClearTaskInstance

func (iuo *ItemUpdateOne) ClearTaskInstance() *ItemUpdateOne

ClearTaskInstance clears the "task_instance" edge to the TaskInstance entity.

func (*ItemUpdateOne) Exec

func (iuo *ItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ItemUpdateOne) ExecX

func (iuo *ItemUpdateOne) ExecX(ctx context.Context)

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

func (*ItemUpdateOne) Mutation

func (iuo *ItemUpdateOne) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdateOne) RemoveDimensionIDs

func (iuo *ItemUpdateOne) RemoveDimensionIDs(ids ...int) *ItemUpdateOne

RemoveDimensionIDs removes the "dimensions" edge to Dimension entities by IDs.

func (*ItemUpdateOne) RemoveDimensions

func (iuo *ItemUpdateOne) RemoveDimensions(d ...*Dimension) *ItemUpdateOne

RemoveDimensions removes "dimensions" edges to Dimension entities.

func (*ItemUpdateOne) Save

func (iuo *ItemUpdateOne) Save(ctx context.Context) (*Item, error)

Save executes the query and returns the updated Item entity.

func (*ItemUpdateOne) SaveX

func (iuo *ItemUpdateOne) SaveX(ctx context.Context) *Item

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

func (*ItemUpdateOne) Select

func (iuo *ItemUpdateOne) Select(field string, fields ...string) *ItemUpdateOne

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

func (*ItemUpdateOne) SetMeta

func (iuo *ItemUpdateOne) SetMeta(m map[string]interface{}) *ItemUpdateOne

SetMeta sets the "meta" field.

func (*ItemUpdateOne) SetMetric

func (iuo *ItemUpdateOne) SetMetric(m *Metric) *ItemUpdateOne

SetMetric sets the "metric" edge to the Metric entity.

func (*ItemUpdateOne) SetMetricID

func (iuo *ItemUpdateOne) SetMetricID(id int) *ItemUpdateOne

SetMetricID sets the "metric" edge to the Metric entity by ID.

func (*ItemUpdateOne) SetNillableTimestamp

func (iuo *ItemUpdateOne) SetNillableTimestamp(t *time.Time) *ItemUpdateOne

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*ItemUpdateOne) SetTaskInstance

func (iuo *ItemUpdateOne) SetTaskInstance(t *TaskInstance) *ItemUpdateOne

SetTaskInstance sets the "task_instance" edge to the TaskInstance entity.

func (*ItemUpdateOne) SetTaskInstanceID

func (iuo *ItemUpdateOne) SetTaskInstanceID(id int) *ItemUpdateOne

SetTaskInstanceID sets the "task_instance" edge to the TaskInstance entity by ID.

func (*ItemUpdateOne) SetTimestamp

func (iuo *ItemUpdateOne) SetTimestamp(t time.Time) *ItemUpdateOne

SetTimestamp sets the "timestamp" field.

func (*ItemUpdateOne) SetUpdateTime

func (iuo *ItemUpdateOne) SetUpdateTime(t time.Time) *ItemUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ItemUpdateOne) SetValue

func (iuo *ItemUpdateOne) SetValue(f float64) *ItemUpdateOne

SetValue sets the "value" field.

type Items

type Items []*Item

Items is a parsable slice of Item.

type Metric

type Metric struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// DisplayTitle holds the value of the "display_title" field.
	DisplayTitle map[string]string `json:"display_title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MetricQuery when eager-loading is set.
	Edges MetricEdges `json:"edges"`
	// contains filtered or unexported fields
}

Metric is the model entity for the Metric schema.

func (*Metric) QueryItems

func (m *Metric) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Metric entity.

func (*Metric) QueryTask

func (m *Metric) QueryTask() *TaskQuery

QueryTask queries the "task" edge of the Metric entity.

func (*Metric) String

func (m *Metric) String() string

String implements the fmt.Stringer.

func (*Metric) Unwrap

func (m *Metric) Unwrap() *Metric

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

func (*Metric) Update

func (m *Metric) Update() *MetricUpdateOne

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

type MetricClient

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

MetricClient is a client for the Metric schema.

func NewMetricClient

func NewMetricClient(c config) *MetricClient

NewMetricClient returns a client for the Metric from the given config.

func (*MetricClient) Create

func (c *MetricClient) Create() *MetricCreate

Create returns a create builder for Metric.

func (*MetricClient) CreateBulk

func (c *MetricClient) CreateBulk(builders ...*MetricCreate) *MetricCreateBulk

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

func (*MetricClient) Delete

func (c *MetricClient) Delete() *MetricDelete

Delete returns a delete builder for Metric.

func (*MetricClient) DeleteOne

func (c *MetricClient) DeleteOne(m *Metric) *MetricDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MetricClient) DeleteOneID

func (c *MetricClient) DeleteOneID(id int) *MetricDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MetricClient) Get

func (c *MetricClient) Get(ctx context.Context, id int) (*Metric, error)

Get returns a Metric entity by its id.

func (*MetricClient) GetX

func (c *MetricClient) GetX(ctx context.Context, id int) *Metric

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

func (*MetricClient) Hooks

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

Hooks returns the client hooks.

func (*MetricClient) Query

func (c *MetricClient) Query() *MetricQuery

Query returns a query builder for Metric.

func (*MetricClient) QueryItems

func (c *MetricClient) QueryItems(m *Metric) *ItemQuery

QueryItems queries the items edge of a Metric.

func (*MetricClient) QueryTask

func (c *MetricClient) QueryTask(m *Metric) *TaskQuery

QueryTask queries the task edge of a Metric.

func (*MetricClient) Update

func (c *MetricClient) Update() *MetricUpdate

Update returns an update builder for Metric.

func (*MetricClient) UpdateOne

func (c *MetricClient) UpdateOne(m *Metric) *MetricUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MetricClient) UpdateOneID

func (c *MetricClient) UpdateOneID(id int) *MetricUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MetricClient) Use

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

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

type MetricCreate

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

MetricCreate is the builder for creating a Metric entity.

func (*MetricCreate) AddItemIDs

func (mc *MetricCreate) AddItemIDs(ids ...int) *MetricCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*MetricCreate) AddItems

func (mc *MetricCreate) AddItems(i ...*Item) *MetricCreate

AddItems adds the "items" edges to the Item entity.

func (*MetricCreate) Exec

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

Exec executes the query.

func (*MetricCreate) ExecX

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

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

func (*MetricCreate) Mutation

func (mc *MetricCreate) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricCreate) Save

func (mc *MetricCreate) Save(ctx context.Context) (*Metric, error)

Save creates the Metric in the database.

func (*MetricCreate) SaveX

func (mc *MetricCreate) SaveX(ctx context.Context) *Metric

SaveX calls Save and panics if Save returns an error.

func (*MetricCreate) SetCreateTime

func (mc *MetricCreate) SetCreateTime(t time.Time) *MetricCreate

SetCreateTime sets the "create_time" field.

func (*MetricCreate) SetDescription

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

SetDescription sets the "description" field.

func (*MetricCreate) SetDisplayTitle

func (mc *MetricCreate) SetDisplayTitle(m map[string]string) *MetricCreate

SetDisplayTitle sets the "display_title" field.

func (*MetricCreate) SetMeta

func (mc *MetricCreate) SetMeta(m map[string]interface{}) *MetricCreate

SetMeta sets the "meta" field.

func (*MetricCreate) SetNillableCreateTime

func (mc *MetricCreate) SetNillableCreateTime(t *time.Time) *MetricCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MetricCreate) SetNillableDescription

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

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

func (*MetricCreate) SetNillableUpdateTime

func (mc *MetricCreate) SetNillableUpdateTime(t *time.Time) *MetricCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MetricCreate) SetTask

func (mc *MetricCreate) SetTask(t *Task) *MetricCreate

SetTask sets the "task" edge to the Task entity.

func (*MetricCreate) SetTaskID

func (mc *MetricCreate) SetTaskID(id int) *MetricCreate

SetTaskID sets the "task" edge to the Task entity by ID.

func (*MetricCreate) SetTitle

func (mc *MetricCreate) SetTitle(s string) *MetricCreate

SetTitle sets the "title" field.

func (*MetricCreate) SetUpdateTime

func (mc *MetricCreate) SetUpdateTime(t time.Time) *MetricCreate

SetUpdateTime sets the "update_time" field.

type MetricCreateBulk

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

MetricCreateBulk is the builder for creating many Metric entities in bulk.

func (*MetricCreateBulk) Exec

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

Exec executes the query.

func (*MetricCreateBulk) ExecX

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

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

func (*MetricCreateBulk) Save

func (mcb *MetricCreateBulk) Save(ctx context.Context) ([]*Metric, error)

Save creates the Metric entities in the database.

func (*MetricCreateBulk) SaveX

func (mcb *MetricCreateBulk) SaveX(ctx context.Context) []*Metric

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

type MetricDelete

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

MetricDelete is the builder for deleting a Metric entity.

func (*MetricDelete) Exec

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

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

func (*MetricDelete) ExecX

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

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

func (*MetricDelete) Where

func (md *MetricDelete) Where(ps ...predicate.Metric) *MetricDelete

Where appends a list predicates to the MetricDelete builder.

type MetricDeleteOne

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

MetricDeleteOne is the builder for deleting a single Metric entity.

func (*MetricDeleteOne) Exec

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

Exec executes the deletion query.

func (*MetricDeleteOne) ExecX

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

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

type MetricEdges

type MetricEdges struct {
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// Task holds the value of the task edge.
	Task *Task `json:"task,omitempty"`
	// contains filtered or unexported fields
}

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

func (MetricEdges) ItemsOrErr

func (e MetricEdges) ItemsOrErr() ([]*Item, error)

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

func (MetricEdges) TaskOrErr

func (e MetricEdges) TaskOrErr() (*Task, error)

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

type MetricGroupBy

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

MetricGroupBy is the group-by builder for Metric entities.

func (*MetricGroupBy) Aggregate

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

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

func (*MetricGroupBy) Bool

func (mgb *MetricGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) BoolX

func (mgb *MetricGroupBy) BoolX(ctx context.Context) bool

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

func (*MetricGroupBy) Bools

func (mgb *MetricGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) BoolsX

func (mgb *MetricGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MetricGroupBy) Float64

func (mgb *MetricGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) Float64X

func (mgb *MetricGroupBy) Float64X(ctx context.Context) float64

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

func (*MetricGroupBy) Float64s

func (mgb *MetricGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) Float64sX

func (mgb *MetricGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MetricGroupBy) Int

func (mgb *MetricGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) IntX

func (mgb *MetricGroupBy) IntX(ctx context.Context) int

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

func (*MetricGroupBy) Ints

func (mgb *MetricGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) IntsX

func (mgb *MetricGroupBy) IntsX(ctx context.Context) []int

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

func (*MetricGroupBy) Scan

func (mgb *MetricGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MetricGroupBy) ScanX

func (mgb *MetricGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MetricGroupBy) String

func (mgb *MetricGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) StringX

func (mgb *MetricGroupBy) StringX(ctx context.Context) string

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

func (*MetricGroupBy) Strings

func (mgb *MetricGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MetricGroupBy) StringsX

func (mgb *MetricGroupBy) StringsX(ctx context.Context) []string

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

type MetricMutation

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

MetricMutation represents an operation that mutates the Metric nodes in the graph.

func (*MetricMutation) AddField

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

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

func (*MetricMutation) AddItemIDs

func (m *MetricMutation) AddItemIDs(ids ...int)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*MetricMutation) AddedEdges

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

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

func (*MetricMutation) AddedField

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

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

func (*MetricMutation) AddedFields

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

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

func (*MetricMutation) AddedIDs

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

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

func (*MetricMutation) ClearDescription

func (m *MetricMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*MetricMutation) ClearDisplayTitle

func (m *MetricMutation) ClearDisplayTitle()

ClearDisplayTitle clears the value of the "display_title" field.

func (*MetricMutation) ClearEdge

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

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

func (*MetricMutation) ClearField

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

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

func (*MetricMutation) ClearItems

func (m *MetricMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*MetricMutation) ClearMeta

func (m *MetricMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*MetricMutation) ClearTask

func (m *MetricMutation) ClearTask()

ClearTask clears the "task" edge to the Task entity.

func (*MetricMutation) ClearedEdges

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

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

func (*MetricMutation) ClearedFields

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

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

func (MetricMutation) Client

func (m MetricMutation) Client() *Client

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

func (*MetricMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*MetricMutation) Description

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

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

func (*MetricMutation) DescriptionCleared

func (m *MetricMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*MetricMutation) DisplayTitle

func (m *MetricMutation) DisplayTitle() (r map[string]string, exists bool)

DisplayTitle returns the value of the "display_title" field in the mutation.

func (*MetricMutation) DisplayTitleCleared

func (m *MetricMutation) DisplayTitleCleared() bool

DisplayTitleCleared returns if the "display_title" field was cleared in this mutation.

func (*MetricMutation) EdgeCleared

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

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

func (*MetricMutation) Field

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

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

func (*MetricMutation) FieldCleared

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

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

func (*MetricMutation) Fields

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

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

func (*MetricMutation) ID

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

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

func (*MetricMutation) IDs

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

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

func (*MetricMutation) ItemsCleared

func (m *MetricMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*MetricMutation) ItemsIDs

func (m *MetricMutation) ItemsIDs() (ids []int)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*MetricMutation) Meta

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

Meta returns the value of the "meta" field in the mutation.

func (*MetricMutation) MetaCleared

func (m *MetricMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*MetricMutation) OldCreateTime

func (m *MetricMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

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

func (*MetricMutation) OldDescription

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

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

func (*MetricMutation) OldDisplayTitle

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

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

func (*MetricMutation) OldField

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

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

func (*MetricMutation) OldMeta

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

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

func (*MetricMutation) OldTitle

func (m *MetricMutation) OldTitle(ctx context.Context) (v string, err error)

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

func (*MetricMutation) OldUpdateTime

func (m *MetricMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

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

func (*MetricMutation) Op

func (m *MetricMutation) Op() Op

Op returns the operation name.

func (*MetricMutation) RemoveItemIDs

func (m *MetricMutation) RemoveItemIDs(ids ...int)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*MetricMutation) RemovedEdges

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

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

func (*MetricMutation) RemovedIDs

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

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

func (*MetricMutation) RemovedItemsIDs

func (m *MetricMutation) RemovedItemsIDs() (ids []int)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*MetricMutation) ResetCreateTime

func (m *MetricMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MetricMutation) ResetDescription

func (m *MetricMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MetricMutation) ResetDisplayTitle

func (m *MetricMutation) ResetDisplayTitle()

ResetDisplayTitle resets all changes to the "display_title" field.

func (*MetricMutation) ResetEdge

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

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

func (*MetricMutation) ResetField

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

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

func (*MetricMutation) ResetItems

func (m *MetricMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*MetricMutation) ResetMeta

func (m *MetricMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*MetricMutation) ResetTask

func (m *MetricMutation) ResetTask()

ResetTask resets all changes to the "task" edge.

func (*MetricMutation) ResetTitle

func (m *MetricMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*MetricMutation) ResetUpdateTime

func (m *MetricMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*MetricMutation) SetCreateTime

func (m *MetricMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MetricMutation) SetDescription

func (m *MetricMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MetricMutation) SetDisplayTitle

func (m *MetricMutation) SetDisplayTitle(value map[string]string)

SetDisplayTitle sets the "display_title" field.

func (*MetricMutation) SetField

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

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

func (*MetricMutation) SetMeta

func (m *MetricMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*MetricMutation) SetTaskID

func (m *MetricMutation) SetTaskID(id int)

SetTaskID sets the "task" edge to the Task entity by id.

func (*MetricMutation) SetTitle

func (m *MetricMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*MetricMutation) SetUpdateTime

func (m *MetricMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*MetricMutation) TaskCleared

func (m *MetricMutation) TaskCleared() bool

TaskCleared reports if the "task" edge to the Task entity was cleared.

func (*MetricMutation) TaskID

func (m *MetricMutation) TaskID() (id int, exists bool)

TaskID returns the "task" edge ID in the mutation.

func (*MetricMutation) TaskIDs

func (m *MetricMutation) TaskIDs() (ids []int)

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

func (*MetricMutation) Title

func (m *MetricMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (MetricMutation) Tx

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

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

func (*MetricMutation) Type

func (m *MetricMutation) Type() string

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

func (*MetricMutation) UpdateTime

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

UpdateTime returns the value of the "update_time" field in the mutation.

func (*MetricMutation) Where

func (m *MetricMutation) Where(ps ...predicate.Metric)

Where appends a list predicates to the MetricMutation builder.

type MetricQuery

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

MetricQuery is the builder for querying Metric entities.

func (*MetricQuery) All

func (mq *MetricQuery) All(ctx context.Context) ([]*Metric, error)

All executes the query and returns a list of Metrics.

func (*MetricQuery) AllX

func (mq *MetricQuery) AllX(ctx context.Context) []*Metric

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

func (*MetricQuery) Clone

func (mq *MetricQuery) Clone() *MetricQuery

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

func (*MetricQuery) Count

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

Count returns the count of the given query.

func (*MetricQuery) CountX

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

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

func (*MetricQuery) Exist

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

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

func (*MetricQuery) ExistX

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

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

func (*MetricQuery) First

func (mq *MetricQuery) First(ctx context.Context) (*Metric, error)

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

func (*MetricQuery) FirstID

func (mq *MetricQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MetricQuery) FirstIDX

func (mq *MetricQuery) FirstIDX(ctx context.Context) int

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

func (*MetricQuery) FirstX

func (mq *MetricQuery) FirstX(ctx context.Context) *Metric

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

func (*MetricQuery) GroupBy

func (mq *MetricQuery) GroupBy(field string, fields ...string) *MetricGroupBy

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

Example:

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

client.Metric.Query().
	GroupBy(metric.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MetricQuery) IDs

func (mq *MetricQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MetricQuery) IDsX

func (mq *MetricQuery) IDsX(ctx context.Context) []int

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

func (*MetricQuery) Limit

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

Limit adds a limit step to the query.

func (*MetricQuery) Offset

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

Offset adds an offset step to the query.

func (*MetricQuery) Only

func (mq *MetricQuery) Only(ctx context.Context) (*Metric, error)

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

func (*MetricQuery) OnlyID

func (mq *MetricQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MetricQuery) OnlyIDX

func (mq *MetricQuery) OnlyIDX(ctx context.Context) int

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

func (*MetricQuery) OnlyX

func (mq *MetricQuery) OnlyX(ctx context.Context) *Metric

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

func (*MetricQuery) Order

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

Order adds an order step to the query.

func (*MetricQuery) QueryItems

func (mq *MetricQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*MetricQuery) QueryTask

func (mq *MetricQuery) QueryTask() *TaskQuery

QueryTask chains the current query on the "task" edge.

func (*MetricQuery) Select

func (mq *MetricQuery) Select(fields ...string) *MetricSelect

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

Example:

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

client.Metric.Query().
	Select(metric.FieldCreateTime).
	Scan(ctx, &v)

func (*MetricQuery) Unique

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

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

func (*MetricQuery) Where

func (mq *MetricQuery) Where(ps ...predicate.Metric) *MetricQuery

Where adds a new predicate for the MetricQuery builder.

func (*MetricQuery) WithItems

func (mq *MetricQuery) WithItems(opts ...func(*ItemQuery)) *MetricQuery

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

func (*MetricQuery) WithTask

func (mq *MetricQuery) WithTask(opts ...func(*TaskQuery)) *MetricQuery

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

type MetricSelect

type MetricSelect struct {
	*MetricQuery
	// contains filtered or unexported fields
}

MetricSelect is the builder for selecting fields of Metric entities.

func (*MetricSelect) Bool

func (ms *MetricSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MetricSelect) BoolX

func (ms *MetricSelect) BoolX(ctx context.Context) bool

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

func (*MetricSelect) Bools

func (ms *MetricSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MetricSelect) BoolsX

func (ms *MetricSelect) BoolsX(ctx context.Context) []bool

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

func (*MetricSelect) Float64

func (ms *MetricSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MetricSelect) Float64X

func (ms *MetricSelect) Float64X(ctx context.Context) float64

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

func (*MetricSelect) Float64s

func (ms *MetricSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MetricSelect) Float64sX

func (ms *MetricSelect) Float64sX(ctx context.Context) []float64

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

func (*MetricSelect) Int

func (ms *MetricSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MetricSelect) IntX

func (ms *MetricSelect) IntX(ctx context.Context) int

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

func (*MetricSelect) Ints

func (ms *MetricSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MetricSelect) IntsX

func (ms *MetricSelect) IntsX(ctx context.Context) []int

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

func (*MetricSelect) Scan

func (ms *MetricSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MetricSelect) ScanX

func (ms *MetricSelect) ScanX(ctx context.Context, v interface{})

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

func (*MetricSelect) String

func (ms *MetricSelect) String(ctx context.Context) (_ string, err error)

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

func (*MetricSelect) StringX

func (ms *MetricSelect) StringX(ctx context.Context) string

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

func (*MetricSelect) Strings

func (ms *MetricSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MetricSelect) StringsX

func (ms *MetricSelect) StringsX(ctx context.Context) []string

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

type MetricUpdate

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

MetricUpdate is the builder for updating Metric entities.

func (*MetricUpdate) AddItemIDs

func (mu *MetricUpdate) AddItemIDs(ids ...int) *MetricUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*MetricUpdate) AddItems

func (mu *MetricUpdate) AddItems(i ...*Item) *MetricUpdate

AddItems adds the "items" edges to the Item entity.

func (*MetricUpdate) ClearDescription

func (mu *MetricUpdate) ClearDescription() *MetricUpdate

ClearDescription clears the value of the "description" field.

func (*MetricUpdate) ClearDisplayTitle

func (mu *MetricUpdate) ClearDisplayTitle() *MetricUpdate

ClearDisplayTitle clears the value of the "display_title" field.

func (*MetricUpdate) ClearItems

func (mu *MetricUpdate) ClearItems() *MetricUpdate

ClearItems clears all "items" edges to the Item entity.

func (*MetricUpdate) ClearMeta

func (mu *MetricUpdate) ClearMeta() *MetricUpdate

ClearMeta clears the value of the "meta" field.

func (*MetricUpdate) ClearTask

func (mu *MetricUpdate) ClearTask() *MetricUpdate

ClearTask clears the "task" edge to the Task entity.

func (*MetricUpdate) Exec

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

Exec executes the query.

func (*MetricUpdate) ExecX

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

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

func (*MetricUpdate) Mutation

func (mu *MetricUpdate) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricUpdate) RemoveItemIDs

func (mu *MetricUpdate) RemoveItemIDs(ids ...int) *MetricUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*MetricUpdate) RemoveItems

func (mu *MetricUpdate) RemoveItems(i ...*Item) *MetricUpdate

RemoveItems removes "items" edges to Item entities.

func (*MetricUpdate) Save

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

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

func (*MetricUpdate) SaveX

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

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

func (*MetricUpdate) SetDescription

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

SetDescription sets the "description" field.

func (*MetricUpdate) SetDisplayTitle

func (mu *MetricUpdate) SetDisplayTitle(m map[string]string) *MetricUpdate

SetDisplayTitle sets the "display_title" field.

func (*MetricUpdate) SetMeta

func (mu *MetricUpdate) SetMeta(m map[string]interface{}) *MetricUpdate

SetMeta sets the "meta" field.

func (*MetricUpdate) SetNillableDescription

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

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

func (*MetricUpdate) SetTask

func (mu *MetricUpdate) SetTask(t *Task) *MetricUpdate

SetTask sets the "task" edge to the Task entity.

func (*MetricUpdate) SetTaskID

func (mu *MetricUpdate) SetTaskID(id int) *MetricUpdate

SetTaskID sets the "task" edge to the Task entity by ID.

func (*MetricUpdate) SetTitle

func (mu *MetricUpdate) SetTitle(s string) *MetricUpdate

SetTitle sets the "title" field.

func (*MetricUpdate) SetUpdateTime

func (mu *MetricUpdate) SetUpdateTime(t time.Time) *MetricUpdate

SetUpdateTime sets the "update_time" field.

func (*MetricUpdate) Where

func (mu *MetricUpdate) Where(ps ...predicate.Metric) *MetricUpdate

Where appends a list predicates to the MetricUpdate builder.

type MetricUpdateOne

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

MetricUpdateOne is the builder for updating a single Metric entity.

func (*MetricUpdateOne) AddItemIDs

func (muo *MetricUpdateOne) AddItemIDs(ids ...int) *MetricUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*MetricUpdateOne) AddItems

func (muo *MetricUpdateOne) AddItems(i ...*Item) *MetricUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*MetricUpdateOne) ClearDescription

func (muo *MetricUpdateOne) ClearDescription() *MetricUpdateOne

ClearDescription clears the value of the "description" field.

func (*MetricUpdateOne) ClearDisplayTitle

func (muo *MetricUpdateOne) ClearDisplayTitle() *MetricUpdateOne

ClearDisplayTitle clears the value of the "display_title" field.

func (*MetricUpdateOne) ClearItems

func (muo *MetricUpdateOne) ClearItems() *MetricUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*MetricUpdateOne) ClearMeta

func (muo *MetricUpdateOne) ClearMeta() *MetricUpdateOne

ClearMeta clears the value of the "meta" field.

func (*MetricUpdateOne) ClearTask

func (muo *MetricUpdateOne) ClearTask() *MetricUpdateOne

ClearTask clears the "task" edge to the Task entity.

func (*MetricUpdateOne) Exec

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

Exec executes the query on the entity.

func (*MetricUpdateOne) ExecX

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

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

func (*MetricUpdateOne) Mutation

func (muo *MetricUpdateOne) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricUpdateOne) RemoveItemIDs

func (muo *MetricUpdateOne) RemoveItemIDs(ids ...int) *MetricUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*MetricUpdateOne) RemoveItems

func (muo *MetricUpdateOne) RemoveItems(i ...*Item) *MetricUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*MetricUpdateOne) Save

func (muo *MetricUpdateOne) Save(ctx context.Context) (*Metric, error)

Save executes the query and returns the updated Metric entity.

func (*MetricUpdateOne) SaveX

func (muo *MetricUpdateOne) SaveX(ctx context.Context) *Metric

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

func (*MetricUpdateOne) Select

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

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

func (*MetricUpdateOne) SetDescription

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

SetDescription sets the "description" field.

func (*MetricUpdateOne) SetDisplayTitle

func (muo *MetricUpdateOne) SetDisplayTitle(m map[string]string) *MetricUpdateOne

SetDisplayTitle sets the "display_title" field.

func (*MetricUpdateOne) SetMeta

func (muo *MetricUpdateOne) SetMeta(m map[string]interface{}) *MetricUpdateOne

SetMeta sets the "meta" field.

func (*MetricUpdateOne) SetNillableDescription

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

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

func (*MetricUpdateOne) SetTask

func (muo *MetricUpdateOne) SetTask(t *Task) *MetricUpdateOne

SetTask sets the "task" edge to the Task entity.

func (*MetricUpdateOne) SetTaskID

func (muo *MetricUpdateOne) SetTaskID(id int) *MetricUpdateOne

SetTaskID sets the "task" edge to the Task entity by ID.

func (*MetricUpdateOne) SetTitle

func (muo *MetricUpdateOne) SetTitle(s string) *MetricUpdateOne

SetTitle sets the "title" field.

func (*MetricUpdateOne) SetUpdateTime

func (muo *MetricUpdateOne) SetUpdateTime(t time.Time) *MetricUpdateOne

SetUpdateTime sets the "update_time" field.

type Metrics

type Metrics []*Metric

Metrics is a parsable slice of Metric.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Task

type Task struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Type holds the value of the "type" field.
	Type task.Type `json:"type,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Active holds the value of the "active" field.
	Active bool `json:"active,omitempty"`
	// Display holds the value of the "display" field.
	Display bool `json:"display,omitempty"`
	// Schedule holds the value of the "schedule" field.
	Schedule string `json:"schedule,omitempty"`
	// Args holds the value of the "args" field.
	Args map[string]interface{} `json:"args,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskQuery when eager-loading is set.
	Edges TaskEdges `json:"edges"`
	// contains filtered or unexported fields
}

Task is the model entity for the Task schema.

func (*Task) QueryCategory

func (t *Task) QueryCategory() *TaskCategoryQuery

QueryCategory queries the "category" edge of the Task entity.

func (*Task) QueryInstances

func (t *Task) QueryInstances() *TaskInstanceQuery

QueryInstances queries the "instances" edge of the Task entity.

func (*Task) QueryMetrics

func (t *Task) QueryMetrics() *MetricQuery

QueryMetrics queries the "metrics" edge of the Task entity.

func (*Task) QueryTags

func (t *Task) QueryTags() *TaskTagQuery

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

func (*Task) String

func (t *Task) String() string

String implements the fmt.Stringer.

func (*Task) Unwrap

func (t *Task) Unwrap() *Task

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

func (t *Task) Update() *TaskUpdateOne

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

type TaskCategories

type TaskCategories []*TaskCategory

TaskCategories is a parsable slice of TaskCategory.

type TaskCategory

type TaskCategory struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Display holds the value of the "display" field.
	Display bool `json:"display,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskCategoryQuery when eager-loading is set.
	Edges TaskCategoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

TaskCategory is the model entity for the TaskCategory schema.

func (*TaskCategory) QueryTasks

func (tc *TaskCategory) QueryTasks() *TaskQuery

QueryTasks queries the "tasks" edge of the TaskCategory entity.

func (*TaskCategory) String

func (tc *TaskCategory) String() string

String implements the fmt.Stringer.

func (*TaskCategory) Unwrap

func (tc *TaskCategory) Unwrap() *TaskCategory

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

func (tc *TaskCategory) Update() *TaskCategoryUpdateOne

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

type TaskCategoryClient

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

TaskCategoryClient is a client for the TaskCategory schema.

func NewTaskCategoryClient

func NewTaskCategoryClient(c config) *TaskCategoryClient

NewTaskCategoryClient returns a client for the TaskCategory from the given config.

func (*TaskCategoryClient) Create

Create returns a create builder for TaskCategory.

func (*TaskCategoryClient) CreateBulk

func (c *TaskCategoryClient) CreateBulk(builders ...*TaskCategoryCreate) *TaskCategoryCreateBulk

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

func (*TaskCategoryClient) Delete

Delete returns a delete builder for TaskCategory.

func (*TaskCategoryClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TaskCategoryClient) DeleteOneID

func (c *TaskCategoryClient) DeleteOneID(id int) *TaskCategoryDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TaskCategoryClient) Get

Get returns a TaskCategory entity by its id.

func (*TaskCategoryClient) GetX

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

func (*TaskCategoryClient) Hooks

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

Hooks returns the client hooks.

func (*TaskCategoryClient) Query

Query returns a query builder for TaskCategory.

func (*TaskCategoryClient) QueryTasks

func (c *TaskCategoryClient) QueryTasks(tc *TaskCategory) *TaskQuery

QueryTasks queries the tasks edge of a TaskCategory.

func (*TaskCategoryClient) Update

Update returns an update builder for TaskCategory.

func (*TaskCategoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskCategoryClient) UpdateOneID

func (c *TaskCategoryClient) UpdateOneID(id int) *TaskCategoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskCategoryClient) Use

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

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

type TaskCategoryCreate

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

TaskCategoryCreate is the builder for creating a TaskCategory entity.

func (*TaskCategoryCreate) AddTaskIDs

func (tcc *TaskCategoryCreate) AddTaskIDs(ids ...int) *TaskCategoryCreate

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*TaskCategoryCreate) AddTasks

func (tcc *TaskCategoryCreate) AddTasks(t ...*Task) *TaskCategoryCreate

AddTasks adds the "tasks" edges to the Task entity.

func (*TaskCategoryCreate) Exec

func (tcc *TaskCategoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCategoryCreate) ExecX

func (tcc *TaskCategoryCreate) ExecX(ctx context.Context)

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

func (*TaskCategoryCreate) Mutation

func (tcc *TaskCategoryCreate) Mutation() *TaskCategoryMutation

Mutation returns the TaskCategoryMutation object of the builder.

func (*TaskCategoryCreate) Save

Save creates the TaskCategory in the database.

func (*TaskCategoryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TaskCategoryCreate) SetCreateTime

func (tcc *TaskCategoryCreate) SetCreateTime(t time.Time) *TaskCategoryCreate

SetCreateTime sets the "create_time" field.

func (*TaskCategoryCreate) SetDescription

func (tcc *TaskCategoryCreate) SetDescription(s string) *TaskCategoryCreate

SetDescription sets the "description" field.

func (*TaskCategoryCreate) SetDisplay

func (tcc *TaskCategoryCreate) SetDisplay(b bool) *TaskCategoryCreate

SetDisplay sets the "display" field.

func (*TaskCategoryCreate) SetMeta

func (tcc *TaskCategoryCreate) SetMeta(m map[string]interface{}) *TaskCategoryCreate

SetMeta sets the "meta" field.

func (*TaskCategoryCreate) SetNillableCreateTime

func (tcc *TaskCategoryCreate) SetNillableCreateTime(t *time.Time) *TaskCategoryCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskCategoryCreate) SetNillableDescription

func (tcc *TaskCategoryCreate) SetNillableDescription(s *string) *TaskCategoryCreate

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

func (*TaskCategoryCreate) SetNillableDisplay

func (tcc *TaskCategoryCreate) SetNillableDisplay(b *bool) *TaskCategoryCreate

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskCategoryCreate) SetNillableUpdateTime

func (tcc *TaskCategoryCreate) SetNillableUpdateTime(t *time.Time) *TaskCategoryCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TaskCategoryCreate) SetTitle

func (tcc *TaskCategoryCreate) SetTitle(s string) *TaskCategoryCreate

SetTitle sets the "title" field.

func (*TaskCategoryCreate) SetUpdateTime

func (tcc *TaskCategoryCreate) SetUpdateTime(t time.Time) *TaskCategoryCreate

SetUpdateTime sets the "update_time" field.

type TaskCategoryCreateBulk

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

TaskCategoryCreateBulk is the builder for creating many TaskCategory entities in bulk.

func (*TaskCategoryCreateBulk) Exec

func (tccb *TaskCategoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCategoryCreateBulk) ExecX

func (tccb *TaskCategoryCreateBulk) ExecX(ctx context.Context)

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

func (*TaskCategoryCreateBulk) Save

Save creates the TaskCategory entities in the database.

func (*TaskCategoryCreateBulk) SaveX

func (tccb *TaskCategoryCreateBulk) SaveX(ctx context.Context) []*TaskCategory

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

type TaskCategoryDelete

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

TaskCategoryDelete is the builder for deleting a TaskCategory entity.

func (*TaskCategoryDelete) Exec

func (tcd *TaskCategoryDelete) Exec(ctx context.Context) (int, error)

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

func (*TaskCategoryDelete) ExecX

func (tcd *TaskCategoryDelete) ExecX(ctx context.Context) int

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

func (*TaskCategoryDelete) Where

Where appends a list predicates to the TaskCategoryDelete builder.

type TaskCategoryDeleteOne

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

TaskCategoryDeleteOne is the builder for deleting a single TaskCategory entity.

func (*TaskCategoryDeleteOne) Exec

func (tcdo *TaskCategoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskCategoryDeleteOne) ExecX

func (tcdo *TaskCategoryDeleteOne) ExecX(ctx context.Context)

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

type TaskCategoryEdges

type TaskCategoryEdges struct {
	// Tasks holds the value of the tasks edge.
	Tasks []*Task `json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

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

func (TaskCategoryEdges) TasksOrErr

func (e TaskCategoryEdges) TasksOrErr() ([]*Task, error)

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

type TaskCategoryGroupBy

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

TaskCategoryGroupBy is the group-by builder for TaskCategory entities.

func (*TaskCategoryGroupBy) Aggregate

func (tcgb *TaskCategoryGroupBy) Aggregate(fns ...AggregateFunc) *TaskCategoryGroupBy

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

func (*TaskCategoryGroupBy) Bool

func (tcgb *TaskCategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) BoolX

func (tcgb *TaskCategoryGroupBy) BoolX(ctx context.Context) bool

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

func (*TaskCategoryGroupBy) Bools

func (tcgb *TaskCategoryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) BoolsX

func (tcgb *TaskCategoryGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TaskCategoryGroupBy) Float64

func (tcgb *TaskCategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) Float64X

func (tcgb *TaskCategoryGroupBy) Float64X(ctx context.Context) float64

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

func (*TaskCategoryGroupBy) Float64s

func (tcgb *TaskCategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) Float64sX

func (tcgb *TaskCategoryGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TaskCategoryGroupBy) Int

func (tcgb *TaskCategoryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) IntX

func (tcgb *TaskCategoryGroupBy) IntX(ctx context.Context) int

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

func (*TaskCategoryGroupBy) Ints

func (tcgb *TaskCategoryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) IntsX

func (tcgb *TaskCategoryGroupBy) IntsX(ctx context.Context) []int

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

func (*TaskCategoryGroupBy) Scan

func (tcgb *TaskCategoryGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TaskCategoryGroupBy) ScanX

func (tcgb *TaskCategoryGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TaskCategoryGroupBy) String

func (tcgb *TaskCategoryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) StringX

func (tcgb *TaskCategoryGroupBy) StringX(ctx context.Context) string

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

func (*TaskCategoryGroupBy) Strings

func (tcgb *TaskCategoryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskCategoryGroupBy) StringsX

func (tcgb *TaskCategoryGroupBy) StringsX(ctx context.Context) []string

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

type TaskCategoryMutation

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

TaskCategoryMutation represents an operation that mutates the TaskCategory nodes in the graph.

func (*TaskCategoryMutation) AddField

func (m *TaskCategoryMutation) 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 (*TaskCategoryMutation) AddTaskIDs

func (m *TaskCategoryMutation) AddTaskIDs(ids ...int)

AddTaskIDs adds the "tasks" edge to the Task entity by ids.

func (*TaskCategoryMutation) AddedEdges

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

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

func (*TaskCategoryMutation) AddedField

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

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

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

func (*TaskCategoryMutation) AddedIDs

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

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

func (*TaskCategoryMutation) ClearDescription

func (m *TaskCategoryMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*TaskCategoryMutation) ClearEdge

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

func (m *TaskCategoryMutation) 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 (*TaskCategoryMutation) ClearMeta

func (m *TaskCategoryMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*TaskCategoryMutation) ClearTasks

func (m *TaskCategoryMutation) ClearTasks()

ClearTasks clears the "tasks" edge to the Task entity.

func (*TaskCategoryMutation) ClearedEdges

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

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

func (*TaskCategoryMutation) ClearedFields

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

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

func (TaskCategoryMutation) Client

func (m TaskCategoryMutation) 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 (*TaskCategoryMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*TaskCategoryMutation) Description

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

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

func (*TaskCategoryMutation) DescriptionCleared

func (m *TaskCategoryMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*TaskCategoryMutation) Display

func (m *TaskCategoryMutation) Display() (r bool, exists bool)

Display returns the value of the "display" field in the mutation.

func (*TaskCategoryMutation) EdgeCleared

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

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

func (*TaskCategoryMutation) Field

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

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

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

func (*TaskCategoryMutation) Fields

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

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

func (m *TaskCategoryMutation) 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 (*TaskCategoryMutation) Meta

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

Meta returns the value of the "meta" field in the mutation.

func (*TaskCategoryMutation) MetaCleared

func (m *TaskCategoryMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*TaskCategoryMutation) OldCreateTime

func (m *TaskCategoryMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the TaskCategory entity. If the TaskCategory 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 (*TaskCategoryMutation) OldDescription

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

OldDescription returns the old "description" field's value of the TaskCategory entity. If the TaskCategory 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 (*TaskCategoryMutation) OldDisplay

func (m *TaskCategoryMutation) OldDisplay(ctx context.Context) (v bool, err error)

OldDisplay returns the old "display" field's value of the TaskCategory entity. If the TaskCategory 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 (*TaskCategoryMutation) OldField

func (m *TaskCategoryMutation) 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 (*TaskCategoryMutation) OldMeta

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

OldMeta returns the old "meta" field's value of the TaskCategory entity. If the TaskCategory 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 (*TaskCategoryMutation) OldTitle

func (m *TaskCategoryMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the TaskCategory entity. If the TaskCategory 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 (*TaskCategoryMutation) OldUpdateTime

func (m *TaskCategoryMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the TaskCategory entity. If the TaskCategory 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 (*TaskCategoryMutation) Op

func (m *TaskCategoryMutation) Op() Op

Op returns the operation name.

func (*TaskCategoryMutation) RemoveTaskIDs

func (m *TaskCategoryMutation) RemoveTaskIDs(ids ...int)

RemoveTaskIDs removes the "tasks" edge to the Task entity by IDs.

func (*TaskCategoryMutation) RemovedEdges

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

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

func (*TaskCategoryMutation) RemovedIDs

func (m *TaskCategoryMutation) 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 (*TaskCategoryMutation) RemovedTasksIDs

func (m *TaskCategoryMutation) RemovedTasksIDs() (ids []int)

RemovedTasks returns the removed IDs of the "tasks" edge to the Task entity.

func (*TaskCategoryMutation) ResetCreateTime

func (m *TaskCategoryMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TaskCategoryMutation) ResetDescription

func (m *TaskCategoryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TaskCategoryMutation) ResetDisplay

func (m *TaskCategoryMutation) ResetDisplay()

ResetDisplay resets all changes to the "display" field.

func (*TaskCategoryMutation) ResetEdge

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

func (m *TaskCategoryMutation) 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 (*TaskCategoryMutation) ResetMeta

func (m *TaskCategoryMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*TaskCategoryMutation) ResetTasks

func (m *TaskCategoryMutation) ResetTasks()

ResetTasks resets all changes to the "tasks" edge.

func (*TaskCategoryMutation) ResetTitle

func (m *TaskCategoryMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*TaskCategoryMutation) ResetUpdateTime

func (m *TaskCategoryMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TaskCategoryMutation) SetCreateTime

func (m *TaskCategoryMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TaskCategoryMutation) SetDescription

func (m *TaskCategoryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TaskCategoryMutation) SetDisplay

func (m *TaskCategoryMutation) SetDisplay(b bool)

SetDisplay sets the "display" field.

func (*TaskCategoryMutation) SetField

func (m *TaskCategoryMutation) 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 (*TaskCategoryMutation) SetMeta

func (m *TaskCategoryMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*TaskCategoryMutation) SetTitle

func (m *TaskCategoryMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*TaskCategoryMutation) SetUpdateTime

func (m *TaskCategoryMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TaskCategoryMutation) TasksCleared

func (m *TaskCategoryMutation) TasksCleared() bool

TasksCleared reports if the "tasks" edge to the Task entity was cleared.

func (*TaskCategoryMutation) TasksIDs

func (m *TaskCategoryMutation) TasksIDs() (ids []int)

TasksIDs returns the "tasks" edge IDs in the mutation.

func (*TaskCategoryMutation) Title

func (m *TaskCategoryMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (TaskCategoryMutation) Tx

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

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

func (*TaskCategoryMutation) Type

func (m *TaskCategoryMutation) Type() string

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

func (*TaskCategoryMutation) UpdateTime

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

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TaskCategoryMutation) Where

Where appends a list predicates to the TaskCategoryMutation builder.

type TaskCategoryQuery

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

TaskCategoryQuery is the builder for querying TaskCategory entities.

func (*TaskCategoryQuery) All

func (tcq *TaskCategoryQuery) All(ctx context.Context) ([]*TaskCategory, error)

All executes the query and returns a list of TaskCategories.

func (*TaskCategoryQuery) AllX

func (tcq *TaskCategoryQuery) AllX(ctx context.Context) []*TaskCategory

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

func (*TaskCategoryQuery) Clone

func (tcq *TaskCategoryQuery) Clone() *TaskCategoryQuery

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

func (*TaskCategoryQuery) Count

func (tcq *TaskCategoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskCategoryQuery) CountX

func (tcq *TaskCategoryQuery) CountX(ctx context.Context) int

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

func (*TaskCategoryQuery) Exist

func (tcq *TaskCategoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*TaskCategoryQuery) ExistX

func (tcq *TaskCategoryQuery) ExistX(ctx context.Context) bool

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

func (*TaskCategoryQuery) First

func (tcq *TaskCategoryQuery) First(ctx context.Context) (*TaskCategory, error)

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

func (*TaskCategoryQuery) FirstID

func (tcq *TaskCategoryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TaskCategoryQuery) FirstIDX

func (tcq *TaskCategoryQuery) FirstIDX(ctx context.Context) int

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

func (*TaskCategoryQuery) FirstX

func (tcq *TaskCategoryQuery) FirstX(ctx context.Context) *TaskCategory

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

func (*TaskCategoryQuery) GroupBy

func (tcq *TaskCategoryQuery) GroupBy(field string, fields ...string) *TaskCategoryGroupBy

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

client.TaskCategory.Query().
	GroupBy(taskcategory.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskCategoryQuery) IDs

func (tcq *TaskCategoryQuery) IDs(ctx context.Context) ([]int, error)

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

func (*TaskCategoryQuery) IDsX

func (tcq *TaskCategoryQuery) IDsX(ctx context.Context) []int

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

func (*TaskCategoryQuery) Limit

func (tcq *TaskCategoryQuery) Limit(limit int) *TaskCategoryQuery

Limit adds a limit step to the query.

func (*TaskCategoryQuery) Offset

func (tcq *TaskCategoryQuery) Offset(offset int) *TaskCategoryQuery

Offset adds an offset step to the query.

func (*TaskCategoryQuery) Only

func (tcq *TaskCategoryQuery) Only(ctx context.Context) (*TaskCategory, error)

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

func (*TaskCategoryQuery) OnlyID

func (tcq *TaskCategoryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TaskCategoryQuery) OnlyIDX

func (tcq *TaskCategoryQuery) OnlyIDX(ctx context.Context) int

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

func (*TaskCategoryQuery) OnlyX

func (tcq *TaskCategoryQuery) OnlyX(ctx context.Context) *TaskCategory

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

func (*TaskCategoryQuery) Order

func (tcq *TaskCategoryQuery) Order(o ...OrderFunc) *TaskCategoryQuery

Order adds an order step to the query.

func (*TaskCategoryQuery) QueryTasks

func (tcq *TaskCategoryQuery) QueryTasks() *TaskQuery

QueryTasks chains the current query on the "tasks" edge.

func (*TaskCategoryQuery) Select

func (tcq *TaskCategoryQuery) Select(fields ...string) *TaskCategorySelect

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

client.TaskCategory.Query().
	Select(taskcategory.FieldCreateTime).
	Scan(ctx, &v)

func (*TaskCategoryQuery) Unique

func (tcq *TaskCategoryQuery) Unique(unique bool) *TaskCategoryQuery

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

Where adds a new predicate for the TaskCategoryQuery builder.

func (*TaskCategoryQuery) WithTasks

func (tcq *TaskCategoryQuery) WithTasks(opts ...func(*TaskQuery)) *TaskCategoryQuery

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

type TaskCategorySelect

type TaskCategorySelect struct {
	*TaskCategoryQuery
	// contains filtered or unexported fields
}

TaskCategorySelect is the builder for selecting fields of TaskCategory entities.

func (*TaskCategorySelect) Bool

func (tcs *TaskCategorySelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TaskCategorySelect) BoolX

func (tcs *TaskCategorySelect) BoolX(ctx context.Context) bool

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

func (*TaskCategorySelect) Bools

func (tcs *TaskCategorySelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TaskCategorySelect) BoolsX

func (tcs *TaskCategorySelect) BoolsX(ctx context.Context) []bool

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

func (*TaskCategorySelect) Float64

func (tcs *TaskCategorySelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TaskCategorySelect) Float64X

func (tcs *TaskCategorySelect) Float64X(ctx context.Context) float64

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

func (*TaskCategorySelect) Float64s

func (tcs *TaskCategorySelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TaskCategorySelect) Float64sX

func (tcs *TaskCategorySelect) Float64sX(ctx context.Context) []float64

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

func (*TaskCategorySelect) Int

func (tcs *TaskCategorySelect) Int(ctx context.Context) (_ int, err error)

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

func (*TaskCategorySelect) IntX

func (tcs *TaskCategorySelect) IntX(ctx context.Context) int

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

func (*TaskCategorySelect) Ints

func (tcs *TaskCategorySelect) Ints(ctx context.Context) ([]int, error)

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

func (*TaskCategorySelect) IntsX

func (tcs *TaskCategorySelect) IntsX(ctx context.Context) []int

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

func (*TaskCategorySelect) Scan

func (tcs *TaskCategorySelect) Scan(ctx context.Context, v interface{}) error

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

func (*TaskCategorySelect) ScanX

func (tcs *TaskCategorySelect) ScanX(ctx context.Context, v interface{})

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

func (*TaskCategorySelect) String

func (tcs *TaskCategorySelect) String(ctx context.Context) (_ string, err error)

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

func (*TaskCategorySelect) StringX

func (tcs *TaskCategorySelect) StringX(ctx context.Context) string

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

func (*TaskCategorySelect) Strings

func (tcs *TaskCategorySelect) Strings(ctx context.Context) ([]string, error)

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

func (*TaskCategorySelect) StringsX

func (tcs *TaskCategorySelect) StringsX(ctx context.Context) []string

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

type TaskCategoryUpdate

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

TaskCategoryUpdate is the builder for updating TaskCategory entities.

func (*TaskCategoryUpdate) AddTaskIDs

func (tcu *TaskCategoryUpdate) AddTaskIDs(ids ...int) *TaskCategoryUpdate

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*TaskCategoryUpdate) AddTasks

func (tcu *TaskCategoryUpdate) AddTasks(t ...*Task) *TaskCategoryUpdate

AddTasks adds the "tasks" edges to the Task entity.

func (*TaskCategoryUpdate) ClearDescription

func (tcu *TaskCategoryUpdate) ClearDescription() *TaskCategoryUpdate

ClearDescription clears the value of the "description" field.

func (*TaskCategoryUpdate) ClearMeta

func (tcu *TaskCategoryUpdate) ClearMeta() *TaskCategoryUpdate

ClearMeta clears the value of the "meta" field.

func (*TaskCategoryUpdate) ClearTasks

func (tcu *TaskCategoryUpdate) ClearTasks() *TaskCategoryUpdate

ClearTasks clears all "tasks" edges to the Task entity.

func (*TaskCategoryUpdate) Exec

func (tcu *TaskCategoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCategoryUpdate) ExecX

func (tcu *TaskCategoryUpdate) ExecX(ctx context.Context)

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

func (*TaskCategoryUpdate) Mutation

func (tcu *TaskCategoryUpdate) Mutation() *TaskCategoryMutation

Mutation returns the TaskCategoryMutation object of the builder.

func (*TaskCategoryUpdate) RemoveTaskIDs

func (tcu *TaskCategoryUpdate) RemoveTaskIDs(ids ...int) *TaskCategoryUpdate

RemoveTaskIDs removes the "tasks" edge to Task entities by IDs.

func (*TaskCategoryUpdate) RemoveTasks

func (tcu *TaskCategoryUpdate) RemoveTasks(t ...*Task) *TaskCategoryUpdate

RemoveTasks removes "tasks" edges to Task entities.

func (*TaskCategoryUpdate) Save

func (tcu *TaskCategoryUpdate) Save(ctx context.Context) (int, error)

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

func (*TaskCategoryUpdate) SaveX

func (tcu *TaskCategoryUpdate) SaveX(ctx context.Context) int

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

func (*TaskCategoryUpdate) SetDescription

func (tcu *TaskCategoryUpdate) SetDescription(s string) *TaskCategoryUpdate

SetDescription sets the "description" field.

func (*TaskCategoryUpdate) SetDisplay

func (tcu *TaskCategoryUpdate) SetDisplay(b bool) *TaskCategoryUpdate

SetDisplay sets the "display" field.

func (*TaskCategoryUpdate) SetMeta

func (tcu *TaskCategoryUpdate) SetMeta(m map[string]interface{}) *TaskCategoryUpdate

SetMeta sets the "meta" field.

func (*TaskCategoryUpdate) SetNillableDescription

func (tcu *TaskCategoryUpdate) SetNillableDescription(s *string) *TaskCategoryUpdate

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

func (*TaskCategoryUpdate) SetNillableDisplay

func (tcu *TaskCategoryUpdate) SetNillableDisplay(b *bool) *TaskCategoryUpdate

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskCategoryUpdate) SetTitle

func (tcu *TaskCategoryUpdate) SetTitle(s string) *TaskCategoryUpdate

SetTitle sets the "title" field.

func (*TaskCategoryUpdate) SetUpdateTime

func (tcu *TaskCategoryUpdate) SetUpdateTime(t time.Time) *TaskCategoryUpdate

SetUpdateTime sets the "update_time" field.

func (*TaskCategoryUpdate) Where

Where appends a list predicates to the TaskCategoryUpdate builder.

type TaskCategoryUpdateOne

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

TaskCategoryUpdateOne is the builder for updating a single TaskCategory entity.

func (*TaskCategoryUpdateOne) AddTaskIDs

func (tcuo *TaskCategoryUpdateOne) AddTaskIDs(ids ...int) *TaskCategoryUpdateOne

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*TaskCategoryUpdateOne) AddTasks

func (tcuo *TaskCategoryUpdateOne) AddTasks(t ...*Task) *TaskCategoryUpdateOne

AddTasks adds the "tasks" edges to the Task entity.

func (*TaskCategoryUpdateOne) ClearDescription

func (tcuo *TaskCategoryUpdateOne) ClearDescription() *TaskCategoryUpdateOne

ClearDescription clears the value of the "description" field.

func (*TaskCategoryUpdateOne) ClearMeta

func (tcuo *TaskCategoryUpdateOne) ClearMeta() *TaskCategoryUpdateOne

ClearMeta clears the value of the "meta" field.

func (*TaskCategoryUpdateOne) ClearTasks

func (tcuo *TaskCategoryUpdateOne) ClearTasks() *TaskCategoryUpdateOne

ClearTasks clears all "tasks" edges to the Task entity.

func (*TaskCategoryUpdateOne) Exec

func (tcuo *TaskCategoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskCategoryUpdateOne) ExecX

func (tcuo *TaskCategoryUpdateOne) ExecX(ctx context.Context)

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

func (*TaskCategoryUpdateOne) Mutation

func (tcuo *TaskCategoryUpdateOne) Mutation() *TaskCategoryMutation

Mutation returns the TaskCategoryMutation object of the builder.

func (*TaskCategoryUpdateOne) RemoveTaskIDs

func (tcuo *TaskCategoryUpdateOne) RemoveTaskIDs(ids ...int) *TaskCategoryUpdateOne

RemoveTaskIDs removes the "tasks" edge to Task entities by IDs.

func (*TaskCategoryUpdateOne) RemoveTasks

func (tcuo *TaskCategoryUpdateOne) RemoveTasks(t ...*Task) *TaskCategoryUpdateOne

RemoveTasks removes "tasks" edges to Task entities.

func (*TaskCategoryUpdateOne) Save

Save executes the query and returns the updated TaskCategory entity.

func (*TaskCategoryUpdateOne) SaveX

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

func (*TaskCategoryUpdateOne) Select

func (tcuo *TaskCategoryUpdateOne) Select(field string, fields ...string) *TaskCategoryUpdateOne

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

func (*TaskCategoryUpdateOne) SetDescription

func (tcuo *TaskCategoryUpdateOne) SetDescription(s string) *TaskCategoryUpdateOne

SetDescription sets the "description" field.

func (*TaskCategoryUpdateOne) SetDisplay

func (tcuo *TaskCategoryUpdateOne) SetDisplay(b bool) *TaskCategoryUpdateOne

SetDisplay sets the "display" field.

func (*TaskCategoryUpdateOne) SetMeta

func (tcuo *TaskCategoryUpdateOne) SetMeta(m map[string]interface{}) *TaskCategoryUpdateOne

SetMeta sets the "meta" field.

func (*TaskCategoryUpdateOne) SetNillableDescription

func (tcuo *TaskCategoryUpdateOne) SetNillableDescription(s *string) *TaskCategoryUpdateOne

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

func (*TaskCategoryUpdateOne) SetNillableDisplay

func (tcuo *TaskCategoryUpdateOne) SetNillableDisplay(b *bool) *TaskCategoryUpdateOne

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskCategoryUpdateOne) SetTitle

SetTitle sets the "title" field.

func (*TaskCategoryUpdateOne) SetUpdateTime

func (tcuo *TaskCategoryUpdateOne) SetUpdateTime(t time.Time) *TaskCategoryUpdateOne

SetUpdateTime sets the "update_time" field.

type TaskClient

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

TaskClient is a client for the Task schema.

func NewTaskClient

func NewTaskClient(c config) *TaskClient

NewTaskClient returns a client for the Task from the given config.

func (*TaskClient) Create

func (c *TaskClient) Create() *TaskCreate

Create returns a create builder for Task.

func (*TaskClient) CreateBulk

func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk

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

func (*TaskClient) Delete

func (c *TaskClient) Delete() *TaskDelete

Delete returns a delete builder for Task.

func (*TaskClient) DeleteOne

func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TaskClient) DeleteOneID

func (c *TaskClient) DeleteOneID(id int) *TaskDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TaskClient) Get

func (c *TaskClient) Get(ctx context.Context, id int) (*Task, error)

Get returns a Task entity by its id.

func (*TaskClient) GetX

func (c *TaskClient) GetX(ctx context.Context, id int) *Task

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

func (*TaskClient) Hooks

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

Hooks returns the client hooks.

func (*TaskClient) Query

func (c *TaskClient) Query() *TaskQuery

Query returns a query builder for Task.

func (*TaskClient) QueryCategory

func (c *TaskClient) QueryCategory(t *Task) *TaskCategoryQuery

QueryCategory queries the category edge of a Task.

func (*TaskClient) QueryInstances

func (c *TaskClient) QueryInstances(t *Task) *TaskInstanceQuery

QueryInstances queries the instances edge of a Task.

func (*TaskClient) QueryMetrics

func (c *TaskClient) QueryMetrics(t *Task) *MetricQuery

QueryMetrics queries the metrics edge of a Task.

func (*TaskClient) QueryTags

func (c *TaskClient) QueryTags(t *Task) *TaskTagQuery

QueryTags queries the tags edge of a Task.

func (*TaskClient) Update

func (c *TaskClient) Update() *TaskUpdate

Update returns an update builder for Task.

func (*TaskClient) UpdateOne

func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskClient) UpdateOneID

func (c *TaskClient) UpdateOneID(id int) *TaskUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskClient) Use

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

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

type TaskCreate

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

TaskCreate is the builder for creating a Task entity.

func (*TaskCreate) AddInstanceIDs

func (tc *TaskCreate) AddInstanceIDs(ids ...int) *TaskCreate

AddInstanceIDs adds the "instances" edge to the TaskInstance entity by IDs.

func (*TaskCreate) AddInstances

func (tc *TaskCreate) AddInstances(t ...*TaskInstance) *TaskCreate

AddInstances adds the "instances" edges to the TaskInstance entity.

func (*TaskCreate) AddMetricIDs

func (tc *TaskCreate) AddMetricIDs(ids ...int) *TaskCreate

AddMetricIDs adds the "metrics" edge to the Metric entity by IDs.

func (*TaskCreate) AddMetrics

func (tc *TaskCreate) AddMetrics(m ...*Metric) *TaskCreate

AddMetrics adds the "metrics" edges to the Metric entity.

func (*TaskCreate) AddTagIDs

func (tc *TaskCreate) AddTagIDs(ids ...int) *TaskCreate

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

func (*TaskCreate) AddTags

func (tc *TaskCreate) AddTags(t ...*TaskTag) *TaskCreate

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

func (*TaskCreate) Exec

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

Exec executes the query.

func (*TaskCreate) ExecX

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

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

func (*TaskCreate) Mutation

func (tc *TaskCreate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskCreate) Save

func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)

Save creates the Task in the database.

func (*TaskCreate) SaveX

func (tc *TaskCreate) SaveX(ctx context.Context) *Task

SaveX calls Save and panics if Save returns an error.

func (*TaskCreate) SetActive

func (tc *TaskCreate) SetActive(b bool) *TaskCreate

SetActive sets the "active" field.

func (*TaskCreate) SetArgs

func (tc *TaskCreate) SetArgs(m map[string]interface{}) *TaskCreate

SetArgs sets the "args" field.

func (*TaskCreate) SetCategory

func (tc *TaskCreate) SetCategory(t *TaskCategory) *TaskCreate

SetCategory sets the "category" edge to the TaskCategory entity.

func (*TaskCreate) SetCategoryID

func (tc *TaskCreate) SetCategoryID(id int) *TaskCreate

SetCategoryID sets the "category" edge to the TaskCategory entity by ID.

func (*TaskCreate) SetCode

func (tc *TaskCreate) SetCode(s string) *TaskCreate

SetCode sets the "code" field.

func (*TaskCreate) SetCreateTime

func (tc *TaskCreate) SetCreateTime(t time.Time) *TaskCreate

SetCreateTime sets the "create_time" field.

func (*TaskCreate) SetDescription

func (tc *TaskCreate) SetDescription(s string) *TaskCreate

SetDescription sets the "description" field.

func (*TaskCreate) SetDisplay

func (tc *TaskCreate) SetDisplay(b bool) *TaskCreate

SetDisplay sets the "display" field.

func (*TaskCreate) SetNillableActive

func (tc *TaskCreate) SetNillableActive(b *bool) *TaskCreate

SetNillableActive sets the "active" field if the given value is not nil.

func (*TaskCreate) SetNillableCreateTime

func (tc *TaskCreate) SetNillableCreateTime(t *time.Time) *TaskCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskCreate) SetNillableDescription

func (tc *TaskCreate) SetNillableDescription(s *string) *TaskCreate

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

func (*TaskCreate) SetNillableDisplay

func (tc *TaskCreate) SetNillableDisplay(b *bool) *TaskCreate

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskCreate) SetNillableSchedule

func (tc *TaskCreate) SetNillableSchedule(s *string) *TaskCreate

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*TaskCreate) SetNillableUpdateTime

func (tc *TaskCreate) SetNillableUpdateTime(t *time.Time) *TaskCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TaskCreate) SetSchedule

func (tc *TaskCreate) SetSchedule(s string) *TaskCreate

SetSchedule sets the "schedule" field.

func (*TaskCreate) SetTitle

func (tc *TaskCreate) SetTitle(s string) *TaskCreate

SetTitle sets the "title" field.

func (*TaskCreate) SetType

func (tc *TaskCreate) SetType(t task.Type) *TaskCreate

SetType sets the "type" field.

func (*TaskCreate) SetUpdateTime

func (tc *TaskCreate) SetUpdateTime(t time.Time) *TaskCreate

SetUpdateTime sets the "update_time" field.

type TaskCreateBulk

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

TaskCreateBulk is the builder for creating many Task entities in bulk.

func (*TaskCreateBulk) Exec

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

Exec executes the query.

func (*TaskCreateBulk) ExecX

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

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

func (*TaskCreateBulk) Save

func (tcb *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error)

Save creates the Task entities in the database.

func (*TaskCreateBulk) SaveX

func (tcb *TaskCreateBulk) SaveX(ctx context.Context) []*Task

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

type TaskDelete

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

TaskDelete is the builder for deleting a Task entity.

func (*TaskDelete) Exec

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

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

func (*TaskDelete) ExecX

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

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

func (*TaskDelete) Where

func (td *TaskDelete) Where(ps ...predicate.Task) *TaskDelete

Where appends a list predicates to the TaskDelete builder.

type TaskDeleteOne

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

TaskDeleteOne is the builder for deleting a single Task entity.

func (*TaskDeleteOne) Exec

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

Exec executes the deletion query.

func (*TaskDeleteOne) ExecX

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

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

type TaskEdges

type TaskEdges struct {
	// Instances holds the value of the instances edge.
	Instances []*TaskInstance `json:"instances,omitempty"`
	// Metrics holds the value of the metrics edge.
	Metrics []*Metric `json:"metrics,omitempty"`
	// Category holds the value of the category edge.
	Category *TaskCategory `json:"category,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*TaskTag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (TaskEdges) CategoryOrErr

func (e TaskEdges) CategoryOrErr() (*TaskCategory, error)

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

func (TaskEdges) InstancesOrErr

func (e TaskEdges) InstancesOrErr() ([]*TaskInstance, error)

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

func (TaskEdges) MetricsOrErr

func (e TaskEdges) MetricsOrErr() ([]*Metric, error)

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

func (TaskEdges) TagsOrErr

func (e TaskEdges) TagsOrErr() ([]*TaskTag, error)

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

type TaskGroupBy

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

TaskGroupBy is the group-by builder for Task entities.

func (*TaskGroupBy) Aggregate

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

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

func (*TaskGroupBy) Bool

func (tgb *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) BoolX

func (tgb *TaskGroupBy) BoolX(ctx context.Context) bool

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

func (*TaskGroupBy) Bools

func (tgb *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) BoolsX

func (tgb *TaskGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TaskGroupBy) Float64

func (tgb *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) Float64X

func (tgb *TaskGroupBy) Float64X(ctx context.Context) float64

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

func (*TaskGroupBy) Float64s

func (tgb *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) Float64sX

func (tgb *TaskGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TaskGroupBy) Int

func (tgb *TaskGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) IntX

func (tgb *TaskGroupBy) IntX(ctx context.Context) int

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

func (*TaskGroupBy) Ints

func (tgb *TaskGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) IntsX

func (tgb *TaskGroupBy) IntsX(ctx context.Context) []int

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

func (*TaskGroupBy) Scan

func (tgb *TaskGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TaskGroupBy) ScanX

func (tgb *TaskGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TaskGroupBy) String

func (tgb *TaskGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) StringX

func (tgb *TaskGroupBy) StringX(ctx context.Context) string

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

func (*TaskGroupBy) Strings

func (tgb *TaskGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskGroupBy) StringsX

func (tgb *TaskGroupBy) StringsX(ctx context.Context) []string

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

type TaskInstance

type TaskInstance struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime time.Time `json:"start_time,omitempty"`
	// EndTime holds the value of the "end_time" field.
	EndTime time.Time `json:"end_time,omitempty"`
	// Attempt holds the value of the "attempt" field.
	Attempt int `json:"attempt,omitempty"`
	// Success holds the value of the "success" field.
	Success *bool `json:"success,omitempty"`
	// Running holds the value of the "running" field.
	Running bool `json:"running,omitempty"`
	// Error holds the value of the "error" field.
	Error *string `json:"error,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskInstanceQuery when eager-loading is set.
	Edges TaskInstanceEdges `json:"edges"`
	// contains filtered or unexported fields
}

TaskInstance is the model entity for the TaskInstance schema.

func (*TaskInstance) QueryItems

func (ti *TaskInstance) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the TaskInstance entity.

func (*TaskInstance) QueryTask

func (ti *TaskInstance) QueryTask() *TaskQuery

QueryTask queries the "task" edge of the TaskInstance entity.

func (*TaskInstance) String

func (ti *TaskInstance) String() string

String implements the fmt.Stringer.

func (*TaskInstance) Unwrap

func (ti *TaskInstance) Unwrap() *TaskInstance

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

func (ti *TaskInstance) Update() *TaskInstanceUpdateOne

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

type TaskInstanceClient

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

TaskInstanceClient is a client for the TaskInstance schema.

func NewTaskInstanceClient

func NewTaskInstanceClient(c config) *TaskInstanceClient

NewTaskInstanceClient returns a client for the TaskInstance from the given config.

func (*TaskInstanceClient) Create

Create returns a create builder for TaskInstance.

func (*TaskInstanceClient) CreateBulk

func (c *TaskInstanceClient) CreateBulk(builders ...*TaskInstanceCreate) *TaskInstanceCreateBulk

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

func (*TaskInstanceClient) Delete

Delete returns a delete builder for TaskInstance.

func (*TaskInstanceClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TaskInstanceClient) DeleteOneID

func (c *TaskInstanceClient) DeleteOneID(id int) *TaskInstanceDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TaskInstanceClient) Get

Get returns a TaskInstance entity by its id.

func (*TaskInstanceClient) GetX

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

func (*TaskInstanceClient) Hooks

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

Hooks returns the client hooks.

func (*TaskInstanceClient) Query

Query returns a query builder for TaskInstance.

func (*TaskInstanceClient) QueryItems

func (c *TaskInstanceClient) QueryItems(ti *TaskInstance) *ItemQuery

QueryItems queries the items edge of a TaskInstance.

func (*TaskInstanceClient) QueryTask

func (c *TaskInstanceClient) QueryTask(ti *TaskInstance) *TaskQuery

QueryTask queries the task edge of a TaskInstance.

func (*TaskInstanceClient) Update

Update returns an update builder for TaskInstance.

func (*TaskInstanceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskInstanceClient) UpdateOneID

func (c *TaskInstanceClient) UpdateOneID(id int) *TaskInstanceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskInstanceClient) Use

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

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

type TaskInstanceCreate

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

TaskInstanceCreate is the builder for creating a TaskInstance entity.

func (*TaskInstanceCreate) AddItemIDs

func (tic *TaskInstanceCreate) AddItemIDs(ids ...int) *TaskInstanceCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*TaskInstanceCreate) AddItems

func (tic *TaskInstanceCreate) AddItems(i ...*Item) *TaskInstanceCreate

AddItems adds the "items" edges to the Item entity.

func (*TaskInstanceCreate) Exec

func (tic *TaskInstanceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskInstanceCreate) ExecX

func (tic *TaskInstanceCreate) ExecX(ctx context.Context)

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

func (*TaskInstanceCreate) Mutation

func (tic *TaskInstanceCreate) Mutation() *TaskInstanceMutation

Mutation returns the TaskInstanceMutation object of the builder.

func (*TaskInstanceCreate) Save

Save creates the TaskInstance in the database.

func (*TaskInstanceCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TaskInstanceCreate) SetAttempt

func (tic *TaskInstanceCreate) SetAttempt(i int) *TaskInstanceCreate

SetAttempt sets the "attempt" field.

func (*TaskInstanceCreate) SetCreateTime

func (tic *TaskInstanceCreate) SetCreateTime(t time.Time) *TaskInstanceCreate

SetCreateTime sets the "create_time" field.

func (*TaskInstanceCreate) SetEndTime

func (tic *TaskInstanceCreate) SetEndTime(t time.Time) *TaskInstanceCreate

SetEndTime sets the "end_time" field.

func (*TaskInstanceCreate) SetError

func (tic *TaskInstanceCreate) SetError(s string) *TaskInstanceCreate

SetError sets the "error" field.

func (*TaskInstanceCreate) SetMeta

func (tic *TaskInstanceCreate) SetMeta(m map[string]interface{}) *TaskInstanceCreate

SetMeta sets the "meta" field.

func (*TaskInstanceCreate) SetNillableAttempt

func (tic *TaskInstanceCreate) SetNillableAttempt(i *int) *TaskInstanceCreate

SetNillableAttempt sets the "attempt" field if the given value is not nil.

func (*TaskInstanceCreate) SetNillableCreateTime

func (tic *TaskInstanceCreate) SetNillableCreateTime(t *time.Time) *TaskInstanceCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskInstanceCreate) SetNillableEndTime

func (tic *TaskInstanceCreate) SetNillableEndTime(t *time.Time) *TaskInstanceCreate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*TaskInstanceCreate) SetNillableError

func (tic *TaskInstanceCreate) SetNillableError(s *string) *TaskInstanceCreate

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

func (*TaskInstanceCreate) SetNillableRunning

func (tic *TaskInstanceCreate) SetNillableRunning(b *bool) *TaskInstanceCreate

SetNillableRunning sets the "running" field if the given value is not nil.

func (*TaskInstanceCreate) SetNillableStartTime

func (tic *TaskInstanceCreate) SetNillableStartTime(t *time.Time) *TaskInstanceCreate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*TaskInstanceCreate) SetNillableSuccess

func (tic *TaskInstanceCreate) SetNillableSuccess(b *bool) *TaskInstanceCreate

SetNillableSuccess sets the "success" field if the given value is not nil.

func (*TaskInstanceCreate) SetNillableUpdateTime

func (tic *TaskInstanceCreate) SetNillableUpdateTime(t *time.Time) *TaskInstanceCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TaskInstanceCreate) SetRunning

func (tic *TaskInstanceCreate) SetRunning(b bool) *TaskInstanceCreate

SetRunning sets the "running" field.

func (*TaskInstanceCreate) SetStartTime

func (tic *TaskInstanceCreate) SetStartTime(t time.Time) *TaskInstanceCreate

SetStartTime sets the "start_time" field.

func (*TaskInstanceCreate) SetSuccess

func (tic *TaskInstanceCreate) SetSuccess(b bool) *TaskInstanceCreate

SetSuccess sets the "success" field.

func (*TaskInstanceCreate) SetTask

func (tic *TaskInstanceCreate) SetTask(t *Task) *TaskInstanceCreate

SetTask sets the "task" edge to the Task entity.

func (*TaskInstanceCreate) SetTaskID

func (tic *TaskInstanceCreate) SetTaskID(id int) *TaskInstanceCreate

SetTaskID sets the "task" edge to the Task entity by ID.

func (*TaskInstanceCreate) SetUpdateTime

func (tic *TaskInstanceCreate) SetUpdateTime(t time.Time) *TaskInstanceCreate

SetUpdateTime sets the "update_time" field.

type TaskInstanceCreateBulk

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

TaskInstanceCreateBulk is the builder for creating many TaskInstance entities in bulk.

func (*TaskInstanceCreateBulk) Exec

func (ticb *TaskInstanceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskInstanceCreateBulk) ExecX

func (ticb *TaskInstanceCreateBulk) ExecX(ctx context.Context)

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

func (*TaskInstanceCreateBulk) Save

Save creates the TaskInstance entities in the database.

func (*TaskInstanceCreateBulk) SaveX

func (ticb *TaskInstanceCreateBulk) SaveX(ctx context.Context) []*TaskInstance

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

type TaskInstanceDelete

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

TaskInstanceDelete is the builder for deleting a TaskInstance entity.

func (*TaskInstanceDelete) Exec

func (tid *TaskInstanceDelete) Exec(ctx context.Context) (int, error)

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

func (*TaskInstanceDelete) ExecX

func (tid *TaskInstanceDelete) ExecX(ctx context.Context) int

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

func (*TaskInstanceDelete) Where

Where appends a list predicates to the TaskInstanceDelete builder.

type TaskInstanceDeleteOne

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

TaskInstanceDeleteOne is the builder for deleting a single TaskInstance entity.

func (*TaskInstanceDeleteOne) Exec

func (tido *TaskInstanceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskInstanceDeleteOne) ExecX

func (tido *TaskInstanceDeleteOne) ExecX(ctx context.Context)

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

type TaskInstanceEdges

type TaskInstanceEdges struct {
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// Task holds the value of the task edge.
	Task *Task `json:"task,omitempty"`
	// contains filtered or unexported fields
}

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

func (TaskInstanceEdges) ItemsOrErr

func (e TaskInstanceEdges) ItemsOrErr() ([]*Item, error)

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

func (TaskInstanceEdges) TaskOrErr

func (e TaskInstanceEdges) TaskOrErr() (*Task, error)

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

type TaskInstanceGroupBy

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

TaskInstanceGroupBy is the group-by builder for TaskInstance entities.

func (*TaskInstanceGroupBy) Aggregate

func (tigb *TaskInstanceGroupBy) Aggregate(fns ...AggregateFunc) *TaskInstanceGroupBy

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

func (*TaskInstanceGroupBy) Bool

func (tigb *TaskInstanceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) BoolX

func (tigb *TaskInstanceGroupBy) BoolX(ctx context.Context) bool

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

func (*TaskInstanceGroupBy) Bools

func (tigb *TaskInstanceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) BoolsX

func (tigb *TaskInstanceGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TaskInstanceGroupBy) Float64

func (tigb *TaskInstanceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) Float64X

func (tigb *TaskInstanceGroupBy) Float64X(ctx context.Context) float64

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

func (*TaskInstanceGroupBy) Float64s

func (tigb *TaskInstanceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) Float64sX

func (tigb *TaskInstanceGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TaskInstanceGroupBy) Int

func (tigb *TaskInstanceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) IntX

func (tigb *TaskInstanceGroupBy) IntX(ctx context.Context) int

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

func (*TaskInstanceGroupBy) Ints

func (tigb *TaskInstanceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) IntsX

func (tigb *TaskInstanceGroupBy) IntsX(ctx context.Context) []int

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

func (*TaskInstanceGroupBy) Scan

func (tigb *TaskInstanceGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TaskInstanceGroupBy) ScanX

func (tigb *TaskInstanceGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TaskInstanceGroupBy) String

func (tigb *TaskInstanceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) StringX

func (tigb *TaskInstanceGroupBy) StringX(ctx context.Context) string

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

func (*TaskInstanceGroupBy) Strings

func (tigb *TaskInstanceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskInstanceGroupBy) StringsX

func (tigb *TaskInstanceGroupBy) StringsX(ctx context.Context) []string

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

type TaskInstanceMutation

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

TaskInstanceMutation represents an operation that mutates the TaskInstance nodes in the graph.

func (*TaskInstanceMutation) AddAttempt

func (m *TaskInstanceMutation) AddAttempt(i int)

AddAttempt adds i to the "attempt" field.

func (*TaskInstanceMutation) AddField

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) AddItemIDs

func (m *TaskInstanceMutation) AddItemIDs(ids ...int)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*TaskInstanceMutation) AddedAttempt

func (m *TaskInstanceMutation) AddedAttempt() (r int, exists bool)

AddedAttempt returns the value that was added to the "attempt" field in this mutation.

func (*TaskInstanceMutation) AddedEdges

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

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

func (*TaskInstanceMutation) AddedField

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

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

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

func (*TaskInstanceMutation) AddedIDs

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

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

func (*TaskInstanceMutation) Attempt

func (m *TaskInstanceMutation) Attempt() (r int, exists bool)

Attempt returns the value of the "attempt" field in the mutation.

func (*TaskInstanceMutation) ClearEdge

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) ClearEndTime

func (m *TaskInstanceMutation) ClearEndTime()

ClearEndTime clears the value of the "end_time" field.

func (*TaskInstanceMutation) ClearError

func (m *TaskInstanceMutation) ClearError()

ClearError clears the value of the "error" field.

func (*TaskInstanceMutation) ClearField

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) ClearItems

func (m *TaskInstanceMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*TaskInstanceMutation) ClearMeta

func (m *TaskInstanceMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*TaskInstanceMutation) ClearSuccess

func (m *TaskInstanceMutation) ClearSuccess()

ClearSuccess clears the value of the "success" field.

func (*TaskInstanceMutation) ClearTask

func (m *TaskInstanceMutation) ClearTask()

ClearTask clears the "task" edge to the Task entity.

func (*TaskInstanceMutation) ClearedEdges

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

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

func (*TaskInstanceMutation) ClearedFields

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

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

func (TaskInstanceMutation) Client

func (m TaskInstanceMutation) 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 (*TaskInstanceMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*TaskInstanceMutation) EdgeCleared

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

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

func (*TaskInstanceMutation) EndTime

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

EndTime returns the value of the "end_time" field in the mutation.

func (*TaskInstanceMutation) EndTimeCleared

func (m *TaskInstanceMutation) EndTimeCleared() bool

EndTimeCleared returns if the "end_time" field was cleared in this mutation.

func (*TaskInstanceMutation) Error

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

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

func (*TaskInstanceMutation) ErrorCleared

func (m *TaskInstanceMutation) ErrorCleared() bool

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

func (*TaskInstanceMutation) Field

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

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

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

func (*TaskInstanceMutation) Fields

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

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

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) ItemsCleared

func (m *TaskInstanceMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*TaskInstanceMutation) ItemsIDs

func (m *TaskInstanceMutation) ItemsIDs() (ids []int)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*TaskInstanceMutation) Meta

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

Meta returns the value of the "meta" field in the mutation.

func (*TaskInstanceMutation) MetaCleared

func (m *TaskInstanceMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*TaskInstanceMutation) OldAttempt

func (m *TaskInstanceMutation) OldAttempt(ctx context.Context) (v int, err error)

OldAttempt returns the old "attempt" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldCreateTime

func (m *TaskInstanceMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldEndTime

func (m *TaskInstanceMutation) OldEndTime(ctx context.Context) (v time.Time, err error)

OldEndTime returns the old "end_time" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldError

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

OldError returns the old "error" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldField

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) OldMeta

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

OldMeta returns the old "meta" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldRunning

func (m *TaskInstanceMutation) OldRunning(ctx context.Context) (v bool, err error)

OldRunning returns the old "running" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldStartTime

func (m *TaskInstanceMutation) OldStartTime(ctx context.Context) (v time.Time, err error)

OldStartTime returns the old "start_time" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldSuccess

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

OldSuccess returns the old "success" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) OldUpdateTime

func (m *TaskInstanceMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the TaskInstance entity. If the TaskInstance 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 (*TaskInstanceMutation) Op

func (m *TaskInstanceMutation) Op() Op

Op returns the operation name.

func (*TaskInstanceMutation) RemoveItemIDs

func (m *TaskInstanceMutation) RemoveItemIDs(ids ...int)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*TaskInstanceMutation) RemovedEdges

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

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

func (*TaskInstanceMutation) RemovedIDs

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) RemovedItemsIDs

func (m *TaskInstanceMutation) RemovedItemsIDs() (ids []int)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*TaskInstanceMutation) ResetAttempt

func (m *TaskInstanceMutation) ResetAttempt()

ResetAttempt resets all changes to the "attempt" field.

func (*TaskInstanceMutation) ResetCreateTime

func (m *TaskInstanceMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TaskInstanceMutation) ResetEdge

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) ResetEndTime

func (m *TaskInstanceMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*TaskInstanceMutation) ResetError

func (m *TaskInstanceMutation) ResetError()

ResetError resets all changes to the "error" field.

func (*TaskInstanceMutation) ResetField

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) ResetItems

func (m *TaskInstanceMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*TaskInstanceMutation) ResetMeta

func (m *TaskInstanceMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*TaskInstanceMutation) ResetRunning

func (m *TaskInstanceMutation) ResetRunning()

ResetRunning resets all changes to the "running" field.

func (*TaskInstanceMutation) ResetStartTime

func (m *TaskInstanceMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*TaskInstanceMutation) ResetSuccess

func (m *TaskInstanceMutation) ResetSuccess()

ResetSuccess resets all changes to the "success" field.

func (*TaskInstanceMutation) ResetTask

func (m *TaskInstanceMutation) ResetTask()

ResetTask resets all changes to the "task" edge.

func (*TaskInstanceMutation) ResetUpdateTime

func (m *TaskInstanceMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TaskInstanceMutation) Running

func (m *TaskInstanceMutation) Running() (r bool, exists bool)

Running returns the value of the "running" field in the mutation.

func (*TaskInstanceMutation) SetAttempt

func (m *TaskInstanceMutation) SetAttempt(i int)

SetAttempt sets the "attempt" field.

func (*TaskInstanceMutation) SetCreateTime

func (m *TaskInstanceMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TaskInstanceMutation) SetEndTime

func (m *TaskInstanceMutation) SetEndTime(t time.Time)

SetEndTime sets the "end_time" field.

func (*TaskInstanceMutation) SetError

func (m *TaskInstanceMutation) SetError(s string)

SetError sets the "error" field.

func (*TaskInstanceMutation) SetField

func (m *TaskInstanceMutation) 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 (*TaskInstanceMutation) SetMeta

func (m *TaskInstanceMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*TaskInstanceMutation) SetRunning

func (m *TaskInstanceMutation) SetRunning(b bool)

SetRunning sets the "running" field.

func (*TaskInstanceMutation) SetStartTime

func (m *TaskInstanceMutation) SetStartTime(t time.Time)

SetStartTime sets the "start_time" field.

func (*TaskInstanceMutation) SetSuccess

func (m *TaskInstanceMutation) SetSuccess(b bool)

SetSuccess sets the "success" field.

func (*TaskInstanceMutation) SetTaskID

func (m *TaskInstanceMutation) SetTaskID(id int)

SetTaskID sets the "task" edge to the Task entity by id.

func (*TaskInstanceMutation) SetUpdateTime

func (m *TaskInstanceMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TaskInstanceMutation) StartTime

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

StartTime returns the value of the "start_time" field in the mutation.

func (*TaskInstanceMutation) Success

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

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

func (*TaskInstanceMutation) SuccessCleared

func (m *TaskInstanceMutation) SuccessCleared() bool

SuccessCleared returns if the "success" field was cleared in this mutation.

func (*TaskInstanceMutation) TaskCleared

func (m *TaskInstanceMutation) TaskCleared() bool

TaskCleared reports if the "task" edge to the Task entity was cleared.

func (*TaskInstanceMutation) TaskID

func (m *TaskInstanceMutation) TaskID() (id int, exists bool)

TaskID returns the "task" edge ID in the mutation.

func (*TaskInstanceMutation) TaskIDs

func (m *TaskInstanceMutation) TaskIDs() (ids []int)

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

func (TaskInstanceMutation) Tx

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

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

func (*TaskInstanceMutation) Type

func (m *TaskInstanceMutation) Type() string

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

func (*TaskInstanceMutation) UpdateTime

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

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TaskInstanceMutation) Where

Where appends a list predicates to the TaskInstanceMutation builder.

type TaskInstanceQuery

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

TaskInstanceQuery is the builder for querying TaskInstance entities.

func (*TaskInstanceQuery) All

func (tiq *TaskInstanceQuery) All(ctx context.Context) ([]*TaskInstance, error)

All executes the query and returns a list of TaskInstances.

func (*TaskInstanceQuery) AllX

func (tiq *TaskInstanceQuery) AllX(ctx context.Context) []*TaskInstance

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

func (*TaskInstanceQuery) Clone

func (tiq *TaskInstanceQuery) Clone() *TaskInstanceQuery

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

func (*TaskInstanceQuery) Count

func (tiq *TaskInstanceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskInstanceQuery) CountX

func (tiq *TaskInstanceQuery) CountX(ctx context.Context) int

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

func (*TaskInstanceQuery) Exist

func (tiq *TaskInstanceQuery) Exist(ctx context.Context) (bool, error)

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

func (*TaskInstanceQuery) ExistX

func (tiq *TaskInstanceQuery) ExistX(ctx context.Context) bool

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

func (*TaskInstanceQuery) First

func (tiq *TaskInstanceQuery) First(ctx context.Context) (*TaskInstance, error)

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

func (*TaskInstanceQuery) FirstID

func (tiq *TaskInstanceQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TaskInstanceQuery) FirstIDX

func (tiq *TaskInstanceQuery) FirstIDX(ctx context.Context) int

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

func (*TaskInstanceQuery) FirstX

func (tiq *TaskInstanceQuery) FirstX(ctx context.Context) *TaskInstance

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

func (*TaskInstanceQuery) GroupBy

func (tiq *TaskInstanceQuery) GroupBy(field string, fields ...string) *TaskInstanceGroupBy

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

client.TaskInstance.Query().
	GroupBy(taskinstance.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskInstanceQuery) IDs

func (tiq *TaskInstanceQuery) IDs(ctx context.Context) ([]int, error)

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

func (*TaskInstanceQuery) IDsX

func (tiq *TaskInstanceQuery) IDsX(ctx context.Context) []int

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

func (*TaskInstanceQuery) Limit

func (tiq *TaskInstanceQuery) Limit(limit int) *TaskInstanceQuery

Limit adds a limit step to the query.

func (*TaskInstanceQuery) Offset

func (tiq *TaskInstanceQuery) Offset(offset int) *TaskInstanceQuery

Offset adds an offset step to the query.

func (*TaskInstanceQuery) Only

func (tiq *TaskInstanceQuery) Only(ctx context.Context) (*TaskInstance, error)

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

func (*TaskInstanceQuery) OnlyID

func (tiq *TaskInstanceQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TaskInstanceQuery) OnlyIDX

func (tiq *TaskInstanceQuery) OnlyIDX(ctx context.Context) int

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

func (*TaskInstanceQuery) OnlyX

func (tiq *TaskInstanceQuery) OnlyX(ctx context.Context) *TaskInstance

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

func (*TaskInstanceQuery) Order

func (tiq *TaskInstanceQuery) Order(o ...OrderFunc) *TaskInstanceQuery

Order adds an order step to the query.

func (*TaskInstanceQuery) QueryItems

func (tiq *TaskInstanceQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*TaskInstanceQuery) QueryTask

func (tiq *TaskInstanceQuery) QueryTask() *TaskQuery

QueryTask chains the current query on the "task" edge.

func (*TaskInstanceQuery) Select

func (tiq *TaskInstanceQuery) Select(fields ...string) *TaskInstanceSelect

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

client.TaskInstance.Query().
	Select(taskinstance.FieldCreateTime).
	Scan(ctx, &v)

func (*TaskInstanceQuery) Unique

func (tiq *TaskInstanceQuery) Unique(unique bool) *TaskInstanceQuery

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

Where adds a new predicate for the TaskInstanceQuery builder.

func (*TaskInstanceQuery) WithItems

func (tiq *TaskInstanceQuery) WithItems(opts ...func(*ItemQuery)) *TaskInstanceQuery

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

func (*TaskInstanceQuery) WithTask

func (tiq *TaskInstanceQuery) WithTask(opts ...func(*TaskQuery)) *TaskInstanceQuery

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

type TaskInstanceSelect

type TaskInstanceSelect struct {
	*TaskInstanceQuery
	// contains filtered or unexported fields
}

TaskInstanceSelect is the builder for selecting fields of TaskInstance entities.

func (*TaskInstanceSelect) Bool

func (tis *TaskInstanceSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TaskInstanceSelect) BoolX

func (tis *TaskInstanceSelect) BoolX(ctx context.Context) bool

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

func (*TaskInstanceSelect) Bools

func (tis *TaskInstanceSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TaskInstanceSelect) BoolsX

func (tis *TaskInstanceSelect) BoolsX(ctx context.Context) []bool

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

func (*TaskInstanceSelect) Float64

func (tis *TaskInstanceSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TaskInstanceSelect) Float64X

func (tis *TaskInstanceSelect) Float64X(ctx context.Context) float64

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

func (*TaskInstanceSelect) Float64s

func (tis *TaskInstanceSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TaskInstanceSelect) Float64sX

func (tis *TaskInstanceSelect) Float64sX(ctx context.Context) []float64

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

func (*TaskInstanceSelect) Int

func (tis *TaskInstanceSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TaskInstanceSelect) IntX

func (tis *TaskInstanceSelect) IntX(ctx context.Context) int

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

func (*TaskInstanceSelect) Ints

func (tis *TaskInstanceSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TaskInstanceSelect) IntsX

func (tis *TaskInstanceSelect) IntsX(ctx context.Context) []int

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

func (*TaskInstanceSelect) Scan

func (tis *TaskInstanceSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TaskInstanceSelect) ScanX

func (tis *TaskInstanceSelect) ScanX(ctx context.Context, v interface{})

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

func (*TaskInstanceSelect) String

func (tis *TaskInstanceSelect) String(ctx context.Context) (_ string, err error)

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

func (*TaskInstanceSelect) StringX

func (tis *TaskInstanceSelect) StringX(ctx context.Context) string

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

func (*TaskInstanceSelect) Strings

func (tis *TaskInstanceSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TaskInstanceSelect) StringsX

func (tis *TaskInstanceSelect) StringsX(ctx context.Context) []string

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

type TaskInstanceUpdate

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

TaskInstanceUpdate is the builder for updating TaskInstance entities.

func (*TaskInstanceUpdate) AddItemIDs

func (tiu *TaskInstanceUpdate) AddItemIDs(ids ...int) *TaskInstanceUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*TaskInstanceUpdate) AddItems

func (tiu *TaskInstanceUpdate) AddItems(i ...*Item) *TaskInstanceUpdate

AddItems adds the "items" edges to the Item entity.

func (*TaskInstanceUpdate) ClearEndTime

func (tiu *TaskInstanceUpdate) ClearEndTime() *TaskInstanceUpdate

ClearEndTime clears the value of the "end_time" field.

func (*TaskInstanceUpdate) ClearError

func (tiu *TaskInstanceUpdate) ClearError() *TaskInstanceUpdate

ClearError clears the value of the "error" field.

func (*TaskInstanceUpdate) ClearItems

func (tiu *TaskInstanceUpdate) ClearItems() *TaskInstanceUpdate

ClearItems clears all "items" edges to the Item entity.

func (*TaskInstanceUpdate) ClearMeta

func (tiu *TaskInstanceUpdate) ClearMeta() *TaskInstanceUpdate

ClearMeta clears the value of the "meta" field.

func (*TaskInstanceUpdate) ClearSuccess

func (tiu *TaskInstanceUpdate) ClearSuccess() *TaskInstanceUpdate

ClearSuccess clears the value of the "success" field.

func (*TaskInstanceUpdate) ClearTask

func (tiu *TaskInstanceUpdate) ClearTask() *TaskInstanceUpdate

ClearTask clears the "task" edge to the Task entity.

func (*TaskInstanceUpdate) Exec

func (tiu *TaskInstanceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskInstanceUpdate) ExecX

func (tiu *TaskInstanceUpdate) ExecX(ctx context.Context)

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

func (*TaskInstanceUpdate) Mutation

func (tiu *TaskInstanceUpdate) Mutation() *TaskInstanceMutation

Mutation returns the TaskInstanceMutation object of the builder.

func (*TaskInstanceUpdate) RemoveItemIDs

func (tiu *TaskInstanceUpdate) RemoveItemIDs(ids ...int) *TaskInstanceUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*TaskInstanceUpdate) RemoveItems

func (tiu *TaskInstanceUpdate) RemoveItems(i ...*Item) *TaskInstanceUpdate

RemoveItems removes "items" edges to Item entities.

func (*TaskInstanceUpdate) Save

func (tiu *TaskInstanceUpdate) Save(ctx context.Context) (int, error)

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

func (*TaskInstanceUpdate) SaveX

func (tiu *TaskInstanceUpdate) SaveX(ctx context.Context) int

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

func (*TaskInstanceUpdate) SetEndTime

func (tiu *TaskInstanceUpdate) SetEndTime(t time.Time) *TaskInstanceUpdate

SetEndTime sets the "end_time" field.

func (*TaskInstanceUpdate) SetError

func (tiu *TaskInstanceUpdate) SetError(s string) *TaskInstanceUpdate

SetError sets the "error" field.

func (*TaskInstanceUpdate) SetMeta

func (tiu *TaskInstanceUpdate) SetMeta(m map[string]interface{}) *TaskInstanceUpdate

SetMeta sets the "meta" field.

func (*TaskInstanceUpdate) SetNillableEndTime

func (tiu *TaskInstanceUpdate) SetNillableEndTime(t *time.Time) *TaskInstanceUpdate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*TaskInstanceUpdate) SetNillableError

func (tiu *TaskInstanceUpdate) SetNillableError(s *string) *TaskInstanceUpdate

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

func (*TaskInstanceUpdate) SetNillableRunning

func (tiu *TaskInstanceUpdate) SetNillableRunning(b *bool) *TaskInstanceUpdate

SetNillableRunning sets the "running" field if the given value is not nil.

func (*TaskInstanceUpdate) SetNillableStartTime

func (tiu *TaskInstanceUpdate) SetNillableStartTime(t *time.Time) *TaskInstanceUpdate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*TaskInstanceUpdate) SetNillableSuccess

func (tiu *TaskInstanceUpdate) SetNillableSuccess(b *bool) *TaskInstanceUpdate

SetNillableSuccess sets the "success" field if the given value is not nil.

func (*TaskInstanceUpdate) SetRunning

func (tiu *TaskInstanceUpdate) SetRunning(b bool) *TaskInstanceUpdate

SetRunning sets the "running" field.

func (*TaskInstanceUpdate) SetStartTime

func (tiu *TaskInstanceUpdate) SetStartTime(t time.Time) *TaskInstanceUpdate

SetStartTime sets the "start_time" field.

func (*TaskInstanceUpdate) SetSuccess

func (tiu *TaskInstanceUpdate) SetSuccess(b bool) *TaskInstanceUpdate

SetSuccess sets the "success" field.

func (*TaskInstanceUpdate) SetTask

func (tiu *TaskInstanceUpdate) SetTask(t *Task) *TaskInstanceUpdate

SetTask sets the "task" edge to the Task entity.

func (*TaskInstanceUpdate) SetTaskID

func (tiu *TaskInstanceUpdate) SetTaskID(id int) *TaskInstanceUpdate

SetTaskID sets the "task" edge to the Task entity by ID.

func (*TaskInstanceUpdate) SetUpdateTime

func (tiu *TaskInstanceUpdate) SetUpdateTime(t time.Time) *TaskInstanceUpdate

SetUpdateTime sets the "update_time" field.

func (*TaskInstanceUpdate) Where

Where appends a list predicates to the TaskInstanceUpdate builder.

type TaskInstanceUpdateOne

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

TaskInstanceUpdateOne is the builder for updating a single TaskInstance entity.

func (*TaskInstanceUpdateOne) AddItemIDs

func (tiuo *TaskInstanceUpdateOne) AddItemIDs(ids ...int) *TaskInstanceUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*TaskInstanceUpdateOne) AddItems

func (tiuo *TaskInstanceUpdateOne) AddItems(i ...*Item) *TaskInstanceUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*TaskInstanceUpdateOne) ClearEndTime

func (tiuo *TaskInstanceUpdateOne) ClearEndTime() *TaskInstanceUpdateOne

ClearEndTime clears the value of the "end_time" field.

func (*TaskInstanceUpdateOne) ClearError

func (tiuo *TaskInstanceUpdateOne) ClearError() *TaskInstanceUpdateOne

ClearError clears the value of the "error" field.

func (*TaskInstanceUpdateOne) ClearItems

func (tiuo *TaskInstanceUpdateOne) ClearItems() *TaskInstanceUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*TaskInstanceUpdateOne) ClearMeta

func (tiuo *TaskInstanceUpdateOne) ClearMeta() *TaskInstanceUpdateOne

ClearMeta clears the value of the "meta" field.

func (*TaskInstanceUpdateOne) ClearSuccess

func (tiuo *TaskInstanceUpdateOne) ClearSuccess() *TaskInstanceUpdateOne

ClearSuccess clears the value of the "success" field.

func (*TaskInstanceUpdateOne) ClearTask

func (tiuo *TaskInstanceUpdateOne) ClearTask() *TaskInstanceUpdateOne

ClearTask clears the "task" edge to the Task entity.

func (*TaskInstanceUpdateOne) Exec

func (tiuo *TaskInstanceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskInstanceUpdateOne) ExecX

func (tiuo *TaskInstanceUpdateOne) ExecX(ctx context.Context)

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

func (*TaskInstanceUpdateOne) Mutation

func (tiuo *TaskInstanceUpdateOne) Mutation() *TaskInstanceMutation

Mutation returns the TaskInstanceMutation object of the builder.

func (*TaskInstanceUpdateOne) RemoveItemIDs

func (tiuo *TaskInstanceUpdateOne) RemoveItemIDs(ids ...int) *TaskInstanceUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*TaskInstanceUpdateOne) RemoveItems

func (tiuo *TaskInstanceUpdateOne) RemoveItems(i ...*Item) *TaskInstanceUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*TaskInstanceUpdateOne) Save

Save executes the query and returns the updated TaskInstance entity.

func (*TaskInstanceUpdateOne) SaveX

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

func (*TaskInstanceUpdateOne) Select

func (tiuo *TaskInstanceUpdateOne) Select(field string, fields ...string) *TaskInstanceUpdateOne

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

func (*TaskInstanceUpdateOne) SetEndTime

SetEndTime sets the "end_time" field.

func (*TaskInstanceUpdateOne) SetError

SetError sets the "error" field.

func (*TaskInstanceUpdateOne) SetMeta

func (tiuo *TaskInstanceUpdateOne) SetMeta(m map[string]interface{}) *TaskInstanceUpdateOne

SetMeta sets the "meta" field.

func (*TaskInstanceUpdateOne) SetNillableEndTime

func (tiuo *TaskInstanceUpdateOne) SetNillableEndTime(t *time.Time) *TaskInstanceUpdateOne

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*TaskInstanceUpdateOne) SetNillableError

func (tiuo *TaskInstanceUpdateOne) SetNillableError(s *string) *TaskInstanceUpdateOne

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

func (*TaskInstanceUpdateOne) SetNillableRunning

func (tiuo *TaskInstanceUpdateOne) SetNillableRunning(b *bool) *TaskInstanceUpdateOne

SetNillableRunning sets the "running" field if the given value is not nil.

func (*TaskInstanceUpdateOne) SetNillableStartTime

func (tiuo *TaskInstanceUpdateOne) SetNillableStartTime(t *time.Time) *TaskInstanceUpdateOne

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*TaskInstanceUpdateOne) SetNillableSuccess

func (tiuo *TaskInstanceUpdateOne) SetNillableSuccess(b *bool) *TaskInstanceUpdateOne

SetNillableSuccess sets the "success" field if the given value is not nil.

func (*TaskInstanceUpdateOne) SetRunning

func (tiuo *TaskInstanceUpdateOne) SetRunning(b bool) *TaskInstanceUpdateOne

SetRunning sets the "running" field.

func (*TaskInstanceUpdateOne) SetStartTime

func (tiuo *TaskInstanceUpdateOne) SetStartTime(t time.Time) *TaskInstanceUpdateOne

SetStartTime sets the "start_time" field.

func (*TaskInstanceUpdateOne) SetSuccess

func (tiuo *TaskInstanceUpdateOne) SetSuccess(b bool) *TaskInstanceUpdateOne

SetSuccess sets the "success" field.

func (*TaskInstanceUpdateOne) SetTask

SetTask sets the "task" edge to the Task entity.

func (*TaskInstanceUpdateOne) SetTaskID

func (tiuo *TaskInstanceUpdateOne) SetTaskID(id int) *TaskInstanceUpdateOne

SetTaskID sets the "task" edge to the Task entity by ID.

func (*TaskInstanceUpdateOne) SetUpdateTime

func (tiuo *TaskInstanceUpdateOne) SetUpdateTime(t time.Time) *TaskInstanceUpdateOne

SetUpdateTime sets the "update_time" field.

type TaskInstances

type TaskInstances []*TaskInstance

TaskInstances is a parsable slice of TaskInstance.

type TaskMutation

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

TaskMutation represents an operation that mutates the Task nodes in the graph.

func (*TaskMutation) Active

func (m *TaskMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*TaskMutation) AddField

func (m *TaskMutation) 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 (*TaskMutation) AddInstanceIDs

func (m *TaskMutation) AddInstanceIDs(ids ...int)

AddInstanceIDs adds the "instances" edge to the TaskInstance entity by ids.

func (*TaskMutation) AddMetricIDs

func (m *TaskMutation) AddMetricIDs(ids ...int)

AddMetricIDs adds the "metrics" edge to the Metric entity by ids.

func (*TaskMutation) AddTagIDs

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

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

func (*TaskMutation) AddedEdges

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

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

func (*TaskMutation) AddedField

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

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

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

func (*TaskMutation) AddedIDs

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

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

func (*TaskMutation) Args

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

Args returns the value of the "args" field in the mutation.

func (*TaskMutation) ArgsCleared

func (m *TaskMutation) ArgsCleared() bool

ArgsCleared returns if the "args" field was cleared in this mutation.

func (*TaskMutation) CategoryCleared

func (m *TaskMutation) CategoryCleared() bool

CategoryCleared reports if the "category" edge to the TaskCategory entity was cleared.

func (*TaskMutation) CategoryID

func (m *TaskMutation) CategoryID() (id int, exists bool)

CategoryID returns the "category" edge ID in the mutation.

func (*TaskMutation) CategoryIDs

func (m *TaskMutation) CategoryIDs() (ids []int)

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

func (*TaskMutation) ClearArgs

func (m *TaskMutation) ClearArgs()

ClearArgs clears the value of the "args" field.

func (*TaskMutation) ClearCategory

func (m *TaskMutation) ClearCategory()

ClearCategory clears the "category" edge to the TaskCategory entity.

func (*TaskMutation) ClearDescription

func (m *TaskMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*TaskMutation) ClearEdge

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

func (m *TaskMutation) 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 (*TaskMutation) ClearInstances

func (m *TaskMutation) ClearInstances()

ClearInstances clears the "instances" edge to the TaskInstance entity.

func (*TaskMutation) ClearMetrics

func (m *TaskMutation) ClearMetrics()

ClearMetrics clears the "metrics" edge to the Metric entity.

func (*TaskMutation) ClearSchedule

func (m *TaskMutation) ClearSchedule()

ClearSchedule clears the value of the "schedule" field.

func (*TaskMutation) ClearTags

func (m *TaskMutation) ClearTags()

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

func (*TaskMutation) ClearedEdges

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

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

func (*TaskMutation) ClearedFields

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

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

func (TaskMutation) Client

func (m TaskMutation) 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 (*TaskMutation) Code

func (m *TaskMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*TaskMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*TaskMutation) Description

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

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

func (*TaskMutation) DescriptionCleared

func (m *TaskMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*TaskMutation) Display

func (m *TaskMutation) Display() (r bool, exists bool)

Display returns the value of the "display" field in the mutation.

func (*TaskMutation) EdgeCleared

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

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

func (*TaskMutation) Field

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

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

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

func (*TaskMutation) Fields

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

func (m *TaskMutation) GetType() (r task.Type, exists bool)

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

func (*TaskMutation) ID

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

func (m *TaskMutation) 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 (*TaskMutation) InstancesCleared

func (m *TaskMutation) InstancesCleared() bool

InstancesCleared reports if the "instances" edge to the TaskInstance entity was cleared.

func (*TaskMutation) InstancesIDs

func (m *TaskMutation) InstancesIDs() (ids []int)

InstancesIDs returns the "instances" edge IDs in the mutation.

func (*TaskMutation) MetricsCleared

func (m *TaskMutation) MetricsCleared() bool

MetricsCleared reports if the "metrics" edge to the Metric entity was cleared.

func (*TaskMutation) MetricsIDs

func (m *TaskMutation) MetricsIDs() (ids []int)

MetricsIDs returns the "metrics" edge IDs in the mutation.

func (*TaskMutation) OldActive

func (m *TaskMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the Task entity. If the Task 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 (*TaskMutation) OldArgs

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

OldArgs returns the old "args" field's value of the Task entity. If the Task 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 (*TaskMutation) OldCode

func (m *TaskMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Task entity. If the Task 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 (*TaskMutation) OldCreateTime

func (m *TaskMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Task entity. If the Task 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 (*TaskMutation) OldDescription

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

OldDescription returns the old "description" field's value of the Task entity. If the Task 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 (*TaskMutation) OldDisplay

func (m *TaskMutation) OldDisplay(ctx context.Context) (v bool, err error)

OldDisplay returns the old "display" field's value of the Task entity. If the Task 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 (*TaskMutation) OldField

func (m *TaskMutation) 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 (*TaskMutation) OldSchedule

func (m *TaskMutation) OldSchedule(ctx context.Context) (v string, err error)

OldSchedule returns the old "schedule" field's value of the Task entity. If the Task 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 (*TaskMutation) OldTitle

func (m *TaskMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Task entity. If the Task 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 (*TaskMutation) OldType

func (m *TaskMutation) OldType(ctx context.Context) (v task.Type, err error)

OldType returns the old "type" field's value of the Task entity. If the Task 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 (*TaskMutation) OldUpdateTime

func (m *TaskMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Task entity. If the Task 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 (*TaskMutation) Op

func (m *TaskMutation) Op() Op

Op returns the operation name.

func (*TaskMutation) RemoveInstanceIDs

func (m *TaskMutation) RemoveInstanceIDs(ids ...int)

RemoveInstanceIDs removes the "instances" edge to the TaskInstance entity by IDs.

func (*TaskMutation) RemoveMetricIDs

func (m *TaskMutation) RemoveMetricIDs(ids ...int)

RemoveMetricIDs removes the "metrics" edge to the Metric entity by IDs.

func (*TaskMutation) RemoveTagIDs

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

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

func (*TaskMutation) RemovedEdges

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

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

func (*TaskMutation) RemovedIDs

func (m *TaskMutation) 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 (*TaskMutation) RemovedInstancesIDs

func (m *TaskMutation) RemovedInstancesIDs() (ids []int)

RemovedInstances returns the removed IDs of the "instances" edge to the TaskInstance entity.

func (*TaskMutation) RemovedMetricsIDs

func (m *TaskMutation) RemovedMetricsIDs() (ids []int)

RemovedMetrics returns the removed IDs of the "metrics" edge to the Metric entity.

func (*TaskMutation) RemovedTagsIDs

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

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

func (*TaskMutation) ResetActive

func (m *TaskMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*TaskMutation) ResetArgs

func (m *TaskMutation) ResetArgs()

ResetArgs resets all changes to the "args" field.

func (*TaskMutation) ResetCategory

func (m *TaskMutation) ResetCategory()

ResetCategory resets all changes to the "category" edge.

func (*TaskMutation) ResetCode

func (m *TaskMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*TaskMutation) ResetCreateTime

func (m *TaskMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TaskMutation) ResetDescription

func (m *TaskMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TaskMutation) ResetDisplay

func (m *TaskMutation) ResetDisplay()

ResetDisplay resets all changes to the "display" field.

func (*TaskMutation) ResetEdge

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

func (m *TaskMutation) 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 (*TaskMutation) ResetInstances

func (m *TaskMutation) ResetInstances()

ResetInstances resets all changes to the "instances" edge.

func (*TaskMutation) ResetMetrics

func (m *TaskMutation) ResetMetrics()

ResetMetrics resets all changes to the "metrics" edge.

func (*TaskMutation) ResetSchedule

func (m *TaskMutation) ResetSchedule()

ResetSchedule resets all changes to the "schedule" field.

func (*TaskMutation) ResetTags

func (m *TaskMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*TaskMutation) ResetTitle

func (m *TaskMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*TaskMutation) ResetType

func (m *TaskMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*TaskMutation) ResetUpdateTime

func (m *TaskMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TaskMutation) Schedule

func (m *TaskMutation) Schedule() (r string, exists bool)

Schedule returns the value of the "schedule" field in the mutation.

func (*TaskMutation) ScheduleCleared

func (m *TaskMutation) ScheduleCleared() bool

ScheduleCleared returns if the "schedule" field was cleared in this mutation.

func (*TaskMutation) SetActive

func (m *TaskMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*TaskMutation) SetArgs

func (m *TaskMutation) SetArgs(value map[string]interface{})

SetArgs sets the "args" field.

func (*TaskMutation) SetCategoryID

func (m *TaskMutation) SetCategoryID(id int)

SetCategoryID sets the "category" edge to the TaskCategory entity by id.

func (*TaskMutation) SetCode

func (m *TaskMutation) SetCode(s string)

SetCode sets the "code" field.

func (*TaskMutation) SetCreateTime

func (m *TaskMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TaskMutation) SetDescription

func (m *TaskMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TaskMutation) SetDisplay

func (m *TaskMutation) SetDisplay(b bool)

SetDisplay sets the "display" field.

func (*TaskMutation) SetField

func (m *TaskMutation) 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 (*TaskMutation) SetSchedule

func (m *TaskMutation) SetSchedule(s string)

SetSchedule sets the "schedule" field.

func (*TaskMutation) SetTitle

func (m *TaskMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*TaskMutation) SetType

func (m *TaskMutation) SetType(t task.Type)

SetType sets the "type" field.

func (*TaskMutation) SetUpdateTime

func (m *TaskMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TaskMutation) TagsCleared

func (m *TaskMutation) TagsCleared() bool

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

func (*TaskMutation) TagsIDs

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

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

func (*TaskMutation) Title

func (m *TaskMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (TaskMutation) Tx

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

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

func (*TaskMutation) Type

func (m *TaskMutation) Type() string

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

func (*TaskMutation) UpdateTime

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

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TaskMutation) Where

func (m *TaskMutation) Where(ps ...predicate.Task)

Where appends a list predicates to the TaskMutation builder.

type TaskQuery

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

TaskQuery is the builder for querying Task entities.

func (*TaskQuery) All

func (tq *TaskQuery) All(ctx context.Context) ([]*Task, error)

All executes the query and returns a list of Tasks.

func (*TaskQuery) AllX

func (tq *TaskQuery) AllX(ctx context.Context) []*Task

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

func (*TaskQuery) Clone

func (tq *TaskQuery) Clone() *TaskQuery

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

func (*TaskQuery) Count

func (tq *TaskQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskQuery) CountX

func (tq *TaskQuery) CountX(ctx context.Context) int

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

func (*TaskQuery) Exist

func (tq *TaskQuery) Exist(ctx context.Context) (bool, error)

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

func (*TaskQuery) ExistX

func (tq *TaskQuery) ExistX(ctx context.Context) bool

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

func (*TaskQuery) First

func (tq *TaskQuery) First(ctx context.Context) (*Task, error)

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

func (*TaskQuery) FirstID

func (tq *TaskQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TaskQuery) FirstIDX

func (tq *TaskQuery) FirstIDX(ctx context.Context) int

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

func (*TaskQuery) FirstX

func (tq *TaskQuery) FirstX(ctx context.Context) *Task

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

func (*TaskQuery) GroupBy

func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy

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

client.Task.Query().
	GroupBy(task.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskQuery) IDs

func (tq *TaskQuery) IDs(ctx context.Context) ([]int, error)

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

func (*TaskQuery) IDsX

func (tq *TaskQuery) IDsX(ctx context.Context) []int

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

func (*TaskQuery) Limit

func (tq *TaskQuery) Limit(limit int) *TaskQuery

Limit adds a limit step to the query.

func (*TaskQuery) Offset

func (tq *TaskQuery) Offset(offset int) *TaskQuery

Offset adds an offset step to the query.

func (*TaskQuery) Only

func (tq *TaskQuery) Only(ctx context.Context) (*Task, error)

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

func (*TaskQuery) OnlyID

func (tq *TaskQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TaskQuery) OnlyIDX

func (tq *TaskQuery) OnlyIDX(ctx context.Context) int

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

func (*TaskQuery) OnlyX

func (tq *TaskQuery) OnlyX(ctx context.Context) *Task

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

func (*TaskQuery) Order

func (tq *TaskQuery) Order(o ...OrderFunc) *TaskQuery

Order adds an order step to the query.

func (*TaskQuery) QueryCategory

func (tq *TaskQuery) QueryCategory() *TaskCategoryQuery

QueryCategory chains the current query on the "category" edge.

func (*TaskQuery) QueryInstances

func (tq *TaskQuery) QueryInstances() *TaskInstanceQuery

QueryInstances chains the current query on the "instances" edge.

func (*TaskQuery) QueryMetrics

func (tq *TaskQuery) QueryMetrics() *MetricQuery

QueryMetrics chains the current query on the "metrics" edge.

func (*TaskQuery) QueryTags

func (tq *TaskQuery) QueryTags() *TaskTagQuery

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

func (*TaskQuery) Select

func (tq *TaskQuery) Select(fields ...string) *TaskSelect

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

client.Task.Query().
	Select(task.FieldCreateTime).
	Scan(ctx, &v)

func (*TaskQuery) Unique

func (tq *TaskQuery) Unique(unique bool) *TaskQuery

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 (*TaskQuery) Where

func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery

Where adds a new predicate for the TaskQuery builder.

func (*TaskQuery) WithCategory

func (tq *TaskQuery) WithCategory(opts ...func(*TaskCategoryQuery)) *TaskQuery

WithCategory tells the query-builder to eager-load the nodes that are connected to the "category" edge. The optional arguments are used to configure the query builder of the edge.

func (*TaskQuery) WithInstances

func (tq *TaskQuery) WithInstances(opts ...func(*TaskInstanceQuery)) *TaskQuery

WithInstances tells the query-builder to eager-load the nodes that are connected to the "instances" edge. The optional arguments are used to configure the query builder of the edge.

func (*TaskQuery) WithMetrics

func (tq *TaskQuery) WithMetrics(opts ...func(*MetricQuery)) *TaskQuery

WithMetrics tells the query-builder to eager-load the nodes that are connected to the "metrics" edge. The optional arguments are used to configure the query builder of the edge.

func (*TaskQuery) WithTags

func (tq *TaskQuery) WithTags(opts ...func(*TaskTagQuery)) *TaskQuery

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.

type TaskSelect

type TaskSelect struct {
	*TaskQuery
	// contains filtered or unexported fields
}

TaskSelect is the builder for selecting fields of Task entities.

func (*TaskSelect) Bool

func (ts *TaskSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolX

func (ts *TaskSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskSelect) Bools

func (ts *TaskSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolsX

func (ts *TaskSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskSelect) Float64

func (ts *TaskSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64X

func (ts *TaskSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskSelect) Float64s

func (ts *TaskSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64sX

func (ts *TaskSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskSelect) Int

func (ts *TaskSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntX

func (ts *TaskSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskSelect) Ints

func (ts *TaskSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntsX

func (ts *TaskSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskSelect) Scan

func (ts *TaskSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TaskSelect) ScanX

func (ts *TaskSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TaskSelect) String

func (ts *TaskSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringX

func (ts *TaskSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskSelect) Strings

func (ts *TaskSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringsX

func (ts *TaskSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskTag

type TaskTag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Display holds the value of the "display" field.
	Display bool `json:"display,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskTagQuery when eager-loading is set.
	Edges TaskTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

TaskTag is the model entity for the TaskTag schema.

func (*TaskTag) QueryTasks

func (tt *TaskTag) QueryTasks() *TaskQuery

QueryTasks queries the "tasks" edge of the TaskTag entity.

func (*TaskTag) String

func (tt *TaskTag) String() string

String implements the fmt.Stringer.

func (*TaskTag) Unwrap

func (tt *TaskTag) Unwrap() *TaskTag

Unwrap unwraps the TaskTag 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 (*TaskTag) Update

func (tt *TaskTag) Update() *TaskTagUpdateOne

Update returns a builder for updating this TaskTag. Note that you need to call TaskTag.Unwrap() before calling this method if this TaskTag was returned from a transaction, and the transaction was committed or rolled back.

type TaskTagClient

type TaskTagClient struct {
	// contains filtered or unexported fields
}

TaskTagClient is a client for the TaskTag schema.

func NewTaskTagClient

func NewTaskTagClient(c config) *TaskTagClient

NewTaskTagClient returns a client for the TaskTag from the given config.

func (*TaskTagClient) Create

func (c *TaskTagClient) Create() *TaskTagCreate

Create returns a create builder for TaskTag.

func (*TaskTagClient) CreateBulk

func (c *TaskTagClient) CreateBulk(builders ...*TaskTagCreate) *TaskTagCreateBulk

CreateBulk returns a builder for creating a bulk of TaskTag entities.

func (*TaskTagClient) Delete

func (c *TaskTagClient) Delete() *TaskTagDelete

Delete returns a delete builder for TaskTag.

func (*TaskTagClient) DeleteOne

func (c *TaskTagClient) DeleteOne(tt *TaskTag) *TaskTagDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TaskTagClient) DeleteOneID

func (c *TaskTagClient) DeleteOneID(id int) *TaskTagDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TaskTagClient) Get

func (c *TaskTagClient) Get(ctx context.Context, id int) (*TaskTag, error)

Get returns a TaskTag entity by its id.

func (*TaskTagClient) GetX

func (c *TaskTagClient) GetX(ctx context.Context, id int) *TaskTag

GetX is like Get, but panics if an error occurs.

func (*TaskTagClient) Hooks

func (c *TaskTagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TaskTagClient) Query

func (c *TaskTagClient) Query() *TaskTagQuery

Query returns a query builder for TaskTag.

func (*TaskTagClient) QueryTasks

func (c *TaskTagClient) QueryTasks(tt *TaskTag) *TaskQuery

QueryTasks queries the tasks edge of a TaskTag.

func (*TaskTagClient) Update

func (c *TaskTagClient) Update() *TaskTagUpdate

Update returns an update builder for TaskTag.

func (*TaskTagClient) UpdateOne

func (c *TaskTagClient) UpdateOne(tt *TaskTag) *TaskTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskTagClient) UpdateOneID

func (c *TaskTagClient) UpdateOneID(id int) *TaskTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskTagClient) Use

func (c *TaskTagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tasktag.Hooks(f(g(h())))`.

type TaskTagCreate

type TaskTagCreate struct {
	// contains filtered or unexported fields
}

TaskTagCreate is the builder for creating a TaskTag entity.

func (*TaskTagCreate) AddTaskIDs

func (ttc *TaskTagCreate) AddTaskIDs(ids ...int) *TaskTagCreate

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*TaskTagCreate) AddTasks

func (ttc *TaskTagCreate) AddTasks(t ...*Task) *TaskTagCreate

AddTasks adds the "tasks" edges to the Task entity.

func (*TaskTagCreate) Exec

func (ttc *TaskTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskTagCreate) ExecX

func (ttc *TaskTagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskTagCreate) Mutation

func (ttc *TaskTagCreate) Mutation() *TaskTagMutation

Mutation returns the TaskTagMutation object of the builder.

func (*TaskTagCreate) Save

func (ttc *TaskTagCreate) Save(ctx context.Context) (*TaskTag, error)

Save creates the TaskTag in the database.

func (*TaskTagCreate) SaveX

func (ttc *TaskTagCreate) SaveX(ctx context.Context) *TaskTag

SaveX calls Save and panics if Save returns an error.

func (*TaskTagCreate) SetCreateTime

func (ttc *TaskTagCreate) SetCreateTime(t time.Time) *TaskTagCreate

SetCreateTime sets the "create_time" field.

func (*TaskTagCreate) SetDescription

func (ttc *TaskTagCreate) SetDescription(s string) *TaskTagCreate

SetDescription sets the "description" field.

func (*TaskTagCreate) SetDisplay

func (ttc *TaskTagCreate) SetDisplay(b bool) *TaskTagCreate

SetDisplay sets the "display" field.

func (*TaskTagCreate) SetMeta

func (ttc *TaskTagCreate) SetMeta(m map[string]interface{}) *TaskTagCreate

SetMeta sets the "meta" field.

func (*TaskTagCreate) SetNillableCreateTime

func (ttc *TaskTagCreate) SetNillableCreateTime(t *time.Time) *TaskTagCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskTagCreate) SetNillableDescription

func (ttc *TaskTagCreate) SetNillableDescription(s *string) *TaskTagCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskTagCreate) SetNillableDisplay

func (ttc *TaskTagCreate) SetNillableDisplay(b *bool) *TaskTagCreate

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskTagCreate) SetNillableUpdateTime

func (ttc *TaskTagCreate) SetNillableUpdateTime(t *time.Time) *TaskTagCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TaskTagCreate) SetTitle

func (ttc *TaskTagCreate) SetTitle(s string) *TaskTagCreate

SetTitle sets the "title" field.

func (*TaskTagCreate) SetUpdateTime

func (ttc *TaskTagCreate) SetUpdateTime(t time.Time) *TaskTagCreate

SetUpdateTime sets the "update_time" field.

type TaskTagCreateBulk

type TaskTagCreateBulk struct {
	// contains filtered or unexported fields
}

TaskTagCreateBulk is the builder for creating many TaskTag entities in bulk.

func (*TaskTagCreateBulk) Exec

func (ttcb *TaskTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskTagCreateBulk) ExecX

func (ttcb *TaskTagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskTagCreateBulk) Save

func (ttcb *TaskTagCreateBulk) Save(ctx context.Context) ([]*TaskTag, error)

Save creates the TaskTag entities in the database.

func (*TaskTagCreateBulk) SaveX

func (ttcb *TaskTagCreateBulk) SaveX(ctx context.Context) []*TaskTag

SaveX is like Save, but panics if an error occurs.

type TaskTagDelete

type TaskTagDelete struct {
	// contains filtered or unexported fields
}

TaskTagDelete is the builder for deleting a TaskTag entity.

func (*TaskTagDelete) Exec

func (ttd *TaskTagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TaskTagDelete) ExecX

func (ttd *TaskTagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TaskTagDelete) Where

func (ttd *TaskTagDelete) Where(ps ...predicate.TaskTag) *TaskTagDelete

Where appends a list predicates to the TaskTagDelete builder.

type TaskTagDeleteOne

type TaskTagDeleteOne struct {
	// contains filtered or unexported fields
}

TaskTagDeleteOne is the builder for deleting a single TaskTag entity.

func (*TaskTagDeleteOne) Exec

func (ttdo *TaskTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskTagDeleteOne) ExecX

func (ttdo *TaskTagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TaskTagEdges

type TaskTagEdges struct {
	// Tasks holds the value of the tasks edge.
	Tasks []*Task `json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

TaskTagEdges holds the relations/edges for other nodes in the graph.

func (TaskTagEdges) TasksOrErr

func (e TaskTagEdges) TasksOrErr() ([]*Task, error)

TasksOrErr returns the Tasks value or an error if the edge was not loaded in eager-loading.

type TaskTagGroupBy

type TaskTagGroupBy struct {
	// contains filtered or unexported fields
}

TaskTagGroupBy is the group-by builder for TaskTag entities.

func (*TaskTagGroupBy) Aggregate

func (ttgb *TaskTagGroupBy) Aggregate(fns ...AggregateFunc) *TaskTagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TaskTagGroupBy) Bool

func (ttgb *TaskTagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) BoolX

func (ttgb *TaskTagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskTagGroupBy) Bools

func (ttgb *TaskTagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) BoolsX

func (ttgb *TaskTagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskTagGroupBy) Float64

func (ttgb *TaskTagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) Float64X

func (ttgb *TaskTagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskTagGroupBy) Float64s

func (ttgb *TaskTagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) Float64sX

func (ttgb *TaskTagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskTagGroupBy) Int

func (ttgb *TaskTagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) IntX

func (ttgb *TaskTagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskTagGroupBy) Ints

func (ttgb *TaskTagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) IntsX

func (ttgb *TaskTagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskTagGroupBy) Scan

func (ttgb *TaskTagGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TaskTagGroupBy) ScanX

func (ttgb *TaskTagGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TaskTagGroupBy) String

func (ttgb *TaskTagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) StringX

func (ttgb *TaskTagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskTagGroupBy) Strings

func (ttgb *TaskTagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*TaskTagGroupBy) StringsX

func (ttgb *TaskTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskTagMutation

type TaskTagMutation struct {
	// contains filtered or unexported fields
}

TaskTagMutation represents an operation that mutates the TaskTag nodes in the graph.

func (*TaskTagMutation) AddField

func (m *TaskTagMutation) 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 (*TaskTagMutation) AddTaskIDs

func (m *TaskTagMutation) AddTaskIDs(ids ...int)

AddTaskIDs adds the "tasks" edge to the Task entity by ids.

func (*TaskTagMutation) AddedEdges

func (m *TaskTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TaskTagMutation) AddedField

func (m *TaskTagMutation) 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 (*TaskTagMutation) AddedFields

func (m *TaskTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TaskTagMutation) AddedIDs

func (m *TaskTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TaskTagMutation) ClearDescription

func (m *TaskTagMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*TaskTagMutation) ClearEdge

func (m *TaskTagMutation) 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 (*TaskTagMutation) ClearField

func (m *TaskTagMutation) 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 (*TaskTagMutation) ClearMeta

func (m *TaskTagMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*TaskTagMutation) ClearTasks

func (m *TaskTagMutation) ClearTasks()

ClearTasks clears the "tasks" edge to the Task entity.

func (*TaskTagMutation) ClearedEdges

func (m *TaskTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TaskTagMutation) ClearedFields

func (m *TaskTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TaskTagMutation) Client

func (m TaskTagMutation) 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 (*TaskTagMutation) CreateTime

func (m *TaskTagMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*TaskTagMutation) Description

func (m *TaskTagMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*TaskTagMutation) DescriptionCleared

func (m *TaskTagMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*TaskTagMutation) Display

func (m *TaskTagMutation) Display() (r bool, exists bool)

Display returns the value of the "display" field in the mutation.

func (*TaskTagMutation) EdgeCleared

func (m *TaskTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TaskTagMutation) Field

func (m *TaskTagMutation) 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 (*TaskTagMutation) FieldCleared

func (m *TaskTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TaskTagMutation) Fields

func (m *TaskTagMutation) 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 (*TaskTagMutation) ID

func (m *TaskTagMutation) 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 (*TaskTagMutation) IDs

func (m *TaskTagMutation) 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 (*TaskTagMutation) Meta

func (m *TaskTagMutation) Meta() (r map[string]interface{}, exists bool)

Meta returns the value of the "meta" field in the mutation.

func (*TaskTagMutation) MetaCleared

func (m *TaskTagMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*TaskTagMutation) OldCreateTime

func (m *TaskTagMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the TaskTag entity. If the TaskTag 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 (*TaskTagMutation) OldDescription

func (m *TaskTagMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the TaskTag entity. If the TaskTag 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 (*TaskTagMutation) OldDisplay

func (m *TaskTagMutation) OldDisplay(ctx context.Context) (v bool, err error)

OldDisplay returns the old "display" field's value of the TaskTag entity. If the TaskTag 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 (*TaskTagMutation) OldField

func (m *TaskTagMutation) 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 (*TaskTagMutation) OldMeta

func (m *TaskTagMutation) OldMeta(ctx context.Context) (v map[string]interface{}, err error)

OldMeta returns the old "meta" field's value of the TaskTag entity. If the TaskTag 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 (*TaskTagMutation) OldTitle

func (m *TaskTagMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the TaskTag entity. If the TaskTag 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 (*TaskTagMutation) OldUpdateTime

func (m *TaskTagMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the TaskTag entity. If the TaskTag 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 (*TaskTagMutation) Op

func (m *TaskTagMutation) Op() Op

Op returns the operation name.

func (*TaskTagMutation) RemoveTaskIDs

func (m *TaskTagMutation) RemoveTaskIDs(ids ...int)

RemoveTaskIDs removes the "tasks" edge to the Task entity by IDs.

func (*TaskTagMutation) RemovedEdges

func (m *TaskTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TaskTagMutation) RemovedIDs

func (m *TaskTagMutation) 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 (*TaskTagMutation) RemovedTasksIDs

func (m *TaskTagMutation) RemovedTasksIDs() (ids []int)

RemovedTasks returns the removed IDs of the "tasks" edge to the Task entity.

func (*TaskTagMutation) ResetCreateTime

func (m *TaskTagMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TaskTagMutation) ResetDescription

func (m *TaskTagMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TaskTagMutation) ResetDisplay

func (m *TaskTagMutation) ResetDisplay()

ResetDisplay resets all changes to the "display" field.

func (*TaskTagMutation) ResetEdge

func (m *TaskTagMutation) 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 (*TaskTagMutation) ResetField

func (m *TaskTagMutation) 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 (*TaskTagMutation) ResetMeta

func (m *TaskTagMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*TaskTagMutation) ResetTasks

func (m *TaskTagMutation) ResetTasks()

ResetTasks resets all changes to the "tasks" edge.

func (*TaskTagMutation) ResetTitle

func (m *TaskTagMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*TaskTagMutation) ResetUpdateTime

func (m *TaskTagMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TaskTagMutation) SetCreateTime

func (m *TaskTagMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TaskTagMutation) SetDescription

func (m *TaskTagMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TaskTagMutation) SetDisplay

func (m *TaskTagMutation) SetDisplay(b bool)

SetDisplay sets the "display" field.

func (*TaskTagMutation) SetField

func (m *TaskTagMutation) 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 (*TaskTagMutation) SetMeta

func (m *TaskTagMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*TaskTagMutation) SetTitle

func (m *TaskTagMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*TaskTagMutation) SetUpdateTime

func (m *TaskTagMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TaskTagMutation) TasksCleared

func (m *TaskTagMutation) TasksCleared() bool

TasksCleared reports if the "tasks" edge to the Task entity was cleared.

func (*TaskTagMutation) TasksIDs

func (m *TaskTagMutation) TasksIDs() (ids []int)

TasksIDs returns the "tasks" edge IDs in the mutation.

func (*TaskTagMutation) Title

func (m *TaskTagMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (TaskTagMutation) Tx

func (m TaskTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TaskTagMutation) Type

func (m *TaskTagMutation) Type() string

Type returns the node type of this mutation (TaskTag).

func (*TaskTagMutation) UpdateTime

func (m *TaskTagMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TaskTagMutation) Where

func (m *TaskTagMutation) Where(ps ...predicate.TaskTag)

Where appends a list predicates to the TaskTagMutation builder.

type TaskTagQuery

type TaskTagQuery struct {
	// contains filtered or unexported fields
}

TaskTagQuery is the builder for querying TaskTag entities.

func (*TaskTagQuery) All

func (ttq *TaskTagQuery) All(ctx context.Context) ([]*TaskTag, error)

All executes the query and returns a list of TaskTags.

func (*TaskTagQuery) AllX

func (ttq *TaskTagQuery) AllX(ctx context.Context) []*TaskTag

AllX is like All, but panics if an error occurs.

func (*TaskTagQuery) Clone

func (ttq *TaskTagQuery) Clone() *TaskTagQuery

Clone returns a duplicate of the TaskTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TaskTagQuery) Count

func (ttq *TaskTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskTagQuery) CountX

func (ttq *TaskTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TaskTagQuery) Exist

func (ttq *TaskTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TaskTagQuery) ExistX

func (ttq *TaskTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TaskTagQuery) First

func (ttq *TaskTagQuery) First(ctx context.Context) (*TaskTag, error)

First returns the first TaskTag entity from the query. Returns a *NotFoundError when no TaskTag was found.

func (*TaskTagQuery) FirstID

func (ttq *TaskTagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first TaskTag ID from the query. Returns a *NotFoundError when no TaskTag ID was found.

func (*TaskTagQuery) FirstIDX

func (ttq *TaskTagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TaskTagQuery) FirstX

func (ttq *TaskTagQuery) FirstX(ctx context.Context) *TaskTag

FirstX is like First, but panics if an error occurs.

func (*TaskTagQuery) GroupBy

func (ttq *TaskTagQuery) GroupBy(field string, fields ...string) *TaskTagGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TaskTag.Query().
	GroupBy(tasktag.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskTagQuery) IDs

func (ttq *TaskTagQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of TaskTag IDs.

func (*TaskTagQuery) IDsX

func (ttq *TaskTagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TaskTagQuery) Limit

func (ttq *TaskTagQuery) Limit(limit int) *TaskTagQuery

Limit adds a limit step to the query.

func (*TaskTagQuery) Offset

func (ttq *TaskTagQuery) Offset(offset int) *TaskTagQuery

Offset adds an offset step to the query.

func (*TaskTagQuery) Only

func (ttq *TaskTagQuery) Only(ctx context.Context) (*TaskTag, error)

Only returns a single TaskTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one TaskTag entity is not found. Returns a *NotFoundError when no TaskTag entities are found.

func (*TaskTagQuery) OnlyID

func (ttq *TaskTagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only TaskTag ID in the query. Returns a *NotSingularError when exactly one TaskTag ID is not found. Returns a *NotFoundError when no entities are found.

func (*TaskTagQuery) OnlyIDX

func (ttq *TaskTagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TaskTagQuery) OnlyX

func (ttq *TaskTagQuery) OnlyX(ctx context.Context) *TaskTag

OnlyX is like Only, but panics if an error occurs.

func (*TaskTagQuery) Order

func (ttq *TaskTagQuery) Order(o ...OrderFunc) *TaskTagQuery

Order adds an order step to the query.

func (*TaskTagQuery) QueryTasks

func (ttq *TaskTagQuery) QueryTasks() *TaskQuery

QueryTasks chains the current query on the "tasks" edge.

func (*TaskTagQuery) Select

func (ttq *TaskTagQuery) Select(fields ...string) *TaskTagSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.TaskTag.Query().
	Select(tasktag.FieldCreateTime).
	Scan(ctx, &v)

func (*TaskTagQuery) Unique

func (ttq *TaskTagQuery) Unique(unique bool) *TaskTagQuery

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 (*TaskTagQuery) Where

func (ttq *TaskTagQuery) Where(ps ...predicate.TaskTag) *TaskTagQuery

Where adds a new predicate for the TaskTagQuery builder.

func (*TaskTagQuery) WithTasks

func (ttq *TaskTagQuery) WithTasks(opts ...func(*TaskQuery)) *TaskTagQuery

WithTasks tells the query-builder to eager-load the nodes that are connected to the "tasks" edge. The optional arguments are used to configure the query builder of the edge.

type TaskTagSelect

type TaskTagSelect struct {
	*TaskTagQuery
	// contains filtered or unexported fields
}

TaskTagSelect is the builder for selecting fields of TaskTag entities.

func (*TaskTagSelect) Bool

func (tts *TaskTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) BoolX

func (tts *TaskTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskTagSelect) Bools

func (tts *TaskTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) BoolsX

func (tts *TaskTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskTagSelect) Float64

func (tts *TaskTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) Float64X

func (tts *TaskTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskTagSelect) Float64s

func (tts *TaskTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) Float64sX

func (tts *TaskTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskTagSelect) Int

func (tts *TaskTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) IntX

func (tts *TaskTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskTagSelect) Ints

func (tts *TaskTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) IntsX

func (tts *TaskTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskTagSelect) Scan

func (tts *TaskTagSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TaskTagSelect) ScanX

func (tts *TaskTagSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TaskTagSelect) String

func (tts *TaskTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) StringX

func (tts *TaskTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskTagSelect) Strings

func (tts *TaskTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskTagSelect) StringsX

func (tts *TaskTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskTagUpdate

type TaskTagUpdate struct {
	// contains filtered or unexported fields
}

TaskTagUpdate is the builder for updating TaskTag entities.

func (*TaskTagUpdate) AddTaskIDs

func (ttu *TaskTagUpdate) AddTaskIDs(ids ...int) *TaskTagUpdate

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*TaskTagUpdate) AddTasks

func (ttu *TaskTagUpdate) AddTasks(t ...*Task) *TaskTagUpdate

AddTasks adds the "tasks" edges to the Task entity.

func (*TaskTagUpdate) ClearDescription

func (ttu *TaskTagUpdate) ClearDescription() *TaskTagUpdate

ClearDescription clears the value of the "description" field.

func (*TaskTagUpdate) ClearMeta

func (ttu *TaskTagUpdate) ClearMeta() *TaskTagUpdate

ClearMeta clears the value of the "meta" field.

func (*TaskTagUpdate) ClearTasks

func (ttu *TaskTagUpdate) ClearTasks() *TaskTagUpdate

ClearTasks clears all "tasks" edges to the Task entity.

func (*TaskTagUpdate) Exec

func (ttu *TaskTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskTagUpdate) ExecX

func (ttu *TaskTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskTagUpdate) Mutation

func (ttu *TaskTagUpdate) Mutation() *TaskTagMutation

Mutation returns the TaskTagMutation object of the builder.

func (*TaskTagUpdate) RemoveTaskIDs

func (ttu *TaskTagUpdate) RemoveTaskIDs(ids ...int) *TaskTagUpdate

RemoveTaskIDs removes the "tasks" edge to Task entities by IDs.

func (*TaskTagUpdate) RemoveTasks

func (ttu *TaskTagUpdate) RemoveTasks(t ...*Task) *TaskTagUpdate

RemoveTasks removes "tasks" edges to Task entities.

func (*TaskTagUpdate) Save

func (ttu *TaskTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TaskTagUpdate) SaveX

func (ttu *TaskTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TaskTagUpdate) SetDescription

func (ttu *TaskTagUpdate) SetDescription(s string) *TaskTagUpdate

SetDescription sets the "description" field.

func (*TaskTagUpdate) SetDisplay

func (ttu *TaskTagUpdate) SetDisplay(b bool) *TaskTagUpdate

SetDisplay sets the "display" field.

func (*TaskTagUpdate) SetMeta

func (ttu *TaskTagUpdate) SetMeta(m map[string]interface{}) *TaskTagUpdate

SetMeta sets the "meta" field.

func (*TaskTagUpdate) SetNillableDescription

func (ttu *TaskTagUpdate) SetNillableDescription(s *string) *TaskTagUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskTagUpdate) SetNillableDisplay

func (ttu *TaskTagUpdate) SetNillableDisplay(b *bool) *TaskTagUpdate

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskTagUpdate) SetTitle

func (ttu *TaskTagUpdate) SetTitle(s string) *TaskTagUpdate

SetTitle sets the "title" field.

func (*TaskTagUpdate) SetUpdateTime

func (ttu *TaskTagUpdate) SetUpdateTime(t time.Time) *TaskTagUpdate

SetUpdateTime sets the "update_time" field.

func (*TaskTagUpdate) Where

func (ttu *TaskTagUpdate) Where(ps ...predicate.TaskTag) *TaskTagUpdate

Where appends a list predicates to the TaskTagUpdate builder.

type TaskTagUpdateOne

type TaskTagUpdateOne struct {
	// contains filtered or unexported fields
}

TaskTagUpdateOne is the builder for updating a single TaskTag entity.

func (*TaskTagUpdateOne) AddTaskIDs

func (ttuo *TaskTagUpdateOne) AddTaskIDs(ids ...int) *TaskTagUpdateOne

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*TaskTagUpdateOne) AddTasks

func (ttuo *TaskTagUpdateOne) AddTasks(t ...*Task) *TaskTagUpdateOne

AddTasks adds the "tasks" edges to the Task entity.

func (*TaskTagUpdateOne) ClearDescription

func (ttuo *TaskTagUpdateOne) ClearDescription() *TaskTagUpdateOne

ClearDescription clears the value of the "description" field.

func (*TaskTagUpdateOne) ClearMeta

func (ttuo *TaskTagUpdateOne) ClearMeta() *TaskTagUpdateOne

ClearMeta clears the value of the "meta" field.

func (*TaskTagUpdateOne) ClearTasks

func (ttuo *TaskTagUpdateOne) ClearTasks() *TaskTagUpdateOne

ClearTasks clears all "tasks" edges to the Task entity.

func (*TaskTagUpdateOne) Exec

func (ttuo *TaskTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskTagUpdateOne) ExecX

func (ttuo *TaskTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskTagUpdateOne) Mutation

func (ttuo *TaskTagUpdateOne) Mutation() *TaskTagMutation

Mutation returns the TaskTagMutation object of the builder.

func (*TaskTagUpdateOne) RemoveTaskIDs

func (ttuo *TaskTagUpdateOne) RemoveTaskIDs(ids ...int) *TaskTagUpdateOne

RemoveTaskIDs removes the "tasks" edge to Task entities by IDs.

func (*TaskTagUpdateOne) RemoveTasks

func (ttuo *TaskTagUpdateOne) RemoveTasks(t ...*Task) *TaskTagUpdateOne

RemoveTasks removes "tasks" edges to Task entities.

func (*TaskTagUpdateOne) Save

func (ttuo *TaskTagUpdateOne) Save(ctx context.Context) (*TaskTag, error)

Save executes the query and returns the updated TaskTag entity.

func (*TaskTagUpdateOne) SaveX

func (ttuo *TaskTagUpdateOne) SaveX(ctx context.Context) *TaskTag

SaveX is like Save, but panics if an error occurs.

func (*TaskTagUpdateOne) Select

func (ttuo *TaskTagUpdateOne) Select(field string, fields ...string) *TaskTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TaskTagUpdateOne) SetDescription

func (ttuo *TaskTagUpdateOne) SetDescription(s string) *TaskTagUpdateOne

SetDescription sets the "description" field.

func (*TaskTagUpdateOne) SetDisplay

func (ttuo *TaskTagUpdateOne) SetDisplay(b bool) *TaskTagUpdateOne

SetDisplay sets the "display" field.

func (*TaskTagUpdateOne) SetMeta

func (ttuo *TaskTagUpdateOne) SetMeta(m map[string]interface{}) *TaskTagUpdateOne

SetMeta sets the "meta" field.

func (*TaskTagUpdateOne) SetNillableDescription

func (ttuo *TaskTagUpdateOne) SetNillableDescription(s *string) *TaskTagUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskTagUpdateOne) SetNillableDisplay

func (ttuo *TaskTagUpdateOne) SetNillableDisplay(b *bool) *TaskTagUpdateOne

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskTagUpdateOne) SetTitle

func (ttuo *TaskTagUpdateOne) SetTitle(s string) *TaskTagUpdateOne

SetTitle sets the "title" field.

func (*TaskTagUpdateOne) SetUpdateTime

func (ttuo *TaskTagUpdateOne) SetUpdateTime(t time.Time) *TaskTagUpdateOne

SetUpdateTime sets the "update_time" field.

type TaskTags

type TaskTags []*TaskTag

TaskTags is a parsable slice of TaskTag.

type TaskUpdate

type TaskUpdate struct {
	// contains filtered or unexported fields
}

TaskUpdate is the builder for updating Task entities.

func (*TaskUpdate) AddInstanceIDs

func (tu *TaskUpdate) AddInstanceIDs(ids ...int) *TaskUpdate

AddInstanceIDs adds the "instances" edge to the TaskInstance entity by IDs.

func (*TaskUpdate) AddInstances

func (tu *TaskUpdate) AddInstances(t ...*TaskInstance) *TaskUpdate

AddInstances adds the "instances" edges to the TaskInstance entity.

func (*TaskUpdate) AddMetricIDs

func (tu *TaskUpdate) AddMetricIDs(ids ...int) *TaskUpdate

AddMetricIDs adds the "metrics" edge to the Metric entity by IDs.

func (*TaskUpdate) AddMetrics

func (tu *TaskUpdate) AddMetrics(m ...*Metric) *TaskUpdate

AddMetrics adds the "metrics" edges to the Metric entity.

func (*TaskUpdate) AddTagIDs

func (tu *TaskUpdate) AddTagIDs(ids ...int) *TaskUpdate

AddTagIDs adds the "tags" edge to the TaskTag entity by IDs.

func (*TaskUpdate) AddTags

func (tu *TaskUpdate) AddTags(t ...*TaskTag) *TaskUpdate

AddTags adds the "tags" edges to the TaskTag entity.

func (*TaskUpdate) ClearArgs

func (tu *TaskUpdate) ClearArgs() *TaskUpdate

ClearArgs clears the value of the "args" field.

func (*TaskUpdate) ClearCategory

func (tu *TaskUpdate) ClearCategory() *TaskUpdate

ClearCategory clears the "category" edge to the TaskCategory entity.

func (*TaskUpdate) ClearDescription

func (tu *TaskUpdate) ClearDescription() *TaskUpdate

ClearDescription clears the value of the "description" field.

func (*TaskUpdate) ClearInstances

func (tu *TaskUpdate) ClearInstances() *TaskUpdate

ClearInstances clears all "instances" edges to the TaskInstance entity.

func (*TaskUpdate) ClearMetrics

func (tu *TaskUpdate) ClearMetrics() *TaskUpdate

ClearMetrics clears all "metrics" edges to the Metric entity.

func (*TaskUpdate) ClearSchedule

func (tu *TaskUpdate) ClearSchedule() *TaskUpdate

ClearSchedule clears the value of the "schedule" field.

func (*TaskUpdate) ClearTags

func (tu *TaskUpdate) ClearTags() *TaskUpdate

ClearTags clears all "tags" edges to the TaskTag entity.

func (*TaskUpdate) Exec

func (tu *TaskUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpdate) ExecX

func (tu *TaskUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdate) Mutation

func (tu *TaskUpdate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdate) RemoveInstanceIDs

func (tu *TaskUpdate) RemoveInstanceIDs(ids ...int) *TaskUpdate

RemoveInstanceIDs removes the "instances" edge to TaskInstance entities by IDs.

func (*TaskUpdate) RemoveInstances

func (tu *TaskUpdate) RemoveInstances(t ...*TaskInstance) *TaskUpdate

RemoveInstances removes "instances" edges to TaskInstance entities.

func (*TaskUpdate) RemoveMetricIDs

func (tu *TaskUpdate) RemoveMetricIDs(ids ...int) *TaskUpdate

RemoveMetricIDs removes the "metrics" edge to Metric entities by IDs.

func (*TaskUpdate) RemoveMetrics

func (tu *TaskUpdate) RemoveMetrics(m ...*Metric) *TaskUpdate

RemoveMetrics removes "metrics" edges to Metric entities.

func (*TaskUpdate) RemoveTagIDs

func (tu *TaskUpdate) RemoveTagIDs(ids ...int) *TaskUpdate

RemoveTagIDs removes the "tags" edge to TaskTag entities by IDs.

func (*TaskUpdate) RemoveTags

func (tu *TaskUpdate) RemoveTags(t ...*TaskTag) *TaskUpdate

RemoveTags removes "tags" edges to TaskTag entities.

func (*TaskUpdate) Save

func (tu *TaskUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TaskUpdate) SaveX

func (tu *TaskUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdate) SetActive

func (tu *TaskUpdate) SetActive(b bool) *TaskUpdate

SetActive sets the "active" field.

func (*TaskUpdate) SetArgs

func (tu *TaskUpdate) SetArgs(m map[string]interface{}) *TaskUpdate

SetArgs sets the "args" field.

func (*TaskUpdate) SetCategory

func (tu *TaskUpdate) SetCategory(t *TaskCategory) *TaskUpdate

SetCategory sets the "category" edge to the TaskCategory entity.

func (*TaskUpdate) SetCategoryID

func (tu *TaskUpdate) SetCategoryID(id int) *TaskUpdate

SetCategoryID sets the "category" edge to the TaskCategory entity by ID.

func (*TaskUpdate) SetDescription

func (tu *TaskUpdate) SetDescription(s string) *TaskUpdate

SetDescription sets the "description" field.

func (*TaskUpdate) SetDisplay

func (tu *TaskUpdate) SetDisplay(b bool) *TaskUpdate

SetDisplay sets the "display" field.

func (*TaskUpdate) SetNillableActive

func (tu *TaskUpdate) SetNillableActive(b *bool) *TaskUpdate

SetNillableActive sets the "active" field if the given value is not nil.

func (*TaskUpdate) SetNillableDescription

func (tu *TaskUpdate) SetNillableDescription(s *string) *TaskUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskUpdate) SetNillableDisplay

func (tu *TaskUpdate) SetNillableDisplay(b *bool) *TaskUpdate

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskUpdate) SetNillableSchedule

func (tu *TaskUpdate) SetNillableSchedule(s *string) *TaskUpdate

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*TaskUpdate) SetSchedule

func (tu *TaskUpdate) SetSchedule(s string) *TaskUpdate

SetSchedule sets the "schedule" field.

func (*TaskUpdate) SetTitle

func (tu *TaskUpdate) SetTitle(s string) *TaskUpdate

SetTitle sets the "title" field.

func (*TaskUpdate) SetUpdateTime

func (tu *TaskUpdate) SetUpdateTime(t time.Time) *TaskUpdate

SetUpdateTime sets the "update_time" field.

func (*TaskUpdate) Where

func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate

Where appends a list predicates to the TaskUpdate builder.

type TaskUpdateOne

type TaskUpdateOne struct {
	// contains filtered or unexported fields
}

TaskUpdateOne is the builder for updating a single Task entity.

func (*TaskUpdateOne) AddInstanceIDs

func (tuo *TaskUpdateOne) AddInstanceIDs(ids ...int) *TaskUpdateOne

AddInstanceIDs adds the "instances" edge to the TaskInstance entity by IDs.

func (*TaskUpdateOne) AddInstances

func (tuo *TaskUpdateOne) AddInstances(t ...*TaskInstance) *TaskUpdateOne

AddInstances adds the "instances" edges to the TaskInstance entity.

func (*TaskUpdateOne) AddMetricIDs

func (tuo *TaskUpdateOne) AddMetricIDs(ids ...int) *TaskUpdateOne

AddMetricIDs adds the "metrics" edge to the Metric entity by IDs.

func (*TaskUpdateOne) AddMetrics

func (tuo *TaskUpdateOne) AddMetrics(m ...*Metric) *TaskUpdateOne

AddMetrics adds the "metrics" edges to the Metric entity.

func (*TaskUpdateOne) AddTagIDs

func (tuo *TaskUpdateOne) AddTagIDs(ids ...int) *TaskUpdateOne

AddTagIDs adds the "tags" edge to the TaskTag entity by IDs.

func (*TaskUpdateOne) AddTags

func (tuo *TaskUpdateOne) AddTags(t ...*TaskTag) *TaskUpdateOne

AddTags adds the "tags" edges to the TaskTag entity.

func (*TaskUpdateOne) ClearArgs

func (tuo *TaskUpdateOne) ClearArgs() *TaskUpdateOne

ClearArgs clears the value of the "args" field.

func (*TaskUpdateOne) ClearCategory

func (tuo *TaskUpdateOne) ClearCategory() *TaskUpdateOne

ClearCategory clears the "category" edge to the TaskCategory entity.

func (*TaskUpdateOne) ClearDescription

func (tuo *TaskUpdateOne) ClearDescription() *TaskUpdateOne

ClearDescription clears the value of the "description" field.

func (*TaskUpdateOne) ClearInstances

func (tuo *TaskUpdateOne) ClearInstances() *TaskUpdateOne

ClearInstances clears all "instances" edges to the TaskInstance entity.

func (*TaskUpdateOne) ClearMetrics

func (tuo *TaskUpdateOne) ClearMetrics() *TaskUpdateOne

ClearMetrics clears all "metrics" edges to the Metric entity.

func (*TaskUpdateOne) ClearSchedule

func (tuo *TaskUpdateOne) ClearSchedule() *TaskUpdateOne

ClearSchedule clears the value of the "schedule" field.

func (*TaskUpdateOne) ClearTags

func (tuo *TaskUpdateOne) ClearTags() *TaskUpdateOne

ClearTags clears all "tags" edges to the TaskTag entity.

func (*TaskUpdateOne) Exec

func (tuo *TaskUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskUpdateOne) ExecX

func (tuo *TaskUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdateOne) Mutation

func (tuo *TaskUpdateOne) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdateOne) RemoveInstanceIDs

func (tuo *TaskUpdateOne) RemoveInstanceIDs(ids ...int) *TaskUpdateOne

RemoveInstanceIDs removes the "instances" edge to TaskInstance entities by IDs.

func (*TaskUpdateOne) RemoveInstances

func (tuo *TaskUpdateOne) RemoveInstances(t ...*TaskInstance) *TaskUpdateOne

RemoveInstances removes "instances" edges to TaskInstance entities.

func (*TaskUpdateOne) RemoveMetricIDs

func (tuo *TaskUpdateOne) RemoveMetricIDs(ids ...int) *TaskUpdateOne

RemoveMetricIDs removes the "metrics" edge to Metric entities by IDs.

func (*TaskUpdateOne) RemoveMetrics

func (tuo *TaskUpdateOne) RemoveMetrics(m ...*Metric) *TaskUpdateOne

RemoveMetrics removes "metrics" edges to Metric entities.

func (*TaskUpdateOne) RemoveTagIDs

func (tuo *TaskUpdateOne) RemoveTagIDs(ids ...int) *TaskUpdateOne

RemoveTagIDs removes the "tags" edge to TaskTag entities by IDs.

func (*TaskUpdateOne) RemoveTags

func (tuo *TaskUpdateOne) RemoveTags(t ...*TaskTag) *TaskUpdateOne

RemoveTags removes "tags" edges to TaskTag entities.

func (*TaskUpdateOne) Save

func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)

Save executes the query and returns the updated Task entity.

func (*TaskUpdateOne) SaveX

func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdateOne) Select

func (tuo *TaskUpdateOne) Select(field string, fields ...string) *TaskUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TaskUpdateOne) SetActive

func (tuo *TaskUpdateOne) SetActive(b bool) *TaskUpdateOne

SetActive sets the "active" field.

func (*TaskUpdateOne) SetArgs

func (tuo *TaskUpdateOne) SetArgs(m map[string]interface{}) *TaskUpdateOne

SetArgs sets the "args" field.

func (*TaskUpdateOne) SetCategory

func (tuo *TaskUpdateOne) SetCategory(t *TaskCategory) *TaskUpdateOne

SetCategory sets the "category" edge to the TaskCategory entity.

func (*TaskUpdateOne) SetCategoryID

func (tuo *TaskUpdateOne) SetCategoryID(id int) *TaskUpdateOne

SetCategoryID sets the "category" edge to the TaskCategory entity by ID.

func (*TaskUpdateOne) SetDescription

func (tuo *TaskUpdateOne) SetDescription(s string) *TaskUpdateOne

SetDescription sets the "description" field.

func (*TaskUpdateOne) SetDisplay

func (tuo *TaskUpdateOne) SetDisplay(b bool) *TaskUpdateOne

SetDisplay sets the "display" field.

func (*TaskUpdateOne) SetNillableActive

func (tuo *TaskUpdateOne) SetNillableActive(b *bool) *TaskUpdateOne

SetNillableActive sets the "active" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableDescription

func (tuo *TaskUpdateOne) SetNillableDescription(s *string) *TaskUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableDisplay

func (tuo *TaskUpdateOne) SetNillableDisplay(b *bool) *TaskUpdateOne

SetNillableDisplay sets the "display" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableSchedule

func (tuo *TaskUpdateOne) SetNillableSchedule(s *string) *TaskUpdateOne

SetNillableSchedule sets the "schedule" field if the given value is not nil.

func (*TaskUpdateOne) SetSchedule

func (tuo *TaskUpdateOne) SetSchedule(s string) *TaskUpdateOne

SetSchedule sets the "schedule" field.

func (*TaskUpdateOne) SetTitle

func (tuo *TaskUpdateOne) SetTitle(s string) *TaskUpdateOne

SetTitle sets the "title" field.

func (*TaskUpdateOne) SetUpdateTime

func (tuo *TaskUpdateOne) SetUpdateTime(t time.Time) *TaskUpdateOne

SetUpdateTime sets the "update_time" field.

type Tasks

type Tasks []*Task

Tasks is a parsable slice of Task.

type Tx

type Tx struct {

	// Dimension is the client for interacting with the Dimension builders.
	Dimension *DimensionClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// Metric is the client for interacting with the Metric builders.
	Metric *MetricClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// TaskCategory is the client for interacting with the TaskCategory builders.
	TaskCategory *TaskCategoryClient
	// TaskInstance is the client for interacting with the TaskInstance builders.
	TaskInstance *TaskInstanceClient
	// TaskTag is the client for interacting with the TaskTag builders.
	TaskTag *TaskTagClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL